AltME groups: search
Help · search scripts · search articles · search mailing listresults summary
world | hits |
r4wp | 55 |
r3wp | 797 |
total: | 852 |
results window for this page: [start: 1 end: 100]
world-name: r4wp
Group: #Red ... Red language group [web-public] | ||
DocKimbel: 25-Feb-2012 | Kaj: could you replace `print` by `putchar` in the Mandelbrot bench, so it is equivalent to the C version? (Not sure it would change much the timings, but at least, the sources will be equivalent). `print newline` would then become `putchar lf` | |
Henrik: 25-Jul-2012 | We shouldn't forget the idea of ReBrowse, which is Carl's idea of a browser written in R3 and is mean to replace the Viewtop. It's true that it doesn't run inside other browsers or leverages HTML, but it will still be a great technology demonstration of what a webbrowser should be. | |
Kaj: 2-Aug-2012 | Looks interesting. I can see how you're finding those expression bugs. :-) This is a really nice example of how Red/System can replace C | |
DocKimbel: 20-Aug-2012 | It seems that strnlen() is defined for versions >= 10.7.0...unfortunately, I can't upgrade my image (virtual image), so I will replace strnlen() by strlen() in the tests. | |
DocKimbel: 23-Aug-2012 | You mean the C source code I posted, I guess it's a Unicode main() from VisualStudio, you can safely replace it with a standard main(). | |
Pekr: 25-Aug-2012 | you used -dlib option, does it replace -t one? Not skilled here, but - can I generate e.g. ARM executable/library from Windows Red/System? Or is target environment needed? | |
DocKimbel: 4-Sep-2012 | Ok, if you really want to be nitpicking, replace UTF-16 with UCS-2. ;-) | |
DocKimbel: 15-Nov-2012 | Andreas: what do you propose to replace "foo/-1" if negative indexes are disallowed? "first skip foo -1"? | |
Ladislav: 15-Nov-2012 | Andreas: what do you propose to replace "foo/-1" if negative indexes are disallowed? "first skip foo -1"? - In 1-based indexing without negative values it should be PICK-BACK FOO 2, in fact, which is awful | |
DocKimbel: 15-Nov-2012 | Negative indexes applied from tail of series could be a good option, that would help replace the `back tail series` idiom. | |
BrianH: 16-Nov-2012 | Andreas, oh good, whew. In R3 we're already having to replace all system options that affect MOLD with options to the MOLD function itself. It would be a shame to have to do the same for all of the indexing functions. Nonetheless, that meaning of BASIS? doesn't make sense for the name either, so I don't like it. | |
Kaj: 17-Nov-2012 | The reason I'm not finding negative indexes in paths in my own CMS code is that I had to replace them because they're not compatible between R2 and R3 | |
BrianH: 23-Nov-2012 | Almost. It doesn't "replace" the word in all contexts, it registers another spelling for the word in the place where word symbols are stored, then when you refer to the word with either spelling it will point to the *same* word. However, if you write code like this: alias 'print 'stampa then that code, just by being loaded, creates two words in the user context with those two spellings. So when the ALIAS function links the two spellings then there is a conflict in the user context, where "stampa" refers to both the word 'stampa and is an alias for the word 'print and at runtime you can't really tell which word you mean. If the system resolves this conflict by resolving to the alias then you have overriden the original word, which makes ALIAS a security exploit. If it resolves to the original word then ALIAS simply doesn't work. Either way, the function needs to go away ASAP. | |
Kaj: 25-Dec-2012 | I'm thinking about the case where you want to implement operating system level code yourself. For example, I have been fixing many bugs in Syllable's PThreads implementation, but I would like to replace it with a Red/System implementation. PThreads adds quite a few constructs that Syllable's kernel primitives don't implement as such, so to add them you need to write extra concurrency code | |
DocKimbel: 4-Jan-2013 | I haven't found any good prefix to replace # for issue-as-string!, so ## is the only option I see so far. | |
Oldes: 5-Jan-2013 | in my case I used issues only as preprocesor commands and for storing color values in my dialect (which I could replace with the hexadecimal number which is in Red already) | |
Pierre: 11-Jan-2013 | REBOL [] do/args %makedoc2.r 'load-only doc: scan-doc read file: system/options/script set [title out] gen-html/options doc [(options)] file: last split-path file replace file ".txt" ".html" file2: copy file insert find file2 "." "-light" replace out "$DARK$" file replace out "$LIGHT$" file2 write file out replace out "dark.css" "light.css" write file2 out | |
DocKimbel: 18-Apr-2013 | Oops, you should replace 'head by 'p in the above code. | |
Kaj: 23-Apr-2013 | Didn´t you already replace SELECT with FIND in other places? | |
DocKimbel: 23-Apr-2013 | Yes, in compiler.r, I did replace SELECT on most places where it was used on hash! series. | |
DocKimbel: 28-Apr-2013 | I use Textpad on Win7 for coding. As Textpad does not support Unicode, I also use Notepad++ for Red UTF-8 scripts. On Windows, I use PE Explorer for reviewing the disassembled code and IDA Pro for debugging it (hopefully, this happens rarely). I also use IDA Pro on Linux/IA-32 and gdb everywhere else. On Mac, I try to use osxdebug, when it's not crashing. I dream about the day when I'll be able to replace all those tools with a cross-platform Red[/System] IDE. | |
Ladislav: 3-Jun-2013 | However, it is questionable whether a user unable to replace to [a | b] by an idiom like recursive rule: [a | b | skip rule] can be actually able to use Parse... | |
Geomol: 3-Jun-2013 | I feel, you need to explain this. If I replace a with "abc" and b with "str", and I want to parse ["abc"] : (From R3 prompt:) >> parse ["abc"] [to ["abc" | "str"]] == false >> rule: ["abc" | "str" | skip rule] == ["abc" | "str" | skip rule] >> parse ["abc"] rule == true | |
Maxim: 17-Jun-2013 | this would be an nice way for users to try red and progressively replace their binary code base, one source file at a time... instead of a whole project at once. | |
Kaj: 17-Jun-2013 | Yes, not yet, but it's in the roadmap. Currently, you can replace a project one shared library at a time, or one 0MQ service at a time | |
DocKimbel: 27-Jun-2013 | You just need to unzip it in a dedicated folder, install ADT (Android Development Tools) which contains both the SDK and Eclipse, install a JDK, open the project in Eclipse and compile it. For the Red part, there's a precompiled eval.red version in libs/armeabi/libRed.so. You can recompile it with the following command-line options: "-t Android -dlib". Ensure that you replace it with exactly the same name at the same place, then recompile the whole project. | |
Group: Announce ... Announcements only - use Ann-reply to chat [web-public] | ||
Kaj: 24-Dec-2012 | It's 45 times faster than the pure Red version, and all you have to do is replace the word FUNCTION with the word ROUTINE :-) | |
Group: Ann-Reply ... Reply to Announce group [web-public] | ||
Rebolek: 2-Jul-2012 | Arnold, I looked at the script (btw very cool game!) and you can replace nested 'either in zet-label-kleur with 'case for better readability. | |
Pekr: 1-Mar-2013 | As for me, I can see it as a chat. I am not sure it scales well to replace Altme like product, but maybe I am wrong. I liked IOS model with pluggable handlers, and I would also probably made the back-end SQLite based ... | |
DideC: 1-Mar-2013 | @NickA: About enhanced r3 chat, have a look to %wchat.r in the %OpenMe/ folder of this Altme world. Basically its %chat.r but it act as a proxy between the Devbase server and the browser. The goal is that the browser replace the CLI interface : not typing command in CLI but cliking link in the browser. Its just a start. There is some work to do to handle POST request and then allow posting. + enhancing HTML presentation. | |
Group: Rebol School ... REBOL School [web-public] | ||
Gregg: 24-Apr-2012 | parse-int-values: func [ "Parses and returns integer values, each <n> chars long in a string." input [any-string!] spec [block!] "Dialected block of commands: <n>, skip <n>, done, char, or string" /local gen'd-rules ; generated rules result ; what we return to the caller emit emit-data-rule emit-skip-rule emit-literal-rule emit-data digit= n= literal= int-rule= skip-rule= literal-rule= done= build-rule= data-rule skip-rule ][ ; This is where we put the rules we build; our gernated parse rules. gen'd-rules: copy [] ; This is where we put the integer results result: copy [] ; helper functions emit: func [rule n] [append gen'd-rules replace copy rule 'n n] emit-data-rule: func [n] [emit data-rule n] emit-skip-rule: func [n] [emit skip-rule n] emit-literal-rule: func [value] [append gen'd-rules value] emit-data: does [append result to integer! =chars] ; Rule templates; used to generate rules ;data-rule: [copy =chars n digit= (append result to integer! =chars)] data-rule: [copy =chars n digit= (emit-data)] skip-rule: [n skip] ; helper parse rules digit=: charset [#"0" - #"9"] n=: [set n integer!] literal=: [set lit-val [char! | any-string!]] ; Rule generation helper parse rules int-rule=: [n= (emit-data-rule n)] skip-rule=: ['skip n= (emit-skip-rule n)] literal-rule=: [literal= (emit-literal-rule lit-val)] done=: ['done (append gen'd-rules [to end])] ; This generates the parse rules used against the input build-rule=: [some [skip-rule= | int-rule= | literal-rule=] opt done=] ; We parse the spec they give us, and use that to generate the ; parse rules used against the actual input. If the spec parse ; fails, we return none (maybe we should throw an error though); ; if the data parse fails, we return false; otherwise they get ; back a block of integers. Have to decide what to do if they ; give us negative numbers as well. either parse spec build-rule= [ either parse input gen'd-rules [result] [false] ] [none] ] | |
Ladislav: 19-Jun-2012 | Also note that it is easy to replace the </br> or </div> subrule by a more complicated subrule | |
BrianH: 10-Aug-2012 | Sometimes you want to allow someone to pass in functions and then let them evaluate, as long as you have a good semantic model for what is supposed to happen and are careful about how you call them. The ARRAY, EXTRACT and REPLACE functions in R3 and R2 2.7.7+ are a good example of this. | |
Steeve: 11-Aug-2012 | LZ77 could replace RLE. It would do RLE + patterns compression | |
DocKimbel: 28-Aug-2012 | In your first try (bind 'e self), you're binding only this 'e word, not the :e function body, so if you replace it with: bind second :e self, it will work. In second try, you're never binding 'e function body, you've just binded a new instance of 'f word that you have created using FIRST. That's why it works when you add DO, you're evaluating that new 'f instance which has the correct binding. Just remove FIRST, it will bind 'e body block and you'll get the result you've expected. >> e: func [] [f] >> o: context [f: does [print "ok"]] >> bind second :e o == [f] >> e ok | |
Arnold: 7-Sep-2012 | Thank you, this works! I found and old conversation on ALTME this afternoon but that could not convince me being the answer, this answer will replace the old one. (I even typed get_env the first time). And for completeness I will write how to use it (cut and paste code) requestedurl: get-env "REQUEST_URI" | |
Ladislav: 3-Oct-2012 | OK, this is the long version: tail-func: func [ { Define a recursive user function with the supplied SPEC and BODY. The function can use a special TAIL-CALL local function to perform a tail-recursive function call. } [catch] spec [block!] {Help string (opt) followed by arg words (and opt type and string)} body [block!] {The body block of the function} /local the-function tail-call context-word ] [ ; define a new 'tail-call local variable tail-call: use [tail-call] ['tail-call] ; bind the given BODY to "know" the 'tail-call variable body: bind/copy body tail-call ; find a local word in SPEC context-word: find spec word! if context-word [context-word: first context-word] ; define the TAIL-CALL function set tail-call func spec compose [ ( either context-word [ ; set parameters to the new arguments compose [set parameters values? (context-word)] ] [[]] ) throw/name none 'tail-call ] ; define the function the-function: throw-on-error [ func spec compose/deep [ (either context-word [context-word] [[]]) while [true] [ catch/name [ return do [(body)] ] 'tail-call ] ] ] if context-word [ ; get the function context context-word: bind? first second :the-function ; replace the context word in the function body by NONE change second :the-function none ; adjust the TAIL-CALL body ; replace the 'parameters word change/only at second get tail-call 2 bind first context-word context-word ] :the-function ] values?: func ['word] [second bind? word] | |
Kaj: 10-Oct-2012 | #! /usr/bin/env r2 REBOL [] here: what-dir program: dirize clean-path here/../../../cms/files/program/PowerMezz do program/mezz/module.r load-module/from program module [ imports: [ %mezz/trees.r %mezz/load-html.r %mezz/html-to-text.r ] ][ ; print mold-tree load-html read http://osslo.nl/leveranciers make-dir %data for id 1 169 1 [ print id page: load-html read join http://osslo.nl/leveranciers?mod=organization&id= id content: get-node page/childs/html/childs/body/childs/div/childs/3/childs/2 body: get-node content/childs/table/childs/tbody ; print form-html/with body [pretty?: yes] ; print mold-tree body ; item: get-node body/childs/10/childs/2 ; print form-html/with item [pretty?: yes] ; print mold-tree item ; print mold item record: copy "" short-name: name: none unless get-node body/childs/tr/childs/th [ ; Missing record foreach item get-node body/childs [ switch/default type: trim get-node item/childs/td/childs/text/prop/value [ "Logo:" [ ; if all [get-node item/childs/2/childs/1 get-node item/childs/2/childs/1/childs/1] [ ; repend record ; ['icon tab tab tab tab get-node item/childs/2/childs/a/childs/img/prop/src newline] ; ] ] "Naam:" [ if get-node item/childs/2/childs/1 [ repend record ['name tab tab tab tab name: trim/lines html-to-text get-node item/childs/2/childs/text/prop/value newline] ] ] ... "Adres:" [ unless empty? trim/lines html-to-text form-html/with get-node item/childs/2 [pretty?: yes] [ street: get-node item/childs/2/childs/1/prop/value place: get-node item/childs/2/childs/3/prop/value number: next find/last street #" " street: trim/lines html-to-text copy/part street number unless empty? street [ repend record ['street tab tab tab tab street newline] ] unless empty? number [ repend record ['number tab tab tab tab number newline] ] unless place/1 = #" " [ where: find skip place 5 #" " repend record ['postal-code tab tab tab copy/part place where newline] place: where ] unless empty? place: trim/lines html-to-text place [ repend record ['place tab tab tab tab place newline] ] ] ] "Telefoon:" [ unless #{C2} = to-binary trim/lines html-to-text form-html/with get-node item/childs/2 [pretty?: yes] [ repend record ['phones tab tab tab tab trim get-node item/childs/2/childs/text/prop/value newline] ] ] "Website:" [ if all [get-node item/childs/2/childs/1 get-node item/childs/2/childs/1/childs/1] [ repend record ['websites tab tab tab trim get-node item/childs/2/childs/a/childs/text/prop/value newline] ] ] "E-mail:" [ if all [get-node item/childs/2/childs/1 get-node item/childs/2/childs/1/childs/1] [ repend record ['mail-addresses tab tab trim/all get-node item/childs/2/childs/a/childs/text/prop/value newline] ] ] "Profiel:" [ unless #{C2} = to-binary trim/lines html-to-text form-html/with get-node item/childs/2 [pretty?: yes] [ repend record [ 'description newline tab replace/all trim html-to-text form-html/with get-node item/childs/2 [pretty?: yes] "^/" "^/^-" newline ] ] ] ][ print ["Onbekend veld: " type] ] ] write rejoin [%data/ replace/all replace/all replace/all any [short-name name] #" " #"-" #"/" #"-" #"." "" %.txt ] record ] ] ] | |
Bo: 14-Mar-2013 | BrianH: If I wanted to take a subsection of an image, why wouldn't it create a new image with just that subsection, and then replace the "taken" part in the old image with 0.0.0? Or am I understanding the purpose of 'take incorrectly? | |
PatrickP61: 8-May-2013 | Hey all, I'm having such a good time learning again! I've got some code to generate a print ruler, but I think it could be cleaned up a lot more. If some of you have a quick moment, could you take a quick look and advise me on how to shorten this code. ruler1: copy ruler2: "" idx: 0 loop 110 [ idx: idx + 1 append ruler1 "_" append ruler2 last-digit: last to-string idx if last-digit = #"5" [ clear back tail ruler1 append ruler1 "+" ] if last-digit = #"0" [ either idx < 99 [clear back back tail ruler1] [clear back back back tail ruler1] append ruler1 to-string idx ] ] replace/all ruler2 "0" "_" print ruler1 print ruler2 ____+___10____+___20____+___30____+___40____+___50____+___60____+___70____+___80____+___90____+__100____+__110 123456789_123456789_123456789_123456789_123456789_ 123456789_123456789_ 123456789_123456789_ 123456789_123456789_ | |
PatrickP61: 8-May-2013 | How can I use the LENGTH? of IDX as a way to CLEAR those last positions. ie IDX is 110, length is 3 then clear the last 3 characters from the ruler1 series and replace with to-string idx | |
Bo: 8-May-2013 | Actually, the first method I posted above is easier to understand for a lot of nested statements. Compare this real line of script from one of my programs. The way I normally write it: browse probe rejoin copy [http://www.respectech.com/log/show-invoice.cgi?user= username "&pass=" password "&submit=" replace/all client "&" "%26" "&invno=" invnum either amtdue [rejoin ["¬ice=1&amtdue=" to-decimal amtdue "&daysdue=" daysdue]][copy ""]] Lisp-y: browse (probe (rejoin (copy [http://www.respectech.com/log/show-invoice.cgi?user= username "&pass=" password "&submit=" (replace/all (client) ("&") ("%26")) "&invno=" invnum (either amtdue [rejoin ["¬ice=1&amtdue=" (to-decimal amtdue) "&daysdue=" daysdue]][copy ""])]))) Heirarchical (takes a lot more space, but is easier to follow -- however, doesn't have the parameter enforcement of parens): browse probe rejoin copy [ http://www.respectech.com/log/show-invoice.cgi?user= username "&pass=" password "&submit=" replace/all client "&" "%26" "&invno=" invnum either amtdue [ rejoin [ "¬ice=1&amtdue=" to-decimal amtdue "&daysdue=" daysdue ] ] [ copy "" ] ] | |
Gregg: 28-May-2013 | parse-int-values: func [ "Parses and returns integer values, each <n> chars long in a string." input [any-string!] spec [block!] "Dialected block of commands: <n>, skip <n>, done, char, or string" /local gen'd-rules ; generated rules result ; what we return to the caller emit emit-data-rule emit-skip-rule emit-literal-rule emit-data digit= n= literal= int-rule= skip-rule= literal-rule= done= build-rule= data-rule skip-rule ][ ; This is where we put the rules we build; our gernated parse rules. gen'd-rules: copy [] ; This is where we put the integer results result: copy [] ; helper functions emit: func [rule n] [append gen'd-rules replace copy rule 'n n] emit-data-rule: func [n] [emit data-rule n] emit-skip-rule: func [n] [emit skip-rule n] emit-literal-rule: func [value] [append gen'd-rules value] emit-data: does [append result to integer! =chars] ; Rule templates; used to generate rules ;data-rule: [copy =chars n digit= (append result to integer! =chars)] data-rule: [copy =chars n digit= (emit-data)] skip-rule: [n skip] ; helper parse rules digit=: charset [#"0" - #"9"] n=: [set n integer!] literal=: [set lit-val [char! | any-string!]] ; Rule generation helper parse rules int-rule=: [n= (emit-data-rule n)] skip-rule=: ['skip n= (emit-skip-rule n)] literal-rule=: [literal= (emit-literal-rule lit-val)] done=: ['done (append gen'd-rules [to end])] ; This generates the parse rules used against the input build-rule=: [some [skip-rule= | int-rule= | literal-rule=] opt done=] ; We parse the spec they give us, and use that to generate the ; parse rules used against the actual input. If the spec parse ; fails, we return none (maybe we should throw an error though); ; if the data parse fails, we return false; otherwise they get ; back a block of integers. Have to decide what to do if they ; give us negative numbers as well. either parse spec build-rule= [ either parse input gen'd-rules [result] [false] ] [none] ] | |
Kees: 17-Jul-2013 | Question about an example from the R3 docs: str: "abcdef" end: find str "d" for s str end 1 [print s] abcdef bcdef cdef def find finds the d at position 4, if I replace end with 4, I get the same result. However: type? end says string! and no pointer If I replace the text in str, end still equals to "def", so it does not point at str any more. Can someone explane this? | |
DideC: 17-Jul-2013 | If I replace the text in str, end still equals to def", so it does not point at str any more." How do you replace the text in 'str ? If it's like this: str: "new text" then you have created a new string! in memory and point 'str to this new serie. 'str and 'end does not point anymore the same string! | |
Pekr: 17-Jul-2013 | Kees: there are 'replace and 'change functions .... | |
Group: Databases ... group to discuss various database issues and drivers [web-public] | ||
BrianH: 22-Mar-2012 | You can't do an R2-style hot-patch of a function in R3, but you can replace the entire function with a new, fixed one. | |
Group: !Syllable ... Syllable free operating system family [web-public] | ||
Cyphre: 29-Jun-2012 | Kaj, yes, but the changes I plan will allow you to relatively easily use different renderer component. Even in current host-kit I would just replace the agg renderer with something more suitable for slow or not sufficiently equipped ARM cpus but the "framework base" of the sytem would remain same. | |
Kaj: 22-Sep-2012 | Adrian, I could try that with your OVF: use the configuration and replace the VMDK using QEmu. Could you upload it somewhere simple without the VMDK in it? | |
Group: !REBOL3 ... General discussion about REBOL 3 [web-public] | ||
Pekr: 19-Dec-2012 | MaxV: I think you can edit. I would definitely not replace it with the Github one, at least not for docs, which are quite extensive. IIRC, you had to be registered on R3 Chat, and then when you got some level of access, you could edit docs. There is more to the R3 Chat, than might be seen from the mostly ugly surface ... | |
BrianH: 16-Jan-2013 | The main subject of the initial /options proposal was MOLD, to replace all of the MOLD-related system/options settings. | |
Cyphre: 27-Feb-2013 | cool, so looks like we could try to replace the old code in the future with these and see if it makes R3 better. | |
MarcS: 10-Mar-2013 | (Replace file:/// with anything else, I think the point stands.) | |
BrianH: 13-Mar-2013 | Remember, #864 is a proposal to replace FOR with a more flexible power-user function that would be less safe to use. They lose some safety as a tradeoff for more power and prettier sytnax. So, they lose two features (safety and backwards compatibility) but gain more flexibility. The greater flexibility would come at the expense of a slower function: negligably in the case of the function itself, but more when you add the conditional wrapper code, so it would have to be used carefully if you want it to be efficient. Overall, that is the R3 motto right there: R2 is for newbies, R3 for power users. | |
Group: Community ... discussion about Rebol/Rebol-related communities [web-public] | ||
Andreas: 31-May-2013 | They are on archive.debian.org, so use a APT source like the following: deb http://archive.debian.org/debian/$RELEASE main contrib (Replace $RELEASE with the codename of your Debian version.) |
world-name: r3wp
Group: !AltME ... Discussion about AltME [web-public] | ||
[unknown: 9]: 10-Mar-2005 | We plan to clean it up, and write a paper that explains it all, for example, you can actually dump all your grpahics, and then replace them all. | |
BrianH: 15-Jul-2005 | replace "me" "my" | |
Group: Core ... Discuss core issues [web-public] | ||
Ladislav: 7-Jan-2005 | your trouble is, that the evaluation of X doesn't have the same effect as if you replace X by its value. The evaluation of X only yields a set-word instead of setting anything. If you really want to set a word 'y, then there are two ways: set x 'z do compose [(x) 'z] | |
Geomol: 22-Jan-2005 | Did I just found an error with replace? Try these: >> replace/all "abc{def" "{" "^^{" == "abc^^{def" >> replace/all "abc{def" "{" "^{" == "abc{def" So I can't get a result with just one ^? | |
Geomol: 22-Jan-2005 | >> replace/all "abc{def" "{" "^^^{" == "abc^^{def" | |
Volker: 22-Jan-2005 | print replace/all "abc{def" "{" "^^^{" | |
Group: Script Library ... REBOL.org: Script library and Mailing list archive [web-public] | ||
Anton: 10-Feb-2005 | Could add/replace some of that with "cross-platform, CGI, console and simple GUI dialect etc.." | |
Sunanda: 11-Feb-2005 | Thank guys Ammon -- control panel --- can you do a mockup to show what you are thinking? Banner text -- this is a good place for that dicsussion.....REBOL.org could publish the winners and use one/some of them to replace the existing banner tex. | |
eFishAnt: 25-Apr-2006 | there were some others. I contacted TGD to get one that saves...hope they have done more with it...but there were some...gonna search my harddrive. course, what I want to do can just be a one-line replace...just wanna get a good tool for hex crafted as I need. I started on one a while back... | |
Group: I'm new ... Ask any question, and a helpful person will try to answer. [web-public] | ||
Henrik: 13-Apr-2006 | probably through old fashioned search/replace | |
Anton: 17-Apr-2006 | Now, the tricky thing with modifying parts of a string in a parse rule is that you have to leave the current parse index at the end of your new replacement string. What usually happens is you parse up to your search string, set a marker (here it's done with p1:), parse through your search string, set another marker (p2:), then (remove/part p1 p2 insert p1 "my new string") but if the the new string is shorter or longer than the old string, then the parse index will be left in the wrong position. So to fix that we need to set p2 to p1 plus the length of the new string, then set the parse index to that position so it can continue as intended: (p2: p1 + length? new-string) :p2 So the full example above can modify links in place if you simply replace: (append images copy/part p1 p2) with something like: ( old-string: copy/part p1 p2 new-string: "create your new link from the old one here" remove/part p1 p2 insert p1 new-string p2: p1 + length? new-string ) :p2 | |
Group: MySQL ... [web-public] | ||
DideC: 25-Feb-2005 | I could use the REPLACE statement, but doc said that it's an heavy instruction. Is there an "UPDATE-IF-THERE-ELSE-INSERT" statement somewhere ? | |
Dockimbel: 11-Jun-2006 | Erratum: replace the step : do %mysql.r by : | |
Group: Syllable ... The free desktop and server operating system family [web-public] | ||
Volker: 3-Sep-2005 | No, but you can replace it with a x86-compiler. bigforth has one. | |
Kaj: 14-Nov-2005 | Yes, it's primitive. It should be replaced with a native graphical installer, maybe with Orca scripting embedded. It just hasn't been a priority yet. We were pretty pleased a few years ago to replace the manual installation with a text installer :-) | |
Group: Linux ... [web-public] group for linux REBOL users | ||
Graham: 27-Jan-2006 | Volker is suggesting this: escape-metachars: func["escape metachars" s][ replace/all s "'" "''" rejoin ["'" s "'"] ] browse: func[url]compose/deep[ call rejoin ["screen -X screen -- " (view-root/bin/browser.sh) " " escape-metachars url] ] | |
Group: CGI ... web server issues [web-public] | ||
Volker: 19-Aug-2005 | prepare your upload with rebol and replace some things server-specific. write %dst/cgi/script.r join "#!/here/is/rebol^/" read src/script.r | |
Ingo: 23-Aug-2005 | Does anyone have exoerience with CMS's with Rebol cgi? How do they scale compared to the usual suspects? (the three "P"s Perl/Python/Php) (Maybe that's the biggest hurdle to worldwide Rebol adoption: it doesn't start with a "P" so can't easily replace any of the aforementioned languages in the LAMP acronym ... Any chances of renaming Rebol to Pebol?) | |
Gabriele: 28-Sep-2006 | afaik, the latest formmail.pl is "secure enough" (esp. if you configure it properly). it's not the best system out there, and being very popular it is also a popular target, but if you don't have time to replace it but can keep it up to date you should be fine. | |
Group: Web ... Everything web development related [web-public] | ||
Sunanda: 31-Jan-2005 | The biggest advatnage you'll find in workflow is when the client starts making changes. 1000 pages all with <font color=blue> and they now want all <p>s to be green -- that's not a search and replace job -- you need to check the context of each <font> tag.. It might take hours. Next day, they ask for dark yellow. In css: p {color:blue} -- you can show them the whole site changed in 1 minute. Though, of course, you need to think through the styles you need first. That's a big bit of the design. | |
Group: !RebGUI ... A lightweight alternative to VID [web-public] | ||
Ammon: 31-Mar-2005 | Well, from my POV... Carl intended to have us build dialects that are better than VID. There have been several attempts so far but none of them have made it far enough to actually be ready for mainstream usage. I think that if we can actually produce a solid dialect that outperforms VID in enough areas then Carl will want to add it to the language or maybe even replace VID with it. | |
Group: XML ... xml related conversations [web-public] | ||
BrianH: 30-Oct-2005 | You might even be able to replace attribute value strings with REBOL values if you implement XML Schema typing. | |
CarstenK: 7-Nov-2005 | I will try the new xml2rebxml.r, I think it would be nice to preserve the comments. If somebody writes xml in a text editor and makes some annotations, so it its nice, if he gets these comments back after processing the files with some other (REBOL) tool. But this feature has some lower priority. I found some more thing in xml2rebxml.r, only the entities replace/all att-data ">" #">" replace/all att-data "<" #"<" replace/all att-data "&" #"&" will be replaced, the other two are missed, I think: replace/all att-data """ #"^"" replace/all att-data "'" #"'" | |
Christophe: 7-Nov-2005 | MichaelB: about unicode handling. That's a point we didn't think about, because we're working in iso-8859-1 (western european) and not utf-8 or-16. So we've to see what would the cost be of it. If here is any suggestion about how to handle this, those are mostly welcome ! (I handled a similar problem with a simple replace/all, but i don't know if it's the best approach) About a port-approach... What should be the advantages ? | |
Gabriele: 28-Apr-2006 | no, you specify a pattern that can match a subtree, and replace that subtree with something else. | |
BrianH: 29-Apr-2006 | You can do some structural pattern matching with parse rules, but with how parse is currently implemented it can be a little awkward. The lack of arguments to parse rules make recursion quite difficult, and the lack of local variables make the rules difficult to use concurrently. It is difficult to examine both the data type and the value of elements in block parsing, to switch to string parsing mode for string elements, to parse lists, hashes or parens, to direct the parse flow based on semantic criteria (which is needed to work around any of these other problems). And don't even get me started on the difficulties of structure rebuilding. The thing that is the most difficult to do in parse is the easiest thing to do with regexes: Search and replace. Didn't we make a web site years ago collecting suggestions for improving parse? Wasn't a replace operation one of those suggestions? What happened with that? Structural pattern matching and rebuilding currently has to be done with a mix of parse and REBOL code that is tricky to write and debug. If parse doesn't get improved, I'd rather use a nice declarative dialect, preferably with before and after structures, and have the dialect processor generate the parse and REBOL code for me. If that dialect is powerful enough to be written in itself then we'll really be cooking. | |
Gabriele: 30-Apr-2006 | my rewrite function works quite well for search and replace. it still has the limitations of parse, though, but they don't seem a huge problem so far. | |
Ashley: 10-Nov-2008 | Almost ... I want to "push" my Address Book (on my iMac) to all the IP Phones in our office. I know the address of each IP Phone (10.1.1.x), and I can extract the data from Address Book easily enough ... what I havn't figured out how to do is replace the manual process of bringing up the admin page of each phone (in Safari), keying in the numbers and clicking the "Submit" button. Tom's suggestion may be on the right track, although I've got no idea what query-string is supposed to look like. May be time to dig the old HTML4 manual out! ;) | |
Maxim: 23-Jun-2009 | note that in the above, you can replace types within so it could be words instead of tags. | |
Maxim: 24-Jun-2009 | >> probe load replace {#[object! [a: #[object! [b: #[object! [c: "%VALUE%"]]]]]]} "%VALUE%" "tadam!" make object! [ a: make object! [ b: make object! [ c: "tadam!" ] ] ] | |
Group: PgSQL ... PostgreSQL and REBOL [web-public] | ||
Oldes: 24-Jul-2005 | in function to-octal replace "\\" with "\" | |
Group: Rebol School ... Rebol School [web-public] | ||
Pekr: 4-Apr-2006 | that is the set of proto functions - those string manipulation functions - you do use them everywhere ... even in graphics ... you have face, which has pane (container), and you insert, append, find, replace another gui elements, and then you call 'show ... | |
Group: Tech News ... Interesting technology [web-public] | ||
Anton: 9-Jan-2006 | Yes, that's what I will do, but I wanted to completely replace the phone without having my computer on all the time. | |
Henrik: 10-Jan-2006 | new MacBook Pro to replace the powerbook. 4-5 times faster than the current powerbook | |
Group: !RebDB ... REBOL Pseudo-Relational Database [web-public] | ||
Ashley: 11-Feb-2006 | Thanks guys, I've had a good look at both implementations and I've got ideas from both for a future full JOIN implementation; but at the moment my master/detail code has come along nicely. I've now enhanced the db-select function to accept statements in these additional forms: select * from master joins [select * from details where &id] on id select * from master joins [select * from details where [all [master-id = &id master-date = &date]] on [id date] which works exactly like a normal join with the following differences: a) It can only join one table to another b) Detail columns are always joined to the right of master columns c) Table.column prefixes are not supported so all columns in the join must be uniquely named Apart from that you get all the benefits of db-select (can replace * with specific column combinations, order and group by on the final result set, etc) *and* it's significantly faster than even the raw REBOL code example I gave before (as the SQL is parsed once within db-select and all loop sub-selects are done in-line). I've also implemented “lookups” with the following form: select * from table replaces id with name select * from table replaces [id-1 id-2] with [table-1 table-2] which performs a highly optimized db-lookup for each replaced value, but has the following restrictions: a) The lookup expects lookup tables in the form [id label other-column(s)] b) Only single-key lookups are supported c) A lookup that fails will replace the column value with none! I'm now in the process of benchmarking these changes against sqlite to see where the bottlenecks (if any) are. Feedback on the design decisions is welcome. While I was doing this, I was once again reminded how cumbersome it is to construct SQL statements (not just for RebDB, same goes for the other SQL protocols), as the heavy use of 'compose, 'rejoin, etc adds noise that reduces legibility. The design goal is to provide alternatives to: sql compose/deep [select * from table where [all [col1 = (val1) col2 = (val2)]]] so for a start the 'sql function should probably accept a string, to allow: sql join “select * from “ table type constructs; but this doesn't make the first example easier. So how about the 'sql function accept a block containing a string statement followed by a number of substitution variables, as in: sql reduce [“select * from table where [all [col1 = &1 col2 = &2]]” val1 val2] which makes things a bit more readable (and shortens the expression if longer word names are used multiple times). So the two questions here are: a) Is this a good idea? b) If so, what substitution character (& % $ @ other) will cause the least conflict with REBOL and/or SQL? | |
Sunanda: 11-Feb-2006 | Traditional with embedded SQL, the technique is to use "host variables" which start with a colon: sql reduce “select * from table where [all [col1 = :var1 col2 = :var2 ]]” And you'd magically replace :var1 with the value of var1. Which is almost exactly the behaviour you'd expect from :var1 in REBOL too. If you insist that that host variables always have a space before and after, that makes the whole substitution process a fairly simple parse operation. | |
Pekr: 12-Feb-2006 | Ashley - why 'replace? Do you want to really replace id with looked-up value? I can imagine having some usage for 'id, especially in the case where 'id is of some meaning. I know it should not be, but e.g. some ppl might use, for companies db, companie's registration number, which is not anonymous id, and could be further used in the resultset ... | |
Group: SQLite ... C library embeddable DB [web-public]. | ||
Ashley: 13-Feb-2006 | sqlite3-protocol.r has a minor bug whereby locals/cols are not cleared. Fix is to add a "clear cols" at the beginning of the ' sqlite-exec func. Two other changes I made to this function were: 1) Changing “SQLITE_TEXT [any [attempt [load val: sqlite3/column_text stmt j] val]]” so as REBOL values are returned, and 2) Removing the /only clause from "system/words/insert/only tail result col" for those that prefer flat data structures (i.e. non-blocked records) Finally, a simple wrapper makes the whole thing more usable: context [ db: none set 'open-db func [name [file!]] [ db: open join sqlite://localhost/ name ] set 'close-db does [ close db ] set 'describe func ['table [word!]] [ insert db rejoin ["select type, name, sql from sqlite_master where upper(tbl_name) = '" uppercase form table "' order by rootpage"] db/locals/sqlresult ] set 'sql function [arg [string! block!]] [statement] [ case [ string? arg [insert db arg] string? first arg [ statement: copy first arg repeat i -1 + length? arg [ replace/all statement join ":" i pick arg i + 1 ] insert db statement ] ] db/locals/sqlresult ] ] which lets you do stuff like: >> open-db %test.db >> sql "create table t1 (col1 INTEGER, col2 TEXT)" == [] >> describe t1 == [table t1 "CREATE TABLE t1 (col1 INTEGER, col2 TEXT)"] >> sql reduce ["insert into t1 values (1,':1')" now/date] == [] >> sql "select * from t1" == [1 13-Feb-2006] >> close-db | |
Ashley: 15-Feb-2006 | Yep, wish I had read your message earler. ;) The 'open func sets port/target to a string of the file name and port/path to a string of the path (empty if none). So you just need to replace the sqlite-open in the 'open func with: port/locals/dbid: sqlite-open to-file join port/path port/target as Anton stated above. | |
Pekr: 21-Mar-2006 | but it is easy to convert to - replace time-value "T" " " " :-) | |
Ashley: 25-Mar-2006 | Replace the column-text block in the SQL function with: [( either direct [ [*column-text (sid) idx] ][ [ s: v: *column-text (sid) idx while [s: find s {""}] [change/part s "" 2] load v ] ] )] I've added this to the next build. | |
Group: Plugin-2 ... Browser Plugins [web-public] | ||
Cyphre: 10-May-2006 | Josh: so you basically need to replace WndProc handler with a plugin specific one right? | |
Oldes: 16-May-2006 | Be carefull with restricting Rebol. I like Rebol, because I can simply do things, which I cannot do in other apps. I cannot believe, that Maxim wants to remove send even from Rebol and replace it with some application. Why? Do I need xxMB large aplication just to send message? What will be better in Rebol than in Flash, if you remove the best parts of Rebol? | |
Group: Games ... talk about using REBOL for games [web-public] | ||
ICarii: 30-Jun-2007 | RebTower 0.0.4 released. This version is playable :) Quick notes: left click a card to select it (it will enlarge in size) then either left click it again to replace it or right (Alt) click it to play it. only cards that are alpha/0 (ie solid) can be played unless you are discarding. if all your cards are transparent you will have to discard. the object of the game is to destroy your oponnents tower while keeping yours alive. Yes, I know the debug info is still displaying - the final image cards are not ready yet :) | |
Group: DevCon2008 (post-chatter) ... DevCon2008 [web-public] | ||
BrianH: 17-Dec-2008 | The presenter chat interface is too tall to fit on a 1024x768 screen, let alone the 1024x600 on my netbook. It would help if you got rid of <tr> <td align="center"> </td> </tr> that is above the row where the flash is embedded, or better yet replace the whole table with a <div style="text-align: center">...</div> However, even when you reference the the flash itself, it has some kind of title at the top that pushes the interface down so far that you can't see the text entry field on a 1024x768 screen. This is a bug in the flash. |
1 / 852 | [1] | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |