Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 03 2017 05:53
    @PeterWAWood banned @matrixbot
  • Sep 28 2016 12:19
    @PeterWAWood banned @TimeSeriesLord
  • Aug 13 2016 03:23
    @PeterWAWood banned @Vexercizer
viayuve
@viayuve
who was making red system programming book ? If its already being made than link please....
Simon
@simonmc_gitlab
Hello! In the Red/System specification, in the #import section, it is stated that this is not the same as dynamically loading a shared library from your Red/System code after your program has started. Is there a way to dynamically load a dll? If so, is it documented anywhere? Thank you for your help!
Boleslav Březovský
@rebolek
AFAIK, not yet.
lepinekong
@lepinekong_twitter
@ne1uno @viayuve for full version of pomodoro/countdown https://miniapps.red/doc/countdown/ (direct source link: https://github.com/lepinekong/miniapps/blob/master/countdown.red)
lepinekong
@lepinekong_twitter
By the way will change design of https://miniapps.red/ next year jekyll templates too ugly ;)
lepinekong
@lepinekong_twitter
call/wait/out doesn't seem to work on Windows 10 in that case (whereas directly in cmd prompt it returns something):
path: copy ""
call/output/wait {where curl} path
path

path: copy ""
call/output/wait {cmd /c "where curl"} path
path
Nenad Rakocevic
@dockimbel

@simonmc_gitlab

Hello! In the Red/System specification, in the #import section, it is stated that this is not the same as dynamically loading a shared library from your Red/System code after your program has started. Is there a way to dynamically load a dll? If so, is it documented anywhere? Thank you for your help!

You can load a library dynamically, but you need to rely on each platform's OS API (LoadLibrary on Windows, dlopen on others), then map function calls to the imported functions. We should add an abstraction layer for that at some point.

Nenad Rakocevic
@dockimbel

@lepinekong_twitter
where is a shell command, not an executable that can be called. In such case, use the /shell refinement, as the call docstring says:

path: make string! 100
call/shell/output "where curl" path

and eventually:

call/shell/error "where curl" path
;>> path
;== {INFO: Could not find files for the given pattern(s).^/}
lepinekong
@lepinekong_twitter

@dockimbel thanks, so I get error when calling from red:

c:\ > call/shell/error "where curl" path
== 1
c:\ > path
== {INFO: Could not find files for the given pattern(s).^/INFO: Could not find files for the given pattern(s).^/}

but in windows 10 cmd or in powershell I do get this:

where curl
C:\Windows\System32\curl.exe

Will try on Windows 8.

