AltME groups: search
Help · search scripts · search articles · search mailing listresults summary
world | hits |
r4wp | 443 |
r3wp | 4402 |
total: | 4845 |
results window for this page: [start: 801 end: 900]
world-name: r3wp
Group: RAMBO ... The REBOL bug and enhancement database [web-public] | ||
Volker: 8-Jan-2005 | execve("../rebol2558042", ["../rebol2558042"], [/* 18 vars */]) = 0 uname({sys="Linux", node="dino.local", ...}) = 0 brk(0) = 0x809b000 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 7 fstat64(7, {st_mode=S_IFREG|0644, st_size=51977, ...}) = 0 old_mmap(NULL, 51977, PROT_READ, MAP_PRIVATE, 7, 0) = 0x40018000 close(7) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/tls/libm.so.6", O_RDONLY) = 7 read(7, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\2405\0"..., 512) = 512 fstat64(7, {st_mode=S_IFREG|0644, st_size=141236, ...}) = 0 old_mmap(NULL, 139712, PROT_READ|PROT_EXEC, MAP_PRIVATE, 7, 0) = 0x40025000 old_mmap(0x40047000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 7, 0x22000) = 0x40047000 close(7) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/tls/libc.so.6", O_RDONLY) = 7 read(7, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200X\1"..., 512) = 512 fstat64(7, {st_mode=S_IFREG|0644, st_size=1270908, ...}) = 0 old_mmap(NULL, 1281292, PROT_READ|PROT_EXEC, MAP_PRIVATE, 7, 0) = 0x40048000 old_mmap(0x40176000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 7, 0x12d000) = 0x40176000 old_mmap(0x4017f000, 7436, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4017f000 close(7) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40181000 set_thread_area({entry_number:-1 -> 6, base_addr:0x401812a0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 munmap(0x40018000, 51977) = 0 rt_sigaction(SIGCONT, {0x804b6c4, [CONT], SA_RESTART}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGTSTP, {0x804b67c, [TSTP], SA_RESTART}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGINT, {0x804b700, [INT], SA_RESTART}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGTERM, {0x804b700, [TERM], SA_RESTART}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGHUP, {0x804b700, [HUP], SA_RESTART}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGCHLD, {0x804b718, [CHLD], SA_RESTART}, {SIG_DFL}, 8) = 0 socketpair(PF_UNIX, SOCK_DGRAM, 0, [7, 8]) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x401812e8) = 21686 close(8) = 0 brk(0) = 0x809b000 brk(0x80be000) = 0x80be000 brk(0) = 0x80be000 brk(0) = 0x80be000 brk(0x80eb000) = 0x80eb000 brk(0) = 0x80eb000 brk(0x810c000) = 0x810c000 ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, TCSETSW, {B38400 opost isig -icanon -echo ...}) = 0 open("/etc/termcap", O_RDONLY) = -1 ENOENT (No such file or directory) write(1, "R", 1) = 1 | |
Volker: 8-Jan-2005 | stat64("/home/volker/d/t/rebol.r", 0xbffff11c) = -1 ENOENT (No such file or directory) stat64("/home/volker/rebol.r", 0xbffff11c) = -1 ENOENT (No such file or directory) stat64("/home/volker/d/t/user.r", 0xbffff11c) = -1 ENOENT (No such file or directory) stat64("/home/volker/user.r", {st_mode=S_IFREG|0644, st_size=3086, ...}) = 0 time([1105173013]) = 1105173013 open("/home/volker/user.r", O_RDONLY) = 8 fstat64(8, {st_mode=S_IFREG|0644, st_size=3086, ...}) = 0 time([1105173013]) = 1105173013 read(8, "REBOL [\n Title: \"%~/user.r\" \n"..., 3086) = 3086 close(8) = 0 | |
Gabriele: 8-Jan-2005 | Note the: open("/etc/termcap", O_RDONLY) = -1 ENOENT (No such file or directory) | |
Romano: 29-Jan-2005 | the rebol parser could be more relaxed (what it is not an integer, an url, a file and so on) must be a word!, but so you will never see an error! for invalid integer! invalid url! and so on, and the parser would be also more slow | |
Oldes: 9-Feb-2005 | so the file may look like %localhost_atport_88/test.php_query_id=100 | |
Romano: 9-Feb-2005 | for example here: %file or here: %e./ | |
Romano: 9-Feb-2005 | rebol[ Author: "Romano Paolo Tenca" Date: 10/02/2005 ] split-path-3: func [ "Splits a file or URL pos. Returns a block containing path and target." target [file! url!] /local dir pos ][ parse/all target [ [#"/" | 1 2 #"." opt #"/"] end (dir: dirize target) | pos: any [thru #"/" [end | pos:]] ( all [empty? dir: copy/part target at target index? pos dir: %./] all [find [%. %..] pos: to file! pos insert tail pos #"/"] ) ] reduce [dir pos] ] | |
PeterWood: 11-Feb-2005 | There is a file rebol.r in the directory where rebol0301.exe | |
Anton: 11-Feb-2005 | Just the one file, trust me :) | |
Anton: 11-Feb-2005 | The bug is shown for any file, not just rebol.r | |
Anton: 11-Feb-2005 | I think so. Bad timezone found by QUERY (as used by INFO?). Replacement is to use GET-MODES file 'modification date. | |
Anton: 11-Feb-2005 | oops, that should be GET-MODES file 'modification-date, but Sunanda's answer is more relevant.. | |
Allen: 18-Feb-2005 | it might help with file paths, but what about object paths? How should a typo like system/view/ be handled? or face/text/ ? | |
Anton: 22-Feb-2005 | DIR? - This function, useful as it is, is confusing, because it is not obvious that it goes to the filesystem or network to check. Perhaps it should be called EXISTS-DIR? I also feel the lack of a function just to see if a file or url ends with a slash. If you work with the filesystem at all you quickly find yourself checking for final slashes all the time. Here is my latest way of detecting that: #"/" = pick tail file -1 That sure is ugly to put into code all the time, and I keep wishing this is what DIR? would do. I understand that there is probably a huge body of code that would be adversely affected by this renaming, so I am looking for a nice short name. So far I thought of DIR-SPEC? (ie. "does this file have the specification of a dir ?") but.... | |
Romano: 22-Feb-2005 | Anton, that are the results of standard split-path that i replicated.The only difference is in %"" which gives an error on split-path and that result on split-path-3. I have some problems on how path are splitted by split-path in some cases, but to change them is a problematic thing, because all handlers knows how split-path works and get their decisions on it. I am not sure that the better result is [%./ none] in the %"" example, because the starting path (%"") is a file of name "" like in the %"a" example, where the starting path is a file of name "a". In the other 2 examples (%/ %.) the starting path is a DIR not a file (and the file is "exactly" none). | |
Volker: 22-Feb-2005 | #"/" = last file ; somehat shorter. | |
Anton: 24-Feb-2005 | In #3639, Oldes asks for a request-dir, same as request-file. I've always wanted these to be implemented in rebol. So I created my own, based on scroll-table. | |
Romano: 27-Feb-2005 | Also if i always thought that this file/url paths are a little strange. | |
Group: Script Library ... REBOL.org: Script library and Mailing list archive [web-public] | ||
Janko: 29-Dec-2009 | Basically I am writing to ask something ... I am newbie at writing rebol bindings. This binding if it works it works but if almost anything goes wrong it simply crashes. For example missing some file, not going into TEXT mode , not oppening closing something, page reference insted of pdf doc reference given to some function in binding .. pdf that we intend to write being locked (alredy open in acrobat)... ETC ... I intend to write this robust now, so I am asking how is this usually done? I can check for preconditions before talking to binding at runtime in rebol. Another (better) option is that binding shouldn't just crash for anything that goes wrong. I saw in docs something about error messages as return, so maybe I am doing something wrong in the first place , for example not implementing or setting up some callback for errors... Anyone more experienced than me? Rebol Haru could be quite capable otherwise, it supports all things that are really messy to do in PDF (encodings, embedding fonts, images, encryption, graphics, ...). One thing is that I can check for these preconditions at runtime, | |
WuJian: 17-Jan-2010 | Is there any way to produce a single animated .gif file from ten frame files? This script http://www.rebol.org/view-script.r?script=animated-gif.r runs animation in the gui. Can it be saved into a gif file? | |
Anton: 22-Jul-2010 | Sunanda, how did you change the simetrics matching? (I noticed there were several algorithms in the simetrics.r file, so I suppose you selected a better one.) | |
Sunanda: 20-Oct-2010 | We've had all sorts of fun trying to get the line endings to work for everyone. There's a magic, undocumented URL parameter you can add to the URL that might make a difference on your platform. It is MODE=???? I'll just cut'n'paste the comment from the download-a-script source... it may help explain it: ;; mode=windows -- the default. Makes LF or CR into CRLF ;; mode=binary -- sends file as binary ;; mode=carl -- saved and reloads file first as Carl thought ;; this would fix the problem ;; mode=text -- the old default. Works in most cases. Just ;; prints the file (so sends whatever line ;; terminations work on the platform the library ;; is running on. | |
Sunanda: 2-Feb-2011 | Okay....that's a problem.....the downloader does not pace itself, so it triggers flood protection. Best current work-around is to download the whole set as one file -- probably faster too: http://www.rebol.org/download-librarian.r Let me take you off the flood trigger list first..... | |
Group: Parse ... Discussion of PARSE dialect [web-public] | ||
Brock: 30-Jan-2005 | Save the following data out to a file (I used territory.txt)... | |
Brock: 30-Jan-2005 | I read the file in using... | |
Chris: 30-Jan-2005 | It may be a recurrence of a problem parsing " at the beginning of a line -- doesn't seem to be a problem on the beta that I have open (1.2.54). As an alternative, you could always read/lines, or simply load the file... | |
Tomc: 30-Jan-2005 | note: block: parse/all read file newline could as well be written block read/lines file to side step the issue | |
Graham: 30-Jan-2005 | and what do you do if the text is not a file ? Write your own parse rule. | |
MichaelAppelmans: 9-Jun-2005 | newby here: can anyone direct me to a sample of code which matches a pattern over multiple text lines? I need to process a 5MB text file and remove all patterns of multiple consecutive email address es eg. [foo-:-my-:-com]; [foou-:-you-:-net] except the multiple email address string spans mulitple lines. Thanks for any pointers | |
Pekr: 22-Jun-2005 | I have CSV file and I have trouble using parse one-liner. The case is, that I export tel. list from Lotus Notes, then I save it in Excel into .csv for rebol to run thru. I wanted to use: foreach line ln-tel-list [append result parse/all line ";"] ... and I expected all lines having 7 elements. However - once last column is missing, that row is incorrect, as rebol parse will not add empty "" at the end. That is imo a bug ... | |
Group: SDK ... [web-public] | ||
DideC: 23-Feb-2005 | Question: the SDK license require to not let the program interpret Rebol code ! If the program load a config file (with 'construct) does it go against the license or not ? | |
Graham: 22-Mar-2005 | I found that under win32, set-modes file [ modication-date: date ] works in the betas, but not in the latest sdk. Can anyone else confirm this? | |
Geomol: 9-Aug-2005 | I have a problem, if I in a DOS-prompt under windows try to run a REBOL program built with REBOL/SDK into a .exe file, and the program is not in current directory, but has to be found along the PATH. I get the error Program error: invalid encapsulated data I've tried under Windows2000 and WinXP. Can others confirm this error? (Just make a simple REBOL-script with e.g. a print and try it.) | |
Geomol: 10-Aug-2005 | It works, if you place yourself in the same directory as the .exe file and don't give full path. It also works, if you place yourself anywhere and give full or relative path. As I see it, the error is only, if you're not in the same directory as the .exe file, and the system finds it along the PATH environment variable. Maybe I should report it in RAMBO!? | |
Benjamin: 10-Oct-2005 | unsiged integers can safely be casted to integers, you sould know that some dll's wont work just because the need special arguments like pointers to certain data etc... nay whay why do you need to write a file using windows API can't you use rebol ? | |
Gabriele: 1-Nov-2005 | if you're just distributing a script to friends, then what about just a zip file with view, the script, and a windows link that starts view with the script? | |
Henrik: 1-Nov-2005 | so you link to an exe file within the zip file? is it not necessary to unpack the zip file? | |
Volker: 1-Dec-2005 | In the case of #do the result of the expression will be placed in the output file. For example: version: #do [1.2.3 + 0.0.1] will create the output: version: 1.2.4 | |
Volker: 1-Dec-2005 | The #if and #either commands will put the results of their blocks into the output file. For example: version: #if [new-version] [2.3.4] [1.2.3] will result in: version: 2.3.4 | |
Group: !RebGUI ... A lightweight alternative to VID [web-public] | ||
shadwolf: 30-Apr-2005 | same file | |
shadwolf: 1-May-2005 | same file on my ftp ;) | |
shadwolf: 1-May-2005 | same file ;) | |
Group: !Uniserve ... Creating Uniserve processes [web-public] | ||
Graham: 5-Mar-2005 | put this corrected file into your services directory as smtpd.r | |
DideC: 9-Mar-2005 | Rebol [ title: "example of starter script that act the same with View after encap" ] #include %/e/rebol/sdk/source/mezz.r #include %/e/rebol/sdk/source/prot.r #include %/e/rebol/sdk/source/view.r ;***** This is the function that make the tricks #include %uniserve/libs/encap-fs.r if not value? 'encap-fs [do %uniserve/libs/encap-fs.r] set-cache [ %uniserve/uni-engine.r [#include %uniserve/uni-engine.r] %uniserve/libs/headers.r [#include %uniserve/libs/headers.r] %libs/log.r [#include %uniserve/libs/log.r] %uniserve/protocols/HTTP.r [#include %uniserve/protocols/HTTP.r] %your-file.r [#include %path/to/your-file.r] ;... ] ;***** Start do-cache %uniserve/uni-engine.r do-cache %uniserve/libs/headers.r UniServe-path: %./uniserve/ logger/level: none ;***** You have to load protocols and services before starting Uniserve do-cache %uniserve/protocols/HTTP.r ;***** Uniserve Initialise ; Require like this to not loading protocols/services from disk uniserve/boot/no-loop/with [] ;***** Your script initialise ;... | |
DideC: 9-Mar-2005 | encap-fs: context [ cache: path: none root: system/script/path get-cache: func [file][ path: parse file "/" remove-each dir path [dir = ".."] file: to-file path either file [ either file: select cache file [file][load file] ][ make error! join "Cannot access : " file ] ] set 'encap? to-logic select system/components 'decap either encap? [ set 'set-cache func [list [block!] /local bin file][ cache: list ;cache: make block! 16 ;parse list [ ; some [ ; (bin: no) opt ['binary (bin: yes)] ; set file file! ( ; repend cache [ ; file ; either bin [read/binary file][read file] ; ] ; ) ; ] ;] ] set 'do-cache func [file [file!]][do get-cache file] set 'load-cache func [file [file!]][load first get-cache file] set 'read-cache func [file [file!]][] ][ set-cache: none do-cache: :do load-cache: :load read-cache: :read ] ] | |
Dockimbel: 17-Mar-2005 | This might be useful to a lot of non-techie users. (Just a single exe file with a minimal form for login/pass). | |
Graham: 17-May-2005 | but when you stream a file that is encrypted, the file length is now changed | |
Graham: 17-May-2005 | if you encrypt the whole file at the start, it defeats the point of streaming which is to save cpu | |
Graham: 31-Aug-2005 | Open/skip will be very helpful to allow file resume in Cheyenne. | |
Terry: 4-Feb-2006 | Still have this context issue though.. goes like this.. If I have a service, and in that service i have a "on-received' event.. and I put a function within that event (aka, in the on-received function itself.. then it works fine.. but if I try to add the same function to an external file, so that, when I trigger the on-received function, it does a DO to the external file, that function now DOESN'T work? Some kind of context issue, and how do you work around it? If i have a 1000 pieces of code that needs to be processed with each event, do i need to bury the whole thing in the service? | |
Terry: 4-Feb-2006 | And if I LOAD the external file, you would think it would bind it all globally, but it doesn't? | |
Terry: 4-Feb-2006 | Again, this is a service.. on-received: func [data][ raw-input: copy to-string data if raw-input = "test" [print "works"] ] But if I put the if raw-input = "test" [print "works"] line in a seperate file.. ie process.r ,and do it like this.. on-received: func [data][ raw-input: copy to-string data do %./process.r ] It doesn't work.. In fact, it seems difficult to put global functions that are truly global, anywhere. | |
Terry: 5-Feb-2006 | Here's an example.. prototype ( a javascript framework uses prototype.js and that file uses includes to add other JS files.. like this.. <%= include 'ajax.js', 'dom.js', 'form.js', 'event.js', 'position.js' %> the problem seems to be here somewhere? | |
Group: SVG Renderer ... SVG rendering in Draw AGG [web-public] | ||
shadwolf: 23-Jun-2005 | REBOL [ Title: "SVG Demo" Owner: "Ashley G. Trüter" Version: 0.0.1 Date: 21-Jun-2005 Purpose: "Loads and displays a resizeable SVG file." History: { 0.0.1 Initial release } Notes: { Tested on very simple SVG icons Only a few basic styles / attributes / commands supported Does not handle sizes in units other than pixels (e.g. pt, in, cm, mm, etc) SVG path has an optional close command, "z" ... AGG shape equivalent auto-closes load-svg function needs to be totally refactored / optimized ... *sample only* } ] ; The following commands are available for path data: ; ; M = moveto ; L = lineto ; H = horizontal lineto ; V = vertical lineto ; C = curveto ; S = smooth curveto ; Q = quadratic Belzier curve ; T = smooth quadratic Belzier curveto ; A = elliptical Arc ; Z = closepath ;print: none ; comment out this line to enable debug messages load-svg: function [svg-file [file! string!] size [pair!]] [ id defs x y to-color to-byte draw-blk append-style svg-size scale-x scale-y ][ xml: either string? svg-file [parse-xml svg-file] [ unless %.svg = suffix? svg-file [to error! "File has an invalid suffix!"] parse-xml read svg-file ] unless xml/3/1/1 = "svg" [to error! "Could not find SVG header!"] ;unless find ["id" "xmlns"] xml/3/1/2/1 [to error! "Could not find ID header!"] ;unless xml/3/1/3/1/1 = "defs" [to error! "Could not find DEFS header!"] id: xml/3/1/2 defs: xml/3/1/3 ; ; --- Parse SVG id ; svg-size: either find ["32pt" "48pt" "72pt"] select id "width" [ switch select id "width" [ "72pt" [120x120] "48pt" [80x80] "32pt" [60x60] ] ][ as-pair to integer! any [select id "width" "100"] to integer! any [select id "height" "100"] ] x: to integer! any [select id "x" "0"] y: to integer! any [select id "y" "0"] scale-x: size/x / svg-size/x scale-y: size/y / svg-size/y ; ; --- Helper functions ; to-color: func [s [string!]] [ ; converts a string in the form "#FFFFFF" to a 4-byte tuple to tuple! load rejoin ["#{" next s "00}"] ] to-byte: func [s [string!]] [ ; converts a string with a value 0-1 to an inverted byte 255 - to integer! 255 * to decimal! s ] ; ; --- Parse SVG defs ; draw-blk: copy [] append-style: function [ command [string!] blk [block!] ][ x xy pen-color fill-color line-width mode size radius shape closed? matrix transf-command ][ xy: 0x0 size: 0x0 line-width: 1 matrice: make block! [] radius: none transf-command: none foreach [attr val] blk [ switch attr [ "transform" [print "tranform have been found" ;probe val halt val: parse val "()," transf-command: first val probe transf-command switch transf-command [ "matrix" [ foreach word val [ if not find word "matrix" [ insert tail matrice to-decimal word ] ] ] ] ] "style" [ foreach [attr val] parse val ":;" [ switch/default attr [ "font-size" [ ] "stroke" [ switch/default first val [ #"#" [pen-color: to-color val] #"n" [pen-color: none] ][ print ["Unknown stroke:" val] ] ] "stroke-width" [line-width: to decimal! val] "fill" [ fill-color: switch/default first val [ #"#" [to-color val] #"n" [none] ][ print ["Unknown fill value:" val] none ] ] "fill-rule" [ mode: switch/default val [ "evenodd" ['even-odd] ][ print ["Unknown fill-rule value:" val] none ] ] "stroke-opacity" [pen-color: any [pen-color 0.0.0.0] pen-color/4: to-byte val] "fill-opacity" [fill-color: any [fill-color 0.0.0.0] fill-color/4: to-byte val] "stroke-linejoin" [ insert tail draw-blk switch/default val [ "miter" [compose [line-join miter]] "round" [compose [line-join round]] "bevel" [compose [line-join bevel]] ][ print ["Unknown stroke-linejoin value:" val] none ] ] "stroke-linecap" [ insert tail draw-blk 'line-cap insert tail draw-blk to word! val ] ][ print ["Unknown style:" attr] ] ] ] "x" [xy/x: scale-x * val] "y" [xy/y: scale-y * val] "width" [size/x: scale-x * val] "height" [size/y: scale-y * val] "rx" [print "rx"] "ry" [radius: to decimal! val] "d" [ shape: copy [] x: none closed?: false foreach token load val [ switch/default token [ M [insert tail shape 'move] C [insert tail shape 'curve] L [insert tail shape 'line] z [closed?: true] ][ unless number? token [print ["Unknown path command:" token]] either x [insert tail shape as-pair x scale-y * token x: none] [x: scale-x * token] ] ] ] ] ] insert tail draw-blk compose [ pen (pen-color) fill-pen (fill-color) fill-rule (mode) line-width (line-width * min scale-x scale-y) ] switch command [ "rect" [ insert tail draw-blk compose [box (xy) (xy + size)] if radius [insert tail draw-blk radius] ] "path" [ unless closed? [print "Path closed"] either transf-command <> none [ switch transf-command [ "matrix" [insert tail draw-blk compose/only [ (to-word transf-command) (matrice) shape (shape) reset-matrix]] ] ][ insert tail draw-blk compose/only [shape (shape)] ] ] "g" [ print "Write here how to handle G insertion to Draw block" insert tail draw-blk probe compose/only [reset-matrix (to-word transf-command) (matrice)] ] ] ] probe defs foreach blk defs [ switch first blk [ "rect" [append-style first blk second blk] "path" [append-style first blk second blk] "g" [ print "key word" probe first blk print "matrix and style in G" probe second blk append-style first blk second blk ;print "what to draw in G" probe third blk foreach blk2 third blk [ probe blk2 switch first blk2[ "path" [append-style first blk2 second blk2] ] ] ] ] ] probe draw-blk draw-blk ] view make face [ offset: 100x100 size: 200x200 action: request-file/filter/only "*.svg" text: rejoin ["SVG Demo [" last split-path action "]"] data: read action color: white effect: compose/only [draw (load-svg data size)] edge: font: para: none feel: make feel [ detect: func [face event] [ if event/type = 'resize [ insert clear face/effect/draw load-svg face/data face/size show face ] if event/type = 'close [quit] ] ] options: [resize] ] | |
shadwolf: 23-Jun-2005 | AS reference take the file blender.svg from svg-demo.zip package maide by ashley | |
shadwolf: 23-Jun-2005 | REBOL [ Title: "SVG Demo" Owner: "Ashley G. Trüter" Version: 0.0.1 Date: 21-Jun-2005 Purpose: "Loads and displays a resizeable SVG file." History: { 0.0.1 Initial release } Notes: { Tested on very simple SVG icons Only a few basic styles / attributes / commands supported Does not handle sizes in units other than pixels (e.g. pt, in, cm, mm, etc) SVG path has an optional close command, "z" ... AGG shape equivalent auto-closes load-svg function needs to be totally refactored / optimized ... *sample only* } ] ; The following commands are available for path data: ; ; M = moveto ; L = lineto ; H = horizontal lineto ; V = vertical lineto ; C = curveto ; S = smooth curveto ; Q = quadratic Belzier curve ; T = smooth quadratic Belzier curveto ; A = elliptical Arc ; Z = closepath ;print: none ; comment out this line to enable debug messages load-svg: function [svg-file [file! string!] size [pair!]] [ id defs x y to-color to-byte draw-blk append-style svg-size scale-x scale-y ][ xml: either string? svg-file [parse-xml svg-file] [ unless %.svg = suffix? svg-file [to error! "File has an invalid suffix!"] parse-xml read svg-file ] unless xml/3/1/1 = "svg" [to error! "Could not find SVG header!"] ;unless find ["id" "xmlns"] xml/3/1/2/1 [to error! "Could not find ID header!"] ;unless xml/3/1/3/1/1 = "defs" [to error! "Could not find DEFS header!"] id: xml/3/1/2 defs: xml/3/1/3 ; ; --- Parse SVG id ; svg-size: either find ["32pt" "48pt" "72pt"] select id "width" [ switch select id "width" [ "72pt" [120x120] "48pt" [80x80] "32pt" [60x60] ] ][ as-pair to integer! any [select id "width" "100"] to integer! any [select id "height" "100"] ] x: to integer! any [select id "x" "0"] y: to integer! any [select id "y" "0"] scale-x: size/x / svg-size/x scale-y: size/y / svg-size/y ; ; --- Helper functions ; to-color: func [s [string!]] [ ; converts a string in the form "#FFFFFF" to a 4-byte tuple to tuple! load rejoin ["#{" next s "00}"] ] to-byte: func [s [string!]] [ ; converts a string with a value 0-1 to an inverted byte 255 - to integer! 255 * to decimal! s ] ; ; --- Parse SVG defs ; draw-blk: copy [] append-style: function [ command [string!] blk [block!] ][ x xy pen-color fill-color line-width mode size radius shape closed? matrix transf-command ][ xy: 0x0 size: 0x0 line-width: 1 matrice: make block! [] radius: none transf-command: none foreach [attr val] blk [ switch attr [ "transform" [print "tranform have been found" ;probe val halt val: parse val "()," transf-command: first val probe transf-command switch transf-command [ "matrix" [ foreach word val [ if not find word "matrix" [ insert tail matrice to-decimal word ] ] ] ] ] "style" [ foreach [attr val] parse val ":;" [ switch/default attr [ "font-size" [ ] "stroke" [ switch/default first val [ #"#" [pen-color: to-color val] #"n" [pen-color: none] ][ print ["Unknown stroke:" val] ] ] "stroke-width" [line-width: to decimal! val] "fill" [ fill-color: switch/default first val [ #"#" [to-color val] #"n" [none] ][ print ["Unknown fill value:" val] none ] ] "fill-rule" [ mode: switch/default val [ "evenodd" ['even-odd] ][ print ["Unknown fill-rule value:" val] none ] ] "stroke-opacity" [pen-color: any [pen-color 0.0.0.0] pen-color/4: to-byte val] "fill-opacity" [fill-color: any [fill-color 0.0.0.0] fill-color/4: to-byte val] "stroke-linejoin" [ insert tail draw-blk switch/default val [ "miter" [compose [line-join miter]] "round" [compose [line-join round]] "bevel" [compose [line-join bevel]] ][ print ["Unknown stroke-linejoin value:" val] none ] ] "stroke-linecap" [ insert tail draw-blk 'line-cap insert tail draw-blk to word! val ] ][ print ["Unknown style:" attr] ] ] ] "x" [xy/x: scale-x * val] "y" [xy/y: scale-y * val] "width" [size/x: scale-x * val] "height" [size/y: scale-y * val] "rx" [print "rx"] "ry" [radius: to decimal! val] "d" [ shape: copy [] x: none closed?: false foreach token load val [ switch/default token [ M [insert tail shape 'move] C [insert tail shape 'curve] S [insert tail shape 'curv] L [insert tail shape 'line] Q [insert tail shape 'qcurve] T [insert tail shape 'qcurv] z [closed?: true] H [insert tail shape 'hline] V [insert tail shape 'vline] A [insert tail shape 'arc] ][ unless number? token [print ["Unknown path command:" token]] either x [insert tail shape as-pair x scale-y * token x: none] [x: scale-x * token] ] ] ] ] ] insert tail draw-blk compose [ pen (pen-color) fill-pen (fill-color) fill-rule (mode) line-width (line-width * min scale-x scale-y) ] switch command [ "rect" [ insert tail draw-blk compose [box (xy) (xy + size)] if radius [insert tail draw-blk radius] ] "path" [ unless closed? [print "Path closed"] either transf-command <> none [ switch transf-command [ "matrix" [insert tail draw-blk compose/only [ (to-word transf-command) (matrice) shape (shape) reset-matrix]] ] ][ insert tail draw-blk compose/only [shape (shape)] ] ] "g" [ print "Write here how to handle G insertion to Draw block" insert tail draw-blk probe compose/only [reset-matrix (to-word transf-command) (matrice)] ] ] ] probe defs foreach blk defs [ switch first blk [ "rect" [append-style first blk second blk] "path" [append-style first blk second blk] "g" [ print "key word" probe first blk print "matrix and style in G" probe second blk append-style first blk second blk ;print "what to draw in G" probe third blk foreach blk2 third blk [ probe blk2 switch first blk2[ "path" [append-style first blk2 second blk2] ] ] ] ] ] probe draw-blk draw-blk ] view make face [ offset: 100x100 size: 200x200 action: request-file/filter/only "*.svg" text: rejoin ["SVG Demo [" last split-path action "]"] data: read action color: white effect: compose/only [draw (load-svg data size)] edge: font: para: none feel: make feel [ detect: func [face event] [ if event/type = 'resize [ insert clear face/effect/draw load-svg face/data face/size show face ] if event/type = 'close [quit] ] ] options: [resize] ] | |
shadwolf: 23-Jun-2005 | REBOL [ Title: "SVG Demo" Owner: "Ashley G. Trüter" Version: 0.0.1 Date: 21-Jun-2005 Purpose: "Loads and displays a resizeable SVG file." History: { 0.0.1 Initial release } Notes: { Tested on very simple SVG icons Only a few basic styles / attributes / commands supported Does not handle sizes in units other than pixels (e.g. pt, in, cm, mm, etc) SVG path has an optional close command, "z" ... AGG shape equivalent auto-closes load-svg function needs to be totally refactored / optimized ... *sample only* } ] ; The following commands are available for path data: ; ; M = moveto ; L = lineto ; H = horizontal lineto ; V = vertical lineto ; C = curveto ; S = smooth curveto ; Q = quadratic Belzier curve ; T = smooth quadratic Belzier curveto ; A = elliptical Arc ; Z = closepath ;print: none ; comment out this line to enable debug messages load-svg: function [svg-file [file! string!] size [pair!]] [ id defs x y to-color to-byte draw-blk append-style svg-size scale-x scale-y ][ xml: either string? svg-file [parse-xml svg-file] [ unless %.svg = suffix? svg-file [to error! "File has an invalid suffix!"] parse-xml read svg-file ] unless xml/3/1/1 = "svg" [to error! "Could not find SVG header!"] ;unless find ["id" "xmlns"] xml/3/1/2/1 [to error! "Could not find ID header!"] ;unless xml/3/1/3/1/1 = "defs" [to error! "Could not find DEFS header!"] id: xml/3/1/2 defs: xml/3/1/3 ; ; --- Parse SVG id ; svg-size: either find ["32pt" "48pt" "72pt"] select id "width" [ switch select id "width" [ "72pt" [120x120] "48pt" [80x80] "32pt" [60x60] ] ][ as-pair to integer! any [select id "width" "100"] to integer! any [select id "height" "100"] ] x: to integer! any [select id "x" "0"] y: to integer! any [select id "y" "0"] scale-x: size/x / svg-size/x scale-y: size/y / svg-size/y ; ; --- Helper functions ; to-color: func [s [string!]] [ ; converts a string in the form "#FFFFFF" to a 4-byte tuple to tuple! load rejoin ["#{" next s "00}"] ] to-byte: func [s [string!]] [ ; converts a string with a value 0-1 to an inverted byte 255 - to integer! 255 * to decimal! s ] ; ; --- Parse SVG defs ; draw-blk: copy [] append-style: function [ command [string!] blk [block!] ][ x xy pen-color fill-color line-width mode size radius shape closed? matrix transf-command ][ xy: 0x0 size: 0x0 line-width: 1 matrice: make block! [] radius: none transf-command: none foreach [attr val] blk [ switch attr [ "transform" [print "tranform have been found" ;probe val halt val: parse val "()," transf-command: first val probe transf-command switch transf-command [ "matrix" [ foreach word val [ if not find word "matrix" [ insert tail matrice to-decimal word ] ] ] ] ] "style" [ foreach [attr val] parse val ":;" [ switch/default attr [ "font-size" [ ] "stroke" [ switch/default first val [ #"#" [pen-color: to-color val] #"n" [pen-color: none] ][ print ["Unknown stroke:" val] ] ] "stroke-width" [line-width: to decimal! val] "fill" [ fill-color: switch/default first val [ #"#" [to-color val] #"n" [none] ][ print ["Unknown fill value:" val] none ] ] "fill-rule" [ mode: switch/default val [ "evenodd" ['even-odd] ][ print ["Unknown fill-rule value:" val] none ] ] "stroke-opacity" [pen-color: any [pen-color 0.0.0.0] pen-color/4: to-byte val] "fill-opacity" [fill-color: any [fill-color 0.0.0.0] fill-color/4: to-byte val] "stroke-linejoin" [ insert tail draw-blk switch/default val [ "miter" [compose [line-join miter]] "round" [compose [line-join round]] "bevel" [compose [line-join bevel]] ][ print ["Unknown stroke-linejoin value:" val] none ] ] "stroke-linecap" [ insert tail draw-blk 'line-cap insert tail draw-blk to word! val ] ][ print ["Unknown style:" attr] ] ] ] "x" [xy/x: scale-x * val] "y" [xy/y: scale-y * val] "width" [size/x: scale-x * val] "height" [size/y: scale-y * val] "rx" [print "rx"] "ry" [radius: to decimal! val] "d" [ shape: copy [] x: none closed?: false if all [x not number? token] [ insert tail shape x * either token = 'V [scale-y][scale-x] x: none ] foreach token load val [ switch/default token [ M [insert tail shape 'move] C [insert tail shape 'curve] S [insert tail shape 'curv] L [insert tail shape 'line] Q [insert tail shape 'qcurve] T [insert tail shape 'qcurv] z [closed?: true] H [insert tail shape 'hline] V [insert tail shape 'vline] A [insert tail shape 'arc] ][ unless number? token [print ["Unknown path command:" token]] either x [insert tail shape as-pair x scale-y * token x: none] [x: scale-x * token] ] ] ] ] ] insert tail draw-blk compose [ pen (pen-color) fill-pen (fill-color) fill-rule (mode) line-width (line-width * min scale-x scale-y) ] switch command [ "rect" [ insert tail draw-blk compose [box (xy) (xy + size)] if radius [insert tail draw-blk radius] ] "path" [ unless closed? [print "Path closed"] either transf-command <> none [ switch transf-command [ "matrix" [insert tail draw-blk compose/only [ (to-word transf-command) (matrice) shape (shape) reset-matrix]] ] ][ insert tail draw-blk compose/only [shape (shape)] ] ] "g" [ print "Write here how to handle G insertion to Draw block" insert tail draw-blk probe compose/only [reset-matrix (to-word transf-command) (matrice)] ] ] ] probe defs foreach blk defs [ switch first blk [ "rect" [append-style first blk second blk] "path" [append-style first blk second blk] "g" [ print "key word" probe first blk print "matrix and style in G" probe second blk append-style first blk second blk ;print "what to draw in G" probe third blk foreach blk2 third blk [ probe blk2 switch first blk2[ "path" [append-style first blk2 second blk2] ] ] ] ] ] probe draw-blk draw-blk ] view make face [ offset: 100x100 size: 200x200 action: request-file/filter/only "*.svg" text: rejoin ["SVG Demo [" last split-path action "]"] data: read action color: white effect: compose/only [draw (load-svg data size)] edge: font: para: none feel: make feel [ detect: func [face event] [ if event/type = 'resize [ insert clear face/effect/draw load-svg face/data face/size show face ] if event/type = 'close [quit] ] ] options: [resize] ] | |
shadwolf: 23-Jun-2005 | I allways use as reference script for my work the blender.svg file provided in ashley's archive svg-demo.zip | |
shadwolf: 24-Jun-2005 | if you wants to write the "in" AGG/draw code that is based on my rebol linear gradient list there is the code and a sample file from InkScape | |
shadwolf: 30-Jun-2005 | in this file we have xml-to-object function load-svg function (mostly empty there is where to put the data conversion and draw block construction) and the widget that start the program | |
shadwolf: 2-Jul-2005 | hum xpdf.svg file shows me a problem with the use of xml-to-object ... if you have serveral g block at the same level all g block are compacted into the same reference | |
shadwolf: 2-Jul-2005 | so you have to remaining choice (3 in fact ) 1) using IE but then your not my pal any more, 2) installing Inkscape and relate it to svg file 3) help me finishing the SVG viewer using REBOL !!! ;)) | |
shadwolf: 2-Jul-2005 | I improve some more the rendering now the file gnome-keyboard-dev.svg is fully and perfectly rendererd. I put a red pen-fill color for identify all primitives that needs fill:url related gradient | |
shadwolf: 2-Jan-2006 | for me to be honnest the advantages of using SVG instead of images are a lot this is a quick list of my thoughts on what can be done with SVG format. - easier embeding of graphical content - resizing auto ith not grphics quality loss - cheap but sharp skining - graphical content of an User Interface very low because rebol is pretty able to work with compression of text content ( compress/decompress) A little sample to enlight this compressed SVG file with blender logo -> less than 500 octets (any size can be applyed with no graphic loss (aliasing, color loose, blur, pixelisation etc..) ) a fixed jped for same content will use around 50ko. This means less datas in memory to as graphic pixel tables are very heavy in VM memory - Dynamic graphical content. some thing like text scrolling or efffect like Flash ones but with a reduction of 1000 of the data and memory use SVG use a labeling system for each graphical content that compose the image we can provided a tiny system to handle easy animation and show/hide of graphical content using raw rebol commands -> this will make pretty easier the realisation of dynamic animations in rebol ViD content and as any REBOL/View face is DRaw/AGG capable the effects that we can create isn the futur with this idea will have no limits -> this means too to have a pretty fast and ell designed SVG engine (that's my actual path on research) | |
shadwolf: 3-Jan-2006 | Joe hum inkscape is not able to show this svgz file that's strange ... I will try to investigate why this happend ... | |
shadwolf: 24-Jan-2006 | surfing around on internet i found another common application for SVG -> graphs representation. The idea is inspired by a ruby project http://www.germane-software.com/software/SVG/SVG::Graph/#N10034. To do this in rebol we need teh ability to save data in an image PNG. The way we can use a thing like this could be to use a simple rebol draw based dialect to write the graphs if we are in REBOL/view application the graph is isealy shown if we need to show the graph in webrowser we can have 2 external sources SVG and PNG. For importing graphs from another application the SVG is the best way. So our REBOL::SVG::GRAPH would be able to import graphi content from a SVG file, output SVG and PNG files, render graphs to REBOL/view draw pane, propose a simple way to implement graphs using a rebol dialect. | |
Group: AJAX ... Web Development Using AJAX [web-public] | ||
Henrik: 11-Apr-2006 | it would be a plugin, but I'm not sure how much sense it makes other than a smaller DLL file | |
Will: 25-May-2007 | http://blog.kevinhoyt.org/2007/05/21/file-upload-with-apollo-and-javascript/ | |
Group: Syncing ... Syncing technologies [web-public] | ||
Pekr: 4-Jan-2006 | - the problem of IOS syncing is, that it can't work in sync-and-forget mode - simply put, once you delete your file locally, there is no simple solution of how to tell server, that it is still ok | |
Pekr: 4-Jan-2006 | rsync - file syncing protocol - http://samba.anu.edu.au/rsync | |
Pekr: 4-Jan-2006 | what is to be said the best file-sync for Mac - ChronoSync - http://www.econtechnologies.com | |
Pekr: 4-Jan-2006 | I would like to have answered: 1) what technique to use for "timestamping" - do we continue with timestamps against one central time, or do we use hashes, or sequencing numbers, or mixture of mentioned techniqueues? We might look how others do it ... 2) better support for possible conflicts - imagine following scenario - you have some reblet, e.g. Contacts - one person starts editing it, then another person starts editing it too. First one syncs (saves changes), then second one does the same - changes of first ones are lost. How to aproach this - introduce some kind of resources locking? (not real locking, but we are message based, so could be queued) It could work as follows - person 1 wants to edit some record. Edit button posts request-for-lock. Lock is assigned. I other person tries to edit, it will not obtain lock. We could even introduce protocol level support, so that the person is informed, who has the lock, and how long. The trouble usually comes, when person goes off-line after the edit started - we need to remove dead-locks, so by default, I would lock for 20 minutes e.g. and the lock would have to be renewed, if person 1 wants to work longer with the given document ... another scenario is, when you actually start editing something which might require locking, but you start already being off-line. We could create lock-request, just not synced yet. Once you go on-line, you simply check seqno, if the lock is possible, and the given record not modified. But what if it was modified in the meantime? e.g. you might be working with stock system and someone else in the office sells few units, for which you may start writing offer for to another customer. Tough scenario - would like to know your opinion. Maybe some things simply need to be done on-line only? 3) I needed small file-sync scenario - could use IOS, but IOS can't sync and "forget". Simply idea is to have different kind of syncing techniques, so e.g. for file transfer you have dir to sync, if correctly synced, log it, forget it, delete it on client and or server (or not, it depends) as for IOS, local storage could be encrypted (or not), imported into RebDB (no single better solution so far introduced for rebol), sync-per-record or record-set could remain (record=document). RebDB on Serve would speed things up significantly too ... another possibility is to think outside the IOS terms, in more general way - simply thinking about world of objects, being in various states, with various life-time around internet and on-line or off-line devices. I think that maybe we could find some simpler solution than SyncML and the likes ... another point - such techniques should be transport independent, so I would not like to hear that it needs this or that ;-) So, anyone? | |
Pekr: 4-Jan-2006 | yes, I might be, if I decide to go for the app ... I will post our company requirements in oportunities group, maybe today evening. Our company failed with big Sap system for file transfer. I wanted to create something upon which business could be based. I will not be selfish - I better publish what could be a good business imo, than doing nothing myself due to lack of free time or the lack of my coding knowledges ... | |
BrianH: 4-Jan-2006 | By "for comparison purposes", I mean don't change the file date, just subtract the diff between you and UTC to get the adjusted file date in memory and then compare against the adjusted file date from the server. | |
BrianH: 4-Jan-2006 | FAT also stores file dates in 2-second increments, so file times can adjust up to two seconds when copied between FAT and NTFS. File times in ZIP files have the same restriction because of ZIP's DOS origins. | |
Maxim: 21-Sep-2009 | using tortoise SVN, how can I checkout just a single file? here it complains about only wanting to checkout directories.... which is a bit dumb IMHO. note, this checkout occurs in a new checkout area, the directories on the repository aren't anywhere else. I just want to pick out one file from a repository and use just that elsewhere. | |
Group: Tech News ... Interesting technology [web-public] | ||
Pekr: 22-Mar-2006 | uf, so the only advantage of mozilla mail is now gone :-) they go ms outlook route - one big file, binary, what a route .... | |
Group: SQLite ... C library embeddable DB [web-public]. | ||
Pekr: 15-Feb-2006 | so, for me, sqlite is near ideal, I give it a big minus because of that, in my opinion, bad design decision .... well, although I can imagine that they need to control locking/transacitons on file level, so it is easier for them to work with one file only .... | |
Alek_K: 15-Feb-2006 | One file IMO is appreciated also in web programming - especially with small databases instead of flat-file. But - as You wrote - can be problematic at some level. | |
Alek_K: 15-Feb-2006 | (one file = easy to transfer, easy to backup, easy to update) | |
Pekr: 15-Feb-2006 | Antont - it can't be easier to fix, as it is a binary file .... I really like old unix mail format, which nowadays uses mozilla/netscape - plain text files - that is what I call easy to fix ... | |
Pekr: 15-Feb-2006 | even if some part of file gets corrupted, you might be able to fix it ... once binary file is corrupted, I bet sqlite.dll code contains some parser, which will simply fail :-) | |
Pekr: 15-Feb-2006 | Alek - as for backups, one file per table is imo better, because imagine your all-tables-in-one-file containing blog, the db may easily exceed large size .... | |
Pekr: 15-Feb-2006 | anyway - that's all I can do about it - to dislike it :-) I expect they went with one file because of locking issues in FS .... | |
Ashley: 15-Feb-2006 | As I mentioned near the beginning of this thread, SQLite supports multiple database files each containing one or more tables - in fact they go so far as recommending that you separate multiple high-access tables out into different databases for concurrency reasons. In this sense, SQLite "databases" act more like traditional "tablespaces". So, if we wanted we could write our REBOL front-end so that it created/accessed each table in a database of the same name thus ensuring a one-to-one mapping between table names and database names. The advantages of this approach are: backups (only those tables that change need be backed up) external table administration (you can drop a table by deleting its database file) concurrency (you spread your file locking across a greater number of physical files) Disadvantages: Administering your database is more cumbersome (you can't use the sqlite3 admin tool to administer all tables in one session) Value of sqlite_master is diminished (you can't "select * from sqlite_master" to report on all your tables in one query) Query references need to add a database prefix when referring to a table not in their own database Name conflicts (all tables in one file means multiple databases can use the same table names - the solution with multiple files would be to segregate at the directory level) Multiple database files means you need to zip them prior to some operations such as email attachment, etc On balance, I actually prefer the one file / one database approach. Pekr's other comments in relation to schema implementation also have merit (I've agreed with Pekr twice today - a new record!); I see the value of an ftp schema, an http schema, etc; but what value in a sqlite schema? Given that the entire schema can be written in a much more concise fashion as an anonymous context that exports a couple of key access functions to the global context; I can't see what the functional differences between the two implementations would be? So, bar any good reasons to the contrary, these are the features of the implementation I am currently working on (a rough design spec if you like): Implemented as an anonymous context "Database" is a directory (which is specified when a database is opened with 'open-db) Each table resides in a "tablespace" (aka SQLite database file) of the same name File is automatically opened on first reference The /blocked refinement of 'db-open specifies that rows will be returned in their own block (default is a single block of values) Non-numeric values (which SQLite stores natively as INTEGER and REAL) will be subject to 'mold/all on insert and 'load on retrieval The /native refinement of 'open-db will turn this behaviour off (see comments below) SQLite binding will be supported allowing statements such as ["insert into table values (?,?,?)" 1 [bob-:-mail-:-com] "Some text"] and ["select * from table where email = ?" [bob-:-mail-:-com]] Whether to store values (including string!) as molded values in SQLite is an interesting question; on the one hand it gives you transparent storage and access to REBOL values – but at the performance cost of having to mold and load every TEXT value returned; and the storage cost of the overhead of a molded representation. On the other hand, if I only want to store numbers and strings anyway then I don't want this overhead. I think the only practical solution is a /native type option as detailed above. | |
Pekr: 16-Feb-2006 | OK, need to leave to work, just a note - I think we can forget having one-table-per-file, as it is simply a hack with sqlite. Version prior to 3.0 even had problems with transactions in that regard and even 3.0 has stupid compile limitation (like we have with callbacks) to something like 16 separate table-files, so ... | |
Pekr: 16-Feb-2006 | what is more - subdire has some meaning, if sqlite would use one table per file design, not sure here, I am opened to thoughts .... | |
Ashley: 16-Feb-2006 | I've given up on the one table per database idea as the default attachment limit is 10 files. On the positive side, the ATTACH command seems to work properly under 3.0+ and table names unique to an attached database do not have to be prefixed in queries. ;) My 'connect function: >> help connect USAGE: CONNECT database /create /attach databases /blocked /direct DESCRIPTION: Open a SQLite database. CONNECT is a function value. ARGUMENTS: database -- (Type: file url) REFINEMENTS: /create -- Create database if non-existent /attach -- Attach up to 10 databases (of type file!) to this connection databases -- Database files (Type: block) /blocked -- Return each row as a block /direct -- Do not mold/load REBOL values lets you do this: connect/attach %/c/app/data/system.db [%/c/app/data/users.db %/c/app/data/reports.db] sql "select * from a-system-table" sql "select * from a-user-table" sql "select * from a-report-table" which could be quite useful in many situations. The default, however, is now one database. BTW, my rewrite (even after adding a lot more functionality) is about twice as fast as the original protocol version. | |
Ashley: 17-Feb-2006 | 1) why did you name somehow not traditionally functions as connect and disconnect? open and close are already taken and I wanted to avoid pathing (sqlite/open) or prefixes (sqlite-open) as the number of words added to the global context is relatively few and I wanted them to be meaningful words in their own right (same reason why VID doesn't have vid-layout, vid-center-face, etc). Connect and disconnect are the commands used to login/logout of another user in many databases; so while the context is not strictly correct, they are recognisable DB words. 2) why can't we support multiple name-spaces? You can via the connect/attach refinement (and this lets you transparently reference tables across multiple "databases"). Why would you want to concurrently access multiple databases that are *not* related to each other in any way? 3) can we have opened only one db at a time? Yes, bar /attach as above. The benefit of this approach is that you minimise the number of file locks a single process obtains, and you don't have to track state information (i.e. you don't need to tell 'sql which DB you are referring to). 4) Would it also be possible to extend e.g. 'headings to return non-string values? No, as it may contain strings like "count(*)" 5) don't agree with exposing functions as you did I tend to write CONNECT, SQL, etc in upper-case so db references embedded in my code stand out. Come up with a better naming scheme that everyone likes though and I'll adopt it. ;) | |
Ashley: 9-Mar-2006 | 0.1.5 available at: http://www.dobeash.com/SQLite/sqlite.r Changes of note include: - New /format refinement of CONNECT that formats output like MySQL (can be turned on/off via SQLIte/format?: true|false) - Widths block (SQLite/widths) added to supporrt above - DESCRIBE, TABLES and INDEXES functions rewritten (and simplified) - Added an EXPLAIN function - CONNECT rewritten (note that the attach refinement has been replaced by the function accepting a block! of file names instead) - DATABASE function added - Experimental IMPORT function added (but not exported to global context - see example for how it is used) - Error trapping / reporting more informative (especially if a library call error occurs) - Example block updated (do example) Documentation will be updated as time permits. | |
Gabriele: 11-Mar-2006 | btw, do you know if it's possible to separate sqlite's engine from the rest of the code? (sql, etc) we'd need only the low level stuff, file format, indexind etc. | |
Pekr: 12-Mar-2006 | fileformat sucks :-) who needs one extra big binary file? that is like ms outlook storage against mozilla's one - give me table per file like any other database, plus maybe text storage like rebdb, and you win :-) | |
Ashley: 12-Mar-2006 | give me table per file like any other database ... many databases actually have a table -> tablespace -> file(s) kind of mapping; and finding a [high performance] RDBMS that uses plain text storage is not that easy. | |
Robert: 8-Apr-2006 | IMO encryption should be on a lower level, on the file level. I don't want to care about using encryption in my application, I just want to set a flag that the database file gets encrypted. | |
Group: !Liquid ... any questions about liquid dataflow core. [web-public] | ||
Mario: 18-May-2007 | A suggestion: put the working full script as a downloadable file (rebol.org or a link from liquid site) at the beginning of the page. I did the example step by step following the page and, at the endo of my tests I found the full script I colud copy and paste!!! | |
Maxim: 8-Dec-2008 | elixir, itself is about 90% done. file i/o is done, GUI framework finiwhed, CLI 100% operational, all I needed was to finish the data query language to be able to create/list/edit/delete stuff in the data cloud more easily... | |
Group: DevCon2007 ... DevCon 2007 [web-public] | ||
Sunanda: 10-May-2007 | He said Unicode is three separate issues: 1: getting strings into REBOL 2: a REBOL unicode datatype 3: interfaces to operating systems -- eg for file names. The first two he said are easy. The third, he needs help on. But, as it wll be part of the Open Source 3.0 Opsys interface, it does not need to be done by RT. | |
Group: reblets ... working reblets (50-100 lines or less) [web-public] | ||
Maxim: 19-Mar-2009 | rebol [ title: "explore.r" version 1.0 date: 2009-03-19 author: "Maxim Olivier-Adlhoch" copyright: "2009(c)Maxim Olivier-Adlhoch" tested: "win xp" notes: "Add any dir to the dirs block. options are self explanatory" ] dirs: [ %/C/ [] %"/C/program files/" [expand] "%tmp%" [label "temp dir"] "" [ label "my documents"] ] blk: [] explore-dir: func [path expand? /local cmd][ call/shell rejoin [" explorer " either expand? ["/n,/e,"]["/n,"] path ] ] ctr: 1 foreach [item opts] dirs [ ctr: ctr + 1 expand?: found? find opts 'expand label: any [select opts 'label to-local-file item] append blk compose/deep [ pad 20 (to-set-word setw: rejoin ["dir" ctr]) check (expand?) pad 20 btn 200 left (label) [ explore-dir to-local-file item get in (to-word setw) 'data ] ] append blk 'return ] view layout compose [across vtext right "expand?" vtext "folder" return (blk)] | |
Maxim: 19-Mar-2009 | bug creep: parens disapeared for some strange reason... replace in the above: btn 200 left (label) [ explore-dir to-local-file item get in (to-word setw) 'data ] with btn 200 left (label) [ explore-dir (to-local-file item) get in (to-word setw) 'data ] | |
Ammon: 1-Apr-2009 | REBOL [ File: %scramble.r Author: "Ammon Johnson" Email: [ammon-:-johnson-:-gmail-:-com] Version: 0.0.1 History: [ 0.0.1 31-Mar-2009 "scrambles and descrambles code" ] ] scramble: context [ words: [] load-words: does [ foreach word first system/words [ add-word mold word ] ] add-word: func [ word /local chars length ][ chars: charset word unless found? find words chars [repend words [chars copy []]] unless found? find words/:chars length: length? word [repend words/:chars [length copy []]] length: select words/:chars length unless found? find length word [insert tail length word] word ] get-word: func [ word /local chars length ][ chars: charset word unless chars: select words chars [return "UNKNOWN"] unless length: select chars length? word [return "UNKNOWN"] random/only length ] scramble: func [ txt /local result ][ result: parse/all txt " " forall result [ unless empty? trim copy result/1 [change result random add-word result/1] ] form result ] descramble: func [ txt /local result ][ result: parse/all txt " " forall result [ unless empty? trim copy result/1 [change result get-word result/1] ] form result ] ] |
801 / 4845 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | [9] | 10 | 11 | ... | 45 | 46 | 47 | 48 | 49 |