[REBOL] can rebol strip this type of text file?
hi all i am new to scripting (rebol and python) and was wondering if it was capable of doing to the following and if so..how? the following is an example of what i need to strip and turn into a tab delimited file.. the entries are from a music database that is updated weekly..it is in lotus notes so i export from there and it dumps this file out with the new titles for the coming week (here the 19th June) i only need to get the rows with the double astericks at the start (i put those in for this post, they are not there in the normal file) and then strip the words at the start and then put a tab in between them so i can bring it into excel for the sales team to look at i would need a first row to describe each column also maybe something like Title tab Artist tab Cat no tab APN etc etc the tracklisting is a little more complicated as it has multiple tracks within the row..they are seperated by commas i think that it won't be that hard but i had no success in perl so i thought i might try rebol or python... thanks in advance keith FORM: Popular Recording CMTYPESWITCH: Popular RELOCORIGINAL: 55864A2603AC94ACCA2568F200224388 CMCOUNTRY_ORIGIN: CMGENRE_CODE: **CPTITLE: INFINITE POSSIBILITIES **CPARTIST: AMEL LARRIEUX CPOARTISTS: **CMCATNUMBER: 4948792 **CMAPN: 9399700067507 **CMARIAPRICECODE: C9921 **CMARIAMEDIACODE: 21 **CMARIADISTRIBUTORCODE: SMA CMARIAPACKAGECODE: **DMRELEASE: 19/06/2000 cMDateFormat: 19/06/2000 12:00:00 AM DMDELETE: cMDeleteStatus: No **CMLISTPTRACKS: GET UP,I N I,SWEET MISERY,SEARCHIN' FOR MY SOUL,EVEN IF,INFINITE POSSIBILITES,SHINE,DOWN,WEATHER,MAKE ME WHOLE,GET UP (THREAD HAD FUN MAIN MI,GET UP (MV MIG MIX (RADIO)) CMLISTPARTISTS: ,,, RELOCMEDIA: F73C80183A01A8D7CA2568F2002A5517 **CURMPRICE: 15.91 **CMTYPE: Compact Disc CMRECORDCOMPANY: SONY MUSIC CMPACKAGE: CMARIADISTRIBUTORHOUSECODE: cDistributorHouse: CMLOCALE: Y $UpdatedBy: CN=PPT/OU=AEROS/O=JUKEBOX $Revisions: 02/06/2000 05:42:22 PM,02/06/2000 05:42:22 PM
[REBOL] restart in FTP and HTTP Re:
[EMAIL PROTECTED] wrote: OK. Two scripts have been posted to REBOL.org though not yet linked from the main page. Go to: http://www.rebol.org/unsupported/ for a brief text blurb and the files. These are the FTP and HTTP protocols modified so that a wisely formed read/custom call will make use of the partial read functionality of many web browsers and the restart command that exists in some ftp servers. If these changes make it into a full release version of REBOL then thes files will be removed from this location never to be seen from again as they perish into /dev/null. Sterling If I totally messed up and the files fail all over the place for you I'll fix them quickly so they work but they are unsupported so nobody is going to constantly be updating them with bug fixes as you find servers they don't work on. If somebody wants to take it on as their script, then just grab it and post it back into the REBOL.org script library. Then you can update it all you like. Party on Wayne! Party on Garth! Also, remember that the first byte is 0... read/custom http://www.ibm.com/index.html [restart 1 reend 2] This reads the *second* byte and the third byte, so the length is (3 - 2) + 1 = 2 read/custom http://www.ibm.com/index.html [restart 10 reend 20] Read from the eleventh byte upto and including the twenty-first byte, a length of (21 - 11) + 1 = 21 Rebol will also translate line terminators, which is why (on a Windows machine) - length? read/custom http://www.ibm.com/index.html [restart 100 reend 1000] == 899 The length that was actually read is (1001 - 101) + 1 = 901, but Rebol removed two #"^M"'s. Using the binary refinement is a wise choice - length? read/binary/custom http://www.ibm.com/index.html [restart 100 reend 1000] == 901 The same applies to ftp, [restart 1] will start reading from the second byte, and you'll probably want to use the binary refinement to avoid confusion. Julian Kinraid
[REBOL] solved (was detach-image: func (was: %detach.r ) ) Re:(10)
Ok peoples, I've spent all day looking at %detach.r, Ryans email, rfcs and the inner parts of Rebol. And I blame Ryan for it. :) I really couldn't let the code in detach go to waste. I chopped %detach.r to pieces and put it back together again (no guarantee all functionality is the same - in fact I know it is different). I called my version %import-attachments.r. Because I wanted to import them as a block and leaving hanging of an email object as a new field. But alas I think I was misguided. Nevertheless! export-attachments found in this same file seems to work :) Even for Ryans email from the Be mailer. I have assumed, that multipart message can be nested (as is the case with the Be mailer). This is explicitly allowed according to the rfc. Please check it out and let me know how many mistakes a newbie Rebol programmer has made. :) Please note that I have only got it working for content-type of image so far. Next to do would be text and application. I'm very happy if someone else wants to "spit and polish it". Brett.
[REBOL] By any other name (CGI, HTTP)
- Open Your Mind - I didn't find a way in the RFC, but maybe I did a poor search. I don't have the time to study Apache right now, so I don't know if the answer is there. The question: is there a way for an Apache-handled CGI script named john-doe.r, and referenced to as such in a web form, to output a web page named john-doe.html (or even john-smith.html)? In other words, I'd like to have form action="john-doe.r" method="get" in the form, click on the submit button and see john-doe.html on my browser. Oh, *without* generating a file on the server and redirecting to it. I need direct output maybe with some neat HTTP header. :-) If it turns out there's no way, well, I'll happily keep the .r extension and be proud of it. (-: Alessandro Pini ([EMAIL PROTECTED]) "Oh, just like that?" "Just like that!" "And how do you suggest we do that?" "I'm sure you'll think of something." (Sheridan Delenn)
[REBOL] CGI
Can someone help me with the following : Consider this : print exists %. In other words, does the current directory exists ? (which has to be always true). However, when this line is called from a CGI script (it's not part of the CGI script itself, but part of a rebol script called with "do/args" from the CGI script), it produces "false". I'm running Apache. daniel -- [EMAIL PROTECTED] http://perso.worldonline.fr/mutant
[REBOL] PAM authentication REBOL
daemon, rebol test file, and rebol function available at: Conventional Browser: 3337 bytes http://users.iitowns.com/deryk/rebol/rebolauthd-1.0.tar.gz or REBOL: 4326 bytes do read http://users.iitowns.com/deryk/rebol/rebolauthd-1.0.rip Running the daemon on a server and using these scripts, one can authenticate against it. Have fun. :) Regards, Deryk
[REBOL] Re: CGI
Hello [EMAIL PROTECTED], Just a guess, but does the same happen if you add a trailing slash, ie: print exists? %./ On 13-Jun-00, [EMAIL PROTECTED] wrote: Can someone help me with the following : Consider this : print exists %. In other words, does the current directory exists ? (which has to be always true). However, when this line is called from a CGI script (it's not part of the CGI script itself, but part of a rebol script called with "do/args" from the CGI script), it produces "false". I'm running Apache. daniel Best regards Thomas Jensen
[REBOL] Re: CGI Re:
Just a guess, but does the same happen if you add a trailing slash, ie: print exists? %./ Yes it does. I guess it has to do with file permissions. I'm running NT, the script does some stuff on files but it's local. The rebol script invoked with the do/args is outside of the cgi-bin directory defined in Apache. Is this a problem ? (it runs fine, it just seems oblivious to what local files pertains). daniel On 13-Jun-00, [EMAIL PROTECTED] wrote: Can someone help me with the following : Consider this : print exists %. In other words, does the current directory exists ? (which has to be always true). However, when this line is called from a CGI script (it's not part of the CGI script itself, but part of a rebol script called with "do/args" from the CGI script), it produces "false". I'm running Apache. daniel Best regards Thomas Jensen -- [EMAIL PROTECTED] http://perso.worldonline.fr/mutant
[REBOL] can rebol strip this type of text file? Re:
Hi Keith, its trivial to do that in REBOL. You have a number of different choices. The most elegant way to do it would be to use parse. Take a look at the documentation under parse. Let me know if you have questions. Elan At 04:18 PM 6/13/00 +1000, you wrote: hi all i am new to scripting (rebol and python) and was wondering if it was capable of doing to the following and if so..how? the following is an example of what i need to strip and turn into a tab delimited file.. the entries are from a music database that is updated weekly..it is in lotus notes so i export from there and it dumps this file out with the new titles for the coming week (here the 19th June) i only need to get the rows with the double astericks at the start (i put those in for this post, they are not there in the normal file) and then strip the words at the start and then put a tab in between them so i can bring it into excel for the sales team to look at i would need a first row to describe each column also maybe something like Title tab Artist tab Cat no tab APN etc etc the tracklisting is a little more complicated as it has multiple tracks within the row..they are seperated by commas i think that it won't be that hard but i had no success in perl so i thought i might try rebol or python... thanks in advance keith FORM: Popular Recording CMTYPESWITCH: Popular RELOCORIGINAL: 55864A2603AC94ACCA2568F200224388 CMCOUNTRY_ORIGIN: CMGENRE_CODE: **CPTITLE: INFINITE POSSIBILITIES **CPARTIST: AMEL LARRIEUX CPOARTISTS: **CMCATNUMBER: 4948792 **CMAPN: 9399700067507 **CMARIAPRICECODE: C9921 **CMARIAMEDIACODE: 21 **CMARIADISTRIBUTORCODE: SMA CMARIAPACKAGECODE: **DMRELEASE: 19/06/2000 cMDateFormat: 19/06/2000 12:00:00 AM DMDELETE: cMDeleteStatus: No **CMLISTPTRACKS: GET UP,I N I,SWEET MISERY,SEARCHIN' FOR MY SOUL,EVEN IF,INFINITE POSSIBILITES,SHINE,DOWN,WEATHER,MAKE ME WHOLE,GET UP (THREAD HAD FUN MAIN MI,GET UP (MV MIG MIX (RADIO)) CMLISTPARTISTS: ,,, RELOCMEDIA: F73C80183A01A8D7CA2568F2002A5517 **CURMPRICE: 15.91 **CMTYPE: Compact Disc CMRECORDCOMPANY: SONY MUSIC CMPACKAGE: CMARIADISTRIBUTORHOUSECODE: cDistributorHouse: CMLOCALE: Y $UpdatedBy: CN=PPT/OU=AEROS/O=JUKEBOX $Revisions: 02/06/2000 05:42:22 PM,02/06/2000 05:42:22 PM ;- Elan [ : - ) ]
[REBOL] can rebol strip this type of text file? Re:(2)
I haven't done much actual programming in REBOL yet, so I hope I'm not talking out of turn, but here we have an industry-specific terminology that seems like an application for dialecting. Would that apply? I'd love to see how it's done... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 13, 2000 8:33 AM To: [EMAIL PROTECTED] Subject: [REBOL] can rebol strip this type of text file? Re: Hi Keith, its trivial to do that in REBOL. You have a number of different choices. The most elegant way to do it would be to use parse. Take a look at the documentation under parse. Let me know if you have questions. Elan At 04:18 PM 6/13/00 +1000, you wrote: hi all i am new to scripting (rebol and python) and was wondering if it was capable of doing to the following and if so..how? the following is an example of what i need to strip and turn into a tab delimited file.. the entries are from a music database that is updated weekly..it is in lotus notes so i export from there and it dumps this file out with the new titles for the coming week (here the 19th June) i only need to get the rows with the double astericks at the start (i put those in for this post, they are not there in the normal file) and then strip the words at the start and then put a tab in between them so i can bring it into excel for the sales team to look at i would need a first row to describe each column also maybe something like Title tab Artist tab Cat no tab APN etc etc the tracklisting is a little more complicated as it has multiple tracks within the row..they are seperated by commas i think that it won't be that hard but i had no success in perl so i thought i might try rebol or python... thanks in advance keith FORM: Popular Recording CMTYPESWITCH: Popular RELOCORIGINAL: 55864A2603AC94ACCA2568F200224388 CMCOUNTRY_ORIGIN: CMGENRE_CODE: **CPTITLE: INFINITE POSSIBILITIES **CPARTIST: AMEL LARRIEUX CPOARTISTS: **CMCATNUMBER: 4948792 **CMAPN: 9399700067507 **CMARIAPRICECODE: C9921 **CMARIAMEDIACODE: 21 **CMARIADISTRIBUTORCODE: SMA CMARIAPACKAGECODE: **DMRELEASE: 19/06/2000 cMDateFormat: 19/06/2000 12:00:00 AM DMDELETE: cMDeleteStatus: No **CMLISTPTRACKS: GET UP,I N I,SWEET MISERY,SEARCHIN' FOR MY SOUL,EVEN IF,INFINITE POSSIBILITES,SHINE,DOWN,WEATHER,MAKE ME WHOLE,GET UP (THREAD HAD FUN MAIN MI,GET UP (MV MIG MIX (RADIO)) CMLISTPARTISTS: ,,, RELOCMEDIA: F73C80183A01A8D7CA2568F2002A5517 **CURMPRICE: 15.91 **CMTYPE: Compact Disc CMRECORDCOMPANY: SONY MUSIC CMPACKAGE: CMARIADISTRIBUTORHOUSECODE: cDistributorHouse: CMLOCALE: Y $UpdatedBy: CN=PPT/OU=AEROS/O=JUKEBOX $Revisions: 02/06/2000 05:42:22 PM,02/06/2000 05:42:22 PM ;- Elan [ : - ) ]
[REBOL] External scripts in CGI (was: CGI)
Hi all, In a rebol CGI script, what would be the correct way to call load and execute regular rebol scripts. In the CGI script : do/args %/path/script.r args Any special configuration required on the web server side (Apache) ? How come my external scripts can't access my local file system ? daniel -- [EMAIL PROTECTED] http://perso.worldonline.fr/mutant
[REBOL] CGI Re:(3)
So, Daniel: what do you see if you do what-dir in the other script? Can you change-dir? What are the system/options/path, and system/script/path values? Can your script write out a test file, if so, where does it show up? The exists? function actually makes this determination by attempting to open a port to the file or url your specified. If opening the port results in an error it does not exist (for all practical purposes that's true as far as REBOL's concerned there)-- otherwise it does exist. Point being that other things can make it appear to not exist. -jeff Just a guess, but does the same happen if you add a trailing slash, ie: print exists? %./ Yes it does. I guess it has to do with file permissions. I'm running NT, the script does some stuff on files but it's local. The rebol script invoked with the do/args is outside of the cgi-bin directory defined in Apache. Is this a problem ? (it runs fine, it just seems oblivious to what local files pertains). daniel
[REBOL] solved (was detach-image: func (was: %detach.r ) ) Re:(10)
Damn. Missed the attachment! Here 'tis. import-attachments.r
[REBOL] Dangerous (use of) Secure Re:(8)
Hi Jeff, tried your idea of a secure script execution without the need for random word generation: secure-do: func [ {secure script execution} untrusted [block! file! string!] {untrusted script} security [block! word!] {specify net/file policy} protected [block!] {words to protect} /local my-words my result ] [ ; create a temporary storage for system/words my-words: make system/words [] ; converts words to my words my: func [words] [bind words in my-words 'system] ; file and net security security: do reduce ['secure security] ; protect Secure and Secure-do at least protected: bind union protected [secure secure-do] 'system do compose/deep [ ; protect words unset protected ; do untrusted script (my [if error? set/any]) 'result (my 'try) :untrusted [ result: disarm :result ] ; restore the words (my 'foreach) word protected [ (my [set/any word get/any in]) my-words word ] ] ; restore file/net security do reduce ['secure security] get/any 'result ] { example: secure-do [1 / 1] 'throw [] } Crazy, no? With REBOL you can be very possesive about your words. No, they're MY words! :-) What a swell language... -jeff There may be some problems with GC, I think. GC corrections should take this situation into account... Ladislav
[REBOL] CGI Re:(4)
So, Daniel: what do you see if you do what-dir in the other script? Can you change-dir? What are the system/options/path, and system/script/path values? Can your script write out a test file, if so, where does it show up? Jeff, All the above works as intended when launched with the Rebol interpreter. However, when called from a cgi-script, a change-dir in the regular script yields : ** Access Error: Cannot open /c/winnt/. ** BTW, the same change-dir (change-dir %/c/winnt/) in the CGI script does not work neither and results in the same error. The external script runs in its own directory [system/script/path]. The CGI script runs in the cgi-bin as defined in httpd.conf (Apache on NT) In both scripts, if I write print system/options/path, I get ** Script Error: Invalid path value: path. ** Where: system/options/path daniel The exists? function actually makes this determination by attempting to open a port to the file or url your specified. If opening the port results in an error it does not exist (for all practical purposes that's true as far as REBOL's concerned there)-- otherwise it does exist. Point being that other things can make it appear to not exist. -jeff Just a guess, but does the same happen if you add a trailing slash, ie: print exists? %./ Yes it does. I guess it has to do with file permissions. I'm running NT, the script does some stuff on files but it's local. The rebol script invoked with the do/args is outside of the cgi-bin directory defined in Apache. Is this a problem ? (it runs fine, it just seems oblivious to what local files pertains). daniel -- [EMAIL PROTECTED] http://perso.worldonline.fr/mutant
[REBOL] solved (was detach-image: func (was: %detach.r ) ) Re:(2)
Hi Eric Welcome back! Your detach function works like a charm on my e-mail text file. The file was produced with: write %msg.txt read pop://user:pass%pop-server Cheers -Larry - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 13, 2000 3:12 AM Subject: [REBOL] solved (was detach-image: func (was: %detach.r ) ) Re: Hi, I don't know how helpful it will be, but here's the function I use for detaching attachments. It only works for four types of encoding (the type has to be specified), and only for attachments that have an associated file name, but it's a pretty simple and general solution, I think. All the attachments it can handle will be written into the current directory. If the same file name appears more than once the first one will be overwritten. Eric snip---
[REBOL] CGI Re:(4)
Thank you for your answer. I don't see why this would happen, as I'm working on local files with an administrator account (NT). What user does the *web server* run as? CGI scripts will inherit the same permissions as the web server, which usually runs with minimal permissions. Regards, Kev Kevin McKinnon, Network Engineer [EMAIL PROTECTED] Sunshine Communications http://www.sunshinecable.com PGP Public Key: http://www.dockmaster.net/pgp.html PGP 6.0 www.pgp.com
[REBOL] New VID scroller styles...
Hi! I just finished two new styles for VID. The first one is a scroller, which is a generalization of the "slider" style found in VID. The second one is a replacement for VID's slider. The SLIDER style is almost backward compatible with VID's slider; only a minor change to your layouts should be needed if you add these styles to them: the current value of the slider is SLIDER/CURRENT instead of SLIDER/DATA. Its behaviour is different from that of VID's slider, hopefully better; the look is the same anyway. This style offers more functionality wrt VID's. It is possible to set the minimum as well as the maximum value for the slider. Examples: ... do %scroller-styles.r ... view layout [ styles scrollers ... slider ; as for VID's (from 1 to size) slider 310 ; range from 1 to 310 slider minimum 5 maximum 20 ; range from 5 to 20 ... ] ... (SLIDER is implemented as a special case of SCROLLER, so it has all of its features; the difference between the two is only in default values.) The SCROLLER style is very similar to the one found in my previous script CID-Utils.r. It is designed to be used to scroll areas. Other than the obvious minimum and maximum value parameters, it has a VISIBLE parameter that is used to specify how much of the area is visible. So, VISIBLE is the size of the visible area; MINIMUM is the value the scroller should have when the top of the area is visible; MAXIMUM is the value the scroller should have when the bottom of the area is visible. By default, the scroller comes with two arrows. It is possible to choose their position; by default they are as I like them, on both sides of the scroller. (I know some of you DON'T like them this way, but I repeat that this is just the default.) Pressing an arrow will increase/decrease the scroller's value by 5 (this can be changed too). Some examples: ... do %scroller-styles.r ... view layout [ styles scrollers ... scroller ; just a vertical scroller with arrows, going from 0 ; to 150, visible 50 scroller minimum 10 maximum 100 visible 30 ; you can guess scroller options [without arrows] ; no arrows scroller options [with arrows together] ; both arrows on the ; same side scroller options [with arrows skipping 10] ; pressing an arrow will skip 10 ... ] ... For those of you who like having the arrows together, I'd suggest defining your own style: ... styles scrollers style my-scroller scroller options [with arrows together] ... my-scroller ... ... Ok, enough for now. I hope to put up a REB site soon with documentation ad examples. See ya, Gabriele. -- Gabriele Santilli [EMAIL PROTECTED] - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/ REBOL [ Title: "Scroller and slider styles for VID" Author: "Gabriele Santilli" File: %scroller-styles.r Date: 13-Jun-2000 Version: 1.3.0 ; majorv.minorv.status ; status: 0: alpha; 1: beta; 2: gamma History: [ 11-Jun-2000 1.1.0 "First version" 13-Jun-2000 1.2.0 "Finished writing it, now going to test it..." 13-Jun-2000 1.3.0 "(Hopefully) fixed all noticed bugs" ] ] scroller-feels: make object! [ knob-feel: make face/feel [ engage: func [ face action event ] [ if zero? face/knob-span [exit] if action = 'down [face/mouse-start: event/offset exit] if find [over away] action [ face/offset: min max face/zero-offset face/offset + ((event/offset - face/mouse-start) * face/way) face/max-offset do face/action show face ] ] ] arrow-feel: make face/feel [ engage: func [ face action event ] [ switch action [ time [ if face/clicked [ either face/delay = 0 [do face/action] [face/delay: face/delay - 1] ] ] down [ face/clicked: yes face/edge/effect: 'ibevel face/rate: 15 face/delay: 3 show face do face/action ] up [ if face/clicked [ face/rate: none
[REBOL] New VID scroller styles... Re:
[EMAIL PROTECTED] wrote: Hi! I just finished two new styles for VID. The first one is a scroller, which is a generalization of the "slider" style found in VID. The second one is a replacement for VID's slider. The SLIDER style is almost backward compatible with VID's slider; only a minor change to your layouts should be needed if you add these styles to them: the current value of the slider is SLIDER/CURRENT instead of SLIDER/DATA. Its behaviour is different from that of VID's slider, hopefully better; the look is the same anyway. This style offers more functionality wrt VID's. It is possible to set the minimum as well as the maximum value for the slider. Examples: ... do %scroller-styles.r ... view layout [ styles scrollers ... slider ; as for VID's (from 1 to size) slider 310 ; range from 1 to 310 slider minimum 5 maximum 20 ; range from 5 to 20 ... ] ... (SLIDER is implemented as a special case of SCROLLER, so it has all of its features; the difference between the two is only in default values.) The SCROLLER style is very similar to the one found in my previous script CID-Utils.r. It is designed to be used to scroll areas. Other than the obvious minimum and maximum value parameters, it has a VISIBLE parameter that is used to specify how much of the area is visible. So, VISIBLE is the size of the visible area; MINIMUM is the value the scroller should have when the top of the area is visible; MAXIMUM is the value the scroller should have when the bottom of the area is visible. By default, the scroller comes with two arrows. It is possible to choose their position; by default they are as I like them, on both sides of the scroller. (I know some of you DON'T like them this way, but I repeat that this is just the default.) Pressing an arrow will increase/decrease the scroller's value by 5 (this can be changed too). Some examples: ... do %scroller-styles.r ... view layout [ styles scrollers ... scroller ; just a vertical scroller with arrows, going from 0 ; to 150, visible 50 scroller minimum 10 maximum 100 visible 30 ; you can guess scroller options [without arrows] ; no arrows scroller options [with arrows together] ; both arrows on the ; same side scroller options [with arrows skipping 10] ; pressing an arrow will skip 10 ... ] ... For those of you who like having the arrows together, I'd suggest defining your own style: ... styles scrollers style my-scroller scroller options [with arrows together] ... my-scroller ... ... Ok, enough for now. I hope to put up a REB site soon with documentation ad examples. Hey, Gabriele, cool. Use 'across at the beginnig of your examples please, as all that variants of scrollers don't fit 800x600 resolution. One note to RT - I haven't seen anything so ugly as an arrow effect is, bleah :- It completly doesn't fit /View design. Just look at nice Carl's image-sort.r script, and I can't image arrows placed anywhere on screen. At least some beveled drawing should be used instead of flat one for arrow effect, please :-) Gabriele, would it be possible to get scroller which will react upon mouse relese, so not in real-time? I saw it implemented in some apps, and it could help us on slower systems - so drag the scroller, release the mouse button, do the event ... Thanks, -pekr- See ya, Gabriele. -- Gabriele Santilli [EMAIL PROTECTED] - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/ Name: scroller-styles.r scroller-styles.r Type: Plain Text (text/plain) Encoding: quoted-printable Description: created 13.06.2000 19:03:36, last accessed 13.06.2000
[REBOL] Re: By any other name (CGI, HTTP)
Hello [EMAIL PROTECTED]! On 13-Giu-00, you wrote: a The question: is there a way for an Apache-handled CGI script a named john-doe.r, and referenced to as such in a web form, to a output a web page named john-doe.html (or even a john-smith.html)? The only way is redirection AFAIK. Regards, Gabriele. -- Gabriele Santilli [EMAIL PROTECTED] - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
[REBOL] Parsing command line arguments Re:
Howdy, Garold: Command line args that use - or + can be quoted. If you need quotes, at least under unix, you can escape the quotes. Using the following script which I called "rargs": #!/usr/local/bin/rebol -q REBOL [Title: "Rargs"] foreach item [ system/options/args system/script/args ][ print [mold :item "==" item]] You can see some examples: rargs print \"hello\" system/options/args == print "hello" system/script/args == print "hello" rargs \"+-\" system/options/args == "+-" system/script/args == "+-" or... rargs {+-} system/options/args == {+-} system/script/args == {+-} If you're running under windows, I'm not sure what the comparable .bat file for above would be like. Would it just call rebol on the script you wanted? Maybe so... Not sure about what you'd do under mac or amiga to do shell script kind of stuff. Maybe someone will educate me. :-) Oddly enough, I just wrote a little article on using REBOL for shell scripts: http://www.cs.unm.edu/~whip/rebol-unix-shell.html -jeff Since I didnt find anything for processing command line arguments, I decided to investigate the issue as my first REBOL script. I use command line programs heavily from other programs. REBOL eats ALL arguments starting with - or +. Since / is used in paths, it isnt available as a flag either. Is there a REBOL standard for option flags? Is there a standard REBOL script for handling command line arguments that I missed? Any suggestions for improvements of this script? Should I move the parse rules inside the parse-args function? Is there a better choice for names? Thanks, Garold (Gary) L.Johnson DYNAMIC Alternatives [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 562 802 1639
[REBOL] rebol for dummies Re:(3)
Dear Paul: Please do not attribute the troubles of others to meg. In no way would I do that to you Ralph 8-) And if it appeared that I was attacking you I certainly appologies. My target is the marketing animal, not the people that do honest work. Paul Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
[REBOL] /view and the Web Re:
Since /view seems to be platform-dependent in drawing windows, is there any application for /view with Web scripting? I assume the answer is "no." -Ryan Well, Ryan, /View has all of /Core's functions as far as CGI, so you don't have to use all the GUI stuff. I likes /View but I LOVE /Core. /View has potential, it's fun to play wid. But /Core is here and now and running e-commerce aps for me like the loyal trooper it is, night and day. That's my opinion. I speak for strictly for myself here, but I think the immediate real winners from REBL are gonna be /Core and /Command. Later, I am willing predict, /View will come into its own perhaps as a part of the new e-commerce aps on the new http://rebol.com. --Ralph
[REBOL] CGI Re:(4)
Hello, You mentioned that the scripts runs another script with 'do/args - where does that other script reside? Is it in the same/lower directory, or a higher? Regards, Rachid
[REBOL] Dangerous (use of) Secure Re:(10)
Cool stuff, Ladislav! Someone's going to accuse you of being a guru here at the rate you're going! (Or maybe someone just did (; ) I love your "MY" function, saves typing and works nicely with the way compose works, allowing you to sculpt the context of words that are executed in a block. It's wild in REBOL how a given block of words to be executed could have words that are bound to a million different places: Like this silly thing comes to mind: REBOL [Title: "Mind num'in magic"] contexts: [a b c d e f g] i: 0 foreach context contexts [ set context make object! compose [num: (i: i + 1)] ] ;- in this hand we have an ordinary block of ; nums.. nothing up our sleeves.. ;) nums: [[(num)] [(num)] [(num)] [(num)] [(num)] [(num)] [(num)]] ;- allow me to fan the nums out here on the table: forall nums [ bind first nums in get first contexts 'self contexts: next contexts ] nums: head nums ;-- Abracadabra!! Alacazoo! ; All the nums come back to you! print [mold nums "==" mold compose/deep nums] halt ;= Enough silly business, though... What happens if someone does something like this in your secure-do, though?: secure-do [ security: [file allow] get: func [/any][ do %bad-stuff.r ] ] 'throw [] [] -jeff Hi, the GC problem has a work-around as can be seen below: secure-do: func [ {secure script execution} untrusted [block! file! string!] {untrusted script} security [block!word!] {specify net/file policy} hidden [block!] {words to hide} protected [block!] {words to protect} /local my-words my result sec-do ] [ ; tell GC about secure-do sec-do: :secure-do ...
[REBOL] /view and the Web Re:(5)
No. I am thinking of the possibility of creating interactive Web pages using /view . I agree with Ryan, I dont see an end to /Core any time soon. I can see it getting stale, kind of like it is right now. Ryan, are you thinking of making a web browser using view? --Ryan [EMAIL PROTECTED] wrote: I can't see /core being "discontinued" except perhaps being replaced by /command . Perhaps /core is the enticement for /command . I am beginning to use core as a CGI workhorse for me (and I hope Carl continues with it, despite some evidence to the contrary in this list).
[REBOL] /view and the Web Re:(6)
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 14, 2000 8:20 AM Subject: [REBOL] /view and the Web Re:(5) No. I am thinking of the possibility of creating interactive Web pages using /view . view contains core so it works in cgi so you can do the usual server side stuff. But another method to explore if you don't want to do cgi, using browse/only function with local files dynamically created in view, but I think this is fairly limited in the interative stakes. You can set up a kiosk mode browser, add a refresh tag, and have /view doing things in the backgound. (works for IE other browsers may or may not still support it) browse/only "-k pathtofile.html" Like I said, this is limited, but I don't think anyone has fully explored the possibilities. Cheers, Allen K PS. I have been using /view long enough for a paradigm shift. I don't try and fit /view into the web, I now see the web as a live content plugin for my view pages..
[REBOL] What kind of memory? Re:
BIG OOPS! My mistake, ignore this... (trying to decompress an ASCII text file... ;o) Regards, Rachid - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 14, 2000 00:24 Subject: [REBOL] What kind of memory? sd %/d/data/text/evil.txt ** Script Error: Not enough memory. ** Where: data: decompress source write src What kind of memory does this refer to? System Resources? I'm running Win98se on an Intel with 96mb of RAM... Thanks, Rachid
[REBOL] restart in FTP and HTTP Re:(2)
Thanks, Julian! Yee-hah!
[REBOL] /view and the Web Re:(7)
My 2 cents... I have personally been a little disappointed that /view is getting all the RT attention. This is simply because my problems are better solved with /command and who knows when that will be ready. I also wish that /core was updated as quickly as /view with new features and bug fixes. I am actively working on my own /command extensions for Win32 by using a tcp port for communication between Rebol and an EXE that will carry out commands for Rebol. I will likely make this extension public once I'm comfortable with it. I didn't want to do this but since RT is not forthcoming with a /command deadline (and additionally my request for getting a copy of /command has been ignored), I can't wait for something indeterminate. I am also working on using Rebol in web server mode so I can use a browser for UI, even though my app is running locally. I am only using the web server to get the browser interface (so that I can use form input - otherwise file display would be enough). My hope is that under Win32 you can double-click my app icon and it will load Rebol and my special EXE, pop open the default browser to the application's home page, and away you go, with most pages being rebol scripts. I have been very tempted to really rely on /view but haven't for these main reasons: 1) My company has a dictum that all new UI work be browser-based 2) I have found View to be quirky in that certain Win32 niceties aren't available (like cursor blinking, ctrl-shift selecting...) 3) Browsers currently have a richer set of possibilities including video, audio, etc. But I may be a /view convert at some point. Rodney Snell -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 13, 2000 3:55 PM To: [EMAIL PROTECTED] Subject: [REBOL] /view and the Web Re:(6) - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 14, 2000 8:20 AM Subject: [REBOL] /view and the Web Re:(5) No. I am thinking of the possibility of creating interactive Web pages using /view . view contains core so it works in cgi so you can do the usual server side stuff. But another method to explore if you don't want to do cgi, using browse/only function with local files dynamically created in view, but I think this is fairly limited in the interative stakes. You can set up a kiosk mode browser, add a refresh tag, and have /view doing things in the backgound. (works for IE other browsers may or may not still support it) browse/only "-k pathtofile.html" Like I said, this is limited, but I don't think anyone has fully explored the possibilities. Cheers, Allen K PS. I have been using /view long enough for a paradigm shift. I don't try and fit /view into the web, I now see the web as a live content plugin for my view pages..
[REBOL] re: uppercase and lowercase
uppercase and lowercase work apparently only on any-string. But it's too bad it doesn't work on character. You can do a string or a filename, but not a single character. You can write a lower-char function that converts the char to a string then do lowercase then convert back to char again, but it seems a bit wasteful and unnecessary. I submit that making these functions work on a char and return a char is a useful and reasonable thing. Comments? galt
[REBOL] Dangerous (use of) Secure Re:(11)
Hi Jeff, What happens if someone does something like this in your secure-do, though?: secure-do [ security: [file allow] get: func [/any][ do %bad-stuff.r ] ] 'throw [] [] -jeff if I understood you correctly, you are asking what happens, if the untrusted script were: untrusted: [ security: [file allow] get: func [/any][ do %bad-stuff.r ] ] let's try it with a more comfortable/debugged secure-do (sent to [EMAIL PROTECTED]): result: secure-do untrusted 'throw probe :get native secure throw == [net allow file [allow read ask write ask execute]] probe get in result 'result func [/any][ do %bad-stuff.r ] probe result/changed [get security] == [get security] That is all Ladislav
[REBOL] REBOL and the unix shell Re:
Hi Jeff Very nice! I really like short command utilities like these. -Larry - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 11, 2000 11:56 PM Subject: [REBOL] REBOL and the unix shell Say folks: I put up an article I wrote this weekend on using REBOL with the unix shell. It's a part of some other domain specific REBOL materials I've been assembling. Have a look and please feel free to send me any feedback you have. http://www.cs.unm.edu/~whip/rebol-unix-shell.html -jeff If your mailer is configured to be able to DO emails, then hopefully this will take you there: REBOL [] browse http://www.cs.unm.edu/~whip/rebol-unix-shell.html