Semseddin Moldibi
@endo64
It could be a permission issue, even change-dir %/c/Windows/system32/ find read %./ %curl.exe returns none
Can you try in another (non-system) folder?
amreus
@amreus
On 64-bit Windows - since Red is 32-bit, System32 is redirected to Syswow64. Try change-dir %/c/Windows/Sysnative/ find read %./ %curl.exe
Max
@moliad
microsoft really know how to make judicious decisions when doing architecture . yes... storing 32 bit apps in a folder with 64 in and storing the 64 bit stuff in the paths with 32 in it... makes total sense. you'd think that they'd used the specific moment things went to 64 bits to cleanup the entire OS and force people to upgrade... meh.
lepinekong
@lepinekong_twitter
@amreus ah that might be the reason as I remember I did write the code originally on windows 8 32 bit while travelling :)
Now what do you mean by Sysnative ? I don't have any c:\windows\Sysnative on my Windows10 64bit so that this cannot returns error:
out: copy "" call/shell/output {change-dir %/c/Windows/Sysnative/ find read %./ %curl.exe} out
lepinekong
@lepinekong_twitter
@amreus in fact if you use find it defeat the purpose of using where: where is supposed to retrieve where curl is installed without even knowing potentially what folders could be.
amreus
@amreus
@lepinekong_twitter call/shell/output/error "c:/windows/sysnative/where.exe curl" path err
amreus
@amreus
You can check if Sysnative exists, for example:
either exists? %/c/windows/sysnative [
  call/shell/output/error "c:/windows/sysnative/where.exe curl" path err
] [
  call/shell/output/error "c:/windows/system32/where.exe curl" path err
]
And if on 64 bit windows, you need to translate System32 to Sysnative in the returned path if you want to use it in another system call
This message was deleted
lepinekong
@lepinekong_twitter
@amreus thanks tried this it works:
path: copy ""
err: copy ""
either exists? %/c/windows/sysnative [
  call/shell/output/error "c:/windows/sysnative/where.exe curl" path err
] [
  call/shell/output/error "c:/windows/system32/where.exe curl" path err
]
lepinekong
@lepinekong_twitter
This works:
cmd: {XCOPY "test\*.*" "target\" /H /R /S /E /Y /C /EXCLUDE:xcopy-exclude.txt}
out: copy ""
call/wait/output cmd out
but not with call/show or call/shell
GiuseppeChillemi
@GiuseppeChillemi
Is there a way to have a button which is kept pressed until the user clicks again on it ?
ne1uno
@ne1uno
you could create a toggle, not sure if a normal button could stay looking clicked
you could draw your own button
GiuseppeChillemi
@GiuseppeChillemi
Looking clicked and with a different color.
GiuseppeChillemi
@GiuseppeChillemi

@ne1uno

you could draw your own button

I don't know how to do it and make react to all events !

ne1uno
@ne1uno
style togbutton: base 60x20 font-size 10 draw ([])
ne1uno
@ne1uno
@GiuseppeChillemi I 've used something like this, https://gist.github.com/ne1uno/6bd51a409431acdcc376c07f0fe2cbeb
ne1uno
@ne1uno
it would take more work to make them look like buttons and change when clicked but that's the basic toggle
GiuseppeChillemi
@GiuseppeChillemi
@ne1uno Something to learn ! Still missing some theory to understand how a draw shape could trigger events
ne1uno
@ne1uno
it's from base you don't need any drawing
I have a cheap spinbox I will add to the gist later that also draws buttons
nedzadarek
@nedzadarek
I want to know more why I have to use show in this code(just uncomment this line - 28). Without show, text-list's elements disappear.
To reproduce:
  • run code
  • click the button "add color" few times
  • click on the random elements of the list
    ps. or am I doing something wrong?
GiuseppeChillemi
@GiuseppeChillemi
@dockimbel Is there a RED version of your REBOL2 scheduler or sonething like that ?
Semseddin Moldibi
@endo64
@GiuseppeChillemi Not yet.
GiuseppeChillemi
@GiuseppeChillemi
@endo64 how are you going with ODBC on RED ?
Semseddin Moldibi
@endo64
I don't, if I have to I would use call some vbs script.
GiuseppeChillemi
@GiuseppeChillemi
@endo64 in the last day I am starting to wonder on Munge used for ODBC
Semseddin Moldibi
@endo64
@GiuseppeChillemi Munge doesn't use ODBC, instead it uses sqlcmd for SQL Server and sqlite3 for SQLite.
GiuseppeChillemi
@GiuseppeChillemi
@endo64 "I am starting to wonder" = "I am dreaming Ashley will implement it "!
Ungaretti
@Ungaretti
Is it safe to run Cheyenne web server as a localhost on my home computer? I would like to play with CGI and RSP, but I'm concerned I might be opening my machine to some exploit.
Boleslav Březovský
@rebolek
Is your machine accessible from outside?
Ungaretti
@Ungaretti
Well, I have a regular internet connection, wifi, etc. Typical home setup.
Boleslav Březovský
@rebolek
you should be fine then. Of course you can run it on VM connected to VPN.
Ungaretti
@Ungaretti
Thanks! I want to keep it as simple and minimal as possible. That is why I'm using Cheyenne.
Boleslav Březovský
@rebolek
@Ungaretti run it on some random port (like 32852 for example) and make sure that port is closed on your router.
Ungaretti
@Ungaretti
@rebolek Ok. Thanks!
So keeping port 80 is not a good idea...? Even as localhost?