• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r4wp

[Rebol School] REBOL School

Pekr
4-Mar-2012
[4x2]
ah, should be 0.1 e.g. actually. So - wait returns either when there 
is any event on the ports, or at the certain time interval ...
then you can do some handling. But - if your hanlding takes some 
time, of course during such a time, everything is blocked. If you 
would like to have something more sophisticated, you would have to 
spawn separate tasks, as e.g. Cheyenne app server does ...
Endo
4-Mar-2012
[6]
Also check the function DISPATCH
http://www.rebol.com/docs/words/wdispatch.html
Gregg
6-Mar-2012
[7]
Gabriele (and DOc?) wrote a timer module for R2.
DocKimbel
6-Mar-2012
[8]
http://softinnov.org/rebol/scheduler.shtml
Gregg
6-Mar-2012
[9]
Thanks Doc.
Marco
10-Mar-2012
[10]
Very nice the scheduler, but I have not understand if it blocks program 
activity while waiting and if no why. I have solved my problem by 
using a View timer (face/rate: 0:0:1) since that does not block program 
activity.
GrahamC
10-Mar-2012
[11]
If this is a Gui app, wny can't you just wait ?
DocKimbel
10-Mar-2012
[12]
The scheduler lives in the event loop, so it does not block event-based 
apps.
Marco
10-Mar-2012
[13]
@grahamC: It is a gui app that sends output to seral port, so I don't 
want to block user input while waiting the job to be  done.
caelum
23-Mar-2012
[14]
Question: I open a port using rebol2 on my server. It is started 
by cron once every 24 hours and is programmed to shut down after 
1 hour. I need to check if the port is still open and listening or 
has completed and the program has closed. How do I test to see if 
the port is still open from another rebol2 program running on the 
same server?
Maxim
23-Mar-2012
[15]
try to listen to the same port... you will get an error that the 
port is already opened.
caelum
23-Mar-2012
[16]
Got it! Thanks.
Maxim
23-Mar-2012
[17x4]
you can also have the first app open up a second port and give it 
a very simple interface to reply to "are you done?" type messages.
(maybe even a remote kill switch, if required)
basic IPC
if you use a line oriented port it will be very easy to implement 
line by line commands
caelum
23-Mar-2012
[21]
I just wrote some code that seems to work.

; Checks to see if port is already open

either error? is-port-open: try [listen-port: open/binary/no-wait 
tcp://:xxx] [
	; Port already open, so do nothing
][
	; Port can be used so run the program
]
Maxim
23-Mar-2012
[22]
yep that's the simplest way to detect it.  its usually all you need 
when you have full control over the system its working on.
Rondon
27-Mar-2012
[23x3]
Hi guys, anyone have a library in Rebol to get Amazon Records passing 
a keyword and sorted by daterank?
I'd like just to read this url using rebol http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Dstripbooks&field-keywords=%22information+visualization%22#/ref=sr_st?keywords=%22information+visualization%22&qid=1332843525&rh=n%3A283155%2Ck%3A%22information+visualization%22&sort=daterank
it's giving an error.. any tips
james_nak
27-Mar-2012
[26]
Have you tried using Graham's http-tools? http://www.rebol.org/view-script.r?script=http-tools.r
GrahamC
5-Apr-2012
[27x2]
View question http://synapse-ehr.com/community/threads/adjusting-a-text-list-starting-point.1447/
Vid question I mean
Marco
7-Apr-2012
[29]
@GrahamC: after "data read %." insert: "with [append init [sld/data: 
0.5 do-face sld none]]".
sld

 is the name of the slider of the text-list, 0.5 means jump to the 
 middle.
GrahamC
7-Apr-2012
[30]
I'll post this ...thanks
caelum
16-Apr-2012
[31]
I have the SDK (full encryption strength) and I've been playing with 
the rijndael encryption algorithm. I cut and pasted the code below 
from http://www.rebol.com/how-to/encrypt.htmland it produces 256 
as the port strength despite the strength being stated as 512. Is 
it 256 or 512? The web page says Rebol can provide 512 with rijndael. 
Can it?

port: open [
    scheme: 'crypt
    direction: 'encrypt
    key: akey
    strength: 512
    algorithm: 'rijndael
    padding: true
]
print port/strength


When I switch the algorithm to blowfish I get the expected 512 port 
strength. Is blowfish actually 512?

I need to know what level of encryption I am working with. TIA.
PeterWood
16-Apr-2012
[32]
This is probably because there is no 512-bit AES algorithm -- see 
http://en.wikipedia.org/wiki/AES%5F%28cipher%29
caelum
16-Apr-2012
[33]
That makes sense. The strength: 512 in the code misled me to believe 
it should be possible.


The blowfish algorithm works fine, but I presume it actually uses 
a key of 448 bits and not 512. https://en.wikipedia.org/wiki/Blowfish_%28cipher%29. 
In which case the value returned by the print port/strength is deceptively 
wrong when I test it with blowfish? Or am I missing something?
PeterWood
16-Apr-2012
[34]
The final paragraph of the section titled the algorithm in the wikipedia 
enttyr for Blowfish explains that it is possible to implekment the 
algorithm with keys of up to 576 bits long but not advised by the 
author of the algorithm. Though when I was using REBOL for some testing, 
I set the strength to 448. 


I would have thought that AES 256 would suffice for for most purposes 
needing symmetrical encryption
caelum
16-Apr-2012
[35]
AES 256 is more than sufficient for most purposes. I am researching 
what Rebol can do so I am aware of the parameters I am working within. 
I am writing code that will be used to encrypt communication between 
clients who want a secure communication facility.


I am looking at the Rebol RSA algorithms now. Thanks for your input.
Sujoy
21-Apr-2012
[36]
have an issue:
>> fact1: 'a/a
>> num1: 99.0
>> blk: [greater? to-decimal obj/:fact1 num1]
>> objs: []
>> o: make object! [a: make object! [a: "100.0"]
>> append objs o
>> o: make object! [a: make object! [a: "99.0"]
>> append objs o

>> foreach obj objs [if equal?  do bind blk 'obj true [print obj/a]]
**Invalid path value: a/a
Steeve
21-Apr-2012
[37x3]
well... let see...
>> blk: [greater? to-decimal do bind reduce [fact1] obj num1]
you"re doing tortuous things
Sujoy
21-Apr-2012
[40]
looks like it :(
Steeve
21-Apr-2012
[41]
So, Did you check my correction ?
Sujoy
21-Apr-2012
[42x4]
not working for me
>> foreach obj objs [print do blk]
** Script Error: Invalid path value: a
** Near: a/a
sorry!
>> foreach obj objs [print do bind blk 'obj]
** Script Error: Invalid path value: a
** Near: a/a
Steeve
21-Apr-2012
[46]
I repeat, did you take that correction ?
>> blk: [greater? to-decimal do bind reduce [fact1] obj num1]
Sujoy
21-Apr-2012
[47]
yes
Steeve
21-Apr-2012
[48x2]
It works fine with your data
copy that, it must work:

fact1: 'a/a
num1: 99.0
blk: [greater? to-decimal do bind reduce [fact1] obj num1]
objs: []
o: make object! [a: make object! [a: "100.0"]]
append objs o
o: make object! [a: make object! [a: "99.0"]]
append objs o
foreach obj objs [if equal?  do bind blk 'obj true [print obj/a]]
Sujoy
21-Apr-2012
[50]
bloody typo again. sorry steve. yes it does work. its 430am here...
Steeve
21-Apr-2012
[51x2]
Okay
Where are you from ?
Sujoy
21-Apr-2012
[53]
india