AltME groups: search
Help · search scripts · search articles · search mailing listresults summary
world | hits |
r4wp | 4382 |
r3wp | 44224 |
total: | 48606 |
results window for this page: [start: 18001 end: 18100]
world-name: r3wp
Group: Rebol School ... Rebol School [web-public] | ||
Brock: 5-Feb-2009 | There are some text objects below the radio buttons [RS S LS M L], that can be dragged from their current location and moved anywhere on the layout, not just the drawing area. These objects can be moved again at any point, and are not included in the overall draw dialect for the image area. | |
Brock: 5-Feb-2009 | If I can blend these two functionalities into one, I'd have the best of both worlds. Essentially I'm looking to build a Vector-like draw program, but as simple and small as possible. This would allow drag points onto any selected object in order to allow for resizing or fine-tuning of object placement. As I said previously, I believe Anton has done some work with drag-points on lines etc, but don't remember the script name that did this. Warp-image.r also does something similar with an image. | |
Brock: 5-Feb-2009 | I think this would be a very interesting project to undertake. It would be nice to have both the smallest paint program, and vector drawing program in Rebol. | |
Brock: 5-Feb-2009 | you can remove that line from the code, it's only used to save the draw data if you press the save button. I should have removed any reference to the sqlite and the associated queries. | |
Brock: 5-Feb-2009 | I used the method to drag-and-drop as used in Nick's Guitar Chords app. It worked great for that type of drag and drop. | |
kib2: 6-Feb-2009 | Hi, I'm starting with Rebol and I'm asking myself how to split a given string according to a pattern delimiter : "2 linebreaks or more" ? | |
Geomol: 6-Feb-2009 | The second argument to parse can be a string, and then parse split up the first argument, or the second argument can be a block of parsing rules. out is just my output block. So the parsing rules go: 1) first any of a sub-block of sub-rules 2) sub-block copy the input string to a point, where two newlines are found, the result in the variable: arg 3) the paranthesis is evaluated (as normal REBOL code), and it append arg (the part of the string, we just copied) to the variable out 4) the parser then skip any number of newlines (2, 3 or more) 5) when the sub-rules are not valid any longer, the input string is copied till the end (and appended to out as before) | |
Henrik: 6-Feb-2009 | parse is ridiculously powerful (and equally hard to learn/use) :-) | |
Geomol: 6-Feb-2009 | kib, I think, you'll find performance of parse to be really good, and I think, the reason is, that parse is native. | |
kib2: 6-Feb-2009 | Geomol: cool. And does parse uses Unicode with R3 now ? | |
Geomol: 6-Feb-2009 | I have some rather large paring rules here: http://www.fys.ku.dk/~niclasen/nicomdoc/nicomdoc.r http://www.fys.ku.dk/~niclasen/nicomdoc/ndmath.r and it's very fast to create a huge document from those rules. | |
kib2: 6-Feb-2009 | shadwolf: certainly, but it depends on what langage you're coding! Rebol seems a good candidate for such tasks. I'm also learning Factor, and I can tell you that it's a way harder (but maybe that's because it lacks some docs). | |
Geomol: 6-Feb-2009 | kib, after I parse the input to RebXML format, I parse the RebXML to HTML with: http://www.fys.ku.dk/~niclasen/nicomdoc/ndrebxml2html.r So 2 huge sets of rules (3 with math) is into play, and the final document is there in a matter of seconds. | |
Geomol: 6-Feb-2009 | kib, so I find parse to be very fast, and this real example is a good showcase, I think. | |
shadwolf: 6-Feb-2009 | kib2 yes because rebol concept relies on 2 things in fact objects and dialect and as dialects are linked to parse system parse is the real thing that makes rebol a different language | |
shadwolf: 6-Feb-2009 | that means you can analyse each and every char in your document or locate flags and retrieve the data following | |
shadwolf: 6-Feb-2009 | I should retake my svg engin and try to make it in full raw parse ^^ | |
Geomol: 6-Feb-2009 | I have more and more need for LaTeX output, so I might do it any day. | |
shadwolf: 6-Feb-2009 | since R3 is not stable and official and that it can change alot until being stable so i don't write anything for R3 | |
shadwolf: 6-Feb-2009 | and once R3 is out i will do the efffort to restart from scratch this project and do it 1 pass pure parse | |
shadwolf: 6-Feb-2009 | i would say parse is really the thing i need to understand further and heavy work on (you can write a 500 pages book only about parse and all it's subtilities) | |
kib2: 6-Feb-2009 | I've been programming in Python for 6 years now. When I became fed up with it 3 months ago, I've tried maybe 15 langages since, and now I've got 2 or 3 good candidates. | |
shadwolf: 6-Feb-2009 | good question and hum apart the one you will set yourself i don't know | |
kib2: 6-Feb-2009 | Henrik: and you're self hosting ? | |
shadwolf: 6-Feb-2009 | if i was president i would ban apach and impose cheyenne! :O | |
kib2: 8-Feb-2009 | Janko: thanks. I'm starting and don't understand why this snippet does not work : http://clojurepastebin.appspot.com/1003 | |
Geomol: 8-Feb-2009 | Most REBOL programmers use FUNC, and not FUNCTION, because it's easier. Let me see, if I can rewrite your function with func... | |
kib2: 8-Feb-2009 | Geomol: I just followed the book I bought, it tells me that func uses globals, and globals may not be the best no ? | |
Geomol: 8-Feb-2009 | Examples of words, that get declared (defined or known from now on) and also get build: a: none b: 42 c: make block! 16 If you specify words to be local to a function, they don't get declared (build). It just mean, that when you refer to those words, they will be local to the function. | |
Geomol: 8-Feb-2009 | so my-func: func [ var1 var2 /local var3 var4 ][ ..... ] In this, var1 and var2 are two arguments to the function. var3 and var4 are treated local to the function, but they're not created yet. | |
Geomol: 8-Feb-2009 | Another version, you might find useful (at least to see how to make the same thing in different ways, and with different number of variables): fibonacci: func [ i /local a b ][ set [a b] [1 1] loop i [ print a set [a b] reduce [b a + b] ] ] | |
kib2: 8-Feb-2009 | I said my book wasn't clear because in presenting blocks, it uses the words "arrays", then "lists" and "series" inside : it's quiet confusing. | |
Geomol: 8-Feb-2009 | I guess, words like "arrays" and "lists" are common in other languages. In REBOL, you'll see the word "series" a lot. | |
Geomol: 8-Feb-2009 | A block is a series of elements (inside [ and ]). | |
kib2: 8-Feb-2009 | So what's the difference between a block and a serie ? A serie is a block for me no ? (the inverse may not be right) | |
Henrik: 8-Feb-2009 | not all series are alike. We tend to differ between strings and blocks and blocks come in a few different types, optimized for specific use, but they may hold the same content. | |
Geomol: 8-Feb-2009 | A computer language theorist might tell you differences between arrays, lists and series. I suggest, you take the practical view and look at what datatypes, you find in REBOL. | |
Henrik: 8-Feb-2009 | if we didn't have this many datatypes (R3 has even more), parsing and dialects would be less fun. | |
Henrik: 8-Feb-2009 | plus in R3 you can define your own and group types in new ways. | |
Janko: 8-Feb-2009 | wow, you can make your own and combine.. that seems very good! | |
kib2: 8-Feb-2009 | cool and powerful, but we've to wait until R3 gets more stable. | |
Geomol: 8-Feb-2009 | CONTEXT is a function, and you can see, what it does with: >> source context | |
Henrik: 8-Feb-2009 | and objects are contexts. when wrapping set-word!s in contexts, they stay inside that context. | |
Henrik: 8-Feb-2009 | kib2, since you can bind contexts everywhere, even inside other contexts, they are not really secure and so you can't make things really private to a context. Modules will do that, I believe. | |
Janko: 8-Feb-2009 | + in this two cases "dispatches" on the type of arg... but this is probably handlede inside + , so if you define new type (vector3d) you couldn't make + work for that datatype too without changing it ... in multiple dispatch + is a generic word and you add definitions for it for that datatype so it can work on them without changing or having access the original + (basically similar to what is operator overloading at static lang, here it dispatches in runtime based on type) | |
Geomol: 8-Feb-2009 | Janko, I've been thinking about this problem too, and I'm not sure, what's best. Is it good enough, what we can do with functions today? Like: >> old-add: :add >> add: func [a b] [either string! = type? a [join a b] [old-add a b]] >> add 4 5 == 9 >> add "Hi " "John" == "Hi John" Now ADD can also be used to join strings. | |
Henrik: 8-Feb-2009 | kib2, note: the web based dictionary is older and less updated than the word browser, but it works OK. | |
Geomol: 8-Feb-2009 | kib, to avoid confusion, remember that everything in REBOL is a word. The word in itself doesn't have a certain meaning. The words have meaning, when used in a context. The same word can mean different things in different contexts. And you can redefine everything, even things like: + and - | |
Janko: 8-Feb-2009 | Geomol: something like you and I described would probably be possible to do in library , probably not that effective but it should surely be possible | |
Geomol: 8-Feb-2009 | I guess, a number like 1 can't be said to be a word, and it can't be redefined. But you can make a dialect, in which 1 means something else. So you have words, numbers, blocks, etc. The words can be redefined to suit your needs. | |
kib2: 8-Feb-2009 | Geomol: That's really cool; data is code and vice versa, like in Lisp ? | |
kib2: 8-Feb-2009 | Steeve : you don't have too. I'm playing with it at the moment (with R2), and I really enjoy it. | |
kib2: 8-Feb-2009 | Janko: I like this, and in fact it's also the Factor way of doing things. | |
Janko: 8-Feb-2009 | but quotations in factor are still more special case, you have curry and few words for them , but in rebol code block is the same as ordinary data block ( like a sequence { asdasd asd asasd } in factor so you can use insert append remove next ... etc on it .. I imagine factor is more limited here because it compiles things, here you can process your block of code just the same as data and then run it | |
Janko: 8-Feb-2009 | I use that more too and it works.. I don't remember if I changed anything | |
Janko: 8-Feb-2009 | hm.. it seems I just copied that file into .emacs and added 2 lines (I just started using emacs) | |
kib2: 8-Feb-2009 | I saw there was a really nice postscript (and pdf) lib in Rebol. What about using it for making scientific diagrams ? (an old project of mine, in Python, was geoPyx here: http://kib2.free.fr/geoPyX/geoPyXfr.html) | |
Anton: 8-Feb-2009 | When the interpreter evaluates some items in a block, and it comes across word!, it automatically tries to reduce it to its associated value. | |
Geomol: 8-Feb-2009 | In the classes in astronomy, we're taught a language called IDL to reduce scientific data and make images and diagrams. I often just use REBOL directly to make the diagrams. I've wanted many times to make a library of routines or a plotting application in REBOL, but haven't had the time yet. Maybe some day. | |
Steeve: 8-Feb-2009 | and >> reduce reduce ['a] | |
Geomol: 8-Feb-2009 | kib, it's probably not hard, maybe take a bit of work to make it really slim and clever. I just have a ton of projects in the air all the time, so I didn't come to it yet. | |
Anton: 8-Feb-2009 | DO is like REDUCE, in that it evaluates every item in the block, except DO does not create and store results in a new block - it just returns the last value. | |
Anton: 8-Feb-2009 | The 2 is evaluated (to 2), then the 3 is evaluated and returned, because it's last. | |
Geomol: 8-Feb-2009 | Remember, if you wanna know more about operators like =, == and =?, just use ? to ask about them: >> ? =? | |
kib2: 8-Feb-2009 | Geomol: in the last case 1 and 1.0 are different beasts because the first is integer and not the other, that's it ? | |
Geomol: 8-Feb-2009 | kib, yes. == wants both to be same value and same datatype. | |
Geomol: 8-Feb-2009 | http://www.fys.ku.dk/~niclasen/rebol/libs/math/complex.r Just a little start, and no documentation, so you have to read the code to figure it out. | |
Steeve: 8-Feb-2009 | Geomol if your memory works like mine, you only remember process and structures not contents | |
kib2: 8-Feb-2009 | i meant ie is there something for computing intersection between a line and a bezier path ? | |
Geomol: 8-Feb-2009 | kib, no there isn't much graphic routines in postscript, just box, boxfill, image and line: http://www.fys.ku.dk/~niclasen/postscript/postscript.html | |
Anton: 8-Feb-2009 | kib2, you mean intersection(s)* between a line and a bezier path. | |
Geomol: 8-Feb-2009 | kib, I took a look at the PS documentation, and it has arcs, curves, etc. This isn't implemented in the REBOL ps dialect (yet). My dialect was just make fast to get some useful postscript out from REBOL. I have a book on computer graphics, that might deal with the problem, you describe. I take a look ... | |
Anton: 8-Feb-2009 | I would not rest until I had computed the exact intersection(s) of line and bezier curve ! :) | |
Geomol: 8-Feb-2009 | Let's see, chapter 7, "Intersection in 2D". "7.3 Linear Components and Quadratic Curves", "7.4 Linear Components and Polynomial Curves". Hmm | |
Geomol: 8-Feb-2009 | The book is called "Geometric Tools for Computer Graphics" by Philip J. Schneider and David H. Eberly. | |
Geomol: 8-Feb-2009 | I think, it's an excellent book. I read about it on the web long ago, people discussing different books dealing with geometrical problems in computer graphics. I bought it back then and have used it often since. | |
Geomol: 8-Feb-2009 | Chapter 7.4 starts with "This section discusses how to compute points of intersection between the line and curve from both an algebraic and geometric perspective." | |
Geomol: 8-Feb-2009 | Taking some time to read and understand the chapter, I would guess, it wouldn't be too hard to construct an algorithm, that did the job. | |
Geomol: 8-Feb-2009 | Game developers have solved many such problems, and often in efficient ways (games like performance). Intersections with Bezier curves are discussed here: http://www.gamedev.net/community/forums/topic.asp?topic_id=385751 | |
kib2: 8-Feb-2009 | Steeve : the purpose is to create a geometrical drawing dialect. Maybe I'll have a line (AB) that intersects an ellipsis and I wanted to use the intersection points | |
Anton: 8-Feb-2009 | .. because this is where I step in: http://anton.wildit.net.au/rebol/gfx/demo-intersection-points-of-line-and-ellipse.r http://anton.wildit.net.au/rebol/gfx/demo-intersection-points-of-line-and-circle.r | |
Geomol: 8-Feb-2009 | LOL again! I was just about to say: ah, intersection of a line and an ellipse, then you just have to go to Anton's library. | |
Geomol: 8-Feb-2009 | Anton, that's a really cool demo with the line and ellipse! | |
Geomol: 8-Feb-2009 | And I can move the ellipse and endpoints of line around. Cool! | |
Geomol: 8-Feb-2009 | About intersect of line and polynomial curve. There's a preview of the book, I was talking about here: http://books.google.com/books?id=82kntxqd1BoC&printsec=frontcover&dq=Geometric+Tools+for+Computer+Graphics#PPA250,M1 | |
Geomol: 8-Feb-2009 | If you just wanna print the result, PRINT can work on a block, which will be reduced and spaces included in the output: >> print ["Date:" now/date "Time:" now/time] Date: 8-Feb-2009 Time: 23:24:27 | |
Geomol: 8-Feb-2009 | For debugging, you'll find PROBE to be very usefull. You can put it in about anywhere in your code, and it will just work as without PROBE. Examples: >> square-root probe 4 * 8 32 == 5.65685424949238 >> read probe join http:// "www.rebol.com" http://www.rebol.com connecting to: www.rebol.com == {<html> ... | |
kib2: 8-Feb-2009 | Geomol: and thanks a lot for your help | |
Geomol: 8-Feb-2009 | You have build-tag, to-tag and build-markup. | |
Janko: 8-Feb-2009 | it is normal that hash! will only hash "keys" of assoc on first level, if you want on sublevels you can iterate the list and turn it into hashes acordingly .. if you have a lot of data hash is a lot faster 650x in this test http://www.rebol.com/article/0020.html | |
kib2: 8-Feb-2009 | Is there any tool to edit and view at the same time rebDoc files ? I've an idea... | |
Geomol: 8-Feb-2009 | kib, like "Easy VID"? Go to ViewTop and REBOL.com/Demos/Easy VID When you read a page, you can click the code and see how it evaluate. | |
kib2: 8-Feb-2009 | Geomol: I think so :) But for the moment it's in Python (and Qt4). Is there any browser-like widget in the Rebol GUI ? | |
kib2: 8-Feb-2009 | great ! and can you make some parts of text to be bold or italics, etc ? | |
Geomol: 8-Feb-2009 | To make to look good with italic and bold text in the middle, you can use the function SIZE-TEXT to get the layout sizes. | |
Geomol: 8-Feb-2009 | I'm going to bed. Night! And happy coding! :-) | |
DideC: 9-Feb-2009 | Yeah, DOC style is a good start. But there are already great things with R2 : remembering HyperNotes (In R2 Desktop, rebol.com, Contest) this is a Makedoc based and rendering is just fine, with links and so on !! | |
kib2: 11-Feb-2009 | But thanks, "halt" solved my problems as I can now launch my script from my editor and watch the Rebol's console output. | |
Henrik: 11-Feb-2009 | I would not trust R3's parse for now. It's buggy and changing. | |
kib2: 11-Feb-2009 | ok, and for my paragraphs ? |
18001 / 48606 | 1 | 2 | 3 | 4 | 5 | ... | 179 | 180 | [181] | 182 | 183 | ... | 483 | 484 | 485 | 486 | 487 |