AltME groups: search
Help · search scripts · search articles · search mailing listresults summary
world | hits |
r4wp | 5907 |
r3wp | 58701 |
total: | 64608 |
results window for this page: [start: 13701 end: 13800]
world-name: r3wp
Group: Rebol School ... Rebol School [web-public] | ||
JaimeVargas: 17-May-2006 | Maybe you can use Rebol and try to implement a curriculum similar to HtDP. The Structure and Interpretation of the Computer Science Curriculum http://www.cs.brown.edu/~sk/Publications/Papers/Published/fffk-htdp-vs-sicp-journal/ | |
Gregg: 18-May-2006 | My preconception is that adding the graphical layer complicates things too much -- A valid concern in many environments, but VID is great, and simple, for simple things. view layout [button "Show help" [alert "Sorry, I can't help you"]] No need to manage the event loop, no redraw handlers (until you need to get into them of course), just put an action block after a face style and it binds to it automatically. | |
[unknown: 9]: 8-Nov-2006 | Could not find a free tool that allowed al the features we wanted. | |
[unknown: 9]: 8-Nov-2006 | It needs Chat (writte), Talk (Spoken), Video, and several Whiteboards, and a way to view somoeone's computer screen. | |
Izkata: 8-Nov-2006 | Google Desktop has a plugin that makes GTalk able to make a chatroom, and another that allows you to share part of your screen with someone on your buddy list. I don't know how well they work, thouhg | |
denismx: 27-May-2007 | Project 1: Read a web page given a URL, find some data in the page, append it to a file on disk. Read the given disk file et show the data on screen. | |
denismx: 27-May-2007 | Project 2: Establish a two way connection using tcp/ip and save the history on disk. | |
denismx: 27-May-2007 | I'm looking for a LEARNING MAP that could be used as a fast track to learning to build interesting little applications. | |
btiffin: 27-May-2007 | Yeah, that is kinda in the progess of being built. There are some awesome resources but they need to be tracked down sometimes.... The cookbook http://rebol.net/cookbookbeing one starting point. rebol.org has a lot of scripts, but it requires reading code a lot of the time.... The REBOL Viewtop (desktop command at console) REBOL Folder ->Tools->Word Browser is not bad for options | |
denismx: 27-May-2007 | I'm sure, as the pros keep saying, that once you have learned Rebol, it is very fast to code applications. The problem is that it might be that to get to that point takes quite a while | |
denismx: 27-May-2007 | I can read the code. The thing is I have yet to get to a point where I can sit down and start thinking code to do things. | |
denismx: 27-May-2007 | I'm looking for a set of basic essentials, of sort, that can be taught to a beginner so that he/she can start coding useful stuff in, say, 3 to 5 hours. | |
denismx: 27-May-2007 | Read those a couple of times. I teach C++. Know a dozen more languages, including Prolog. | |
denismx: 27-May-2007 | To come to the point of teaching Rebol, I will have to find some structure in the language that permits me to extract the "basic essentials" in view to start students to code in a relatively short time. | |
denismx: 27-May-2007 | yes, that is a problem as far as learning goes. | |
denismx: 27-May-2007 | Like a Zen koan ;-) | |
Brock: 27-May-2007 | Here's a nice tutorial.. http://musiclessonz.com/rebol.html | |
denismx: 28-May-2007 | I hadn't seen this one. Based on View? I was assuming it to be simpler to stick with Rebol/core. Maybe not. This one seems real good at a glance. Tks Brock. And tks btiffin for all the pointers. | |
Volker: 28-May-2007 | view is core for all except gui. + some commands ending with -thru, 'read-thru and such. they are the same as the short form, but use a cache. | |
denismx: 7-Jun-2007 | Reichart: I'm surprised the tools you are wishing for in order to start holding online classes aren't already build in Rebol... From what I've seen, all the bits and pieces seem to be there already, maybe except for a whiteboard. No? | |
[unknown: 9]: 7-Jun-2007 | Rebol is a language... | |
Geomol: 22-Jun-2007 | To everyone: What characterize a good learning book? Do you prefer thick books with deep explanation and many examples, or do you prefer the thin book with the essentials? Look at your collection of technical book; about computer languages, OSs, databases or what you have. Which ones do you like, and which ones is no-good? | |
PatrickP61: 25-Jun-2007 | I'm a newbie and wanted to ask this question on a simple rebol program. If I have a variable COUNT and I wanted to write this value with a literal could I do this: write OutFile [Count " Total lines"]/append. But the word Count is not evaluated and I get "Count Total lines" instead of "8 Total lines". What do I need to tell rebol to return the value of COUNT? | |
Geomol: 25-Jun-2007 | A suggestion: Many words in REBOL can do more than one thing, sometimes depending on data-type of the argument or the use of refinements. It's almost impossible to remember it all. So as a new one to the language, check the help for the new words, you're learning. Like >> ? reduce >> ? compose | |
PatrickP61: 25-Jun-2007 | As a newbie, what suggestions do you have for me to debug my rebol scripts. For example, I have a script called "Convert_to_Table" that I am just starting to write. I can execute it -stand alone- and see the results of the run, but what I would like to do is be able to see what the console has for any values. In other words, when I double click the "Convert_to_Table" I can see the results but not ask the console questions like print Count or the like. How do you suggest a newbie debug a script? Should I go into console first and then perform a "do Convert_to_Table" and then be able to ask questions of console, or is there another way?. | |
Geomol: 25-Jun-2007 | Yes, use the console! Also use PROBE in the script to check values. You can put PROBE in anywhere, also in the middle of a sequnce of words. | |
PatrickP61: 25-Jun-2007 | Hi Volker, after a few variations, I used this: print reduce ["var-name= " var-name] What is the syntax for '?? | |
Rebolek: 25-Jun-2007 | ?? - it's same as with probe: >> ?? probe probe: func [ {Prints a molded, unevaluated value and returns the same value.} value ][ print mold :value :value ] | |
Volker: 25-Jun-2007 | ?? does a get, you can put it in expressions before variables | |
Rebolek: 25-Jun-2007 | Volker: no, ?? changes the meaning of expression in case you put it before function: >> f: func [a][a] >> a: 1 == 1 >> b: probe f a 1 == 1 >> type? :b == integer! >> b: ?? f a f: func [a][a] == 1 >> type? :b == function! | |
PatrickP61: 25-Jun-2007 | Wow, I guess there are a lot of ways to "explain" how rebol is evaluating an expression. Thank you. I will try them all sometime. | |
PatrickP61: 25-Jun-2007 | P.S. In AltMe, what do you guys type to get a carriage return without sending the AltMe message until you do an <enter> | |
PatrickP61: 25-Jun-2007 | This is a test This is a test OK It works! | |
PatrickP61: 25-Jun-2007 | Ahhh so much to learn and not enough time!!! Thanks for your patience Ok, on to another issue. I have a text file as a printable report that contains several pages within it. Each line can be as large as 132 columns wide (or less). - The literal " Page " will begin in column 115 and that indicates the start of a printed page. I want to write a script that will read this text file one-page-at-a-time, so I can do some processing on the page. How do I write a script to load in a single "page"? I am guessing that I need to open a PORT and have rebol read all the lines until I get "....Page." in bype position 115. Any suggestions? | |
Volker: 25-Jun-2007 | you can use read/lines to have all lines in a block | |
PatrickP61: 25-Jun-2007 | I need to load in a single page at a time, then "process" that page before going on to the next page and processing it. Are you suggesting that I go ahead and read in all the lines of the report and then go through that block to identify a page? | |
Volker: 25-Jun-2007 | if parse/all[115 " " "Page" to end] ["its a new page"] (not testet) | |
Volker: 25-Jun-2007 | if parse/all LINE [ 115 " " "Page" to end] ["its a new page"] ;.. | |
PatrickP61: 26-Jun-2007 | Hi everyone, I want to write out a Ruler line to a text file for a specified length of bytes similar to the following for 125 bytes in length: ----+---10----+---20----+---30----+---40----+---50----+---60----+---70----+---80----+---90----+--100----+--110----+--120----+ I tried the following code, but not what I want: Ruler: for Count 10 125 10 [ prin "----+---" Count ] I got this instead: ----+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+---Ruler: 120 Any suggestions? | |
Geomol: 26-Jun-2007 | My version produce a lot of copies of the string. Volker's suggestion is better, because it don't have these copies, so doesn't disturb the garbage collector too much. | |
PatrickP61: 26-Jun-2007 | Volker -- I'm a newbie so bear with me, I don't understand your suggestion. Do you mean I should do this: Ruler: for Count 10 125 10 [ prin "----+-----" then what? | |
Geomol: 26-Jun-2007 | You could also go for a combination with one little string, that you change (by putting in the number) and print. | |
Geomol: 26-Jun-2007 | This is a way without copies: str: "----+-----" for Count 10 125 10 [change skip str either Count < 100 [8][7] Count prin str] | |
Gabriele: 27-Jun-2007 | prin will insert a space though, so you may want to do print join "---" count instead. | |
Geomol: 27-Jun-2007 | I guess, you have to convert it. I've once build a RebXML format, that could be transfered to/from XML. I can handle utf-8. You can find code to convert from utf-8 here: http://home.tiscali.dk/john.niclasen/rebxml/xml2rebxml.r (search for unicode) The other way can be found here: http://home.tiscali.dk/john.niclasen/rebxml/rebxml2xml.r (search for iso2utf-8) | |
PatrickP61: 27-Jun-2007 | Thanks Geomol, Since I am a newbie, I can easily resave the files as ANSI instead of UNICODE and avoid the conversion problem, at least in the short term. Once I get my "Convert to Table" program working, then I can look at your links to convert from UNICODE. | |
PatrickP61: 27-Jun-2007 | When you try to save a document under Notebook, the encoding choices are UTF-8, UNICODE, ANSI among others. UNICODE may be the same as UTF-16 because it does look like every single character is saved as two bytes. The code (rejoin extract read InFile 2) does eliminate the double characters but I noticed that the entire file is still double spaced -- as if the newline is coded twice and not removed from the rejoin. But that extra newline may be an annoyance than anything else. | |
PatrickP61: 27-Jun-2007 | Hello my teachers. Is there a more elegant way to create a ruler than this in rebol... Str7: Str8: "" Ruler: rejoin [ for Count 10 90 10 [ Str8: rejoin [ Str8 "....+..." Count ] ] for Count 100 250 10 [ Str7: rejoin [ Str7 "....+.." Count ] ] ] print Ruler | |
Gregg: 28-Jun-2007 | I don't know about more elegant, but here's a func, just for fun. | |
PhilB: 28-Jun-2007 | Patrick ... on your AS400 problem .... how is the data transferred to the PC? Is it directly from an AS400 file via the data transfer utility built into, or is it a file from the IFS ? (I have used Rebol to read data transferred from an AS400 and didnt get the data as unicode.) | |
Anton: 28-Jun-2007 | Patrick, on the double newlines. Can you inspect the result of read InFile ? How many newlines are present at that point ? Useful rebol words: NEWLINE ; this is the newline character that rebol uses CR ; carriage return character LF ; linefeed character CRLF ; both CR and LF in a string | |
Anton: 28-Jun-2007 | I don't think EXTRACT is at fault, it does a very simple job, getting every second character. | |
PatrickP61: 28-Jun-2007 | Hi Anton -- This is my simulated input for a unicode text file: Line1...10....+...20....+...30....+...40....+...50 Line2...10....+...20....+...30....+...40....+...50 If I run this code: InFile: %"Small In unicode.txt" InText: rejoin extract read InFile 2 ; Convert from UNICODE to ANSI but keeps double spacing. OutFile: %"Test Out.txt" write OutFile InText print InText I get these results ˙Line1...10....+...20....+...30....+...40....+...50 Line2...10....+...20....+...30....+...40....+...50 I get them in the output file when I use the Rebol editor, and in notebook (when I open the file) and I get them in console when PRINT InText. | |
PatrickP61: 28-Jun-2007 | At first, I thought it just be some stray bytes comming from the AS400, but I was able to re-create a file using Notebook and get same results. Any of you should be able to test this out by: 1. Open Notebook 2. Type in some text 3. Save the file with Encoding to UNICODE | |
PatrickP61: 28-Jun-2007 | Ok -- I think I have it: my sample input is a two line text field in UNICODE like Line1 Line2 as-binary InText shows #{FFFE4C0069006E00650031000A000A004C0069006E0065003200} | |
Sunanda: 28-Jun-2007 | FFFE is a "byte order mark" -- something that has been slipped in at the beginning of the file to indicate the file is in UTF-16, little endian format....If it started FEFF you'd have to extract all the other bytes. Looks like the original file (or whatever did the EBCDIC to UTF-16 conversion on the AS400) is using A0A0 to mean newline. You may need to clean those up by hand: | |
PatrickP61: 2-Jul-2007 | Question to all: If I have a block of data inside of In-text like this: Line A Line B Line C How can I print the line number (position in the block) along with the contents of the line? I tried this but it didn't work: foreach Line In-text [ print rejoin [ Count: Count + 1 ] Line ] | |
PatrickP61: 2-Jul-2007 | Now that I think of it, I probably do not need to manuipulate a Count variable -- I can probably use INDEX right? | |
PatrickP61: 2-Jul-2007 | I tried this out but not getting the results I wanted: Data: head In-text while [not tail? Data] [ print [index? Data Data ] Data: next Data ] I'm getting this: 1 Line A Line B Line C 2 Line B Line C 3 Line C Any suggestions? | |
PatrickP61: 2-Jul-2007 | Give me enough time, and I will figure it out --- :-) Data: head In-text while [not tail? Data] [ print [index? Data first Data ] Data: next Data ] Is there a better way to code this kind of thing? | |
Sunanda: 2-Jul-2007 | One way: data: [a b c] for n 1 length? data 1 [print [n data/:n]] | |
PatrickP61: 5-Jul-2007 | Situation: I want to read in an input file and parse it for some strings Current: My test code will do the parsing correctly IF the input block contains each line as a string Problem: When I try to run my code against the test file, It treats the contents of the file as a single string. Question: How do I have Rebol read in a file as one string per line instead of one string? In-text: [ "Line 1 Page 1" "Line 2 Name String-2" "Line 4 Member String-3 on 12/23/03" "Line 5 SEQNBR abcdef " "Line 6 600 Desc 1 text 12/23/03" "Line 7 5400 Desc 2 Page 4 12/23/03" "Line 8 Number of records searched ] Get-page: [thru " Page " copy Page-id to end] Get-file: [thru "Name " copy Name-id to end] Get-member: [thru "Member " copy Member-id to end] Page-id: Name-id: Member-id: "-" for N 1 length? In-text 1 [ parse In-text/:N Get-page parse In-text/:N Get-file parse In-text/:N Get-member ] print [ "Page" Page-id ] print [ "Name" Name-id ] print [ "Member" Member-id ] | |
PatrickP61: 5-Jul-2007 | Thank you Sunanda -- That did work, but I thought Read/Lines would return a single line -- no maybe that is Read/Line without the s -- is that right? | |
Group: rebcode ... Rebcode discussion [web-public] | ||
Cyphre: 24-Oct-2005 | Maybe not a problem, but overhead? | |
Rebolek: 24-Oct-2005 | >> mulr: rebcode [a][mul a 2 return a] >> mull: rebcode [a][loop 10000000 [apply a mulr [a]] return a] | |
Cyphre: 24-Oct-2005 | From my tests calling a REBCODE function (or subroutine) using APPLY is by 100% slower than reusing the same code. | |
Cyphre: 24-Oct-2005 | It looks like APPLY inside a LOOP is causing those problems. | |
Cyphre: 24-Oct-2005 | time: func [b /local start] [ start: now/precise do b print ["Time:" difference now/precise start] ] rgba-to-int: rebcode [r g b a][ lsl a 24 lsl r 16 lsl g 8 or a r or a g or a b return a ] draw-pix: rebcode [r g b a][ apply a rgba-to-int [r g b a] return a ] draw-pix2: rebcode [r g b a][ loop 1000000 [ apply a rgba-to-int [r g b a] ] return a ] probe stats recycle time [loop 1000000 [draw-pix 255 255 255 255]] probe stats recycle time [loop 1000000 [rgba-to-int 255 255 255 255]] probe stats recycle time [draw-pix2 255 255 255 255] probe stats | |
Geomol: 24-Oct-2005 | A note about speed: I've made an exponont function like this: exponent: rebcode [b [decimal!] x [decimal!]] [ eqd x 0.0 braf 2 return 1.0 log-e b muld b x exp b return b ] It can then be used in a rebcode function, e.g.: apply result exponent [2.0 4.0] An alternative way is to make a normal REBOL function: exponent: func [b x][b ** x] which can be used the same way: apply result exponent [2.0 4.0] It turns out, that using a normal REBOL function is faster in this example. It then occured to me, that it could be even faster, if APPLY was changed to support operators. Like this: apply result ** [2.0 4.0] Is that a good request? | |
Geomol: 24-Oct-2005 | it's faster than using a REBOL function. It works with POWER as it should with the operator **, so I'm happy. (I just noticed, POWER wasn't an operator. Didn't know that.) | |
Ladislav: 24-Oct-2005 | Kru: this really seems to be APPLY related, because the following code crashes too: mulr: rebcode [][return 4] mull: rebcode [][loop 10000000 [apply a mulr []] return a] mull | |
Pekr: 24-Oct-2005 | guys, how well does parse play with rebcode? It was said that parse is VM in itself, it is very right, but now we have some discussion about zlib support. Let's suppose we have rebol version on rebol.org and that we would like to speed it up. We can simple extend the idea to any other datatype (= in amiga terms, simply a file format, or protocol one). you will surely want to use parse. The question is, if you can speed up some things using rebcode? | |
Geomol: 24-Oct-2005 | Using APPLY with POWER may be a special case, because the equivalent is 10-11 lines of rebcode. So in this case, calling POWER with APPLY is actually faster than programming the POWER function inline in rebcode. (I hope, I make sense.) | |
Geomol: 24-Oct-2005 | bezier: rebcode [ t [decimal!] P [block!] /local result m n n! i a b c d idx ][ do result [copy [0.0 0.0]] length? n P div n 2 set m n sub n 1 ;apply n! factorial [n] set n! 1 repeat x n [ mul n! x ] repeatz i m [ to-dec a n! ;apply b factorial [i] set b 1 repeat x i [ mul b x ] to-dec b b divd a b set b n sub b i ;apply c factorial [b] set c 1 repeat x b [ mul c x ] to-dec c c divd a c eq i 0 braf i-not-0 set d 1.0 bra muld-d-a label i-not-0 to-dec c i set d t ;apply d power [t c] log-e d muld d c exp d label muld-d-a muld d a set a 1.0 subd a t eq b 0 braf b-not-0 set a 1.0 bra muld-a-c label b-not-0 to-dec b b ;apply a power [a b] log-e a muld a b exp a label muld-a-c muld a d set idx i mul idx 2 pickz b P idx muld b a pick c result 1 addd b c poke result 1 b add idx 1 pickz b P idx muld b a pick c result 2 addd b c poke result 2 b ] return result ] | |
Geomol: 24-Oct-2005 | Pekr, with this histogram function: histogram: rebcode [rgb result /local r n a b c] [ length? n rgb div n 3 repeatz i n [ set a i mul a 3 pickz b rgb a add a 1 pickz c rgb a add b c add a 1 pickz c rgb a add b c div b 3 pickz c result b add c 1 pokez result b c ] return result ] it takes 0.094 seconds on my machine to get histogram of 640x480 pixel image. | |
Geomol: 24-Oct-2005 | The histogram, I posted, count combined rgb values (or light value if you like). To count rgb values individually, a little change is needed. | |
Geomol: 24-Oct-2005 | Right. I once talked with an astronomer working in Lund, Sweden. He told me about the software, they use. It's mostly based in code written in the 70'ies (in FORTH, if I remember correctly). It's good, well-tested software of course, but the user interfaces are terrible, often just a command-line. It could be interesting doing modern versions of some of that software using REBOL. But the scientists have to be 100% sure, the output is correct and the same as they get from the software, they use now. If the right function libraries were developed in REBOL (rebcode), I think scientists could be a good user-base (developer-base) for the REBOL language. | |
Graham: 24-Oct-2005 | Geomol, they are probably using a domain specific language to drive their telescopes ... something forth pioneered. | |
Graham: 24-Oct-2005 | Yeah, I would leave the scientists alone ... it's like trying to wean a unix user from their command line tools! | |
Pekr: 24-Oct-2005 | even big SBIG used parallel port back in the time we used ethernet. The sad thing is - no money, no music ... 4 ppl working part-time can't beat 80 full-time workers. But we did, for ourselves - I have our camera in my table ;-) And we build quite a few telescopes - REBOL is COOL for astronomy - dialects etc. wow ... the thing is, if it would be adopted .... | |
OneTom: 24-Oct-2005 | pekr, did i understand that u were using rebol 4 astronomy? could show me/us some of ur worx? a collegue of mine - whom i really want to b converted from php to rebol - is an amateur astronomist and such a stuff can give him the final pulse to start learning&using rebol | |
BrianH: 25-Oct-2005 | Speaking as someone who generates as well as wwrites rebcode, I would say yes. This frees up the non-typed opcodes to be rewritten with their typed equivalents by a type inferencer. | |
Volker: 25-Oct-2005 | Yes, but a typecheck and a branch and a conversin even more. | |
DideC: 25-Oct-2005 | (no chance some of you change a bit his color : you look the same all three) | |
BrianH: 25-Oct-2005 | Volker, the typecheck can be done by the programmer, or a type inferencer, either way statically. When rebcode gets a JIT those typechecks get put right back to implement generic math, because the real machine won't have it. | |
Volker: 25-Oct-2005 | if i want a generic sum, people feed [ 1 2.5 3 ], it would be faster in rebcode, so makes sense. with hand-typecheck it would be slower. I guess its to rare to worry about, but i would keep the option. but main reason is, its easier to remember, set seti setd add addi addd would be first thoughts. | |
Volker: 25-Oct-2005 | We managed to give you a different color than us. :) | |
BrianH: 25-Oct-2005 | I get generic add by doing this: to-dec a to-dec b addd a b You can skip one or both conversions if you can trace the type flow and be sure of the data types of the arguments. | |
BrianH: 25-Oct-2005 | Sorry, to-dec a a ... | |
DideC: 25-Oct-2005 | 3) come from asm68k that looks like that. And rebcode, as a byte-code, is near ASM (even if more powerfull, ie: block!) | |
Volker: 25-Oct-2005 | dot looks like a space and spaces are veryimportant in rebol-layout. i would not use that. | |
BrianH: 25-Oct-2005 | A period looks like a space? | |
Volker: 25-Oct-2005 | in rebol most signs fill the space if .. [ ..], not if .. { .. }. a-word, not a_word. i like that | |
Volker: 25-Oct-2005 | sure, but i can change the other way. why start with a bad opcode and replace it with a bad, when i can have it the other way around? | |
BrianH: 25-Oct-2005 | DideC: Add a choice. 4) INTEGER add-i mul-i div-i ... / DECIMAL add-d mul-d div-d ... | |
shadwolf: 25-Oct-2005 | REPLY TO URGENT NOTICE: i propose i.add, i.mult, i.div etc... this way we include to rebcode a some object like stuctrure but only applayable on fonctions /operation names this allow us to not mistake betwin rebol/core funtions and rebcode ones. As type take a ! in rebol syntax we can use i!add i!mult i!div i!sub etc... I think this syntaxe would be really attractive for coders abit to object language. I.add or i!add is directly understable i -> interger add -> the operation applyed to integer! args ... | |
Volker: 25-Oct-2005 | rebcode uses a full value for an opcode, 16 bytes? not something comprimized? if so, that works badly with cache-prefetch. But i agree the opcodes should have word-based names. so 2 if we think we stay with int/decimal, 1-2 others, 4 if we think we get special code for more types than the alphabet has letters. | |
Geomol: 25-Oct-2005 | I prefer 1, as it is now. Keep it short. I think of the decimal variations like the normal ones, but with some extra (decimal has better precision and gives you decimals, so it's something extra than integer). It also take up more bits -> more bits, longer name. That's the way, I think. Also reminds me of C, where 10 is a short integer, and 10L is a long integer. (Not the same, but kind of the same thoughts.) | |
Volker: 25-Oct-2005 | i clash with seti and such. then we should make everything integer, and have a setv for any-value. | |
BrianH: 25-Oct-2005 | I never liked that integers were treated like a default value in C. This leads to its typing problems, excessive casting, character as integer, ... |
13701 / 64608 | 1 | 2 | 3 | 4 | 5 | ... | 136 | 137 | [138] | 139 | 140 | ... | 643 | 644 | 645 | 646 | 647 |