[REBOL] Is é a valid char for use in urls? Re:(4)
(user and pass substituted). This works: read ftp://user:[EMAIL PROTECTED]/resume.html This doesn't: read ftp://user:[EMAIL PROTECTED]/résumé.html ** User Error: URL error: ftp://user:[EMAIL PROTECTED]/résumé.html. ** Where: read ftp://user:[EMAIL PROTECTED]/résumé.html Finally, this does: read rejoin [ftp:// user ":" pass "@" to-url "ftp.melbourne.net/r%E9sumE9.html"] I can: write rejoin [ftp:// user ":" pass "@" to-url "ftp.melbourne.net/r%E9sum%E9.html"] read %/c/anton/résumé.html but upon reading the directory I see the name: r%E9sum%E9.html ! and I can't browse to it using netscape or rebol: read to-url "http://www.melbourne.net/antonr/r%E9sum%E9.html" ** User Error: Error. Target url: http://www.melbourne.net/antonr/r%E9sum%E9.html could n ot be retrieved. Server response: HTTP/1.0 404 Not Found. ** Where: read to-url "http://www.melbourne.net/antonr/r%E9sum%E9.html" I am about to give up on using the e acute (this must surely annoy French users) in the filename, but... Would it be good if to-url converted "é" (and other characters that cause URL errors) to %E9 etc? Could read also take "%E9" and find the file "é" ? I am not really sure what should be, but I am having difficulty. Surely my directory isn't the only one with strange characters in it? Anton.
[REBOL] where are all the components? Re:(6)
> this particular example is an implementation of dave winers > outliners idea, Did you tell Dave about this thing? I'm sure he'd be really interested to see it :)
[REBOL] Docbook?
hey guys, I don't suppose any one has written any docbook tools in REBOL, have they? -- Insert witty saying here. -tom
[REBOL] roundoff? Re:
Hi Ralph To really do correct rounding for all possible decimal values requires a bit of work in REBOL. Problems with overflow, round nearest even, etc. For all the gory details see the script decimal.r archived at rebol.org. But just for fun here is a way to use to-money. May fail to give correct results with decimal! input too large in magnitude or with too many digits of precision. >> round: func [x][to-decimal replace to-string to-money x "$" ""] >> round 1.0051 == 1.01 >> round 1.0049 == 1 >> round -1.0049 == -1 >> round -1.0051 == -1.01 BTW This works better than your roundoff function for negative values: >> roundoff -1.0051 == -1 Cheers -Larry - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 18, 2000 6:57 PM Subject: [REBOL] roundoff? > I needed a simple two decimal place round off function for a script this > evening. > > This is what I came up with: > > roundoff: func ["Rounds off to 2 decimal places" a][ > a: a * 100 > b: a - to-integer a > a: to-integer a > if b > .5 [a: a + 1] > a: divide a 100 > ] > > Here's how it works: > > >> roundoff 10.567890 > == 10.57 > >> roundoff 10.56 > == 10.56 > > Can anyone improve on this, or is there a function already in REBOL I > overlooked? > > Okay, yes, to-money does it: > > >> to-money 10.567 > == $10.57 > >> to-money 10.563 > == $10.56 > > but I want the decimal! type. > > --Ralph Roberts > >
[REBOL] Need basic help Re:
Try this... >either find/match ask ["What OS? "] "1" > [get_file: join patch_number ["-" patch_revision ".tar.gz"]] >[get_file: join patch_number ["-" patch_revision ".zip"]] get_file: rejoin [patch_number {-} patch_revision {.zip}] >write %get_file read site/:get_file > >"site" is a previously defined url. The error message on this is: > >** Access Error: Port none not open. >** Where: write %get_file read site/:get_file > complete-url: rejoin [site get_file] retrieve-file: reform ["write" rejoin [{%} get_file] "read" complete-url] do retrieve-file
[REBOL] Is é a valid char for use in urls? Re:(2)
[EMAIL PROTECTED] wrote: > An unescaped é is not valid in URLs, it should be encoded as %E9 > http://www.melbourne.net/antonr/résumé.html fails for me in IE5.5, but works > in NT4.7 > http://www.melbourne.net/antonr/r%E9sum%E9.html works in both. > > More details can be found in RFCs 1738 and 2396. > > In REBOL, (at least in REBOL/View 0.9.8.3.1) you must prevent the %E9 > encoding from being decoded too soon. A literal %E9 in a URL gets decoded > into é immediately; therefore in literal URLs you must escape the % by using > %25, or hide the url inside a string. > read http://www.melbourne.net/antonr/r%E9sum%E9.html doesn't work, but > read to-url "http://www.melbourne.net/antonr/r%E9sum%E9.html" does, and so > does > read http://www.melbourne.net/antonr/r%25E9sum%25E9.html. This looks pretty ugly to me. While it's nice to know that there's a workaround, IMHO REBOL should be taking care of this automatically when requesting URL's with special characters. Would someone like to file this as a bug report? -Jake
[REBOL] roundoff?
I needed a simple two decimal place round off function for a script this evening. This is what I came up with: roundoff: func ["Rounds off to 2 decimal places" a][ a: a * 100 b: a - to-integer a a: to-integer a if b > .5 [a: a + 1] a: divide a 100 ] Here's how it works: >> roundoff 10.567890 == 10.57 >> roundoff 10.56 == 10.56 Can anyone improve on this, or is there a function already in REBOL I overlooked? Okay, yes, to-money does it: >> to-money 10.567 == $10.57 >> to-money 10.563 == $10.56 but I want the decimal! type. --Ralph Roberts
[REBOL] REBOL's scoping rules
I've been wondering what the reasoning behind REBOL's scoping rules was for awhile. In C, for instance, any variable that you declare in a function is "automatic" (that's what C calls them anyway :). They're automatically local to the function they're defined in, etc. Why does REBOL have variables be globally scoped by default? I ran into this a few days ago when I asked the list for assistance, and people helpfully replied (thank you). One of the things people pointed out was that I wasn't being careful with my recursion and kept using the same global variable over and over again. Perl takes a similar approach, where everything is global unless you declare the variable 'local' or 'my', but I always assumed that this was just because of Perl's heritage as a "throw away" script language, in which cases you really don't have to worry about scoping so much. PHP takes a completely opposite approach. Any variable you declare is local to a function, and you can't even get at global variables unless you explicitly get the variable through the $GLOBALS associative array, or declare a variable 'global' in your function. Anyway, I'd really like to understand why REBOL works the way it does in this respect, so if anyone has any insight to give I'd love to receive it. Thanks so much. Keith
[REBOL] Bug in Skip with Open/Direct
There is a bug in skip functions for open/direct files. They should seek to their required positions but do not. Look for a fix in the next release. -Carl
[REBOL] Need basic help
Greetings! I'm pretty new to REBOL, but sofar its been very useful for me. I am having one problem though. I've got a script created that asks the user for a number of variables which it joins together to create a filename (get_file), example: either find/match ask ["What OS? "] "1" [get_file: join patch_number ["-" patch_revision ".tar.gz"]] [get_file: join patch_number ["-" patch_revision ".zip"]] This part works fine, and if I print the "get_file", it prints the properly joined filename. The problem shows up when I try to write this file: write %get_file read site/:get_file "site" is a previously defined url. The error message on this is: ** Access Error: Port none not open. ** Where: write %get_file read site/:get_file This appears to me that its not expanding the "get_file" word into a filename, but again, I'm new and I'm probably wrong. Any thoughts or help? Thanks in Advance! Steven Faulconer
[REBOL] Is é a valid char for use in urls? Re(4):
Brian, This explains things. Now I can update my resume... Thanks a lot! Anton. At 13:19 18/07/00 -0400, you wrote: > > I can read this file: > > > > read http://www.melbourne.net/antonr/resume.html > > > > but not this one: > > > > read http://www.melbourne.net/antonr/résumé.html > > ** User Error: URL error: http://www.melbourne.net/antonr/résumé.html. > > ** Where: read http://www.melbourne.net/antonr/résumé.html > > > > >An unescaped é is not valid in URLs, it should be encoded as %E9 >http://www.melbourne.net/antonr/résumé.html fails for me in IE5.5, but works >in NT4.7 >http://www.melbourne.net/antonr/r%E9sum%E9.html works in both. > >More details can be found in RFCs 1738 and 2396. > >In REBOL, (at least in REBOL/View 0.9.8.3.1) you must prevent the %E9 >encoding from being decoded too soon. A literal %E9 in a URL gets decoded >into é immediately; therefore in literal URLs you must escape the % by using >%25, or hide the url inside a string. >read http://www.melbourne.net/antonr/r%E9sum%E9.html doesn't work, but >read to-url "http://www.melbourne.net/antonr/r%E9sum%E9.html" does, and so >does >read http://www.melbourne.net/antonr/r%25E9sum%25E9.html. > >C programmers will recognize this as being similar to backslash encoding in >literal strings, where \n means a newline character, \t means tab, so \\ >must be used to mean a single \. > >Non-C-programmers will probably just roll their eyes. > >- Brian
[REBOL] simple foreach question Re:
page (pig) is variable that each line is stored (temp) by the function foreach. - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 19, 2000 04:26 Subject: [REBOL] simple foreach question > howdy guys, > > I'm on a roll, just trying to "get" simple things. for instance, in > the exapmle, > > pages: [ http://www.cnet.com >http://www.rebol.com/index.html >http://www.news-wire.com/news/today.html ] > > loop 24 [ foreach page pages [send [EMAIL PROTECTED] read page] wait 1:00 > ] > > where did "page" come from? is it arbitrary? if the block was of species of > pigs, would it be "foreach pig pigs? > > just curious. Let me know if I get annoying. > > > -- > > Eat more spinach. > -tom > >
[REBOL] simple foreach question Re:
Boss is going to please with you aint 'e? "page" is being defined by the foreach. So for each element in the block "pages" foreach will set the word page to the value of that element - it then does the body block with that value. You can use whatever you want: foreach qwrtyuiop ["one" "two" "three"] [print qwrtyuiop] Note that qwrtyuiop only has a value in the body block. see: >> help foreach USAGE: FOREACH 'word data body DESCRIPTION: Evaluates a block for each value(s) in a series. FOREACH is a native value. ARGUMENTS: word -- Word or block of words to set each time (will be local) (Type: get-wor d word block) data -- The series to traverse (Type: series) body -- Block to evaluate each time (Type: block) Brett. - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 19, 2000 4:26 AM Subject: [REBOL] simple foreach question > howdy guys, > > I'm on a roll, just trying to "get" simple things. for instance, in > the exapmle, > > pages: [ http://www.cnet.com >http://www.rebol.com/index.html >http://www.news-wire.com/news/today.html ] > > loop 24 [ foreach page pages [send [EMAIL PROTECTED] read page] wait 1:00 > ] > > where did "page" come from? is it arbitrary? if the block was of species of > pigs, would it be "foreach pig pigs? > > just curious. Let me know if I get annoying. > > > -- > > Eat more spinach. > -tom >
[REBOL] Bug in 'use? Re:(3)
Ole, > Thanks! In the meantime, I got it working by simply having the temporary > variables as parameters to the function. Mean, but it works. You don't need temporary variables. You can use local function variables. Either via func [x /local a-local][the-code] or via function [x][a-local][the-code] Giving you back something that you lost with a broken 'use. Brett.
[REBOL] console via GGI Re:(2)
Great example. Gunna play with this one meself. Obligatory warning phrased anew. "Listen traveller, there be a demon lurking near. If ye, place this script upon an open server, you will let lose the beast upon your system! Your defense, if this occurs, be to sift the intruders with the special name of Parse. Only then will you sleep again at night!" Brett. - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 19, 2000 8:57 AM Subject: [REBOL] Re: console via GGI Hello [EMAIL PROTECTED], Comments below... On 18-Jul-00, [EMAIL PROTECTED] wrote: > Would it be possible to use the REBOL console via CGI? As follows: > > > 1. Enter commands in to a text area within a Web form. The text area is > given the name "rebol_input" > > > > > 2. Hit and the contents of the query_string, containing a single > string value for a single word called "rebol_input", is sent to a script. > > > 3. The script decodes the CGI and creates the value 'cgi-input/rebol_input > containing the input string for the console > > cgi-input: make object! decode-cgi system/options/cgi/query-string > > 4. The script executes 'cgi-input/rebol_input sending the command to the > console. > > do cgi-input/rebol_input > > 5. Now here is where I'm stuck. How can I grab the result from the binary so > that I can print it to the browser? I'm not sure what you mean by "the binary", however if you mean the rebol binary, try the attached script. It's not quite what you asked for, but you might get some ideas. BTW. The script was tested on Apache 1.3.12 (Amiga) and IE (Win98), please let me know if it works. You probably want to change the first line of the script to match your REBOL location and name... Best regards Thomas Jensen
[REBOL] simple foreach question
howdy guys, I'm on a roll, just trying to "get" simple things. for instance, in the exapmle, pages: [ http://www.cnet.com http://www.rebol.com/index.html http://www.news-wire.com/news/today.html ] loop 24 [ foreach page pages [send [EMAIL PROTECTED] read page] wait 1:00 ] where did "page" come from? is it arbitrary? if the block was of species of pigs, would it be "foreach pig pigs? just curious. Let me know if I get annoying. -- Eat more spinach. -tom
[REBOL] where are all the components? Re:(2)
> "Java and C++ make you think that the new ideas are like the old > ones. Java is the most distressing thing to hit computing since > MS-DOS." > That hilarious! But mostly true! A name to my discontent, "distressing". I knew there was a reason I've been playing (=fun) with Rebol instead of working (=discipline) through Java for the last three months. Java is here to stay, it is a great 3GL+ (+ = objects). It is a pity it didn't come out a decade earlier - would've made my life easier. On second thought, probably not, nothin new under the sun Brett.
[REBOL] Upgrade Function Re:
The same thing happens to me YOU'RE PAYING TOO MUCH FOR THE INTERNET! Juno now offers FREE Internet Access! Try it today - there's no risk! For your FREE software, visit: http://dl.www.juno.com/get/tagj.
[REBOL] Introducing Series
Elan Goldman explains REBOL Series in Chapter 5 of REBOL: THE OFFICIAL GUIDE. Free peek at http://www.rebolpress.com/rog/chapter5.pdf. -- Danny Ramsey, Publisher, REBOL Press The Official Source for REBOL Books http://www.REBOLpress.com
[REBOL] Rebol's argument handling is broken Re:(5)
Howdy, Sean: > Jeff, > you seem to be missing the point by comparing REBOL to grep. Point taken. Not arguing or debating, was just offering up another program that works like REBOL does now. There are many aspects of REBOL that we're working on improving. Appreciate all the feedback. -jeff
[REBOL] Rebol's argument handling is broken Re:(4)
Jeff, you seem to be missing the point by comparing REBOL to grep. Suppose I wanted to write grep (or anything else) in REBOL, I'd like it to behave just like that. I'd need a shell wrapper to hide the fact I was running the rebol interpreter with a script and I'd expect any and all args to the shell wrapper to be passed on to my script, not eaten by the rebol interpreter. If this isnt clear, here's two examples I'm working with: 1) executable file rpke.exe, runs like this... rpke -i infilename -o outfilename -e anotherfilename -v 2) java program to do the same thing, run from command line by rpke.bat, like this... rpke -i infilename -o outfilename -e anotherfilename -v The "wrapper" batch file rpke.bat looks like this... @echo off rem driver for Java version of rpke command line program jre -cp rpk.jar;rpkdemo.jar rpkdemo.JRPKE %* ... it passes all the args given to the batch file in the "%*", and these all get thru to the java class, and are not soaked up by jre. I'd like REBOL to be capable of behaving the same way. Incidentally, maybe there's some easy way to "wrap" the command line args "%*" so that the rebol interpreter doesnt notice them, and instead passes them on? Maybe some extra quotes? If the "magic" was all hidden in the .bat file then I can get the job done. (Reason - the command lines are being emitted by another script, and it neither knows or cares which implementation is actually being invoked) I'm aware that there may be flaws in the above .bat file when presented with quoted filenames containing spaces, fortunately I dont need to care about that. Hoping for a workaround, rather than waiting for the is-it-a-bug debate to conclude. Sean At 01:33 PM 18/07/00 -0800, you wrote: > > >> This bit me too. Rebol apparently parses everything that looks like an >> option on the command line, not just up to the script name. >> >> I consider this a bug and not a feature. >> >> Garold (Gary)L. JohnsonDYNAMIC Alternatives >> [EMAIL PROTECTED] > > > Grep works similarly as REBOL currently does, considering > arguments preceded by - to be switches regardless of where > they are placed. For example: > >Before and after args: > > grep -A 3 foo * -vi > >In between and after args: > > grep foo -B 10 *.txt -A 20 > > > -jeff > > >
[REBOL] large-scale REBOL coding? Re:
Hi, >Wow, that makes my REBOL program look puny. A mere 7242 lines (including >comments). And I was feeling so proud of it. Wh! My web directory now has 7383 lines of code (without comments - I don't use them with CGI scripts) and it still isn't finished, note that I like to pack as many commands on to one line as I can, so the lines are sometimes 500 characters long. Although the script is broken up into 55 files which only get read when needed, so it's very quick and efficient. Just in case you wanted to know! All the best, -- Malcolm Campbell [EMAIL PROTECTED] FreesiteUK - http://www.freesiteuk.com The UK based searchable web directory of free internet services. FreesiteWorld.net - coming soon.
[REBOL] Re: console via GGI
Hello [EMAIL PROTECTED], Comments below... On 18-Jul-00, [EMAIL PROTECTED] wrote: > Would it be possible to use the REBOL console via CGI? As follows: > > > 1. Enter commands in to a text area within a Web form. The text area is > given the name "rebol_input" > > > > > 2. Hit and the contents of the query_string, containing a single > string value for a single word called "rebol_input", is sent to a script. > > > 3. The script decodes the CGI and creates the value 'cgi-input/rebol_input > containing the input string for the console > > cgi-input: make object! decode-cgi system/options/cgi/query-string > > 4. The script executes 'cgi-input/rebol_input sending the command to the > console. > > do cgi-input/rebol_input > > 5. Now here is where I'm stuck. How can I grab the result from the binary so > that I can print it to the browser? I'm not sure what you mean by "the binary", however if you mean the rebol binary, try the attached script. It's not quite what you asked for, but you might get some ideas. BTW. The script was tested on Apache 1.3.12 (Amiga) and IE (Win98), please let me know if it works. You probably want to change the first line of the script to match your REBOL location and name... Best regards Thomas Jensen #! /rebol/rebol.core -c REBOL [ Title: "CGI-test" Date: 18-Jul-2000 Name: 'cgi-test Version:0.1 File: %cgi-test.r Author: "Thomas Jensen" EMail: [EMAIL PROTECTED] Language: 'English Charset:'ANSI Tabs: 4 ] print "content-type: text/html" print "" secure quit cgi-args: make object! decode-cgi rebol/options/cgi/query-string command: either none? in cgi-args 'expr [ "" ] [ cgi-args/expr ] prin rejoin [ { REBOL enter rebol expression } ] either error? err: try [ res: do command none ] [ err: disarm err ; don't warn on error 301 (*mostly* it's "res needs a value") ; should be handled better if not err/code = 301 [ print ["ERROR: " mold err] ] ] [ print rejoin ["== " mold res] ] print rejoin [ { }]
[REBOL] Bug in 'use? Re:(2)
Hi Ladislav, 15-Jul-2000 you wrote: >Hi, >don't know, what is the problem, but here is a merge-sort working >for me looong time: [...] Thanks! In the meantime, I got it working by simply having the temporary variables as parameters to the function. Mean, but it works. As a curiosity, I also got the version of merge-sort working which uses less memory. I'll attach it here, just in case anybody finds it interesting. It's less artistic, but I guess that's just the price you have to pay for using less memory. Kind regards, -- Ole Friis <[EMAIL PROTECTED]> Amiga is a trademark of Amiga Inc. ; Merge sorting, uses only memory proportional to the length of list, ; instead of memory proportional to (length of list)*log(length of list) sort-list: function [list cfunc] [sort-list2 low2] [ sort-list2: func [list list2 cfunc low high middle] [ if (high - low) > 1 [ ; Sort recursively middle: to-integer (low + high) / 2 sort-list2 list2 list :cfunc low middle 0 sort-list2 list2 list :cfunc middle high 0 ; Merge list2[low..middle) and list2[middle..high) into list[low..high] list: skip list (low - 1) low2: middle while [(low < middle) and (low2 < high)] [ either cfunc (pick list2 low) (pick list2 low2) [ change list pick list2 low low: low + 1 ] [ change list pick list2 low2 low2: low2 + 1 ] list: next list ] ; Append the missing items for low low (middle - 1) 1 [ change list pick list2 low list: next list ] for low2 low2 (high - 1) 1 [ change list pick list2 low2 list: next list ] ] ] sort-list2 list (copy list) :cfunc 1 (length? list) + 1 0 ]
[REBOL] Bug in 'use? Re:(2)
Hi Ladislav, 15-Jul-2000 you wrote: >you are right, the problem is caused by a context manipulation - >Use unsets your Middle every time it gets executed. My suggestion >is to not use Use in recursive functions, while this problem >doesn't get corrected. Judging from the nature of recursiveness, that's a little hard, isn't it? ;-) Do you know if this problem has already been reported to feedback? Kind regards, -- Ole Friis <[EMAIL PROTECTED]> Amiga is a trademark of Amiga Inc.
[REBOL] shortcut? Re:
A few ideas d: insert/only/dup [] [this] 5 head d == [[this] [this] [this] [this] [this]] or array/initial 5 [this] == [this this this this this] or array/initial 5 [[this]] == [[this] [this] [this] [this] [this]] - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 19, 2000 12:31 AM Subject: [REBOL] shortcut? > > Hi. > > Is there some rebol func that would allow me to quickly create a block > which repeats a given series a given amount of times? > > eg. > > blah: some-func [series-to-be-repeated] [number-of-repeats] > > I made one myself, but I'm sure I've seen something similar before and > wondered if it was a native func that I haven't been able to find in the > dictionary. In which case, it's silly using the custom one. > > Just a quick yes or no would be great. > > Thanks, > chris > >
[REBOL] Rebol's argument handling is broken Re:(4)
Jeff wrote: Grep works similarly as REBOL currently does, considering arguments preceded by - to be switches regardless of where they are placed. For example: Before and after args: grep -A 3 foo * -vi In between and after args: grep foo -B 10 *.txt -A 20 [Garold L. Johnson] That is true, and is true of many Unix programs, but AFAIK it isn't true of Perl which handles switches up to the script name and passes the rest to the script. I suggest that Perl is a better analogy to REBOL than is grep. The standard mode for getopt in Perl (which is patterned after the Unix version used in C) is to process all arguments regardless of position leaving only files in the argument list, but this is still within the script and not being intercepted by the Perl interpreter itself. Thanks, Garold (Gary) L. Johnson DYNAMIC Alternatives [EMAIL PROTECTED]
[REBOL] Rebol's argument handling is broken Re:(4)
[EMAIL PROTECTED] wrote: > Grep works similarly as REBOL currently does, considering > arguments preceded by - to be switches regardless of where > they are placed. For example: > > Before and after args: > > grep -A 3 foo * -vi > > In between and after args: > > grep foo -B 10 *.txt -A 20 Interesting.. But grep isn't a language interpreter, and that makes *all* the difference! :) -Jake
[REBOL] large-scale REBOL coding? Re:
[EMAIL PROTECTED] wrote: > Wow, that makes my REBOL program look puny. A mere 7242 lines (including > comments). And I was feeling so proud of it. Wh! You wrote a 7000 line REBOL program? That's pretty cool.. I'd love to take a look at that, is it publically available? What does your program do? Did you find any problems with using REBOL for a task like that? How did you split the source code up? Inquiring minds want to know. :) -Jake
[REBOL] Rebol's argument handling is broken Re:(3)
> This bit me too. Rebol apparently parses everything that looks like an > option on the command line, not just up to the script name. > > I consider this a bug and not a feature. > > Garold (Gary)L. JohnsonDYNAMIC Alternatives > [EMAIL PROTECTED] Grep works similarly as REBOL currently does, considering arguments preceded by - to be switches regardless of where they are placed. For example: Before and after args: grep -A 3 foo * -vi In between and after args: grep foo -B 10 *.txt -A 20 -jeff
[REBOL] large-scale REBOL coding? Re:
> >Take Zope (www.zope.org), for > >instance, a Web application server written in Python (with a few native > >modules). I just downloaded the latest version and ran a quick line > >count on all the .py files: 83165 lines, plus another 10391 lines for > >the ZServer HTTP server! That includes comments, but still I'm very > >impressed that the language can scale up to handle a project of this > >size. > > Wow, that makes my REBOL program look puny. A mere 7242 lines (including > comments). And I was feeling so proud of it. Wh! > > - Michael Jelinek > But, Micheal, your program probably WOULD be 83,165 line in Python. --Ralph
[REBOL] large-scale REBOL coding?
On 07/17/2000 04:11 PM Jake wrote: >Take Zope (www.zope.org), for >instance, a Web application server written in Python (with a few native >modules). I just downloaded the latest version and ran a quick line >count on all the .py files: 83165 lines, plus another 10391 lines for >the ZServer HTTP server! That includes comments, but still I'm very >impressed that the language can scale up to handle a project of this >size. Wow, that makes my REBOL program look puny. A mere 7242 lines (including comments). And I was feeling so proud of it. Wh! - Michael Jelinek
[REBOL] console via GGI
Would it be possible to use the REBOL console via CGI? As follows: 1. Enter commands in to a text area within a Web form. The text area is given the name "rebol_input" 2. Hit and the contents of the query_string, containing a single string value for a single word called "rebol_input", is sent to a script. 3. The script decodes the CGI and creates the value 'cgi-input/rebol_input containing the input string for the console cgi-input: make object! decode-cgi system/options/cgi/query-string 4. The script executes 'cgi-input/rebol_input sending the command to the console. do cgi-input/rebol_input 5. Now here is where I'm stuck. How can I grab the result from the binary so that I can print it to the browser?
[REBOL] FXP Site to Site transfers Re:
On Tue, 18 Jul 2000, you wrote: > Does anyone know if REBOL/Core support FXP capabilities such as like the > flashfxp ftp client at www.flashfxp.com. I have not seen any information on > how to do this. Not directly. Server-to-server transfers using "port bouncing" (sometimes also called "ftp server proxying" or more recently "FXP") represent a major security hole. A few older ftp servers still support this, but most newer ones cross-check IP addresses between their control and data connections to prohibit such direct transfers, mostly to avoid some obvious denial-of-service attacks. -- Holger Kruse [EMAIL PROTECTED]
[REBOL] FXP Site to Site transfers
Does anyone know if REBOL/Core support FXP capabilities such as like the flashfxp ftp client at www.flashfxp.com. I have not seen any information on how to do this.
[REBOL] Re: where are all the components?
Thanks to everyone who replied to my post on this topic, especially Gary and Brett! I hope to find time to think about this a little more and maybe type up a few more thoughts, but in the meantime, I got an interesting message from Marcel Weiher on the MacOS X mailing list today with some quotes from Alan Kay that I wanted to share (I didn't forward the whole message because I didn't get a chance to ask Marcel if he would mind.. I know the post was in a public forum but I don't want to be impolite). The comments on messaging being even more important than objects gives me hope that REBOL truly is exploring a better path! Original Message "Simula to OOP is moving to new things. Simula to ADT (Abstract Data Types: C++, Mesa, Ada) is moving on to better old things." "Java and C++ make you think that the new ideas are like the old ones. Java is the most distressing thing to hit computing since MS-DOS." "If you think programming is a small thing, that's why your programs are so large." "There is nothing more inefficient than 10 years development on an OS that never runs. (Reference to the Apple "Pink" OS project.)" All from Alan Kay's OOPSLA 97 talk. http://www.cc.gatech.edu/fac/mark.guzdial/squeak/oopsla.html Here is a longer message by Alan on the Squeak mailing list: Just a gentle reminder that I took some pains at the last OOPSLA to try to remind everyone that Smalltalk is not only NOT its syntax or the class library, it is not even about classes. I'm sorry that I long ago coined the term "objects" for this topic because it gets many people to focus on the lesser idea. The big idea is "messaging" -- that is what the kernal of Smalltalk/Squeak is all about (and it's something that was never quite completed in our Xerox PARC phase). The Japanese have a small word -- ma -- for "that which is in between" -- perhaps the nearest English equivalent is "interstitial". The key in making great and growable systems is much more to design how its modules communicate rather than what their internal properties and behaviors should be. Think of the internet -- to live, it (a) has to allow many different kinds of ideas and realizations that are beyond any single standard and (b) to allow varying degrees of safe interoperability between these ideas. If you focus on just messaging -- and realize that a good metasystem can late bind the various 2nd level architectures used in objects -- then much of the language-, UI-, and OS based discussions on this thread are really quite moot. This was why I complained at the last OOPSLA that -- whereas at PARC we changed Smalltalk constantly, treating it always as a work in progress -- when ST hit the larger world, it was pretty much taken as "something just to be learned", as though it were Pascal or Algol. Smalltalk-80 never really was mutated into the next better versions of OOP. Given the current low state of programming in general, I think this is a real mistake. I think I recall also pointing out that it is vitally important not just to have a complete metasystem, but to have fences that help guard the crossing of metaboundaries. One of the simplest of these was one of the motivations for my original excursions in the late sixties: the realization that assignments are a metalevel change from functions, and therefore should not be dealt with at the same level -- this was one of the motivations to encapsulate these kinds of state changes, and not let them be done willy nilly. I would say that a system that allowed other metathings to be done in the ordinary course of programming (like changing what inheritance means, or what is an instance) is a bad design. (I believe that systems should allow these things, but the design should be such that there are clear fences that have to be crossed when serious extensions are made.)
[REBOL] shortcut? Re:(2)
Hi Gisle Nice solution. I would like to add a small clarification. When you use insert/dup it places 5 references to the one instance of the series into the new block. >> a: head insert/dup copy [] "series" 5 == ["series" "series" "series" "series" "series"] >> a/2/1: #"a";change first character of second series in block == "aeries" >> a == ["aeries" "aeries" "aeries" "aeries" "aeries"] ;They are all changed! BTW adding copy before "series" will not change the behavior because insert/dup only evaluates it once. If we want independent copies of the series in the new block, we need to use a different approach. >> b: copy [] loop 5 [append b copy "series"] == ["series" "series" "series" "series" "series"] >> b/2/1: #"a" == "aeries" >> b == ["series" "aeries" "series" "series" "series"];only second series changed Now they are independent. Which one you want depends on what you want to do with the block. Cheers -Larry - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 18, 2000 7:52 AM Subject: [REBOL] shortcut? Re: > > > You mean like this?: > > >> a: head insert/dup copy [] "series" 5 > == ["series" "series" "series" "series" "series"] > > Type 'help insert' to get more info. > > Cheers, > Gisle > ---snip-
[REBOL] Re: [REBOL] Is é a valid char for use in urls?
> I can read this file: > > read http://www.melbourne.net/antonr/resume.html > > but not this one: > > read http://www.melbourne.net/antonr/résumé.html > ** User Error: URL error: http://www.melbourne.net/antonr/résumé.html. > ** Where: read http://www.melbourne.net/antonr/résumé.html > An unescaped é is not valid in URLs, it should be encoded as %E9 http://www.melbourne.net/antonr/résumé.html fails for me in IE5.5, but works in NT4.7 http://www.melbourne.net/antonr/r%E9sum%E9.html works in both. More details can be found in RFCs 1738 and 2396. In REBOL, (at least in REBOL/View 0.9.8.3.1) you must prevent the %E9 encoding from being decoded too soon. A literal %E9 in a URL gets decoded into é immediately; therefore in literal URLs you must escape the % by using %25, or hide the url inside a string. read http://www.melbourne.net/antonr/r%E9sum%E9.html doesn't work, but read to-url "http://www.melbourne.net/antonr/r%E9sum%E9.html" does, and so does read http://www.melbourne.net/antonr/r%25E9sum%25E9.html. C programmers will recognize this as being similar to backslash encoding in literal strings, where \n means a newline character, \t means tab, so \\ must be used to mean a single \. Non-C-programmers will probably just roll their eyes. - Brian
[REBOL] easy email question Re:
friends: [ "1" "person" "address" "2" "person" "address" "3" "person" "address" "4" "person" "address" ] print rejoin [{Choose a friend:} newline] foreach [num person address] friends [print reform [tab num person address]] print rejoin [newline "Your choice?"] choice: input > Hey guys, > > I have a pretty easy question for you. if I have a block of > email addresses, like > > friends: [ > "1" "person" "address" > "2" "person" "address" > "3" "person" "address" > "4" "person" "address" > ] > > how, in the execution of a script, can I list them by number, > then choose one? > > Told you it was easy :-) > > > > > -- > > Eat more spinich. > -tom >
[REBOL] Palm version Re:
> Is a Palm version truly in the works (is been on the list of to-be's for quite > a while) and if it is, will it allow use of palm resources i.e. db's and > interface elements? The Palm version was removed from the list ages ago. There are some issues with memory allocation (size of the stack, IIRC). The crew at RT are watching for Palm to update the OS memory routines at which time they've suggested that the Palm version *might* be put back on the burner. Until then, we wait. ;-) Cheers, Kev Kevin McKinnon, System/Network Administrator [EMAIL PROTECTED] Sunshine Communications http://www.sunshinecable.com PGP Public Key: http://www.dockmaster.net/pgp.html PGP 6.0 www.pgp.com
[REBOL] Palm version Re:
Please someone reply about the OS/2 version, as well. I'd like to be able to use REBOL on my 486 laptop. > Is a Palm version truly in the works (is been on the list of to-be's for > quite a while) and if it is, will it allow use of palm resources i.e. db's > and interface elements?
[REBOL] Palm version
Is a Palm version truly in the works (is been on the list of to-be's for quite a while) and if it is, will it allow use of palm resources i.e. db's and interface elements? Thanks John Get your FREE web-based e-mail and newsgroup access at: http://MailAndNews.com Create a new mailbox, or access your existing IMAP4 or POP3 mailbox from anywhere with just a web browser.
[REBOL] shortcut? Re:(2)
[EMAIL PROTECTED] wrote: > > You mean like this?: > > >> a: head insert/dup copy [] "series" 5 > == ["series" "series" "series" "series" "series"] > > Type 'help insert' to get more info. > > Cheers, > Gisle Ahh... the dup refinement! *smacks head* Thanks for your assistance - and you too, pekr :) later, chris
[REBOL] easy email question
Hey guys, I have a pretty easy question for you. if I have a block of email addresses, like friends: [ "1" "person" "address" "2" "person" "address" "3" "person" "address" "4" "person" "address" ] how, in the execution of a script, can I list them by number, then choose one? Told you it was easy :-) -- Eat more spinich. -tom
[REBOL] shortcut? Re:
You mean like this?: >> a: head insert/dup copy [] "series" 5 == ["series" "series" "series" "series" "series"] Type 'help insert' to get more info. Cheers, Gisle On Wed, 19 Jul 2000 [EMAIL PROTECTED] wrote: > > Hi. > > Is there some rebol func that would allow me to quickly create a block > which repeats a given series a given amount of times? > > eg. > > blah: some-func [series-to-be-repeated] [number-of-repeats] > > I made one myself, but I'm sure I've seen something similar before and > wondered if it was a native func that I haven't been able to find in the > dictionary. In which case, it's silly using the custom one. > > Just a quick yes or no would be great. > > Thanks, > chris > >
[REBOL] shortcut? Re:
[EMAIL PROTECTED] wrote: > Hi. > > Is there some rebol func that would allow me to quickly create a block > which repeats a given series a given amount of times? > > eg. > > blah: some-func [series-to-be-repeated] [number-of-repeats] hmm, while [condition-true][do-something] for i 1 number-of-times step [do-something] foreach item series [do-something] repeat n series [do-something] - probably this one? loop n [do-something] hope-this-helps, Cheers, -pekr- > > > I made one myself, but I'm sure I've seen something similar before and > wondered if it was a native func that I haven't been able to find in the > dictionary. In which case, it's silly using the custom one. > > Just a quick yes or no would be great. > > Thanks, > chris
[REBOL] shortcut?
Hi. Is there some rebol func that would allow me to quickly create a block which repeats a given series a given amount of times? eg. blah: some-func [series-to-be-repeated] [number-of-repeats] I made one myself, but I'm sure I've seen something similar before and wondered if it was a native func that I haven't been able to find in the dictionary. In which case, it's silly using the custom one. Just a quick yes or no would be great. Thanks, chris
[REBOL] where are all the components? Re:(5)
aj can hardly beat Compaq research :-) this particular example is an implementation of dave winers outliners idea, luckily he has better chances to beat Compaq! now, like that blogger/omnipoint etc idea we talked about a while ago, people need to be able to edit (and otherwise manipulate) the outlines through a browser there is no reason why that should not be possible! HJ
[REBOL] where are all the components? Re:(4)
> i have an example of a rebol processing script at a temp server i use: > http://131.211.29.218/cgi-bin/outlines.cgi > > (Note: might be buggy in browsers other than MSIE) > > Just imagine what can be done if rebol and my browser (javascript) could talk > even better with each other (besides boring CGI) > > It is not about what some elite programmers can do in some languages, it is > about what the rest of the world > might try and do with a language. > Great work HJ. I remember seeing some ideas about such an outliner animal on compaq's research site. Good to see you've come up with useable reality. Brett.
[REBOL] where are all the components? Re:(3)
Brett, I totally agree with you about all the dumb stuff which can now enter my mind and return as a feasible plan. My knowledge of rebol is limited (but growing i hope) and already i can do some neat things i never saw before but which i always wanted to see. i have an example of a rebol processing script at a temp server i use: http://131.211.29.218/cgi-bin/outlines.cgi (Note: might be buggy in browsers other than MSIE) Just imagine what can be done if rebol and my browser (javascript) could talk even better with each other (besides boring CGI) It is not about what some elite programmers can do in some languages, it is about what the rest of the world might try and do with a language. HJ sneaky message to rebol-team: any developments regarding rebol/browse?
[REBOL] where are all the components? Re:(2)
I loved reading the two post from Jake and Garold. They express things I've been musing over for years. My own, coupla bits: With any description there is an irreducible amount of information that has to be encoded. Whether this has been done as an interface or as a monolithic program or system. The great thing that Rebol has done is to give the "Reboler" (programmer/user) power in expressing and interpreting this minimum of information. Maybe we call this stuff a dialect - a better language to communicate in. This then is how I understand RT description of Rebol being a messaging language - an' boy don' it do that well. So from this great ideas flow. One day I had an idea - may not be original but hey my brain produced it - one day I'll try it too. I thought well Rebol is so cool at languages I can buy me a voice interpreter and use it to chuck some dialectical words at Rebol and think of the possibilites. Now how does it work on Voyager? "Computer.." "Bip beep" Another. I've found that I'm wanting to write input-parsers for Rebol that take information out of existing format and place it in Rebol blocks where I suspect I'll be able describe all sort of wonderful transformations before forming into other formats again. One example. I got my tab-delimited-with-quoted-strings parser thingy happening. Now if get my Flash SWF input/output thingy happening I'll be able to combine the result and produce a Flash spreadsheet! Cool eh? Well, ok not cool. Probably dum. BUT I would have NEVER DREAMED of doing that before. Thats the point I think. Components. In my Rebolised mind now, a component is an interpreter with associated context. Thus, this component can be in my Rebol script, sitting in Java, sitting in Javascript in a browser, sitting on in another process on my machine, on another machine behind a port or maybe one day be part of a Rebol-OS accessible from the OS prompt. This isn't new this is what is today. Rebol has accepted it and provided another way to talk between them. I think components arrived when system theory game them birth - just maybe no-one celebrated at the time because they could'nt work out they were. They're here to stay because we have a wired and distributed world to talk to, but maybe not existing in the form the designers of COM and CORBA thought they might. End-of-trip. Boy that coffee was strong. Brett.
[REBOL] Reading Binary data Re:(5)
> As per your instructions: Here is the code > fragment with your suggested changes: > ; > fp: open/read/binary/direct %TestBin.txt ; > fp: skip fp 10 > print to-string buffer: copy/part fp 10 > close fp > >> do %BinFile.r > abcdefghij > > >The result you will be looking for in buffer > >will be "klmnopqrst" > > as in print fp fp is your port to the file with a read/write pointer to the position of the data inside it or to buffers with a copy of the data if you do not open with the /direct refinement. You can see its inner details woth probe fp. If you close fp you can no longer read from that port. %Binfile.r is always the name of a file and in your line above you load its content and evaluate it. -- Sent through GMX FreeMail - http://www.gmx.net