World: r3wp
[Cookbook] For http://www.rebol.net/cookbook/requests.html
newer | last |
Tomc 21-Mar-2005 [1x4] | Sorry if people alreadu know about this but I just stumbled accross it |
http://www.rebol.net/cookbook/requests.html | |
glancing through I belive there are many solved questions here that should be posted. | |
questions that are not answered may merit some discussion / implementation | |
Henrik 26-Mar-2005 [5x2] | I'm doing an example now on tabbed pages. I hope it'll be easy to understand. :-) |
alright... I've put it here for review: http://hmkdesign.dk/rebol/panescookbook.html If you think it looks reasonably simple, I'll submit it to Carl. | |
Brock 26-Mar-2005 [7x2] | Henrik, that's really nice and simple. I would suggest putting in some code to check the version number and using the appropriate code, for example... |
either 1.2.8.31 < system/version [ print "Version greater than 1.2.8.31" ][ print "Version less than or equal to 1.2.8.30" ] | |
Henrik 26-Mar-2005 [9] | I'm not sure how to incorporate that in the code without having it dominate the example. Besides the other examples simply state that you need a specific rebol version to use them |
Volker 26-Mar-2005 [10] | something like this? As of <today>, it needs at least beta x (windows http://*), this and other betas are here: http://www.rebol.net/builds/ |
Henrik 26-Mar-2005 [11] | fixed a couple of typos now, but I think I'll still only post a version note at the bottom like in the other scripts... |
Brock 27-Mar-2005 [12x2] | I think all of the cookbook entries should be fixed to indicate their limitation as stated above!! OR, another cookbook entry should be made to indicate how to variably use code from one version of Rebol over another. |
Beat me to it if you choose ;) | |
Henrik 28-Mar-2005 [14] | I like the idea of a cookbook entry to check on versions. It could be expanded to check on OS and other things (what system is this script running on?) |
Henrik 12-May-2005 [15x2] | I would probably like to see a cookbook example on some kind of error handling/redirecting to file or a nice popup window. I've experienced terrified users that call me about "that white text window with cryptic messages in it" that crop up on fatal bugs. |
I'm going to do a last check on my panes example and then submit it to Carl. Haven't done any changes to it. | |
Henrik 7-Jul-2005 [17] | I've created a new draft for a cookbook tutorial for creating a set of configuration loading and storing tools: http://hmkdesign.dk/rebol/configurationtools.html It's a bit long though, but tell me what you think |
Sunanda 7-Jul-2005 [18] | Nice, Henrik! I do that sort of stuff all the time, and I am sure others do too. So to have it as a single item is a good thing. One small point -- your way of extending the existing object works only for single-level values....I often have configuration objects that have sub-objects. A field added to a sub-object would be missed by your code. Take a look at: http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=extend-an-object.r Which was created for this sort of purpose. |
Henrik 7-Jul-2005 [19x3] | thanks for that. I don't know if I'll bring it in though as it would make the tutorial more complex. I might have o split it in multiple parts. |
I'll be updating the old tutorial on panes with modified code soon. | |
sunanda, I've decided to leave recursive upgrading as an excersize to the reader and just made a few notes on it ;-) I must move on with the other tutorial now | |
DideC 7-Jul-2005 [22x6] | On extending config with new values, I usally just use : |
config: construct/with load config-file standard-config | |
where config-file hold the config values as a block. If it's stored as an object, you can use 'third to have the block. | |
standard-config is your config-object. | |
I use 'construct for security reason, but it's most understandable with 'make : | |
config: make standard-config load config-file | |
Sunanda 7-Jul-2005 [28] | DideC -- your method is similar to Henrik's, and has the same limitation: sub-objects fields do not propagate as you'd expect.....No f2-2 field in 'config here: standard-config: make object! [f1: 1 f2: make object! [f2-1: 21 f2-2: 22] f3: 3] config-file: make object! [f1: 88 f2: make object! [f2-1: 99]] probe config: construct/with third config-file standard-config |
Ammon 7-Jul-2005 [29] | Henrik, I'm getting a 403 Forbidden error from your link... |
Henrik 7-Jul-2005 [30] | ammon, should be fixed now |
Colin 7-Jul-2005 [31] | I'm still gettting forbidden |
Henrik 7-Jul-2005 [32] | stupid FTP client... try again :-) |
Colin 7-Jul-2005 [33] | works! thanks. |
Graham 7-Jul-2005 [34] | Henrik, it's nice, but I think the person who looks at a cookbook example doesn't necessarily have the skills to do the exercises to complete those parts left to the reader. I'd prefer complete examples rather than leaving something up to the reader. |
Henrik 7-Jul-2005 [35] | well, I can remove them and make a part 2 tutorial? such as it is now, the code is pretty usable, I think. But it's far from perfect in terms of capability, so do we want perfect code across a few examples or just this one tutorial? |
Graham 7-Jul-2005 [36x4] | There's never any such thing as perfect code .. better to get something up, and let others build on it .. paraphrasing Isaac Newton |
I've set up mediawiki at http://compkarori.com/rebolwiki/index.php/Main_Page and will see how it goes. Currently there's a sql error on updating or creating a page, but you can ignore that it seems as the page changes are made. | |
The advantage over Vanilla is that changes can be rolled back using the mysql database ... | |
PS: mediawiki is used to drive wikipedia. | |
Henrik 7-Jul-2005 [40] | I know mediawiki, as I use it for the Amiga AWeb Webbrowser. be careful with spammers.... |
Graham 7-Jul-2005 [41x2] | that's why I have made logging in obligatory to edit pages |
otherwise I have found scripts generating spam | |
Henrik 7-Jul-2005 [43] | yes, they can get pretty nasty, destroying contents and things like that |
Graham 7-Jul-2005 [44] | spam search bots create lots of junk in the Vanilla sites |
Henrik 8-Jul-2005 [45] | I think my panes cookbook example is ready for one last review: http://hmkdesign.dk/rebol/panescookbook.html I've removed some unnecessary bits about styles and I've added references to the User preferences window in the rebol/view 1.3 desktop |
DideC 8-Jul-2005 [46x2] | One point that would make it simpler : you didn't used 'of keyword for your tog style. 'of keyword allow to group toggle, radio or checkbox in order to reset others while you set one. Like this you don't need 'update-tabs functions : |
main: layout [ space 2 origin 4 across style pane-tog tog of 'panels ; Just to avoid puting {of 'panels} in each tog lines below pane1-tab: pane-tog 100x30 "Pane 1" [show-pane pane1] pane2-tab: pane-tog 100x30 "Pane 2" [show-pane pane2] pane3-tab: pane-tog 100x30 "Pane 3" [show-pane pane3] return content-pane: box 300x200 return btn white "Save" ; Save and Apply are used here for decorative purposes btn orange "Apply" btn sky "Close" [unview] ] | |
Henrik 8-Jul-2005 [48x2] | amazing! I never knew this. I will rewrite it immediately. |
how do you set the default pane? | |
DideC 8-Jul-2005 [50] | We learn something each day :) |
newer | last |