World: r3wp
[Core] Discuss core issues
older newer | first last |
[unknown: 5] 8-Dec-2008 [11419x2] | yeah true Chris. |
debase uses string data | |
Steeve 8-Dec-2008 [11421] | >> debase/base skip to-hex 256 4 16 == #{0100} |
[unknown: 5] 8-Dec-2008 [11422] | think that will be more overhead than just storing the string representation? |
Steeve 8-Dec-2008 [11423] | you mean time consumming ? |
[unknown: 5] 8-Dec-2008 [11424] | performance wise - yes |
Steeve 8-Dec-2008 [11425] | i'm using a preconstructed struct! [] to do the conversion (i don't use debase) , it's fast enough. |
[unknown: 5] 8-Dec-2008 [11426] | Give me an example. |
Steeve 8-Dec-2008 [11427x2] | bin: make struct! [int [integer!]] [0] >> bin/int: 256 >>third bin == #{00010000} |
then , the reverse: >> change third bin #{00010000} >>bin/int == 256 | |
[unknown: 5] 8-Dec-2008 [11429] | Yeah I'm going to have to make a function it seems. |
Steeve 8-Dec-2008 [11430x2] | just to know that with struct! the integer is stored in little endian format (reverse order) |
so you can do that too: >> to integer! reverse #{00010000} == 256 | |
[unknown: 5] 8-Dec-2008 [11432x2] | my issue is a bit more complicated. |
I'll come up with a solution - thanks Steeve, you still may have helped me out. | |
PeterWood 8-Dec-2008 [11434] | No all Rebol platforms store integers in little endian format. |
[unknown: 5] 8-Dec-2008 [11435] | Steeve thanks for the help, I think I can get bye with the debase/base to-hex 256 16 |
Steeve 8-Dec-2008 [11436] | Peter, no one says the opposite |
Graham 9-Dec-2008 [11437] | Anyone got a robust dialect for dealing with command line, or other parameters passed by dropping ? |
Robert 9-Dec-2008 [11438] | Is there a way that I can constrain a listening port to only accept connection from localhost? Using: open tcp://:40000 opens a listening port on port 40000 for all connections. Something like: open tcp://:127.0.0.1:44000 |
Pekr 9-Dec-2008 [11439x2] | you can check on incoming adress, no? |
Robert - look at port/remote-ip item ... | |
Robert 9-Dec-2008 [11441] | Does this work or is it your assumption? |
Pekr 9-Dec-2008 [11442x2] | Why shouldn't it work? IIRC IOS worked that way too, or it was some other script I saw. The simplest "firewall", by IP address .... |
Opening local tcp listening port, waiting for connection. Then opening second console, connecting to first one: local-ip: 127.0.0.1 remote-ip: 127.0.0.1 local-port: 8008 remote-port: 61532 | |
Gregg 9-Dec-2008 [11444x2] | Robert, look at Maarten's Rugby source. He allows IP filtering, which may be all you need, or at least the clue. |
Graham, I started an experimental command line dialect long ago, but it wasn't targeted specifically at file drops. | |
Graham 9-Dec-2008 [11446] | Is it around still? |
Gregg 9-Dec-2008 [11447] | Need to look for the public location, if there was one, or just look at what I have here. Are you dropping on a desktop icon, or using the system port to file drop on a console window? (I assume the former) |
Graham 9-Dec-2008 [11448x2] | mainly passing thru command line |
but sometimes the former | |
Gregg 9-Dec-2008 [11450] | Regular command line parsing (args, switches, etc.) is what it was for. Should work for icon drops, since we just have to know what we're getting. |
Graham 9-Dec-2008 [11451] | one is passed as a block, the other as a string |
Maxim 10-Dec-2008 [11452x4] | yep |
pretty powerfull too. | |
I'll put it on rebol.org is that ok? | |
Graham... FYI, I am working on my args.r module in order to make it public... just for you ... adding in-script documentation and cleaning up a few details :-) | |
[unknown: 5] 12-Dec-2008 [11456x2] | what is the differences between port/size port/state/index and port/tail? Port/tail does seem to point to the last posiition in the file port but what about the others. I know that port/size doesn't really tell me the size of the file. I'm wondering thy that is. |
I should say that port/tail does point to tail. | |
eFishAnt 18-Dec-2008 [11458] | I have a situation where I wish inside a while loop I could do a continue. There is break, but I just want to go back to the top where my wait sits and wait for the next event coming in. Has anyone done some solution to this? |
Steeve 18-Dec-2008 [11459x4] | i use port/state/index to skip in the opened file. beware, port/state/index is a zero-based index |
to read the first byte of a file, you need to set port/state/inedx: 0 | |
i think it's a bug but it wroks like that | |
i should say too, that it works well with the low primitives read-io write-io, but i don't remember if it works as well with the standard functions like copy | |
Sunanda 18-Dec-2008 [11463] | EFishAnt -- use a loop 1 [...] inside the while to simuate a "continue" n: 1 while [n <> 10][ loop 1 [ n: n + 1 if n = 5 [break] print n ] ] |
sqlab 18-Dec-2008 [11464] | forever [ catch [ wait [events] do-some-thing if want-no-more [ throw ] do-more ] ] |
Steeve 18-Dec-2008 [11465] | generaly, i like to use a case structure inside my loop. while [n <> 10][ n: n + 1 case [ n = 5 [] ; break other-case [...] true [print n] ] ] |
Sunanda 18-Dec-2008 [11466] | With my suggestion, it would look like this (Sqlab's may be more elegant) n: 0 while [n <> 10][ n: n + 1 loop 1 [ case [ n = 5 [break] ; break n = 7 [print "its seven"] ; example of another case true [print n] ] ] ] |
BrianH 18-Dec-2008 [11467] | R3 has a CONTINUE native. Not much help now I guess... |
Pekr 18-Dec-2008 [11468] | How does 'continue in R3 work? I can't see it on wiki. Console help shows it, so yes, it does exist :-) |
older newer | first last |