[REBOL] Re: How to capture keyboard tab when typing in an 'area?
Hello, and welcome to Obscure Undocumented Features Of REBOL!! Today's question comes from Alan who is trying to make sense of some of the confusing behaviors of VID styles. Congratulations Alan, your question was chosen at random from the bottom of the email box. Change the flags in the face: view layout [ field area with [flags: [field]] field ] The two fields will tab between each other but the area will not and the tabs will go into the area. Your question rated a fun-factor of 8.7 and therefore you get a bonus question answered for you... here it is: Question: So what are the available flags?? Answer: It's a secret! Just kidding. ;) The flags you can use are: field -- behave like a standard field meaning that text is highlited upon selection and the clear-fields function will clear the text in this field tabbed -- tab and return will move the focus to the next valid face return -- return key activiates the action block of the face Well Alan, thank you for playing Obscure Undocumented Features Of REBOL!! You'll alsso be getting a copy of our home game, a bag of mismatched socks, and a copy of our fake studio audience applause on CD. We hope to see you here next time on OUFOR. Sterling Newton for OUFOR, saying If you don't play, you can't win! Help! How do I change the feel (or whatever) for an 'area so that when I enter a tab from the keyboard, a tab is entered into the area/text. By default, tab moves you around to another pane of the main face. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: Hide a face inside its action event?
It all depends o nwhen you do the hide. The problem you are running into is that the face is reshown automatically to display the change in the face as you release the mouse button. If you hide it on the 'up event then it should hide just fine. Example: view layout [ button hide feel [ engage: func [f a e] [if a = 'up [hide f]] ] ] Sterling Is it possible to hide a face when you're responding to an action for that face? E.g. clicking a button performs some actions, one of which is to hide the button itself. I can't seem to make it work. Other faces hide just fine, but not the one that is engaged. Example: view layout [button hide [hide face]] I'd like to avoide setting flags and having another face responding to time events just to do this, but if I have to... Thanks! --Gregg -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Who's maintaining rebol.el?
So who has the most recent rebol.el file and where is it hiding at? Thanks, Sterling -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: BNF grammar of REBOL for code obfuscator
No need to PARSE it yourself. :) REBOL knows all this stuff on it's own so let it do the work. ? load ... REFINEMENTS: /header -- Includes REBOL header object if present. /next -- Load the next value only. Return block with value and new position. /library -- Force file to be a dynamic library. (Command version) /markup -- Convert HTML and XML to a block of tags and strings. /all -- Load all values. Does not evaluate REBOL header. Play around with load/header and load/next. The /all refinement is recommended if you are working with an unknown script so that no evaluation will happen. To remove comments, just let REBOL remove them for you and try: save %file2.r load %.file.r I'm sure you'll get some more input on this from others too. Sterling Hello REBOLers, I would like to write a code obfuscator (C-ish intention, isn't it ;-)) ) for REBOL. Tha main idea behind is to have a custom loader by 'COMPRESSing the program code and 'DECOMPRESS it on load, like this: - the packager REBOL line: write/binary %someprog.bin compress read %someprog.r - the shell loader (WinDOS .BAT file): rebol.exe -s --noinstall --do do decompress read/binary %%someprog.bin quit To get the unnecessary overhead data out of the script I would like to - strip the header to the simplest REBOL [] form - extinct one-line and block comments - reduce tabulation and blank lines to single whitespace My first approach to detect the end of the REBOL header did not work: I just cannot keep track of the nested block levels in parse rules :-( I also stucked at detecting comment boundaries - to detect one-line comments whether they are _real_ comments or just ; characters buried within a string (both and {} delimited) - detect 'COMMENT blocks (reprise of the previously mentioned detection problem for nested blocks) Do you have an exact BNF notation (or directly 'PARSE rules) of the REBOL language ? I searched the library but even %color-code.r is very spartanian and does not destructure a REBOL script this way (although its syntax coloring purpose might have suggested so). Thanx for your commitment of ideas! -- Best regards, Geza Lakner MD mailto:[EMAIL PROTECTED] -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: To do or not to do?
NOO There is always a way not to do strings. :) Think about it this way... what are you building in your string that can be done? Answer: REBOL code. Why does this work? type? 5-Nov-2001 or this? type? first [10] Answer: because REBOL understands REBOL. Now what's the difference between these two statements? a: print 10 b: [print 10] Not much. do a 10 do b 10 Great. So why do we want to use the second one? Well, check this out. type? second a char! type? second b integer! How about this? find a integer! == none find b integer! [10] This is useful stuff! You can change your code far easier this way than with strings. REBOL knows what you're dealing with and can help you out! Now, the super-quick translation of your code below. I re-arranged the blocks so that the replacement would be simple but you could just as easily do it using COMPOSE or BIND to get it done. I use the word 'item in the block to be the replacement instead of * since words are meant to be symbols and that's exactly what we need. Rules: [ [0 length? to-string item] No data [date? item] Bad date [greater? now/date item - 14] Too old [specialcheck item] Not special ] ;; prepare data field ;; == RawValue: 5-12-2001 ;; bad date in this example Loadedvalue: if error? try [loadedValue: first load/all Rawvalue] [LoadedValue: RawValue] ;; apply rules ;; === foreach [rule message] Rules [ if not (do replace/all copy rule 'item LoadedValue) [ print [LoadedValue fails rule: Message] break ] ; if ] ; for I'm using a valid date here so it gets through more of the checks eventually failing because specialcheck is not defined. I hope this has helped you out. If you have any more questions about it, please ask... we all cringe here at REBOL HQ when we see the unnecessary use of DO with strings... you're always DOing REBOL code so why not start that way? Sterling Hi all, It may just be my irredeemably old-fashioned mindset, but everywhere I turn in Rebol I see the need to 'DO strings. I've been ticked off before on the list about it and -- these days -- I can normally see better approaches. But this little example has got me stumped. So I'm interested in how the gurus would unDo my approach. The code below is the proof-of-concept, back of the envelope idea that many data entry validation rules can be written to a database as Rebol code. I just then need to write a single apply-the-rules function, and add a little code for special cases, rather than write buckets of repetitive code. But its got a DO string in it. Any comments? --Colin -- ;; rules table ;; === Rules: [ (Length? to-string *) 0 No data date? * Bad date (* - 14 ) now/date Too old specialcheck *Not special ] ;; prepare data field ;; == RawValue: 5-122-2001 ;; bad date in this example Loadedvalue: if error? try [loadedValue: first load/all Rawvalue] [LoadedValue: RawValue] ;; apply rules ;; === foreach [rule message] Rules [ if not (do replace/all copy rule item mold LoadedValue) [ print [LoadedValue fails rule: Message] break ] ; if ] ; for -- -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: ftp reading an empty folder
What kind of server are you contacting? i.e. Unix, Windows, ... ?? Doe it fail on all servers or just a specific one? Max had a problem some time ago, which was a failure between REBOLand the Windows FTP server, and I thought it had been fixed in the current version of /View. If it fails in /View, you could send in a network trace, trace/net on read ftp://your-stuff-here to [EMAIL PROTECTED] If it's a public server that we can access, we'd be in great luck but I'm guessing not. If it is just with a Microsoft FTP server, it'll help if we know which one and which version. If you mail a trace in to feedback, fel free to scramble or remove any of the login and/or server information since it's just the network interaction that we care about. Sterling When I try to read an empty ftp directory I get this message: ** Access Error: Port none not open ** Where: parse-dir-list How can I handle this error. I think in this case read should return an empty list, not throw an error. Daniel -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: ftp reading an empty folder
I looked up your feedback ticket and the notes say it was working in the current version of /View. Is that correct or are you still having problems?... just trying to get a handle on where things stand. Sterling hum, I guess Its a question of the way some ftp servers respond to empty dirs... have you tried on another server? The only thing I can suggest is that you enable network tracing : trace/net on and send a copy of the console output to rebol support ([EMAIL PROTECTED]). This way, they'll be notified that the problem persists! ALWAYS REMEMBER to remove all reference to sensitive user/password information in the console's data before sending it at large, cause your urls data will be printed in the net/trace data! -MAx -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: view indirection
Here's another option: Make a list of the checkboxes either directly: checks: reduce [c1 c2 c3 c4 ...] or iteratively: checks: copy [] repeat x 16 [append checks to-word join c x] reduce checks Now when you need to access one: set-check: func [n [integer!]] [ checks/:n/data: true show checks/:n ] Or to just improve on what you've got below: set in wrd: get to-word join c n 'data true show wrd The only thing you really need to build dynamically is the word to reference the checkbox. The rest of the REBOL code can stay as REBOL code. Sterling Hi, I am stuck in a should-not-be-so-difficult problem with view. I have a lot of checkboxes in a layout, named c1, c2, ... c16. At one time, given a number X, I would like to do something on the cX checkbox. For now, I have this sort of code : set-check: func [n [integer!] /local code ][ code: copy code: join join set in c n join 'data true show c n print [generated code ; code] do code ] IT IS WORKING ! (the print is only for debugging purpose). However I am not satisfied with this code. I'am looking for a more elegant way to do that. Something like : myCheckBox: guru-function( c 5) myCheckbox/data: true Patrick -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: integer! which range?
The trick here is that these are differnt REBOL datatypes. type? 1 == integer! type? 99 == decimal! As far as largest integer goes: 2147483647 == 2147483647 2147483647 + 1 ** Math Error: Math or number overflow ** Near: 2147483647 + 1 There it is. But: 2147483647.0 + 1 == 2147483648 but this is decimal! type, not an integer!. Sterling Hello, I've tested something in the REBOL/Core-Console. But, I don't understand that. Look: In the console, I type the following: testzahl: 1 while [true] [testzahl: testzahl * 10] An Error occured: ** Math Error: Math or number overflow After that, I type print testzahl REBOL shows the following: 10 This looks very small. So, if I type in the console simply , it works! So, why is there such a difference? What is the biggest integer!? cu, yogi -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: accessing c functions
You certainly can. What you would do is compile a shared library with your C functions and then use the library component of View/Pro to access them. Check out the documentation on this component here: http://www.rebol.com/docs/library.html If you need more working examples, I'm sure the friendly folks on this list will help you out. Sterling Hi. I am working on a program for a class and was wondering if it would be possible, using view/pro, to: 1. send input to and execute a c function from rebol. 2. receive the output of the c function back to rebol. The reason I want to do this is because their is a recursive function in the code that needs to run fast.. is this possible? If so, what is the general way i would go about doing this? thanks, rishi __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: How do I get rid of the connecting to:
Set: system/options/quiet: true Sterling When I page: read http://www.cnn.com what is the easiest way to get rid of the connecting to: www.cnn.com ?? Thanks. -- Dane Carlson [EMAIL PROTECTED] http://www.nickelnews.com -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: window resize and window scroll
A quick resize example... REBOL [] main-lay: layout [ b1: button Quit [quit] ] view/new/options main-lay [resize] main-lay/feel: make main-lay/feel [ detect: func [face event] [ switch event/type [ resize [ b1/color: random 255.255.255 b1/offset: main-lay/size - (b1/size / 2) show b1 ] ] event ] ] wait none Sterling On Mon, 07 May 2001 23:41:57 +0200 (CEST) [EMAIL PROTECTED] wrote: i want to have the ability to resize the window, which will opened with view and i want to use scroll bars too. Can anybody help me? For the latter check out the vid faq using vidwikibeta at http://www.compkarori.co.nz/index.r :-) -- Graham Chiu -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: International REBOL Use
How do you think that PNG is being generated right now? ;) I'll give you three guesses, the first two don't count, and the right answer starts with a big capital R You're preaching to the preacher in this case... hehe. Take it easy, Sterling See how your country scores in worldwide REBOL interest... http://www.rebol.com/sitehits.html -Carl That's really interesting, I hope you'll keep posting these data monthly. If it's too much work to generate that PNG, you could try to ease it up with REBOL... ;-) -- Paolo Russo [EMAIL PROTECTED] _ -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: read bug?
Well it worked flawlessly for me using both Core 2.5 and View/Pro 1.1. It didn't fail on either through pass 52 (4150 chars) where I stopped it. Are you, by chance, going through any proxies? Anything in between you and the web server has the opportunity to truncate the URL. You are right that read should not fail but it isn't. Notice the error you get back is not a URL Error or any other REBOL script error. It is a 400 response from the webserver telling you Bad Request. Sterling On Wed, 2 May 2001 14:36:27 -0700 [EMAIL PROTECTED] wrote: Let me know what you find out. Sterling Hi, Here's a script to illustrate the problem. I'm not sure that my understanding of what 'read should be doing is correct here. The script dies when it attempts to do a read at 4109 chars at pass 10. I get an error messsage: ** User Error: Error. . the url is printed out .. and then could not be retrieved. Server response: HTTP/1.0 400 Bad Request ** Near: res: read join cgi urltest Since 'read is I thought just returning what the web server is sending, why should 'read die if the remote cgi script dies? Should it not just return the web server error message? -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: Databases
REBOL Command has the database access you need. http://www.rebol.com/command.html Take a look. Sterling After scouring the web site, I see no reference to how to connect to and manipulate databases, ie .. mySQL, SQL Server, Oracle. Can someone point me in the right direction. Thanks! Best Regards, Gunnar Swan Find the best deals on the web at AltaVista Shopping! http://www.shopping.altavista.com -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: read bug?
It seems that this thread has wandered from POST to GET problems. I'll address the issue with GET as best I can. People see that a long URL used with read: read http://foo.com/cgi-bin/cgi.r?name=value-of-really-long-data gets truncated or otherwise fails to read. I ran some tests on my machine here (Linux w/ Apache) using Core 2.5 on both the client and CGI end. I made a really big URL of over 7K which looks like the example above. It made it through just fine. However, I have seen a truncation of sorts happen in some situations here though most have been using a browser going to a REBOL CGI script. Have you tried the same read using a browser? One possibility is that the receiving system truncates the GET data. Remember that when using a GET method, all CGI data is passed to the program on the server using environment variables. If any of the client browser, webserver, or system env. vars limits the length then the CGI script on the other end will not get all the data. So take REBOL out of the picture and see what happens: #!/usr/bin/perl print Content-type: text/html\n\n; while (($key, $val) = each %ENV) { print $key = $valBR\n; } There's a little perl (yuck) cgi that'll print the env. vars for you. Try your request with REBOL or a browser against that and see what you get. Also, with REBOL, turn 'trace/net on' and do the read. What you see printed to the console is EXACTLY what is being sent into the TCP port to the server. Let me know what you find out. Sterling On Wed, 02 May 2001 08:13:37 -0500 Joel Neely [EMAIL PROTECTED] wrote: is a buffer limit, then it's quite by accident somewhere, and we should track it down. I've sent feedback so that it gets entered into the bug investigation system I'll be happy to stand corrected if I'm wrong, but I looked at the manual again just to be sure... It appears to me that READ/CUSTOM has to do with *sending* the POST data from client side to the server. What I thought we were dealing with in this thread was the problem of *receiving* long POST data on Actually, Carl is correct. My problem is that reading a very long url ( cgi by url method ) kills 'read. I haven't been able to post a large enough amount of data to encounter the bug that you were experiencing. I was looking forward to it though :-) -- Graham Chiu -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] REBOL.org Userlist Archive moved to the REB
OK, in the interest of less spam, I've moved the REBOL.org Userlist Archive entirely onto the REB. It is no longer linked off the main page and is only accessible through the REBOl.org REBsite. It's still the same HTML-based view and everything but it will not be webcrawled until REBOL becomes so popular that search engines and spam-freaks write REB-crawling scripts. By then there should be enough time to hide any email addresses that are present in the pages. I hope this is a reasonable first step. Sterling -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: Palm Version
Whoa! Slow down on the messages. I've received this one 4 times now. Anyway, a Palm/OS version is not anticipated any time soon. The memory architecture of Palm/OS is very limited, not just in space, but in the amount of dynamic memory available at boot time. Right now, it just isn't anywhere near enough to get REBOL running. If the memory restrictions go away or the system changes in the future to allow a port then we will certainly revisit it. Sterling Hi, I am new to the Rebol list though I have been following the progress of Rebol for a while. I was wondering if their is a Palm/OS version of Rebol anticipated. Thanks for all your input! Tom Schaeper -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with unsubscribe in the subject, without the quotes.
[REBOL] Re: integers and sizes
It all looks right. The to- conversions are just that and do not transform a value into another value. They are conversions which means that they return a new value of the new type as long as the original type can be converted into the target type. To work with your examples: a: 21 b: 105 / 5 type? a ;integer! type? b ;decimal! to-integer b ; 21 type? b ;decimal!, wow, that is interesting to-decimal a ;21 but: c: to-integer b ; 21 type? c ; integer! c: to-decimal a ;21 type? c ; decimal! The same thing works with series values that have extra storage associated with them: a: "foo" type? a ; string! b: to-issue a type? a ; string! -- still type? b ; issue! -- converted insert a "bar-" a == "bar-foo" b == #foo when b was converted from the string "foo" to the issue #foo it was copied and therefore is a new value. If the old value is changed, the new value is unaffected. Sterling From: "Travis Watkins" I fear that this may be a bug: Integer? 105 false (this is correct because you only use 4 bytes to represent an integer) integer? 21 true integer? (105 / 5) false (note, this is 21, the value which was true before) apparently any number which was at one point associated with a value greater than an integer is not an integer, even when reduced to a sufficently small number. Note: Win98 system Well, this does get interesting. To continue with your example: a: 21 b: 105 / 5 type? a ;integer! type? b ;decimal! a = b;true, as it should be same? a b ;true, as I guess it is strict-equal? a b ;false, ahhh, I feel better to-integer b ; 21 type? b ;decimal!, wow, that is interesting to-decimal a ;21 type? c ;integer! It is interesting that sometimes REBOL "leaves" it as it was (a decimal or an integer), despite trying to coerce it. I can't tell if this is a bug or a feature, but I could imagine circumstances where it might trip up programming logic. Thanks. --Scott Jones -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Password Style
try: request-pass Sterling Hi Guys, Can anyone point me in the direction of a password style?? (ie a field when you type in hides the input with ) Cheers Phil -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: [ALLY] Strange reaction in Rebol/View 1 for Linux
Your problem is that you are calling INFORM from within another INFORM. This is not such a safe thing to do. If you just change "inform out" to "view/new out" it works fine except that the second pane is not modal. You might also get around the problem by doing a hide-popup before doing "interrogation" and then re-popping the "out" layout when the interrogation popup exits. This would make only one popup on the screen at a time. Bottom line: don't make a modal dialog pop up a modal dialog... it's probably not the most logical concept. Sterling Hi, I found a strange reaction in Rebol/View 1 for Linux : The goal of the next script is to change the text of a text widget. - REBOL [] interrogation: func [titre [string!] txt-interro [string!] /local pass-l ok][ if none? :pass-l [ pass-l: layout[ origin 10x10 backdrop effect [gradient -1x-1 50.80.120 70.130.180] across title red :titre bold return text 240 :txt-interro bold yellow return button "YES" [hide-popup] button "NO" [ok: no hide-popup] ] ] ok: yes inform pass-l return ok ] panneau2: func [][ out: layout [ origin 10x10 backdrop effect [gradient -1x-1 50.80.120 70.130.180] across t: text 100x25 "Example" return button "test" [ either interrogation "The test" "Do you want test it ?" [ t/text: copy "Test ok" ][ t/text: copy "Test not ok" ] show t ] ] inform out ] panneau: layout [ origin 10x10 backdrop effect [gradient -1x-1 50.80.120 70.130.180] button "Go" [panneau2] button "Quit" [quit] ] view panneau - In the previous version of Rebol/View (beta), it's seems to be ok. But in the new version (Rebol/View 1), I can't change the text. Why ? Cheers Etienne -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: REGULAR EXPRESSIONS
The really quick answer is "Use PARSE." What docs/examples/demos have you looked at regarding parse? What kind of an answer to this question are you looking for? Parsing strings is the REBOL awy of doing regular expressions but PARSE can also parse blocks which is your path to dialecting. Dialecting is, frankly, the way of the future. Why not use the terminology of your work context to do your work? Sterling Hi everbody, this post is not of any urgency, rather Iam seeking enlightenment from list members about the REBOL approach to regular expressions. Regular expressions in Perl although powerful are mighty ugly and not at all intuitive, what is the REBOL way / approach. Sure REBOL has tremendous Parsing capabilities but what is the best approach in this instance? Jeff, Larry, Elan, anyone? can you enlighten me? cheers, Mark Dickson -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Sterling's proxy does not work with new Core ...
I use that script all the time! It's great! Haha. A slight change was made to the URL parser such that it now returns the port it is paring the url into instead of the target of the url. This should not be a big deal for any other scripts since most do not do deep intricate port work like this to begin with and then even fewer would care about the return value of parse-url. All you need to do is comment out this line from the script and you'll be back in operation. ; port-spec/target: tgt Sterling Hi, does anyone use Sterling's proxy.r script which can be found on www.rebol.org website? It does work using latest View for e.g., but timeouts (or what?) if using new Core ... what's the difference in port handling between the versions? -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Extract substring using offsets?
Is there a way in Rebol to extract a substring using offsets? For example, if I have a string 100 characters long, and I want to get characters 25-50, what can I do? copy/part at str 25 25 If there is a simple positive answer to that question, you can stop here. If not, read the following: Stopping. Sterling -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: ftp question
FTP, by default, caches up to 5 connections. This value is customizable at: system/schemes/ftp/cache-size so just change that to 0 and all connections will close up and say goodbye immediately. Sterling When you use REBOL's built-in FTP protocol, does it send a "bye" command when it is finished downloading? Or does it just let the FTP connection time out? Ryan C. Christiansen Web Developer -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: ftp up one directory
try: log-file: read ftp://username:[EMAIL PROTECTED]/../logs/web.log Some ftp servers will not let you go back like that but you'll get an error, I assume, if that's the case. Sterling I am having trouble accessing a file which is in a directory above my default access directory. The file I want to reach is web.log and here is where it lies / /logs/web.log /web/ When I use the following dir-list: load ftp://username:[EMAIL PROTECTED] REBOL returns [%web/] as if the directory /logs doesn't exist. I have no problems using CuteFTP and accessing the /logs directory with the same username and password. I also tried log-file: read ftp://username:[EMAIL PROTECTED]//logs/web.log and log-file: read ftp://username:[EMAIL PROTECTED]/./logs/web.log but I always get the error "No such file or directory." Suggestions? Ryan C. Christiansen Web Developer -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Complex Series Parsing (Part 2)
Well, before anybody goes further into the "here's something that works for the last input you posted" followed by "but then there's this input that doesn't work" path, lets go back to the definition of input and output. If you use load.markup and trat the REBOL words you have in your block as strings like Andrew suggests (which is a better way to deal with them), then you have these input elements: * text -- open text tag * "???" -- some arbitrary string * ??? -- some other open tag * /??? -- some close tag * /text -- a close text tag Your input looks like this: probe input: load/markup {tag0/tag0 text this and that tag1those /tag1and these/texttag2/tag2textThere and then/text} == [tag0 /tag0 " " text " this and that^/" tag1 "those " /tag1 "and these" /text tag2 /tag2 text "There and^/then" /text] You can get rid of the whitespace-only strings if you want to that are created due to whitespace between the tags. Now write the spec: * any combination of input elements up to text * open text * any combination of "???", ???, /??? where text whould be inserted if front of each "???" * /text * start the whole process over Done. That's all you've told us so far. Each item above is essentially a parse rule already. Some can be joined together: * [thru text] * [any [ /text [thru text] | tag! | string! mark: (insert back mark text) string! ] ] Now we just assemble: ; skip the immediate string after text so we don't add a second one start-rule: [thru text [string! | none]] parse imput [ start-rule any [ /text start-rule ; start over | tag! ; eat any random tags | string! mark: (insert back mark text) string! ] ] probe input And presto! Sterling This is on the right track. But more complexity would arise... here is an advanced XML structure... y: [tag0/tag0 text this and that tag1those /tag1and these/texttag2/tag2textThere and then/text] output would be... out: [ tag0 /tag0 text this and that tag1 text those /tag1 text and these /text tag2 /tag2 text There and then /text ] There is method to the madness, I've got the "madness" part down pat, now if I could only come up with "the method". Thanks Terry Brownell - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 08, 2001 4:17 PM Subject: [REBOL] Re: Complex Series Parsing (Part 2) I'm not sure I understand what you are really trying to do. Usually with parse, once you describe the format of what you want to parse and the output wou desire, the parse rules just fall out onto the screen. Correct me if I'm wrong: Input is a block with the following format: A text tag followed by a series of words with any number of non text or /text tags interspersed and ends with a /text tag. The desired output is the same block except that every place there is a non text tag in the block a text tag should be placed after it and before the next series of words. The ending /text tag should be removed. For this you don't need parse at all. Just march through the block and insert the new text tag as needed: y: [ text This is some text tag with a tag added /tag and then some text /text ] forall y [ all [tag? y/1 y/1 text y/1 /text insert next y text] all [y/1 = /text remove y y: back y] ] probe y: head y Perhaps your rules are a bit more complicated in which caase you need to define them and then see what's the best way to do it. Parse may be necessary but this simple case can be done quickly another way. Sterling -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Complex Series Parsing (Part 2)
I'm not sure I understand what you are really trying to do. Usually with parse, once you describe the format of what you want to parse and the output wou desire, the parse rules just fall out onto the screen. Correct me if I'm wrong: Input is a block with the following format: A text tag followed by a series of words with any number of non text or /text tags interspersed and ends with a /text tag. The desired output is the same block except that every place there is a non text tag in the block a text tag should be placed after it and before the next series of words. The ending /text tag should be removed. For this you don't need parse at all. Just march through the block and insert the new text tag as needed: y: [ text This is some text tag with a tag added /tag and then some text /text ] forall y [ all [tag? y/1 y/1 text y/1 /text insert next y text] all [y/1 = /text remove y y: back y] ] probe y: head y Perhaps your rules are a bit more complicated in which caase you need to define them and then see what's the best way to do it. Parse may be necessary but this simple case can be done quickly another way. Sterling Hello all. How do you parse this... y: [ text This is some text tag with a tag added /tag and then some text /text ] So that you get this n: [ text This is some text tag text with a tag added /tag text and then some text ] I tried this... n: [] z: parse y none foreach val z [ either find val "" [append n val] [append n rejoin [{text } val]] ] But then I get n: [ text text This text is text some text text tag text with text a text tag text added /tag text and text then text some text text /text ] So how do I "collect" all the text until the next "tag"? Terry Brownell -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: unable to read web page
What version of REBOL on what platform? It seems to work fine on current versions that I've tried. Sterling I am unable to read a web page: print read http://www.blackmt.com/skirpt.html only part of the page is read. how do i troubleshoot this error. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] REBOL.org list archive
Oops. Sorry it took so long to get to this but I think I've fixed the list archiver running at REBOL.org. But I need to send a message to see if it really is working. Here goes nothing... Sterling -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: REBOL.org list archive
I am currently updating all the missing messages from when it went offline to now. Due to some code bug, a lot of the messages are date tagged as today 27-Jan-2001 instead of their actual date but they are still placed and threaded appropriately. Once this process finishes, I'll be putting it back into full action for up to the minute archiving. Sterling Oops. Sorry it took so long to get to this but I think I've fixed the list archiver running at REBOL.org. But I need to send a message to see if it really is working. Here goes nothing... Sterling -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: script library on rebol.com vs rebol.org
That would be great, huh? I was rather proud of that creation even with it's problems. It did die with the change away from SELMA. That happened at a time when we were all working rather wildly on projects with zero time to spare to ourselves. I tried to make a 15 minute fix so that it would be able to archive the Listar messages but it didn't quite fly. I still think it's just a couple bugs away from working as it once did. Knowing that there is some support to get it running again might just be the kick in the head I need to fix it up to it's rickety, yet working, state. I'll see what I can do and report back. Sterling Is there a chance that the mailing list archive could be fixed as well? It seemed to break when this list was shifted from Selma. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: script library on rebol.com vs rebol.org
OK. I'll do it tomorrow but be warned that it's not my cleanest work ever. In fact, I'd say it's rather frightening but I'll scrounge up the code tomorrow and make it fetchable off REBOL.org. You may find it easier to take the concept and rewrite. There should be a good, clean, solid mailing list archiver with a search engine written in REBOL. Andrew helped out for a while doing this and that. He kindly took over the ownership when nobody else had the time or desire. The bulk of the original code like the script library, chat, mail archiver, and script submission were done by Jeff and myself as small blitzkrieg projects to try to satisfy a current community need. Little regard to clean coding style was shown in deference to immediate results. Sterling On Thu, 18 Jan 2001 14:46:36 -0800 [EMAIL PROTECTED] wrote: Knowing that there is some support to get it running again might just be the kick in the head I need to fix it up to it's rickety, yet working, state. I'll see what I can do and report back. And here I was thinking it was more of Andrew G's work! How about posting the source so that we all can have a go at fixing it? -- Graham Chiu -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: headers in a HTTP-request
You are looking for the headers of the HTTP response, right? a: open http://www.yahoo.com probe a/locals/headers copy a ; to get the page close a Sterling Does anybody know how to read the headers after reading a HTTP-request? Regards, Petter Egesund, Helpinhand -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: sending 'none to CGI
It will arrive as a string and remain that way until you change it. REBOL, when run in CGI mode, gathers up the relevant environment variables and drops them into the system/options/cgi object. The query-string holds the exact text following the '?' in the URL. You can then make use of 'decode-cgi to make checking values easier: system/options/cgi/query-string: "value=none" cgi-obj: make object! decode-cgi system/options/cgi/query-string The cgi-obj will now be an object containing the word 'value which has the value of the string "none". REBOL purposely does not evaluate any of the CGI information as that would open a security hole. In order to change that "none" into a REBOL none value, you would need to use load. load "none" will result in a REBOL none value. However, if your query string looked like this: value=none%20none then the resulting decoded string would be: "none none" and loading it would result in a block: [none none] which, as you point out below is a block with unevaluated words which means that neither item in the block is actually the REBOL none value. They are both simply the word 'none. It is best, when writing REBOL CGI applications, to know ahead of time what kind of data you are expecting to receive. You can then use 'make object decode-cgi' to help you make an object with the values. Then, for non-string values, either wrap a direct conversion in a try block: if error? try [to-integer cgi-obj/usernumber] ["return error page"] or check the type of a load (which is safe because it does not evaluate any code): if not integer? load cgi-obj/usernumber ["return error page"] Well, that was rather long-winded for a one line answer. Sorry. Sterling If I send the following text/html output to the user {A HREF="http://www.domain.dom/cgi-bin/script.cgi?value=} none {} and he or she clicks on the resultant link, what value will be passed to CGI? Will it be a 'none value REBOL can understand? I suspect that it will be a unevaluated word, like 'none in a block: [none] Andrew Martin ICQ: 26227169 http://members.nbci.com/AndrewMartin/ -- -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: reb sites - Zork! thoughts
That's a cool idea. You would need to build the language parser and basic game engine. With 'parse, the language interpreter could be built pretty fast and easily extended. I think the hard part of making it so distributed would be keeping the game continuity. Two different people may design adjacent rooms, one being a very futuristic space capsule while the other is some bizarre, surreal room with chairs on the walls and 3 legged people drinking soda through their fingertips. Nevertheless, REBOL would be a great platform for it. Sterling I haven't downloaded a copy of /View since the first release, mainly due to the lack of current documentation. One of the fun things I discovered was the Reb Sites links. One thought comes to mind: creating a massively distributed, Internet-based role-playing game the likes of Zork! where the world is created by anyone and everyone. Persons help to create their little pieces of the world by uploading a valid XML file to a central server. The XML file defines a specific "room" or "tile" and also the creatures, objects, actions, and dialog within each room. You could even create a room Editor using the Reb interface. A /View for every PC! -Ryan -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Rebol mode for Emacs
Yeah! Way to go! Like Jeff, I still dream of getting those close brackets balanced with the open and not the body of the block. Perhaps that is not yet to be. Anyway, this is a great update to the REBOL Emacs mode. Thanks Marcus, Sterling -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: Rebol and FTP (recursive stuff in particular)
Yes. FTP will close the old connection to a given host if a new one is made but in a different directory. That is also the same behavior I see here with the latest experimental (2.4.39 on Linux). I also watched my netstat and only one connection stayed active. The only situation where you could end up with more than one connection to a single host is if you are using two different users to log in as. If you really want to make sure that all connections are closed immediately then you can set the port cache size down to zero: system/schemes/ftp/cache-size: 0 This will have the effect that the control connection is closed at the end of the request and no ports at all will ever be cached by REBOL FTP (not so efficient). If you set it to 1 then it should cache only one connection. If you are only connecting to a single host as a single user then you should see no difference in how it's all working. All sequential reads within a single directory will reuse the command port but access of a different directory will create a new command port and close the last one. If you are seeing different results... like multiple command ports open to the same host, please send as much info as you can into feedback as a bug report so we can track down the problem. Sterling On Thu, Dec 14, 2000 at 04:40:21PM +, Mat Bettinson wrote: Heya Holger, HK No, REBOL caches and reuses the FTP control connection across HK subsequent accesses to the same host and directory. But doesn't actually close any. Is there a way of forcing them closed? I'll double-check with Sterling, but AFAIK current experimental versions do close the control connection first if another connection to the same host has to be opened. At least that is the behavior I get here. Which version are you using ? -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: ODBC
I checked into these things a bit and there are definite issues with Interbase. It isn't one of the DBs we tested with so we didn't catch the problems. They probably affect other dbs too... we just haven't seen it yet... thanks for the help. The problem will get fixed in the next rev of /Command but don't ask me when that is... 'cuz I don't know. :( Sterling This is very odd. I can't retrieve any numeric fields thru ODBC unless I first cast them into char(). I had not tried this before so had not noticed this. On the bright side, inserting data thru ODBC and R/command seems to be a lot faster than how I normally do it going thru Visual dBase - as long as I stick to varchar fields. -- Graham Chiu -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: clean-path
The main reason that URLs are not translated by clean-path is basically that you do not really know what directory transaltion is in effect on the contacted site. Take FTP as an example: read ftp://user1:[EMAIL PROTECTED]/readme.txt This file will most likely reside in /home/user1/readme.txt. Now lets say that user1 has shared their directory and this file for others to read. So user2 wants to get it: read ftp://user2:[EMAIL PROTECTED]/../user1/readme.txt This will work because the "root" directory that is specified by ftp://user2:[EMAIL PROTECTED]/ is actually in /home/user2/. The problem with cleaning the URL is this: clean-path ftp://user2:[EMAIL PROTECTED]/../user1/readme.txt would come out as: ftp://user2:[EMAIL PROTECTED]/user1/readme.txt which is clearly not right. Some FTP servers will not allow you to back out of your home directory but some do. The point is that we don't know so we leave it open and do no translation. Sterling -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] Re: clean-path
Right. I see what you mean. Perhaps the more frequent use of clean-path on a URL is this. We'll talk about it the next time we meet about /Core fixes/enhancements/etc. The only issue may be that we would be breaking code that relied on the current behavior... how much of that there is I can't say. The slider does not update on the text list unless you tell it to. I use the following function in my code to update text-list sliders every time I mod the list. The function refers to list/lc. lc is a word in a text-list face that is the number of visible lines of the list. ; updates the bar on the side of a text-list or group of text-lists fix-slider: func [faces [object! block!]] [ foreach list to-block faces [ either 0 = length? list/data [list/sld/redrag 1] [ list/sld/redrag list/lc / length? list/data] ] ] This way I can make changes to one or more text-lists in a layout, fix the sliders, and then re-show the needed faces. Sterling On Mon, 4 Dec 2000 15:23:11 -0800 [EMAIL PROTECTED] wrote: So where do yo urun into problems in the web spidering? Okay, this is a real world example. I need to often grab product images from websites. For example: http://www.asus.com/Products/Addon/Vga/Agpv3800/index.html You can see there that the images are referenced as ball-yellow.gif - current directory /Image/logo-title.gif - off the root directory .../../../Images/arrow.gif - up 3 directories If 'clean-path worked on urls, that would make it much easier. As it was, I wrote my reblet http://www.compkarori.co.nz/reb/imagegrabber.r before I even knew 'clean-path existed :-) If you try out the above, perhaps you would enlighten me as to why the slider on the side of the text-list doesn't update g -- Graham Chiu -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes. -- To unsubscribe from this list, please send an email to [EMAIL PROTECTED] with "unsubscribe" in the subject, without the quotes.
[REBOL] CGI Re:
It simply makes an easy-access object out of the data: decode-cgi "foo=10bar=20" == [foo: 10 bar: 20] when you make an object out of it with: cgi: make object! decode-cgi "foo=10bar=20" you can access the form values like this: cgi/foo == 10 cgi/bar == 20 The reason you might not make an objects is if you have multiple form items on the page with the same name so your cgi query string looks like this: "foo=10bar=20bar=30" Then if you make an object, you'll only get one value for 'bar. WARNING You can also DO the decoded cgi block and it will set the words to their respective valus. This is neat but remember that any word can come in through cgi so if you do this: do decode-cgi "foo=10bar=20read=0" will stomp all over the word 'read... not a good idea. And since you do not have control over what somebody could hack pu and send in to you cgi program it is not generally a good idea to DO the decode-cgi block. WARNING Sterling Hi guys! Sorry to bother you with this newbie question: Why does one have to "make object!" after a "decode-cgi" ? just curious... Sharriff Aina med.iq information quality in healthcare AG Gutenbergstr. 42 41564 Kaarst tel.: 02131-3669-0 fax: 02131-3669-599 www.med-iq.de
[REBOL] pop question Re:
Actually, neither will happen they way you have specified it. This is because you have called REMOVE which will only remove the first element (use CLEAR). But to answer the real question: bag: open pop://user:[EMAIL PROTECTED] length? bag == 5 and DO NOT close it while my program runs for, say, 10 minutes. If the server receives 3 more messages for me during that time and I then do: CLEAR bag ; !! note, CLEAR removes all items, REMOVE does one close bag All 5 items will be removed and the next time you check your mail you will have the 3 new messages. It's easy to check since you can mail yourself some messages while you have the port open and I strongly suggest you do this for two reasons. One, understanding usually comes better through doing than hearing and two, you will prove that is DOES work like this and will not worry that you got the wrong info from somebody else (like me). And I don't want to responsible for lost email in case the server you access is totally weird. :) Sterling For you email gurus out there: I open an email port like this: bag: open pop://user:[EMAIL PROTECTED] length? bag == 5 and DO NOT close it while my program runs for, say, 10 minutes. If the server receives 3 more messages for me during that time and I then do: remove bag close bag Will only the original 5 messages be removed from the server or, since the port was left open, will all 8 of the messages be removed from the server. (with me never knowing about the last 3.) Greg Coughlan
[REBOL] pop question Re:(3)
No problem. If I understand you last question correctly, it means something like this: How doe the server insure that the client only deals with the currently delivered emails while it has the box open? If that's the question, the answer is that I don't know all the specifics. However, from messing around with the POP protocol and watching my mailbox at the same time, I've noticed that the server does not deliver new messages to you mailbox (a simple file) until the mailbox is closed. It keeps the incoming mail in it's spool, a temp file, or some such place until it is safe to deliver. It also, as I recall, removes the mailbox file while you have it open. so when you open the mailbox and then go look for the file on the server, it actually appears empty on the server though you are reading a bunch of messages on the client side. I figure this is to protect the system from mailbox edits while the box is open... could royally mess things up. If I'm incorrect anywhere here or somebody knows all the nifty details, feel free to correct and/or add. Sterling Thanks Sterling, I will perform the suggested testing -- I wouldn't want to turn something loose that mucks around in someone's mailbox until I was sure it was bulletproof AND that I understood exactly how it worked. I went back and checked the docs on "remove" and "clear"-- you're right (of course!), I remembered them wrong. Thanks for "clearing "things up. (;-) If you know, does the server somehow flag an individual message as to whether the client has been informed of its presence in the mailbox; and not allow its deletion until it (the server) is sure the client knows about it? [That's one hellacious sentence!] (;-) Greg - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 28, 2000 4:49 PM Subject: [REBOL] pop question Re: Actually, neither will happen they way you have specified it. This is because you have called REMOVE which will only remove the first element (use CLEAR). But to answer the real question: bag: open pop://user:[EMAIL PROTECTED] length? bag == 5 and DO NOT close it while my program runs for, say, 10 minutes. If the server receives 3 more messages for me during that time and I then do: CLEAR bag ; !! note, CLEAR removes all items, REMOVE does one close bag All 5 items will be removed and the next time you check your mail you will have the 3 new messages. It's easy to check since you can mail yourself some messages while you have the port open and I strongly suggest you do this for two reasons. One, understanding usually comes better through doing than hearing and two, you will prove that is DOES work like this and will not worry that you got the wrong info from somebody else (like me). And I don't want to responsible for lost email in case the server you access is totally weird. :) Sterling For you email gurus out there: I open an email port like this: bag: open pop://user:[EMAIL PROTECTED] length? bag == 5 and DO NOT close it while my program runs for, say, 10 minutes. If the server receives 3 more messages for me during that time and I then do: remove bag close bag Will only the original 5 messages be removed from the server or, since the port was left open, will all 8 of the messages be removed from the server. (with me never knowing about the last 3.) Greg Coughlan
[REBOL] Small admin/report benchmark Re:
This is great! I love to see stuff like this. It'll help us get a good sense for where we stand and it produces useful scripts to the community at the same time. I haven't had a chance to run the same test here but I will sometime. Did you try parsing the whole file instead of line by line? I would think it would be a little faster that way. Maybe I'll try that later as a break from /Command work. Sterling
[REBOL] Decode CGI with checkboxes Re:
Just don't make the object and scan the block yourself: decode-cgi "foo=10foo=20" == [foo: "10" foo: "20"] ; your data is intact parse decode-cgi "foo=10foo=20" [ some [ copy wrd set-word! copy value string! (print ["Name:" wrd "Value:" value]) ] ] So instead of printing them out you can do something with the values you get for each word. The suggestion to use make object! with decode-cgi just makes handling most data very easy. In the less frequent cases you may have to do a little work yourself. Sorry. Sterling Hi, just wondering how you deal with checkboxes when doing CGI. if you do something like: cgi-data: make object! decode-cgi system/options/cgi/query-string you lose multiple values with the same name, like you'd have in the case of multiple selected checkboxes. I couldn't find anything about it in Rebol: The Official Guide. I did a search in all the code on the book's CD and found something that can aid you in generating the HTML for form elements, but nothing that lets you read them. Also, the example in Rebol's howto uses a checkbox, but only one! :) Anyone have any solutions? Thanks! Keith
[REBOL] Challenging script idea Re:(5)
If it's a GPF that takes down the universe, you would be implying that we're all living in MS Universe 2000 or something like that. Maybe that's why we die, eh? It's a bug in the system. Sterling Actually, I think one can make a stronger statement. I suspect (without spending many brain-cycles on it) that the GENERAL question "Does function f1 do the same thing as function f2?" is formally unsolvable, in the same way that the halting problem has no general solution. If you can really find a way to do so, you'll cause a general protection fault that will crash the universe. ;-) -jn- [EMAIL PROTECTED] wrote: If you want to determine if two scripts are doing the same thing, you'd at least have to simulate their execution. That is, you can't determine that by just statically analyzing REBOL code. If you really find a way to do so, then you've found a way to compile REBOL code. Regards, Gabriele. -- Gabriele Santilli [EMAIL PROTECTED] - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
[REBOL] FTP error Re:(2)
Are you perhaps behind a firewall? It looks like REBOL's FTP protocol is having trouble establishing the active connection for the data. Try setting: system/schemes/ftp/passive: true and try it again. Sterling With a trace/net on, one can see that Rebol parses internally the URL, and I'm wondering if this is not the source of the problem : URL Parse: myname password ftp.xoom.com none backup/ FRANCO22 final.DWP Net-log: [ ["PORT" port/locals/active-check] "200"] Net-log: "200 PORT command successful." Net-log: [ ["TYPE A"] ["200"]] Net-log: "200 Type set to A." Net-log: [ [join "LIST " port/target] ["150" "125"]] Net-log: {150 Opening ASCII mode data connection for /bin/ls.} Net-log: [ none "226"] Net-log: "226 Transfer complete." Net-log: [ ["PORT" port/locals/active-check] "200"] Net-log: "200 PORT command successful." ** Access Error: Port none not open. ** Where: read/binary join xoom file So, is this a bug?
[REBOL] Challenging script idea Re:
Well, it sounded fun so here's what I've got. The output running it on the two files you talked about is at the bottom. The diff shows a list of blocks with tokens and a number which is how many times that token was in the file. You may see the same token listed in the diff for each file if the number of appearances is different. Well, enjoy! Sterling REBOL [ Title: "Simple token diff" Purpose: { I don't know, really. It just tries to figure out how many REBOL tokens are different between two files. Somebody thought it would be neat. ;) Maybe they'll ake it complete and fix whatever lurking bugs there are in this code.} Author: "Sterling Newton" ] a: ask "File or URL #1? " b: ask "File or URL #2? " get-type: func [item [string!]] [ switch/default true reduce [ found? find item "://" [item: to-url item] found? find item "%" [item: to-file next item] ] [a: to-file a] item ] a: get-type a b: get-type b ; the unique tokens and totals blocks foreach item [a-tokens b-tokens a-totals b-totals] [ set item copy [] ] file1: load/next a file2: load/next b tokenize-block: func [ blk [block!] tokens [block!] totals [block!] /local tmp idx] [ while [not empty? blk] [ either block? blk/1 [ tokenize-block load/next form blk/1 tokens totals ] [ either tmp: find tokens blk/1 [ idx: index? tmp totals/:idx/2: totals/:idx/2 + 1 ] [ append tokens blk/1 repend/only totals [blk/1 1] ] ] blk: load/next blk/2 ] ] tokenize-block load/next file1 a-tokens a-totals tokenize-block load/next file2 b-tokens b-totals print ["The two files differ by:" length? difference a-tokens b-tokens "tokens."] print ["- Tokens in" a "not in" b "-"] foreach item intersect diff: difference a-totals b-totals a-totals [ probe item ] print ["- Tokens in" b "not in" a "-"] foreach item intersect diff b-totals [ probe item ] Don't laugh, but... I was noticing in the script library (web section) that mailpage.r and websend.r are identical. So here's the challenge: as powerful as parse (and other language processing features) is, can someone come up with a script that would analyze the tokens in a pair of scripts and determine when they are essentially the same? __ Do You Yahoo!? Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/ == results from the two web page emailing scripts == do %/home/moses/temp/diff.r File or URL #1? http://www.rebol.com/library/html/mailpage.html File or URL #2? http://www.rebol.com/library/html/websend.html The two files differ by: 14 tokens. - Tokens in http://www.rebol.com/library/html/mailpage.html not in http://www.rebol.com/library/html/websend.html - [Email 2] [a 2] [Page 1] [mailpage.r 1] [10-Sep-1999 1] [page. 1] [(simple) 1] [http://www.rebol.com/releases.html/font 1] - Tokens in http://www.rebol.com/library/html/websend.html not in http://www.rebol.com/library/html/mailpage.html - [Page 2] [Emailer 1] [websend.r 1] [20-May-1999 1] [Fetch 1] [a 1] [and 1] [it 1] [as 1] [email. 1] [email 1] [http://www.rebol.com/font 1]
[REBOL] Linked list in rebol Re:
Well, as you know, you get doubly linked lists for free in REBOL. That's called a block. To do the other part, I'd just make the items in your block another block or an object. Then hold an index in one of the vars in that. triple: copy [] ; the linked list foreach item [[none 42] [4 9700] [1 15] [3 1846]] [ repend triple item ] now there are four items in triple. Each item is a block where the first number is what you call *mrk in your structure and the second number is the num you have in your struct. The marker is an index back into triple so that you can do 'pick triple triple/2/1' and that will bring back the block indexed by the third link of the second item in triple, namely item number four "[3 1846]". Another thing you could do is put an actual reference to triple into the block: repend triple [skip triple 3 675] This way the first item in the block is actually a refernce into the triple block. You could do this with objects as well instead of blocks but I'll leave that excercise to the reader. The implementation you choose should be the one best suited for your application. Take into account all the uses of that third link, how much data you want to store in this item, and how you will be manipulating it. Sterling Hello: I'd like to implement a *triple* linked list in rebol. Below is a "c" structure: I'd welcome advice on how to translate this to a rebol data structure. If I'm correct, the nxt and prv elements are encapsulated by a rebol list. What I'd like to figure out is how to manually reference another node in the list. (the mrk element) typedef struct test_node { struct test_node *nxt; // points to next node struct test_node *prv; // points to previous node struct test_node *mrk; // points to a randomly selected node long num; }TestNode; Thanks In Advance Regards -Tim
[REBOL] Webcam URL Re:(4)
I'm more concerned as to why the tree to the right, looks like a giant snarling rat? It totally does!!! It totally is!! Why do you think we get so much done around here? We have to wait until it goes to sleep to leave the office. :) Sterling
[REBOL] recursive RIP Re:(3)
By the way, thanks to everybody who posted those fixed up scripts. It saved me some work I didn't have time to spend. I'm not out of the hotseat yet so I better run. Thanks again! (: Sterling
[REBOL] load Re:
It is meant for dealing with markup languages like HTML, XML, and sothers in a simple way; try: foo: load/markup http://www.yahoo.com or any other site you like. You'll see that you get back a block of tags and strings... it kind of unzips the web page. Sterling Does anybody know what the markup refinement for load does ? Like in : load/markup %file -- [EMAIL PROTECTED]
[REBOL] recursive RIP
I'm guessing that somebody out there has modified the original RIP script to be recursive. I'm in the middle of some stuff and could sure use that right about now. Anyone want to help me out and mail it to me, post it to the list, or post it to REBOL.org? Thanks, Sterling
[REBOL] Bcc?? Re:
An important note is that when yo uuse SEND, the [block of addresses] is, by default, entirely Bcc. If you want it to show up in the destination email with the list of people you sent it to, you'll want to use send/header and make a header object like below. Then you'll want to set the to field to the comma separated list of addresses: send-to: [[EMAIL PROTECTED] [EMAIL PROTECTED]] cc-to: [[EMAIL PROTECTED] [EMAIL PROTECTED]] bcc-to: [[EMAIL PROTECTED] [EMAIL PROTECTED]] header: make system/standard/email [ from: [EMAIL PROTECTED] to: replace/all form send-to " " ", " cc: replace/all form cc-to " " ", " subject: "Message subject" ] with any other headers you like. Then: send/header join join send-to cc-to bcc-to "message text" header and it should be off. And the other end sees that you sent the email to two people, and cc'd two others while you actually sent it to 6. If you want to add the Bcc header to the ones you Bcc'd, then just mail those after and add the Bcc header field for them. Bottom line is that REBOL is not trying to pretend to be an emailer. You get to decide how you want your mail to look. If you want an extra reference, check out the %attach.r script on REBOL.org under the 'email area of the script library. I wrote that to send mail with MIME attachements (looks like you're doing the same given that content type header) and it does what I've explained above. Sterling HI, does anyone know how to create a custom email header that includes Bcc. This is what I tried: tommy: reform [[EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]] header: make system/standard/email [ From: "[EMAIL PROTECTED]" Bcc: tommy MIME-Version: "1.0" Subject: "Thank-you :)" Content-Type: join {multipart/mixed; boundary=} {"4F9F64BEEE5"} ] Thanks, timmy
[REBOL] downloading big file via http Re:(2)
url: http://www.someserver/somefile.rm http: open/direct/binary url print "http opened." while [true] [ w: wait [http] {more code here} ] it fails on the w: wait[http] line. why? wait works on a tcp port, I know that from another project. Does wait not work with an http port? That might be a bug... it's being looked into. I ran the url through my IE browser and it never timed out, but you could watch, after about around a megabyte of data, the download rate would plummet as if the server basically lost interest in the request. Then, I found that after cancelling, when I requested the same url, IE was smart enough to just resume where it left off. Well, it took about 20 re-tries, but I eventually got the 14.3 MB file. IE resumed the download because it hadn't wiped the file from it's cache just yet... you're lucky with a file that big. Now, don't tell me you are going to let IE lick you! NEVER Divide and conquer! Remember the Alamo! I've not yet begun to fight! How can I do the same thing (dowload the whole file) in Rebol? You need to invoke a magic incantation and sacrifice your Perl installation to your newfound REBOL gods. is there a way to specify restarting a download in Rebol http? Funny you should ask. I've just been discussing this exact thing with Julian Kinraid. He's already modified both the FTP and HTTP protocols to allow restarts of downloads. We'll be covering these possible additions in our next devel meeting but that stuff wouldn't be out 'til next release and I'd hate to make you all wait like that. So what I'm going to do is post some unsupported protcols onto REBOL.org that have these modifications. It'll take a little time so don't _expect_ them to be there by the time you see this mail though they might be. I'll make the page at: http://www.rebol.org/unsupported/ So you can check back there for them. I'll post a message when it's all there. is there a way to set it so it won't timeout? Note: the timeout is actually on the client side, because IE never times out...? I don't think so right now. The file I am trying to download is http://www.grafxsource.com/RnaG/6-3-00-Caitlin-45.rm It's basically a capture of a couple of hours of Irish radio. -galt You also asked in another message about the size of the file. IF the server reports it (and you trust that), then once you do open/direct on the http file, you can use port/size to see the size: http: open/direct/binary http://www.grafxsource.com/RnaG/6-3-00-Caitlin-45.rm http/size == 15182055 Yup. It's big. Well, you'll excuse me now. I just promised to do something and I guess I'll do it now. Sterling
[REBOL] restart in FTP and HTTP
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!
[REBOL] detach.r Re:
Take another look at the detach function. It expects the wohle email message as text, including all the headers and everything. If you already have the imported email object, you should be able to change the top of the detach func to look like this: detach: func [ {Takes in the whole email text and returns a block of filenames and decoded base64 attachments present in the email} mail [object!] ][ headers: mail print "Starting decoding process..." boundary: headers/content-type .. rest of script... and then call 'detach msg' Sterling I am trying to detach an attachment (.jpg image) from an e-mail using the script detach.r from the REBOL script library. Unfortunately, I am getting an error, as follows... detach msg/content starting decoding process... ** Script Error: find expected series argument of type : series port bitset. ** Where: if boundary: find/tail boundary {boundary="} In the 'msg/content, there is no {boundary="} statement. Instead, there is a {-- Message-Boundary-11825} statement. My question is: Is my Pegasus e-mail client sending some non-standard "boundary" indicator? Is there any way to set this up so that the script will work with most e-mail clients? I can't find any other information in the REBOL docs or examples about detaching e-mail attachments. Thanks. Detailed msg/content and detach.r script information follows... The msg/content looks as follows... cut out the rest
[REBOL] detach.r Re:(3)
Hmmm... well, it got all the attachment parts but blew out right at the end. Try changing: if find/match body "--" [print "breaking... attachents finished" break] ; we're at the end of the message attachments to: if any [find/match body "--" not fimd headers/content "^/--"] [print "breaking... attachents finished" break] ; we're at the end of the message attachments That way, it should gracefully exit if it either finds the proper end marker or if it can't find another attachment. Sterling Doing as you said overcame the problem of the function looking for a string! instead of an object! But... detach msg starting decoding process... == none Then I had to change if boundary: find/tail boundary {boundary="} to if boundary: find/tail boundary {boundary=} Then... do %detach.r Script: "Save email attachments to disk" (9-Jun-1999) detach msg starting decoding process... Boundary string: Message-Boundary-1182 Found message attachment; remaining length: 6451 Found message attachment; remaining length: 6309 Found message attachment; remaining length: 5687 Found message attachment; remaining length: 5 ** Script Error: copy expected range argument of type: number series port. ** Where: file: copy/part headers/content find body: Again, is the {boundary=} statement sent by Pegasus causing problems?
[REBOL] http authorisation - how? Solution Re:(6)
Cheers, Allen K (Look like Digest might be my first chance to write a protocol :-) First chance, Allen!! I'll give you a chance at IMAP, LDAP, or SNMP. ;) You can do it! and if you start that protocol and need any help, don't hesitate to ask. We'd love to see more protocols get added. Sterling
[REBOL] Getting an URL from a form Re:(6)
I did some work on this myself. It's a bit annoying when sites don't have a mechanism for a GET HTTP request. A while back Martin Johannesson wrote a simple http-post script to do those requests. Then, to help automate it a bit, I wrote a form parser that reads a web page, parses out a form and returns an object with that info in it so you can see what it requires to post it back. In the case you are talking about, here's what I can do: probe parse-form http://www.hembiocenter.se/menu.asp make object! [ method: 'post action: "search.asp" inputs: [word: none search: "actor" search: "title"] hidden: [] ] Then just change some fields so that your values are filled into the inputs block for the words you want... inputs == [word: "sleepy+hollow" search: "actor" search: "title] since 'search' appears twice, it's the radio buttons and the last one will be used. Then... page: http-post-form http://www.hembiocenter.se/search.asp inputs and presto! You have your page. On pages with hidden inputs, you will have to do an 'append inputs hidden' to pass the rest of the form data on. Both scripts are available form rebol.org... http://www.rebol.org/web/http-post.r http://www.rebol.org/web/parse-form.r Anyway, it'll help when you want to use a form where there is no alternate GET method to use. Sterling
[REBOL] Rebol/View Win32 and REBOL_HOME envvar Re:
Try setting REBOL_VIEW instead of REBOL_HOME... that work better? Sterling I managed to track down a nifty util called WINSET that allows me to set an evironment variable during the netlogon procedure. The variable is visable to any application launched after it is set (i.e. start-run-command, type 'set' and REBOL_HOME will be there) but Rebol/view doesn't seem to honor the setting as it says in the docs (var first, current dir second). Anyone have any insight on this matter? Regards, Deryk
[REBOL] Timeout Re:
system/schemes/default/timeout can be set to a time, the default is 30 seconds. That'll set the timeout for all protocols... you can just change one if you want, like system/schemes/ftp/timeout: 200 Happy slow modeming! Sterling Hi! Thanks to all who ask to my (stupid) questions. I have a new one: How I can increase the timeout value? The problem is that I get an "timeout" error when the dial-up line it's "blocked" with another job. Thanks in advance, A.D.ing http://www.zonator.com
[REBOL] FTP crashes rebol Re:(3)
FTP can do quite a number of things... we don't implement them all because the "standard" or "required" set of commands is rather small and support for the extra features is not guaranteed. Within REBOL right now, you can: read, write, append to, delete, and rename files read, make, delete, and rename dirs I think that's the list. However, the FTP protocol itself has many other commands that are optionally supported by servers. There is a command to restart a broken transfer at a specified point, and a few that can specify the structure of the target file system or file to be used... I'm not really dure how they get used or how many servers implement stuff like that. Append is probably the only thing there you didn't know about. FTP cannot do any mid-file editing within the protocol... for that you'd have to transfer the whole file back and forth and do the edit locally. It might be neat to implement some way to get that download restart command worked in but how do you put that info into the URL? Sterling Sterling, in your note to Tim to say that append should work, although it would be slow and inefficient. Is this really true? I didn't think you could modify parts of files using FTP. What can FTP really do? -galt
[REBOL] FTP crashes rebol Re:(3)
Really? It worked for me... but I'm on Linux. Try it with 'trace/net on' trace/net on DstFile: ftp://usr:[EMAIL PROTECTED]/log.txt SrcFile: ftp://usr:[EMAIL PROTECTED]/log.bak text: read/lines DstFile if exists? SrcFile [delete SrcFile] rename DstFile SrcFile foreach line text [ write/append DstFile join line newline ] So if you do that to a small file (just 2-3 lines), what does the trace show is happening? Sterling Hi Sterling: Sorry, your modification resulted in a crash also. write/append DstFile [line newline] Be interesting to see if there are different results regarding other OS's. Windows isn't all that stable anyway. Oh well! -Tim At 10:50 PM 6/5/00 -0700, you wrote: Well, this is untested code as I'm crunching away on some other stuff, but try: foreach line text [ print line write/append DstFile [line newline] ;HOPEFULLY DOES NOT CRASH HERE!! ] instead. Yes it's probably _very_ slow plus the other thing should never crash REBOL. That will be looked into. Sterling I'm reposting this, as I've had no takers from the previous, and I note that Holger may be monitoring I have tried a couple of different approaches to rewrite a file and an FTP site, and the result is always that rebol crashes and Dr. Watson intervenes. (Current version of view). Here's the code, I'd welcome comments. ; DstFile: ftp://usr:[EMAIL PROTECTED]/log.txt SrcFile: ftp://usr:[EMAIL PROTECTED]/log.bak text: read/lines DstFile if exists? SrcFile [delete SrcFile] rename DstFile SrcFile ;print type? text DstPort: open/new/write DstFile foreach line text [ print line append DstPort [line newline] ;CRASHES HERE!! ] close DstPort ; I am running from a Win NT 4.0 Workstation Platform with upgrade ; 5.0 ; I am writing to a Linux machine. I can make this work if I do the rewrite on my machine and then FTP it to the site, but it would be just wonderful if I can do the backup and editing at the site. TIA Tim
[REBOL] Newbie Help with Email Processing Re:
Well, I'm sure you'll get lots of other responses but I'm in an email mode so I'll get you going... pop: open pop://email:[EMAIL PROTECTED] That'll open up the pop mailbox. At this point, pop is just like any other block in REBOL except that the items in it are now the email messages that are in your mailbox. So you can do things like this: length? pop ; how many messages are there? print first pop ; print the first message print last pop ; print the last message probe msg: import-email first pop ; import the a message into an object either in msg 'reference [print ["Reference:" msg/reference] [print "No reference"] ; print the reference if there is one !! The follwing are permanent !! 'remove pop' will delete the message that you can read with 'print first pop' from the mailbox -- this is permanent!! 'clear pop' will delete all messages from the current pop location on This will empty the mailbox if pop is at the head - 'head? pop' ? send ; for info on the send function to send mail and throw in a loop like FOR, FOREACH, or FORALL, and... watch out! You're almost done! Sterling Hi Rebols ! I'm brand new to this language/philosophy but it looks real promising. I'm definetly going to learn this... I've got a concrete exercise that I want to solve using rebol so that I can learn quicker. I guess I'm hoping somebody will help a beginner get off to a flying start. So here goes ... I have mail going to a specific user called "email" that contains a header field called "reference:" This "reference" field contains the email address of the intended recipient. I'd like to read this field, parse the email address and resend the email to this new address (including the message body of course). The message should then be deleted from "emails" mailbox. I need to check the "email" mailbox (say every 5 minutes) to see if any new messages have arrived and forward them to the "real" intended recipient. Here is an example mailbox file belonging to "email" Mailbox-- START From [EMAIL PROTECTED] Wed May 31 16:25:54 2000 Return-Path: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] Received: from mailer1.mydomain.com by mailf.mydomain.com (Postfix) with SMTP id BC2B11FA0A for [EMAIL PROTECTED]; Wed, 31 May 2000 16:25:54 +0200 (CEST) Received: from mailer1.mydomain.com with TCP; Wed, 31 May 2000 16:19:43 + Date: Wed, 31 May 2000 16:19:43 + From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Testmail 1 Reference: [EMAIL PROTECTED] Message-Id: [EMAIL PROTECTED] Body Text for email 1. From [EMAIL PROTECTED] Wed May 31 16:26:28 2000 Return-Path: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] Received: from mailer1.mydomain.com with TCP; Wed, 31 May 2000 16:20:17 + Date: Wed, 31 May 2000 16:20:17 + From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: testmail 2 Reference: [EMAIL PROTECTED] Message-Id: [EMAIL PROTECTED] Body Text for email 2. Mailbox-- END I realise this is probably trivial - REBOL can obviously do powerful things with a few lines of code. I've read the manuals and looked at the library examples regarding mail but can't seem to get started properly (sigh .. so much to learn, so fast ...) regards Simon
[REBOL] FTP crashes rebol Re:
Well, this is untested code as I'm crunching away on some other stuff, but try: foreach line text [ print line write/append DstFile [line newline] ;HOPEFULLY DOES NOT CRASH HERE!! ] instead. Yes it's probably _very_ slow plus the other thing should never crash REBOL. That will be looked into. Sterling I'm reposting this, as I've had no takers from the previous, and I note that Holger may be monitoring I have tried a couple of different approaches to rewrite a file and an FTP site, and the result is always that rebol crashes and Dr. Watson intervenes. (Current version of view). Here's the code, I'd welcome comments. ; DstFile: ftp://usr:[EMAIL PROTECTED]/log.txt SrcFile: ftp://usr:[EMAIL PROTECTED]/log.bak text: read/lines DstFile if exists? SrcFile [delete SrcFile] rename DstFile SrcFile ;print type? text DstPort: open/new/write DstFile foreach line text [ print line append DstPort [line newline] ;CRASHES HERE!! ] close DstPort ; I am running from a Win NT 4.0 Workstation Platform with upgrade ; 5.0 ; I am writing to a Linux machine. I can make this work if I do the rewrite on my machine and then FTP it to the site, but it would be just wonderful if I can do the backup and editing at the site. TIA Tim
[REBOL] emacs colors Re:(5)
Here's what I've got... The first line insures that where I put my rebol.el file is in the load path, it loads the file, requires it (whatever that's worth I don't know exactly), then adds the hook and associates .r files. (setq load-path (cons "/usr/lib/xemacs/site-lisp" load-path)) (load "rebol") (require 'rebol) (add-hook 'rebol-mode-hook (lambda () (font-lock-mode 1))) (setq auto-mode-alist (cons (cons "\\.r\\'" 'rebol-mode) auto-mode-alist)) )) Sterling Hello sterling, Tuesday, May 16, 2000, 7:15:44 PM, you wrote: src print emacs-mode: read http://www.rebol.org/rebol.el Thank you. Now I'm not this good at emacs, the program is very good, but i cannot figure out where to put the rebol.el file and how to include/start it in emacs. I tried: ESC-x load-file pathrebol.el (add-hook 'rebol-mode-hook 'turn-on-font-lock) neither one works, may be because this isn't the right way? Regards, Fredrik Bergstrom
[REBOL] emacs colors Re:(3)
print emacs-mode: read http://www.rebol.org/rebol.el Enjoy! Sterling I think someone name Sterling... you might try [EMAIL PROTECTED] He sent me a module for emacs (or was it vi/vim) several months ago, but I no longer have it. HTH Tim
[REBOL] emacs colors Re:
print data: read http://www.rebol.org/rebol.el It's not perfect as the indentation on close blocks is wrong and it gets freaked out sometimes by the occasional multiline string. But it's still good and useful. Sterling Is there a Rebol-syntax hightlighting module for emacs? --yoh
[REBOL] Limit on data in CGI Post? Re:(2)
CGI POST calls will send the data you want to the CGI process. When yo uare handling it yo umay need multiple reads to get it all... it may not all be there when you do your first read. You'll notice that with POST you also get some headers and one of them should tell you how much data to expect. Therefore you can write a read loop to get it all. You would most likely need to check to make sure that the port is still open as well as read from it (copy) to deal with data transfer delays and all. Also, decode-cgi is only for the GET request and not for POST. Yo uwill find that POST data has a more complex structure... almost like an email with attachments. You will have to deal with that data yourself. Sterling On Wed, Apr 19, 2000, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I've done some more digging, and it looks like Rebol isn't reading enough data from the standard input. I'm getting my posted data using the following: stdin: make string! 128000 read-io system/ports/input stdin 128000 raw-cgi: decode-cgi stdin cgi-obj: make object! raw-cgi Oddly different browsers send different amounts of text. With Internet Explorer 5.0 only the first 4096 bytes are read. With Netscape 4.7 only 2920 bytes are read. With Netscape 6 only 2847 bytes are read. And with iCab only 3688 bytes are read. Since read-io doesn't seem to be documented anywhere, I'm not quite sure how to go about fixing this problem. I tried submitting this same hunk of text on a form on another website (my weblog on www.editthispage.com) and it went through just fine. So I'm assuming that this is an issue with my Rebol code. ..:Eric
[REBOL] Problem with SMTP Re:
If you have a proxy set, REBOL will go through it by default. You can make a list of bypass machines like this: system/schemes/default/proxy/bypass: ["center.uniba.sk"] That should bypass the proxy when it connects to your mail server. Sterling Hi, I have problem with network settings in REBOL (tested with Win98 and Linux RH6.2). When I set correct SMTP server and proxy server (3 CERN) I can't send email. But when I set only SMTP server without proxy it's ok. In ethereal (network sniffer) I can see correct communication when I haven't proxy. But when I have PROXY in ethereal is communication with PROXY(why?) but nothing with SMTP server. There are only 5 packets. Two standard UDP with DNS query for PROXY host name, and then 3 packets with PROXY. Here are my user.r set-net [ [EMAIL PROTECTED] center.fmph.uniba.sk none proxy.sturak.sk 8080 generic ] Please tell me what's wrong. Thanks Peter Hanusiak
[REBOL] [REBOL]string to series function Re:(3)
Fair enough. I have little time to give a complete course on parse so I went for the shortest version. I expected to see a few other responses to this thread as well and sure enough the old-time REBOL-masters of the outside world give a more full answer than us insiders have time for. Take it easy guys, Sterling Hi Sterling, one little detail: your approach works well enough with this particular example because space is one of the desired delimiters. Conceivably Tim may want a more universal solution that enables him to determine whether or not he wants to include spaces in his parse rule. In that case IMHO it would be more appropriate to use parse's all refinement and - for the sake of this particular example - include space explicitly as a delimiter in the rule: With space: parse/all "one#two%three four" "%# " == ["one" "two" "three" "four"] Without space parse/all "one#two%three four" "%#" == ["one" "two" "three four"] Note that the second version returns "three four" as one string because space is not included in the rule.
[REBOL] new proxy server and related problems ... Re:(3)
The new proxy server is probably a Squid proxy server, which means that the proxy-type needs to be set to 'generic, not 'socks or 'socks5. I assume that your netscape settings have the host and port number listed under the http proxy area, not under socks. Anyway, try it as generic and see if that fixes the problem. Sterling [EMAIL PROTECTED] wrote: Hi Petr, have you tried to set the http proxy settings? I.e. system/schemes/http/proxy/host: proxy.sec.trz.cz system/schemes/http/proxy/port-id: 3128 system/schemes/http/proxy/type: 'socks. system/schemes/http/proxy/user: none system/schemes/http/proxy/pass: none the strange thing is - netscape works. Well, I tried above, just instead of 'socks I used 'socks5 and instead of both 'none I used 'false, in other case REBOL would use my default scheme's proxy setting, where I have 'user and 'pass set. btw: shouldn't be proxy.sec.trz.cz enclosed in quotes? :-) but, what is the system/schemes/http/host and system/schemes/http/port-id for? I even tried set system/schemes/http/port-id to 3128, or directly site: read http://www.rebol.com:3128, but it still doesn't help. Will www.rebol.com be used for system/schemes/http/host? It's strange direct communication with proxy server works fine, but 'read should work too imho, unless there is bug in http protocol implementation??? -pekr-
[REBOL] ftp limits? Re:(3)
Hi Nigel, I tried this and did get a timeout but I also got a timeout under Netscape reading the same site and received no directory listeing there either. That, unfortunately, tells me nothing other than the server is really slow. You mention that you always get "some error or timeout", so what error other than a timeout have you received? That may be of some use. Sterling Thanks for that. The directory that causes the problem is set drwxr-xr-x and all the files are -r--r--r--. So I don't think this is the same problem. This certainly looks like a bug in Rebol to me. The directory downloaded through an ftp client results in a 137k download (about 1500 files). I suspect the problem is caused by the number of files. I really do need an answer on this - if Rebol cannot do what I want I need save my efforts and look elsewhere. If anyone want to give it a try... system/schemes/default/timeout: 1000 print read ftp://anonymous:[EMAIL PROTECTED]/aix/fixes/cad/other/catia_o em_v4/IRIX/ Replace email_address with you correct email address (all activity is logged) Depending on proxy/no proxy/Rebol platform you always get some error or timeout without the directory listing ever being received. Thanks Nigel - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 25, 2000 11:40 PM Subject: [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/
[REBOL] ftp limits? Re:(4)
Somebody will take a look at it. I did manage to get the same server response error which I think is generated if the server times out before REBOL does and closes the connection. REBOL expects to hear something back and does not so it fails to parse the empty response. Thanks for the info Larry, Nigel. Sterling Hi Nigel, Sterling There does appear to be some kind of problem with the REBOL ftp is this instance. I was able to get the dir listing with WS-FTP although the server was slow (took about 150 seconds). With REBOL I got (don't need the user e-mail if set-net has e-mail configured): system/schemes/default/timeout: 5000 == 5000 list-dir ftp://ftp.europe.ibm.com/aix/fixes/cad/other/catia_oem_v4/IRIX/ connecting to: ftp.europe.ibm.com ** User Error: Server error: tcp 421 Timeout (1800 seconds): closing control connection.. ** Where: list-dir ftp://ftp.europe.ibm.com/aix/fixes/cad/other/catia_oem_v4/IRIX/ I had no problem getting the dir lists for each of the parent directories using REBOL, so I am inclined to agree with your speculation that the number of files or the time required for the server to send them is part of the problem. Based on the tests with WS-FTP, the server should have sent back the dir-list in about 180 seconds, REBOL apparently was unable to receive or acknowledge this, leading to the server timeout at 1800 seconds. The results of using 'trace/net are shown below. I have CC'd this to feedback, perhaps Sterling or someone else at Rebol tech can diagnose the problem? (I see Sterling has already replied:-) I just tried WS-FTP a seond time. It took 120 seconds for the dir-list to start downloading. The dir-list was fine. Hope this helps Larry
[REBOL] Unknown script error Re:
I haven't been keeping up with the beginning of this thread at all so I don't know what you are doing exactly (and don't have much time to deal with it too much myself either). However, I'm guessing that these are ftp transfers you are dealing with, right? That line you are wondering about is part of the protocols system of talking to the server. The error occurred because REBOL was expecting a response from a command sent to the FTP server and did not get an answer. Maybe the server closed the connection. Do you have a long timeout set for the transaction? If so, the server may timeout before REBOL does and close the connection on you causing REBOL to throw that error. Sterling I am trying to author a script to download via ftp. Yesterday I hurdled the problem of getting files bigger than 16 MB by using a function suggested by John to "chunk" the files into smaller pieces thus avoiding memory problems. Today, I have another problem. It appears that I cannot transfer too many bytes in one batch. I can transfer hundreds of small files at a time, no problem. I can transfer a single file 100MB, a little slow, but no problem. The problem lies when I transfer 5 files totaling 200+ MB. I get a script error, either after or during (I am not sure on what line it dies) the transfer of the last file. The error reads: ** Script Error: find expected series argument of type: series port bitset. ** Where: if not find/match/any server-said response Funny thing is 1) It looks like the files transferred fine when I look at the resulting directory, and 2) the line "if not find/match/any server-said response" does not exist anywhere in my script or any other rebol script on my system. Any clues would again be appreciated. Brian
[REBOL] [REBOL] Multipart emails Re:
Check out www.rebol.org. Lots of cool scripts there including scripts to attach and detach files in email. Sterling Does anybody know how (or has written something) to handle multipart email messages? I mean things like listing, extracting attachments from a message when reading it, or composing an email message consisting of a number of attachments? Thanks Mauro
[REBOL] Search Engine Re:
Now that's really cool Paul! I just had a chance to take a look and you've done a really good job of it. I wanted to add the highliting features like you have to the REBOL.org list-archive search engine but never got to it. ANyway, great job! Sterling The Rebol search engine at Paul's Rebol Page has now been submitted to several of the large search engines, ie. Altavista, Hotbot, etc... Hopefully you will have any easier way of finding it in the future. As always enjoy. Paul Tretter Paul's Rebol Page http://p1-110.charter-stl.com/rebolsearch
[REBOL] HTTP username/password Re:(3)
If you grab proxy.r from REBOL.org and run that you can see what you browser sends and maybe that'll shed light on it. Sterling Petr, here's the results of turning on the trace... trace/net on do %getsecurepage.r Script: "Secure Page Retreival" (25-Jan-2000) http://webuser:[EMAIL PROTECTED]/mysite/ URL Parse: webuser letmein 127.0.0.1 none mysite/ none Net-log: ["Opening tcp for" HTTP] connecting to: 127.0.0.1 Net-log: {GET /mysite/ HTTP/1.0 Accept: */* User-Agent: REBOL 2.2.0.3.1 Host: 127.0.0.1 Authorization: Basic d2VidXNlcjpsZXRtZWlu } Net-log: "HTTP/1.1 401 Access Denied" ** User Error: Error. Target url: http://127.0.0.1/mysite/ could not be retrieved. Server r esponse: HTTP/1.1 401 Access Denied. ** Where: print read http_file To me - it looks like REBOL simply parses out the username:password from the URL. But I'm not sure what the results of the trace mean. I can see that the Authorization chalenge comes up - the little box that pops up in your browser when accessing a password protected resource is referred to as "Basic Authentication" - not just in Microsoft's parlance. So - I'd say the server is responding appropriately - but that REBOL isn't reacting to it correctly, and not handing it the username and password... - Porter Woodward
[REBOL] Strange problem with --cgi Re:
Do #!/usr/local/bin/rebol -cs instead. That should solve your problem. Sterling I can't seem to get cgi-bin stuff working properly, and the problem seems sort of strange. I'm using the latest Rebol on a late (2.2 kernel) Red Hat Linux. I have a file (test-cgi.r) which has the magic incantation on the first line: #! /usr/local/bin/rebol --cgi -s
[REBOL] Strange problem with --cgi Re:(3)
You sure your webserver is set up properly? What're you using anyway? Sterling Nope, same symptoms. --cgi and -c are synonyms, no? When I change the first line to #!/usr/local/bin/rebol -cs, I get the same behavior as with blah --cgi -s, namely: Rebol initialization strings print, and the interpreter does not exit when the script is finished. jb [EMAIL PROTECTED] wrote: Do #!/usr/local/bin/rebol -cs instead. That should solve your problem. Sterling I can't seem to get cgi-bin stuff working properly, and the problem seems sort of strange. I'm using the latest Rebol on a late (2.2 kernel) Red Hat Linux. I have a file (test-cgi.r) which has the magic incantation on the first line: #! /usr/local/bin/rebol --cgi -s
[REBOL] Syntax Highlighting Re:
read http://www.rebol.org/rebol.el No guarantees about it... I use it in XEmacs and Jeff uses it in normal Emacs but others have reported that it does "nothing at all" for them. Sterling Are there any syntax highlighting files for Rebol out there? There was discussion about one for Emacs on the list, but I don't know if they ever figured out whether that worked or not. Does it, and is there anything for other editors? I'd like to contribute a syntax file for EditPlus, which is the editor I use for Windows. I guess I'll just go grab a list of keywords from the dictionary. Later all. Keith
[REBOL] Personal Web Server Re:(3)
Well, that set of instructions has worked for others before. The HTTP header problem may be there if your script does not print out a line like "content-type: text/html" at the top with a blank line after it. And usually REBOL is popping up because the -c or --cgi option was not set up properly so that REBOL runs in CGI mode. I thikn that info for WinNT may have been missing the --cgi part in the line 'c:\path\to\rebol.exe --cgi %s %s'. There should be a --cgi in there to prevent the window from popping up and do all the useful CGI stuff. Sterling Hate to be slow, but I followed the directions (I think) to the T--. When I tried to run a simple form with the code from your howto page, I got the following: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: Also, when I submitted the script, an instance of Rebol opened on my machine?? Any suggestions? Thanks Mark
[REBOL] Personal Web Server Re:
Get message number 38514 from SELMA or read it at rebol.org: http://www.rebol.org/userlist/archive/38/514.html Sterling I have searched the mailing list for PWS and CGI and even Microsoft...but have not found information on setting up Rebol to work (cgi) with Personal Web Server? Can someone either tell me, or point to a message thread? Thanks in advance, Mark Woodward
[REBOL] emacs mode Re:(2)
It does nothing? Even if you load up a script and then do 'Meta-X rebol-mode'? Odd. Sterling Something like http://www.rebol.org/rebol.el However, it does nothing (zero, zip) to the installation of EMacs at my university, so I wish you better luck. Kind regards, -- Ole Friis [EMAIL PROTECTED]
[REBOL] CGI Re:
Try this... you just need to write out and read in as binary to get the file read and sent properly. Sterling #!/usr/local/bin/rebol -csq REBOL [] file: read/binary %test.xls ; file is 17920 bytes long prin [ {Content-Type: application/octet-stream; name="file"} newline {Content-Disposition: attachment; filename="file"} newline newline] write-io system/ports/output file length? file Hi I wrote CGI script in REBOL, and I run it, but script doesn't work. I running this script on FreeBSD server (WWW Apache server). I write something like that ;-- begin #!/usr/local/bin/rebol -csq REBOL [] file: read %test.xls ; file is 17920 bytes long prin [ {Content-Type: application/octet-stream; name="file"} newline {Content-Disposition: attachment; filename="file"} newline newline] print file ;--end When i run this script (typing in browser http://aaa.bbb.cc/cgi-bin/examples/test) browser ask me on filename and send to me file, but saved file have only 5340 bytes :( What I can transfer file in binry mode Please help me, it's very important to me, because i can't finish my project. Grettings Mark Sorry for my "English"
[REBOL] FTP Problem - Multiple Connections Re:(3)
Is there an echo here? I was sure I just read two messages about this recently. :) Point noted, it's a bug, and the best way to get it fixed is to send it in using feedack.r or just email the issue to [EMAIL PROTECTED] You know the drill. If we could have somebody constantly monitoring this list for bug reports we would. However, since we can't it is up to you when you find a bug to report it directly to us if you want it fixed. Sometimes we can pull stuff fro mthe list when we see it but doing that as a regular practice just means you'll get all ticked at us when we miss one. You don't want that, do you? So please send in the bug report. Thanks, Sterling STERLING: I used to get multiple "connecting to..." messages also. As stated in several of my previous messages, My script would halt after about 16 connections - very frustrating... I noticed the problem went away when I started using the DNS name rather than the IP address. Must have something to do with this.
[REBOL] FTP Problem - Multiple Connections Re:
REBOL attempts to maintain one connection per site contacted. If more connections are being made, you should see a message like "connecting to site-name" on the REBOL console. I tested your script here and it finished flawlessly with only one connection made. So when you run it, does it print out multiple "connecting to ..." messages? Sterling I have a problem that I hope can be solved. I operate several websites and would like to make a script to upload the site data whenever there is a change. My goal is to use Rebol. I wrote the script below to move an entire site at once. I tested uploading to one of my internal servers (at home) and it worked like a champ. So, I then went to upload my data to my real website and I received an error stating that only one {1} FTP connection was allowed at any given time. Because of that, I went back to my internal servers and monitored the FTP connections, and sure enough, 5 Connections were generated by the script below (it moves about 30 files in total - a very small, test website). These connections persisted until I shutdown Rebol. My question is, how do I open an FTP connection, write to that connection as many times as I like, and then close that connection, all while maintaining only one {1} connection to the FTP Server? Thank-you, Victor Mascari
[REBOL] Valid e-mail addresses Re:
Do this: trace/net on smtp-port: open smtp://you.mail.server you'll see you just got logged in to the SMTP server and then just use: insert smtp-port "your command" Sterling Hi A question: Using REBOL How can I test if the username has a mailbox at the e-mail server? In other words: how can I test if @ is a valid e-mail address? (Of course I don't know the password) In other words: how can I send a VRFY SMTP command to a e-mail port? Thank you
[REBOL] open and proxies Re:
You can use: port-spec: make port! [ scheme: 'tcp host: :base-url port-id: 80 proxy: make system/schemes/default/proxy [] timeout: 0:10 ] Root-Protocol/open-proto port-spec and now it should be open, going through your default proxy. For a more sophisticated look you can check out %proxy.r i nthe advanced section of the REBOL.org script library. It's a neat little script that I use all the time... I have a few things to add to it like error handling and a few bug fixes but it should show you a good look into using direct tcp ports. Sterling Hi all, to send a cgi POST query I'd like to open a port to a particular web server. As I'm behind a proxy I'd like to know if it's possible to set a proxy for every open command. port: open [ scheme: 'tcp host: :base-url port-id: 80 proxy/host:"wingate.intranet.gy" timeout: 0:10 ] If I try to use the above statement I get an error that I cannnot set proxy/host. What's the right way to specify the proxy settings? If I remove the proxy/host and use scheme: 'http I get through the proxy with my settings from user.r, but when I come to the 'close port' statement Rebol crashes with an error (something like an invalid statement or something, sorry, I have a German Win98...). Does anyone have an idea? Thanks, Tom
[REBOL] FTP problem Re:
We don't yet support using FTP proxies. The problem is that many (if not all, I don't know) FTP proxies return HTML rather than normal FTP responses. This causes us a problem for parsing that HTML since it can be totally different for each proxy. Sterling Hi, I once more tried to use the ftp stuff from Rebol. I'm using a dialup connection. For this I connected to the internet and tried to read the root directory of my ftp server, which gave the following error: read ftp://openip.org connecting to: openip.org ** User Error: Server error: tcp 500 Bad username format - format is user@host:port. ** Where: read ftp://openip.org I tried all kind of combinations of user:psw@host etc. with and without the port no success. I'm using an FTP proxy and have configured in the following way: system/schemes/ftp/proxy/host:"localhost" system/schemes/ftp/proxy/port-id: 21 system/schemes/ftp/proxy/type:'generic I can see that a ftp session is established but nothing happens. Any idea where the problem is? Robert M. Muench, Karlsruhe, Germany == ask for PGP public-key == When do you want to reboot today? Use the free portable GUI Library OpenAmulet from http://www.openip.org
[REBOL] clean-path when arg is url? Re:(2)
Well, the reason that clean-path does not clean up URLs is that you may want that information. Take, as an example, FTP. For a file on your hard drive, the path: %/../../foo/bar/baz is the same as: %/foo/bar/baz zso clean-path can clean that up without loss of information. However, the URL: ftp://my.domain.com/../../foo/bar/baz may not be the same file as: ftp://my.domain.com/foo/bar/baz because my home directory may be in /home/me so I am really accessing a totally different file in the two cases. It is dangerous to play around with paths when you could be sitting in a virtual root directory but still with the ability to go back to the real root. Sterling Hi Joel, Not sure why clean path is limited to non urls. Why not put in a request for it to be modified, to [EMAIL PROTECTED] ? In the mean time there is function to clean http paths on the Rebol Examples page http://www.rebol.com/examples.html Clean HTTP-Path "To remove /../ from within HTTP URLs. Will remove parent directories for each /../ encountered, but will not remove site information." http://www.rebol.com/examples/cleanhttp.r Cheers, Allen K
[REBOL] another upgrade problem!! Re:(5)
Then your setting should go as follows: set-net [[EMAIL PROTECTED] mail.server.name pop.server.name proxy.server.name 3128 'generic] system/schemes/default/proxy/user: "proxy-username" system/schemes/default/proxy/pass: "proxy-password" system/schemes/default/proxy/bypass: ["host1.name" "host2.name" ...] maybe you want to bypass "*.internal.net" or "mail.internal.net" That should work for you... let me know if you have any further problems. Sterling Just hold on the thing is .. i do have a proxy server ... i dont have modem to dial up for direct connection ... and i am behind a firewall and i use CAT5 UTP for connecting my pc to the nearest hub which in turn connects to our central computing facility through fiber optic cables squid proxy is used here i disabled my proxy server .. and tried it ... it gave me : "Netscape unable to locate server Please check your server name and try again" i then enabled the manual proxy setting .. it worked just fine ... thats it here goes a section of my preferences.js file ...
[REBOL] (De)Compress function source Re:(4)
Check your REBOL version: system/version It needs to be 2.2 to have replace. If you don't have it, just: upgrade Sterling When I do a: str: make string! read %infile.txt replace/all infile "X" "Y" I get the error: replace has no value. What is the problem here ? Thanks. Dipayan
[REBOL] Linux different? Re:
try this. Instead of always sending mailfile.r, send the file specified on the command line. Sterling REBOL [ Title: "Email a Text File" File: %mailfile.r Date: 10-Sep-1999 Purpose: {Send a text file (as text of message).} Note: { Puts the name of the file in the subject line. } ] file: to-file system/options/args ;name of file to send send [EMAIL PROTECTED] reform [ "File:" file newline newline read file ] My command on Linux is: $rebol mailfile.r readme.txt - where readme.txt is in the current directory and mailfile.r is in ../rebol off the current directory. rebol runs and sends me the mailfile.r script. What am I doing wrong? Something silly, obvious and stupid, obviously! - fleet - (so noone will need to go look it up - here is the script as I have it for my machine.)
[REBOL] How to update port info? Re:
I don't think you can do that. POP locks the mailbox, not REBOL. You would have the same problem with Netscape if you reversed the test. Of course, NS opens, reads, and closes for you but if you had a big mail download and sent yourself more mail while it was still downloading you would not get the new mails. You'd have to check mail again. If somebody knows differently, share with us please... but that AFAIK is how POP works. Sterling Hi, 2) mb: open pop://pekr:[EMAIL PROTECTED] once I connect to my pop account, 'mb reffers to actual state of my mailbox ... then I run Netscape and send myself three additional emails ... length? mb still refers to old state - 3 emails Is there (is there going to be) any way to update port status, without the need to reconnect to my mailbox? Thanks, -pekr-
[REBOL] Fixed format/width field files in REBOL Re:(2)
Instead of doing the read/lines into a block and parsing each line, could you not just have the line ending be part of the parse rule? assume data is your whole body of text before you created the block called 'tracelines' Then, instead of the last line in rule (to end), change that to 'thru newline' and do: parse/all data [ some [rule (print rejoin [time s ts s tt s adr s aack s artry s dbg s ta s dh s dl])] ] the parse rule now reads your data from one line and ends by reading thru the newline. Then the print happens and it repeats until all lines have been parsed. This way you don't have to break up the string into a block and write a whole loop to iterate over it when parse can do all the iteration for you. Sterling Andrew, I used the following snippet to translate logic analyzer trace files (which have fixed width fields, many of which I want to skip) into something that our simulators like. The file was read using read/lines into a block (tracelines) which was then parsed by the following: rule: [ 16 skip copy adr 8 skip 4 skip copy ts 2 skip 6 skip copy tt 4 skip 4 skip copy tbst 4 skip 20 skip copy aack 4 skip 4 skip copy artry 5 skip 11 skip copy dti 6 skip 6 skip copy dbg 3 skip 5 skip copy ta 2 skip 6 skip copy dh 8 skip 4 skip copy dl 8 skip 24 skip copy time 10 skip to end] s: " " trc: func [] [ foreach l tracelines [ parse/all l rule print rejoin [time s ts s tt s adr s aack s artry s dbg s ta s dh s dl] ] ] Ron
[REBOL] Is today the day? Re:(5)
The final ODBC user view has not been fully determined yet so I can't say quite how it will look. Sterling ODBC Implementation Question... Also what are the other main selling points beyond ODBC database access at this stage...? Command won't talk directly to mySQL, but you'll be able to access it through ODBC. Native d-base implementations are slated for early Q1 (also including Oracle, Sybase, etc.). Quick question - are you attempting to stick with the somewhat standard ODBC API used in everything from PHP to VC++ to LotusScript? By this I mean the somewhat usual combo of: snip And then, you could browse thru the result, pulling contents of fields, etc. - Porter
[REBOL] database testing
We're currently testing some different databases on Linux and other *NIX systems and I'm looking for a link to a mySQL test database to work with as well as links to the required shared library (.so) ODBC drivers for other databases and test DB's there as well. So if you work with certain databases and know where good resources are please mail me offline at [EMAIL PROTECTED] We can't test them all but if we can save the time to gather all the software we can test more of them. Any assistance is greatly appreciated and it'll help you in the long run. :) Sterling