[REBOL] obtaining IP address of incoming connection Re:
Hi Cal I modified one of the web-servers on the REBOL site, to write the browser IPs to the console. A couple of snippets should be enough to get you going. listen-port: open/lines tcp://:8080 ; port used for web connections ... http-port: first wait listen-port request: first http-port ... send-page: func [data mime] [ insert data rejoin ["HTTP/1.0 200 OK^/Content-type: " mime "^/^/"] write-io http-port data length? data print [now http-port/host length? data http-port/port-id] ] So after we have an active connection in http-port, properties at browser end are found in http-port object: the browser IP is http-port/host and the connection IP is in http-port/port-id. You can also do a reverse dns look-up on the host IP and log the domain-name if desired. Hope this helps Larry - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 24, 2000 8:04 PM Subject: [REBOL] obtaining IP address of incoming connection Is there any way to determine the source address of an incoming TCP connection in REBOL? I know it can be done in C and Perl, but I haven't found a way to get it in REBOL. I need to identify source addresses so I can add Common Log File support to %webserv.r TIA, - Cal Dixon -- __ Get Your Private, Free Email at http://www.hotmail.com
[REBOL] html4 generator script Re:(2)
Thanks for the suggestions, Elan. I'm using the gentag function internally to create a block of name/value pairs that eventually gets printed with build-tag, i.e., print [build-tag [h1 (tag)]]. The gentag function seems inefficient to me. Also I noticed that if I set the events property of an object like this: h1/events: ['onMouseOver {message('Entered this H1 tag');return true} 'onMouseOut {message('');return true}] the resulting tag looks like this: h1 events onMouseOver="message('Entered this H1 tag');return true" onMouseOut="message('');return true" Note the word 'events' inside the tag. This doesn't seem to bother IE, but it's not correct html either. I think I can fix this problem. I'm open to any suggestions.Thanks Scott From: [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [REBOL] html4 generator script Re: Date: Thu, 24 Feb 2000 16:39:42 -0800 Hi Scott, I briefly glanced at your html4.r script. (Briefly means that I may have few more ideas when I take a close look). __ Get Your Private, Free Email at http://www.hotmail.com
[REBOL] RIP Re:
In einer eMail vom 25.02.00 03:48:44 (MEZ) Mitteleuropäische Zeit schreibt [EMAIL PROTECTED]: For whoever it was who was having problems using RIP: RIP saves the archive's file name in the extraction code, and needs this to open the archive in binary mode - as a result you cannot rename the file... perhaps a solution to this should be the next enhancement? Anyway in the mean time just don't change the name of the archive after you create it. - system/options/script gives the script-name. So why saving it? modify file: .. in carls code: ... Note: (reform [{To extract, type REBOL} filename {or run REBOL and type: do} filename]) ] file: system/options/script ;ex (filename) size: (length? archive) path: (path) ... Tested on windows. OK? Gruss Volker
[REBOL] ftp limits?
I'm writing software to check for file changes at an ftp site, however... There are about 1500 files in one directory, each with a filename of 35 characters - that's my problem I expect. With a normal - print read ftp://sitename/directory/ You get as far as Net-log: {150 Opening BINARY mode data connection for /bin/ls.} Net-log: [ none "226"] Then after several minutes ** Script Error: pick expected series argument of type: series money date time object port tuple any-function. ** Where: pick server-said 4 The above read works fine on directories with only a few files. This is with REBOL 2.2.0.3.1. Is there a solution or workaround? Thanks - Nigel
[REBOL] unix timestamp conversion? Re:(2)
Will this script, submitted to the mailing list take into account leap years etcor will there be a small descrepency? Cheers Francois On Mon, 21 Feb 2000 [EMAIL PROTECTED] wrote: Anyone written a script to convert unix timestamps (is 950618412) to a usable rebol date and time format. Cheers Francois Hi Francois: Try this. REBOL [ Title: "Convert Epoch Time to Date" Author: "Ralph Roberts" File: %epoch-to-date.r Date: 21-Feb-2000 Purpose: {converts UNIX Epoch time (seconds after 1-1-1970 to current date and time } Example: {outputs "Epoch date 951142987 is 21-Feb-2000 14:38:52 GMT or 9:38:52 Local" } ] epoch: 951142987 days: divide epoch 86400 days2: make integer! days time: (days - days2) * 24 hours: make integer! time minutes: (time - hours) * 100 minutes2: make integer! minutes seconds: make integer! (minutes - minutes2) * 100 time2: make time! hours * 60) + minutes2) * 60) + seconds) prin ["Epoch date" epoch "is" 1-Jan-1970 + days2 time2] print [" GMT or" time2 + now/zone "Local"]
[REBOL] Re: WAP (protocol) and REBOL Re:(2)
Hello [EMAIL PROTECTED] On 24-Feb-00, [EMAIL PROTECTED] wrote: Any pointers to URL's with specifications, tutorials ... Here's the WML spec in PDF: http://www1.wapforum.org/tech/documents/SPEC-WML-19991104.pdf Here's a WAP emulator: http://gelon.net/ The concept is that you would prepare your documents in an XML format. The XML will then be processed to generate both HTML and WML, and hopefully PDF too. But you can just write WML directly, of course. The big difference between WML and HTML is the support for very small screens. WML has cards instead of pages - one web page would be divided into several cards. It demands good design if the users are not to be confused. I suspect a good way to design a WML site might be to actually use the old library index cards. Remember Hypercard? I haven't written any WML yet, but I'm studying the spec. It _is_ going to be big. Regards -- Don Cox [EMAIL PROTECTED]
[REBOL] Script = Rebol Tag Re:(6)
[EMAIL PROTECTED] wrote: Better yet, wait til REBOL/View becomes available (or join the beta testing now), and you can do it all with a nice GUI interface using nothing but REBOL/View (no web browser, no web server, no HTML, no JavaScript, and probably in no more than ten or twenty lines of code ...) I recall hearing about the approaching beta testing of /view several months ago before I dropped off the list (final semester of my degree, and playing with rebol was too distracting :). Is the beta still open (to anyone)? If so, how may I join? Thanks, Chris
[REBOL] SOAP
Sort of off topic, but I think REBOL could do well with this protocol. This article at Microsoft got me thinking http://msdn.microsoft.com/msdnmag/issues/0300/soap/soap.asp __ Get Your Private, Free Email at http://www.hotmail.com
[REBOL] Script = Rebol Tag Re:(7)
Hi Chris, send a request for beta participation to [EMAIL PROTECTED] You might get lucky ;-) At 05:46 PM 2/25/00 +1000, you wrote: [EMAIL PROTECTED] wrote: Better yet, wait til REBOL/View becomes available (or join the beta testing now), and you can do it all with a nice GUI interface using nothing but REBOL/View (no web browser, no web server, no HTML, no JavaScript, and probably in no more than ten or twenty lines of code ...) I recall hearing about the approaching beta testing of /view several months ago before I dropped off the list (final semester of my degree, and playing with rebol was too distracting :). Is the beta still open (to anyone)? If so, how may I join? Thanks, Chris ;- Elan [: - )]
[REBOL] Folders on Mac Re:(3)
I'm writing a small script to spool off graphic image files written by multiple users on a network onto a video disk recorder (over FTP) that we manufacture. The same script runs well on a Windows "server", same with Linux but when I try to run it on my iMac I get the following: open %myfolder ** Access Error: Cannot open /Macintosh HD/Desktop Folder/myfolder ** Where: open %myfolder Strangely it works for %. (current dir) and %.. but that seems to be all. Any other folder I try to open will fail. I just realized that maybe I am not running the right version of REBOL for my iMac; I am running 2.2.0.2.3, Macintosh, FAT, PPC, 68K. Is this ok? Any info would help.. Thanks, Stephane Hi Stephane, I think you have to specify that you are opening a directory by appending a "/" after its name. Here it's an example: change-dir %"/macintosh hd/desktop folder/" == %/macintosh%20hd/desktop%20folder/ open %myfolder ** Access Error: Cannot open /macintosh hd/desktop folder/myfolder. ** Where: open %myfolder open %myfolder/ probe open %myfolder/ make object! [ scheme: directory host: none port-id: none user: none pass: none target: % path: %/macintosh%20hd/desktop%20folder/myfolder/ proxy: none access: none allow: none buffer-size: none limit: none handler: none status: none size: none date: none url: none sub-port: none locals: none state: make object! [ flags: 4194835 misc: [0 0 "/macintosh hd/desktop folder/myfolder/"] tail: 0 num: 0 with: "^/" custom: none index: 0 func: 1 fpos: 0 inBuffer: [] outBuffer: none ] timeout: none ] Hope it helps. -- Paolo Russo [EMAIL PROTECTED] _ PERD s.r.l. Virtual Technologies for Real Solutions http://www.perd.com
[REBOL] Message Archive - Quotes - Left() Function
Title: Message Archive - Quotes - Left() Function Sorry to the same questions I'm sure have been asked many times before but maybe my first question will take of that. 1. Is there an archive of posts I can search through. If not: 2. How do I het a double quote inside a string that I am already putting in double quotes. I am asking because I need to write a Javascript string that has both single and double quotes in it. 3. What is the equivalent of the VB left, mid and right functions. If an answer gets posted on the whereabouts of an archive then no need to answer questions 2 and 3, to hopefully keep my noise level down. Thank you in advance Melvin Mudgett-Price Director of Development http://www.acmex.com/bio/mmp (Bio) (216) 391-7400 X207 acmeX.com - Acme Express, Inc. Web-enabled software / e-commerce / Web Marketing http://www.acmeX.com (216) 391-0707 (FAX) (216) 276-5487 (Cell)
[REBOL] Folders on Mac Re:(2)
I know this has nothing to do with the matter but just yesterday I downloaded the PPC version of REBOL and I don´t know why after I decompress it I can´t run REBOL without crashing my G3 Anyone has any idea? Carlos -Mensagem original- De: [EMAIL PROTECTED] [EMAIL PROTECTED] Para: [EMAIL PROTECTED] [EMAIL PROTECTED] Data: Sexta-feira, 25 de Fevereiro de 2000 14:51 Assunto: [REBOL] Folders on Mac Re: Uhm, I've never had any problems with this, on my G4 that is, Reading and writing files in other directories have never goofed.. What is it exactly you're trying to do? Cheers, malte -- Hi All, Sorry if that question has been asked before but I'm new to the list. I can't seem to be able to open up folders on a Macintosh iMac but can do it without any problem on W98, anything special I need to do? Thanks, Stephane __ Get Your Private, Free Email at http://www.hotmail.com
[REBOL] Correct %epoch-to-date.r
Gee, Francois, a mere 20 minute discreptancy over 30 years? Isn't that close? g Okay, okay... there was a small mistake in handling remainders. I was multiplying by 100 when it should have been by 60 for units of time Thanks for pushing me into finding it. This should work for you now: REBOL [ Title: "Convert Epoch Time to Date" Author: "Ralph Roberts" File: %epoch-to-date.r Date: 21-Feb-2000 Purpose: {converts UNIX Epoch time (seconds after 1-1-1970) to current date and time } Example: {outputs "Epoch date 951142987 is 21-Feb-2000 14:38:52 GMT or 9:38:52 Local" } ] epoch: 951505087 days: divide epoch 86400 days2: make integer! days time: (days - days2) * 24 hours: make integer! time minutes: (time - hours) * 60 minutes2: make integer! minutes seconds: make integer! (minutes - minutes2) * 60 time2: make time! hours * 60) + minutes2) * 60) + seconds) prin ["Epoch date" epoch "is" 1-Jan-1970 + days2 time2] print [" GMT or" time2 + now/zone "Local"] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, February 25, 2000 6:05 AM To: [EMAIL PROTECTED] Subject: [REBOL] unix timestamp conversion? Re:(2) Will this script, submitted to the mailing list take into account leap years etcor will there be a small descrepency? Cheers Francois On Mon, 21 Feb 2000 [EMAIL PROTECTED] wrote: Anyone written a script to convert unix timestamps (is 950618412) to a usable rebol date and time format. Cheers Francois Hi Francois: Try this. REBOL [ Title: "Convert Epoch Time to Date" Author: "Ralph Roberts" File: %epoch-to-date.r Date: 21-Feb-2000 Purpose: {converts UNIX Epoch time (seconds after 1-1-1970 to current date and time } Example: {outputs "Epoch date 951142987 is 21-Feb-2000 14:38:52 GMT or 9:38:52 Local" } ] epoch: 951142987 days: divide epoch 86400 days2: make integer! days time: (days - days2) * 24 hours: make integer! time minutes: (time - hours) * 100 minutes2: make integer! minutes seconds: make integer! (minutes - minutes2) * 100 time2: make time! hours * 60) + minutes2) * 60) + seconds) prin ["Epoch date" epoch "is" 1-Jan-1970 + days2 time2] print [" GMT or" time2 + now/zone "Local"]
[REBOL] Message Archive - Quotes - Left() Function Re:
[EMAIL PROTECTED] wrote: str: "This is string" str1: {"And this is quoted string"} left: func [series num-of-chars][copy/part series num-of-chars] right: func [series num-of-chars][copy skip tail series negate num-of-chars] mid:func [series pos num-of-chars] [left skip series (pos - 1) num-of-chars]; :-)) There are surely many other ways how to do it :-) The Rebol way :-) e.g. mid:func [series pos num-of-chars] [copy/part at series pos num-of-chars] Regards, -pekr-
[REBOL] WAP (protocol) and REBOL Re:(2)
Official site: http://www.wapforum.org Interesting article: Building WAP Services http://www.webtechniques.com/archives/2000/03/passani/ Regards, Aleksandar Any pointers to URL's with specifications, tutorials ... ;- Elan [: - )]
[REBOL] Re: Script = Rebol Tag Re:(4)
Hello [EMAIL PROTECTED]! On 24-Feb-00, you wrote: r If you *really* want to use your REBOL scripts with an html r interface in Windows, you can set up the Personal Web Server r to serve REBOL CGI scripts from your own machine. There's been ...or wait a bit for the public release of REBOL/View. Regards, Gabriele. -- o) .-^-. (--o | Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila | | GIESSE on IRC \ \-\_/-/ / http://www.amyresource.it/AGI/ | o) `-v-' (--o
[REBOL] Message Archive - Quotes - Left() Function Re:
On Fri, 25 Feb 2000 14:12:08 -0500, [EMAIL PROTECTED] wrote: 1. Is there an archive of posts I can search through. Yes, try www.rebol.org Also, http://24.217.20.110/rebolsearch/ is nice (though sometimes painfully slow) good luck, ~c ___ Get 100% FREE Internet Access powered by Excite Visit http://freeworld.excite.com
[REBOL] Folders on Mac Re:(4)
You were right Paolo. The Mac OS is less forgiving.. open %myfolder - Will not work open %myfolder/ - Works! Now I seem unable to open an FTP connection from the MAC.. Any idea? The following command works on Windows/Linux but not on Mac: open ftp://user:[EMAIL PROTECTED]/ Thanks a lot for your help guys, Stephane __ Get Your Private, Free Email at http://www.hotmail.com
[REBOL] Script = Rebol Tag Re:(6)
r If you *really* want to use your REBOL scripts with an html r interface in Windows, you can set up the Personal Web Server r to serve REBOL CGI scripts from your own machine. There's been ...or wait a bit for the public release of REBOL/View. Well, you can do a graphical interface with REBOL/View, but I was careful to be explicit and specify that it was if you want an HTML interface that you have to run a REBOL CGI script :) Keith
[REBOL] Script = Rebol Tag Re:(7)
Hi Keith, you wrote: ...or wait a bit for the public release of REBOL/View. Well, you can do a graphical interface with REBOL/View, but I was careful to be explicit and specify that it was if you want an HTML interface that you have to run a REBOL CGI script :) Right. Or you could use one of the REBOL Webservers (see library) and include the necessary REBOL functions in the Web server script without using CGI at all (provided you will be using this local server for this purpose exclusively!) ;- Elan [: - )]
[REBOL] unix timestamp conversion? Re:(3)
Is the line prin ["Epoch date" epoch "is" 1-Jan-1970 + days2 time2] perhaps supposed to have + inserted before 'time2. The + operation for adding an integer number of days to a date does appear to correctly take care of leap years, including that century years are not leap years unless they are multiples of 400, (like 2000), in which case they -are- leap years. You can test this by 1-jan-1999 + 365 == 1-Jan-2000 1-jan-2000 + 365 == 31-Dec-2000 1-jan-1000 + 365 == 1-Jan-1001 Russell [EMAIL PROTECTED] - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 25, 2000 4:05 AM Subject: [REBOL] unix timestamp conversion? Re:(2) Will this script, submitted to the mailing list take into account leap years etcor will there be a small descrepency? Cheers Francois On Mon, 21 Feb 2000 [EMAIL PROTECTED] wrote: Anyone written a script to convert unix timestamps (is 950618412) to a usable rebol date and time format. Cheers Francois Hi Francois: Try this. REBOL [ Title: "Convert Epoch Time to Date" Author: "Ralph Roberts" File: %epoch-to-date.r Date: 21-Feb-2000 Purpose: {converts UNIX Epoch time (seconds after 1-1-1970 to current date and time } Example: {outputs "Epoch date 951142987 is 21-Feb-2000 14:38:52 GMT or 9:38:52 Local" } ] epoch: 951142987 days: divide epoch 86400 days2: make integer! days time: (days - days2) * 24 hours: make integer! time minutes: (time - hours) * 100 minutes2: make integer! minutes seconds: make integer! (minutes - minutes2) * 100 time2: make time! hours * 60) + minutes2) * 60) + seconds) prin ["Epoch date" epoch "is" 1-Jan-1970 + days2 time2] print [" GMT or" time2 + now/zone "Local"]
[REBOL] Re: ftp limits?
Hello [EMAIL PROTECTED], This might be completely unrelated, but I've noticed some other odd stuff. When reading directories with links, or the links themselves, sometimes strage things happen, example: *reading a dir* ## list: read ftp://ftp.aminet.net/pub/aminet/recent/ URL Parse: none none ftp.aminet.net none pub/aminet/recent/ none Net-log: [["PORT" port/locals/active-check] "200"] Net-log: "200 PORT command successful." --snip-- Net-log: [["LIST" "."] ["150" "125"]] Net-log: {150 Opening BINARY mode data connection for /bin/ls.} Net-log: [ none "226"] ** Access Error: Network timeout. ** Where: list: read ftp://ftp.aminet.net/pub/aminet/recent/ (to start with, modem lamps blink happily, but after a short while there's no activity and then later comes the timeout) *reading a file* ## file: read ftp://ftp.aminet.net/pub/aminet/recent/AMP.readme URL Parse: none none ftp.aminet.net none pub/aminet/recent/ AMP.readme Net-log: [["PORT" port/locals/active-check] "200"] Net-log: "200 PORT command successful." --snip-- Net-log: [["RETR" port/target] ["150" "125"]] Net-log: {150 Opening BINARY mode data connection for AMP.readme (640 bytes).} Net-log: ["low level read of " 22 "bytes"] Net-log: [ none "226"] Net-log: "226 Transfer complete." == "Short:MPEG1/2,MP2/" ## print file Short:MPEG1/2,MP2/ I'm not going through a firewall. Best regards Thomas Jensen On 25-Feb-00, [EMAIL PROTECTED] wrote: I'm writing software to check for file changes at an ftp site, however... There are about 1500 files in one directory, each with a filename of 35 characters - that's my problem I expect. With a normal - print read ftp://sitename/directory/ You get as far as Net-log: {150 Opening BINARY mode data connection for /bin/ls.} Net-log: [ none "226"] Then after several minutes ** Script Error: pick expected series argument of type: series money date time object port tuple any-function. ** Where: pick server-said 4 The above read works fine on directories with only a few files. This is with REBOL 2.2.0.3.1. Is there a solution or workaround? Thanks - Nigel
[REBOL] .r to html monthly calendar prelude Re:(3)
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 22, 2000 6:34 AM Subject: [REBOL] .r to html monthly calendar prelude Re:(2) Here is something more efficient : firstOfNextMonth: firstOfMonth/month: firstOfMonth/month + 1 == 1-Mar-2000 daysInMonth: firstOfNextMonth - firstOfMonth == 29 print [" There are " daysInMonth " days in " currentMonth now/year] Olivier Thanks for the elegant code above... run the following... an oddity occurs... You're right. There is something wrong in REBOL with the /month refinement of date values. Here is my test : d: now/date == 26-Feb-2000 d/day: 1 == 1-Feb-2000 d/day: 2 == 2-Feb-2000 d/day: 0 == 31-Jan-2000 d/day: -1 == 30-Jan-2000 d/month: 1 == 26-Jan-2000 d/month: 0 == 26-Apr-23845 d/month: -1 == 26-Mar-23845 Olivier.
[REBOL] Project Submissions
I have only 7 projects to date. The deadline for Project submissions is March 1st. If you have any good ideas we liked to here them. Follow the project submission links at http://p1-110.charter-stl.com/rebolsearch. Paul Tretter Paul's Rebol Page
[REBOL] protect-system ??
Hi I wrote protect-system in %user.r but I got an error saying it has no value. Here is what the guide said: If protect-system is set in the user .r file, then all words set within REBOL will be protected from modification because the user .r file is called by REBOL just after initializing itself. timmy
[REBOL] protect-system ?? Re:
Hi Timmy, Check your version number (type rebol/version), if it is pre 2.2.0.xx then you need to upgrade. Protect-system is a v2.2.0.xx command. Type upgrade to get the latest version. Cheers, Allen K - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, February 26, 2000 3:15 PM Subject: [REBOL] protect-system ?? Hi I wrote protect-system in %user.r but I got an error saying it has no value. Here is what the guide said: If protect-system is set in the user .r file, then all words set within REBOL will be protected from modification because the user .r file is called by REBOL just after initializing itself. timmy