[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.