[REBOL] command/mySQL
Dear List, I was wondering if someone has tried to let rebol/command use the %libmySQL.dll from MySQL. at the moment i can get several routines working (e.g. connecting to MySQL, getting stats, create database etc) but, i am failing to get to the 'real' stuff I, and probably more people with me would consider talking directly to MySQL from rebol as something rather important. While MySQL might, perhaps, be seen as the 'beer' among the Open Source Databases (postgresql-- vintage port?) but, as is the case with beer, MySQL is hugely popular and free (available at least). so, any thoughts/help/pointers etc would be appreciated, Hendrik-Jan Bosch
[REBOL] command/mySQL Re:(2)
hi jeff, to be honest? all functions with MYSQL_RES and MYSQL_ROW/FIELD as input/output. i think my main problem is that once a result from an API-call is not 'just a variable' i am lost... perhaps one good example would do the trick, but i don't know about that untill I try off course. example: all mysql_fetch-* functions... for me, this is kinda difficult, but i am amazed how far rebol would let me go without giving me any problems.. hendrik-jan
[REBOL] that XML outliner example again
Dear List, and my thanks to Brett Handley and Keith Devens for helping me out with my 'dynamic append' problem have no idea if parsing a XML file into a javascript array is very easy for other people working with rebol or languages, but i found it to be rather complicated... (individual nodes will be dynamically appended to a block with names like: arMenu1_1_4_3_3_2, depending on the level of the node within the tree, and depending on the number of childs of the parent of the current node which have been parsed and which are still left in the tree to be parsed... stuff like that ) http://131.211.29.218/index.html and.. http://131.211.29.218/index2.html (for a different color) my code is very very dirty at the moment (6kb) if i have the time, i will clean it up off course it's idea is to create a javascript file with array's which can be used by the javascript from www.webreference.com (hierarchical menu's) comments, ideas for improvements please hendrik-jan bosch REBOL [ Title: "hiermenus.r" Date: 27-Jul-2000 Author: "Hendrik-Jan Bosch" Version: 1.2.3 ] ;--- xml-language/check-version: func [v][return] xml: first third parse-xml read http://www.scripting.com/xml/currentOutline.xml ;--- clean: func [B [block!] /local res-B] [ res-B: make block! 10 foreach elem B [ either = (type? elem) block! [append/only res-B clean elem] [if not = (length? trim copy to-string elem) 0 [append res-B elem]] ] return res-B ] ;--- xml: clean xml Q: make block! [1 1] P: ["document"] levels: copy ["root"] arraylist: copy ["root" "arMenu1"] menuarray: copy [] armenu1: copy [] correction: 1 javascript: "" ;--- basic: func [B [block!] P [block!] /local result] [ ;--- either all [(= (length? B) 3) (= (type? B/1) string!)] [X: "T"] [either (= (length? B) 1)[either (= (type? B/1) string!) [X: "V"] [X: "L"]] [ either (= (type? B/1) string!) [X: "A"] [X: "L"] ]] if (X = "L")[append/only Q length? B append Q length? B append/only P B/1/1] if (X = "T")[reverse Q if (= (first Q) 0) [ if (= (first Q) 0) [ remove Q remove Q reverse P remove P reverse P if (= (first Q) 0) [ remove Q remove Q reverse P remove P reverse P]]] Q/1: Q/1 - 1 reverse Q] ;--- if (X = "T") [ if (= (B/1) "outline") [ either any [(find B/2/2 "rule") (find B/2/2 "rules") (find B/2/2 "lt;textStyle") (find B/2/2 "lt;internalLink")(find B/2/2 "rules")(find B/2/2 "lt;rule") (find B/2/2 "rule level")] [ QR: Q LQR: (length? QR) - 2 if (= (last QR) 0) [reverse QR remove QR remove QR diff: (second QR) - (first QR) reverse QR] ] [ if (= (correction) 1) [ reverse Q Q/2: Q/2 - diff reverse Q correction: 0 ] either (= (type? B/3) block!) [ currentlevel: to-word last arraylist either (= (last Q) 0) [ either (= (last arraylist) "arMenu1") [ string: rejoin [tab {"}B/2/2{","",1,1,^/}] ] [ string: rejoin [tab {"}B/2/2{","",1,1^/}] ] ] [ string: rejoin [tab {"}B/2/2{","",1,1,^/}] ] append (get currentlevel) string ] [ currentlevel: to-word last arraylist either (= (last Q) 0) [ either (= (last arraylist) "arMenu1") [ string: rejoin [tab {"}B/2/2{","",0,0,^/}]
[REBOL] 'dynamic append'
Dear List, Am at a loss here, i have failed trying to get a script with an "unknown" number of blocks working. I need to create "blocks on the fly", example: append/only test rejoin ["block1_"A ": copy []"] do last test will allow me to make blocks for any value of "A" but: at some point i would like to append stuff to one of these blocks, at that stage i know A (example: A: 12), and i need to: append block1_12 "some data" Question: how can i do append (join "block1_"A) "some data" """" perhaps someone can help me with this greetings, Hendrik-Jan Bosch
[REBOL] 'dynamic append' Re:(2)
hi Brett, it works great! thanks very very much! HJ
[REBOL] Outlines (was where are all the components?)
Hi Curt, at the moment the script is rather dirty and i am absolutely not satisfied with it, (neither the rebol part, nor the javascript/DHTML part) can you give me a few days? Parsing xml with rebol is easy if you want a quick and dirty job, but have not been able to get all the functionality i want . I just have the feeling that what i am doing with XML and rebol cannot be as easy in any other language, if you ask me why? i have no idea :-) Perhaps others on this list can share some of their ideas? BTW: two basic ingredients of the script can be found at: www.webreference.com and www.langreiter.com HJ At 07:14 PM 7/19/00 -0700, you wrote: i have an example of a rebol processing script at a temp server i use: http://131.211.29.218/cgi-bin/outlines.cgi That's pretty cool! Would it be possible for me to get a copy of your REBOL script? Curt
[REBOL] Outlines (was where are all the components?) Re:(2)
Hi Robert, nice communicating with you again, well, hoping i can explain it correctly: after getting the xml and cleaning it a bit,I have a recursive function which gets a block (one of the nested ones you get after parse-xml) and checks if it is either 1 of 4 types: - tag - attributes - value - block of children (there are no more 'basic' types if i am correct) for each type it gathers information (each type is a temporary block) if type is tag: -name, attributes, children/value (how many attributes or children, and which value) if type is attributes: which if type is value: what value if type is block of children: how many So far O.K. Now i want for each appropriate type it's immediate parent, if it has more elements on the same level and how many (all with same immediate parent) Also i want to remember how many elements on the former level have been passed, and how many are still to come etc etc... let me work on it for a day or so, and i will paste the code here.. the example i have shown on my temp. server (IE only i am afraid: http://131.211.29.218 ) was very very easy, but the script i want should make it even easier (once i have all that information) HJ
[REBOL] where are all the components? Re:(7)
yes i did mention it to him, he even mentioned it in his daily writings at www.scripting.com his outliner XML idea is rather powerfull :-) although i have found it not easy (at first) to parse and manipulate it with rebol HJ
[REBOL] Apache and CGI Re:
michael: it took me 3 minutes (have not checked any security holes, wouldn't know hot to do so..-- saves time) Have no idea if it is normal, but: place files with .cgi extension and #!d:/rebol/rebol.exe -cs -c rebol [] print "Content-Type: text/html^/" print . html stuff do rebol stuff in CGI-BIN directory, and for me it works, no HTTPD.conf changed HJ
[REBOL] CGI and XML Re:(3)
cgi is not that easy to debug (this i read somewhere in the archive) to prevent the printing of the XML version is not a problem anymore, however, some functions i use in my cgi script will send some result to my console, and now also to my browser example: a: probe make lit-word! "b" 'b == 'b 'b will be shown in my browser, could anyone on the list help me out please? Hendrik-Jan Bosch
[REBOL] An experiment with RTF Re:(2)
There are a few very good applications especially for people who believe in just what you said (content/seperation, writing content for the web instead of writing HTML for the web) if you want, i can dig up the appropriate url's, but these might be worth checking out: - http://www.editthispage.com - http://www.pyra.com - http://www.trellix.com consistent styles through templates are the basis for these three applications. As for Rebol, have a look at blogger, the product from pyra.com. No Rebol there, but wouldn't it be nice (just dreaming away) hendrik-jan PS: these three examples are based upon the idea/concept of maintaining weblogs, i.e. rapid/frequent updates of content with no continuous thought about the presentation The situation I have is that I'm going to do up a web-site for my sister's company. I want to be able to implement a consistent style for the site and yet have my sister or her staff do the updates. Since they are not familiar with Web pages (and I don't think they should have to be), I was looking for some sort of automated process. I've done a lot of research on the web and I haven't seen a simple effective solution to this problem - the grail of content + presentation.
[REBOL] tcp-stream
dear rebels, i would like to try and get the following working: 1) establish a connection with a server 2) send requests to the server and 3) parse whenever i receive some data problem is, the server send XML i have been playing with %little-bell.r which does at least part of what i want does anyone have a good pointer for me, or is just willing to lend a helping hand greetings, Hendrik-Jan Bosch
[REBOL] web apps
a few months ago someone asked for a spell checker, just found http://www.spellchecker.net - using a javascript file and a script (perl). would rebol be an interesting choice for this task? quote The sproxy.cgi script file is used to return the data corrected by SpellChecker to the text-box on your web page. -Perl script - use the file "sproxy_pl.zip" for all platforms where is installed perl interpreter (all UNIX systems, win32 with ActivePerl). -Binary executable - use the file "sproxy_win32.zip" for win32 x86 platforms when you have not installed perl interpreter. /quote Another interesting webapp is located at http://www.spyonit.com again, rebol might be an interesting choice here. Rebol being an Internet Messaging Language, spyonit's features are doing just that.. a notification of a change somewhere on the net using a variety of methods (e.g. pager, AOL IM, ICQ, other messengers, Email, webphone etc BTW, i have no affiliation whatsoever with these two examples. greetings, Hendrik-Jan Bosch
[REBOL] XML - node/parent?
Dear rebols, I have asked a few questions about XML/REBOL before, but alas, i have another one: after parsing an XML-file, probe node ["access_status" none [" "]] == ["access_status" none [" "]] In the case of the XML file I used, this "access_status" is the last 'node' of the file. Interesting i can access it using node, but i can understand there is more to this: documentation about this is nonexistant, could someone help me out with this??? There are other words which are given values after parsing, but what can i do with them? (probe data, probe temp etc.?) Hendrik-Jan
[REBOL] AW: group projects Re:(4)
if i understood it correctly: http://cache.intersys.com/homepage.html is the URL for the possible solution of one of your problems (am now looking for my bookmarks concerning E-mail updatable web-pages, i know i have some) At 12:11 PM 6/5/00 -0500, you wrote: Where can I find more info on this? Your last point could be solved by the Cachè-Database which already uses objects for storing information. They call it postrelational database or multidimensional database.
[REBOL] How does Rebol earn it's stripes? Re:
brett: will tell you about a rebol experience i had today. For me it illustrated the extreme simplicity of rebol: i asked a question concerning XML parsing, received an example (thanks martin!) looked at it for a minute, and within 5 minutes i had a first version of something i wanted to do a long time, but did not want to make in python/perl: maybe this is not a direct answer to your question, but to my knowledge, no scripting language makes it this easy (btw, getting it in rebol/view will take as long as it takes to write this e-mail) hendrik-jan - REBOL [ Title: "Moreover XML feed parser" File: %moreover.r Author: "Martin Johannesson" Email: [EMAIL PROTECTED] Date: 30-May-2000 Purpose: { Parse XML news feeds from Moreover, script modified by HJ Bosch ([EMAIL PROTECTED]). } ] ;;; All the Moreover XML feeds are listed here: ;;; http://w.moreover.com/categories/category_list_xml.html ;;; ;;; I'm reading the Linux news feed in this script. feed-url: http://p.moreover.com/cgi-local/page?index_linux+xml ;;; Store articles in this block after parsing. articles: [] ;;; Read XML text from feed. print "Reading XML feed" xml-data: read feed-url f: open/new %moreover.html append f {htmlheadSTYLE TYPE="text/css"table.tablefeed {border-width:thin; border-style:solid;border-color:black;color: } td.headline_text { border-width:thin; border-style:solid;border-color:black;color: black; font-weight: bold;}/style/headbodyTABLE class=tablefeed} ;;; Parse XML data. parse-tree: parse-xml xml-data ;;; The Moreover DTD is not very complicated. ;;; It's easy to traverse the parse tree. handle-moreovernews: func [ tag /local article ][ foreach article-tag tag/3 [ if block? article-tag [ article: compose ["id" (select article-tag/2 "id")] foreach field-tag article-tag/3 [ if block? field-tag [ append article reduce [ field-tag/1 trim/lines field-tag/3/1 ] ] ] append/only articles article ] ] ] handle-moreovernews parse-tree/3/1 ;;; Print all headlines foreach article articles [ source: select article "source" headline_text: select article "headline_text" document_url: select article "document_url" url: rejoin [{a href="} document_url {"} headline_text {/ABR}] test: rejoin [ {TRTD class=headline_text} source {/TDTD} url {/TD/TR} ] append f test ] append f "/table/body/html^/" close f quit -