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: 28201 end: 28300]
world-name: r3wp
Group: Core ... Discuss core issues [web-public] | ||
Graham: 29-Sep-2006 | Gregg's, and Bo's and mine don't report an error and parse it incorrectly | |
james_nak: 29-Sep-2006 | I'm attempting to add a "repeat command" button to an app but I need to capture the what was sent to a function including the refinements. I'll put that capturing code inside the function called and store it in a global. The arguments, of course, are no problem to save. | |
Gordon: 30-Sep-2006 | Hi guys; Thanks for the input. PeterWood & Anton: I could have sworn that I tried both to-char and to-string. It is the obvious answer, but I have been trying so many things in solving a parse problem that I missed it. Now I remember, I did try them but at the time I complicated the character testing by using quotes and brackets and braces, or in the case of the hex string - not using the #{}. Anyway, thanks for your time in answering. Gabriele: As I was waking up this morning, I was thinking about modifying your CVS parser to make it work with (improperly) quoted strings. That may be the simplier answer to my parsing problem. MikeL: I started by not using the /binary but then the 'read' converts the #{0D0A} sequences to just #{0A} so I was going to try using the /binary option to preserve the original #{0D0A} and got sidetracked into changing the rest of the file back into a string. Turns out that I will be going back to just using the 'read' without the /binary option and try modifying Gabriele's, CVS parser to handle improperly embedded quotes. | |
Gabriele: 30-Sep-2006 | (ie in my code allow " in the charset and remove the quoted field rule) | |
Sunanda: 5-Oct-2006 | 1.2.1 and early do give an error in this case. So, at the very least., its an undocumented change of behaviour. | |
Maxim: 5-Oct-2006 | this is where as-integer and as-decimal make sense IMHO. return the most logical representation of supplied value, with a defined fall back when no sense can be made of input. | |
Gregg: 6-Oct-2006 | False and none are treated the same in many cases, so I think it's fine the way it is; otherwise you have to consider all the other cases as well. | |
Henrik: 6-Oct-2006 | well: pick [do-this do-that] false ; == does 'do-that pick [do-this do-that] none ; == error This came from a function where I had a refinement: f: func [/act] [ pick [do-this do-that] act ] You can't do that, since /act is none. Sure you can then use EITHER, if do-this and do-that are not necessarily in one block, but you couldn't extend the existing code with: >> pick [do-this do-that] any [act false] ; == still none, which gives error So you have to use something less clean like: >> pick [do-this do-that] any [act 2] | |
Henrik: 6-Oct-2006 | rebolek, thanks. as long as there is a way to discern between none and false with one function | |
Maxim: 6-Oct-2006 | all and any are extremely capable as they are. and I don't see why they should change. all and any are NOT boolean operations, they are program flow just like if and either. | |
Maxim: 6-Oct-2006 | 'ANY on returns a non false or non none value. it does not return such a value from the block itself. if you specify only none and false value, it effectively assumes all is bad and returns none. 'ALL is the same, but will only return a value unless one value equates to false or none (in which case it considers the block a failure and returns its own value, not the value from the block itself). | |
Louis: 10-Oct-2006 | Thanks, Peter. I'll try that and let you know what happens. | |
Louis: 10-Oct-2006 | That is a windows error message, and just the first part of it. | |
PeterWood: 10-Oct-2006 | I also downloaded the latest version and got a similar error on 1.3.2. | |
Louis: 11-Oct-2006 | PeterWood and Anton, many thanks! It turned out that one of my children sent me a file with many huge photos. The very slow dialup connection I have here in Indonesia could not (or perhaps is designed to not) handle it. I was able to delete the file and all is well, except that now I can't look at the photos, at it cost me two days trying to solve the problem. I probably could not have solved it at all without you guys. | |
Ladislav: 13-Oct-2006 | Comparison of BUILD and REDUCE/ONLY: | |
Gregg: 13-Oct-2006 | Examples contrasting compose (with /only and /deep) and reduce/only, would be great. I know it has a couple in the script. I've looked at it in the past, but haven't been driven to add it as a standard part of my process yet. | |
Ladislav: 13-Oct-2006 | Henrik: Build can do it using one of the following ways: build [1 [ins 3 + 2 ins now]] build [1 only reduce [3 + 2 now]] build/with [1 inner] [inner: reduce [3 + 2 now]] OTOH, your example is quite specific and not very general (I would say that it as a task for REDUCE/DEEP) | |
Henrik: 13-Oct-2006 | I think some practical examples are needed, for example in building some HTML for a webpage. Something that shows that BUILD is significantly easier than a combination of REDUCE and COMPOSE. | |
Henrik: 13-Oct-2006 | it wants to find the file in my local cache before the remote one and crashes: >> do http://www.fm.tul.cz/~ladislav/rebol/include.r connecting to: www.fm.tul.cz Script: "Include" (5-Jan-2006/14:31:42+1:00) >> append include-path http://www.fm.tul.cz/~ladislav/rebol/ == [%. %/Volumes/c/rebol/ http://www.fm.tul.cz/~ladislav/rebol/] >> include %spider.r connecting to: www.fm.tul.cz ** Access Error: Cannot open /Volumes/c/rebol/spider.r ** Where: include-script ** Near: found: load/all target if header >> Sorry, if I'm being a little difficult :-) | |
Henrik: 13-Oct-2006 | I saw it. The draw block would then be evaluated from the spider code and then inserted at that place? | |
Henrik: 13-Oct-2006 | something like "this takes 100 lines of code to do with regular REBOL block construction functions, while BUILD can do it in 20 and make much prettier code out of it" | |
Henrik: 13-Oct-2006 | by looking at it, SPIDER looks like a regular function to me with the following block as input. I guess it can't be, because then the layout block could simply be done by enclosing spider [...] in ()'s and compose/deep the whole thing. | |
Henrik: 13-Oct-2006 | that would be cases where you need to compose things during runtime and not "layout time" | |
Ladislav: 13-Oct-2006 | Actually, we might use something like REDUCE/DEEP/ONLY, if the /DEEP refinement existed and if /ONLY specified the words that should be evaluated instead of the unevaluated ones | |
Pekr: 13-Oct-2006 | hmm, what if you have more parens, containing the same words, and one you want to evaluate, while second you don't? | |
Ladislav: 13-Oct-2006 | This is exactly why COMPOSE isn't as comfortable. There are many blocks containing parens and you cannot pick any replacement for parens in COMPOSE case. | |
Henrik: 13-Oct-2006 | then I would vote for having it done and deprecate the use of compose, or is that too drastic? | |
BrianH: 13-Oct-2006 | Has anyone implemented some kind of functional-language-style structural patten matching and transformation? | |
BrianH: 13-Oct-2006 | I don't know - I was pretty throrough before. Let me review past discussions and see if I've come up with anything new. | |
Henrik: 13-Oct-2006 | ladislav, what if I want to use values that are already set elsewhere, like function input? then the /with values block needs to specify the values too: a: func [b] [ build/with [this block contains a c] [c: :b] ] Perhaps I've created the build block elsewhere and want to use parts of it with BUILD. Perhaps also I want that block to be fully readable. Then it would be nice to: y: [that is a very large animal] a: func [animal] [ build/words [that is a very large animal] [animal] ] a 'cow == [that is a very large cow] | |
Ladislav: 13-Oct-2006 | the problem with your 'animal example is, that such a thing can be implemented natively and be quite fast. To obtain the fastest possible mezzanine implementation I resorted to the "object-like" behaviour. BTW, it is easy to "transform": a: func [animal /local animal*] [ animal*: :animal build/with [that is a very large animal] [animal: :animal*] ] | |
Anton: 13-Oct-2006 | I support the idea of adding build as a native. I would like to check it out more but I think it's a good bet from what I've seen today and in the past. | |
Gregg: 13-Oct-2006 | 1) I think reduce/only works backwards; /only should say what words you want evaluated. I don't know how much code depends on that yet, or if Carl would be open to change it, or even what the design rationale was. I wonder if adding BUILD is will cause some confusion, because of similar methods to do the same thing, WRT REDUCE and COMPOSE. What I like about COMPOSE (and, yes, I don't like the downside of trying to compose in parens) is that the parens are visible, so you know what's being operated on. With BUILD, 'ins and 'only don't jump out visibly as much. | |
Maxim: 13-Oct-2006 | we could simply add a double parens filter. that allows parens to stay in the blocks, and makes the composed values even more obvious... | |
Maxim: 13-Oct-2006 | but those extra blocks add unneeded complexity... and honestly... in about 80% of cases, the /deep refinement is required... | |
Henrik: 13-Oct-2006 | It's awkward, I think. I can't tell what really happens when you embed multiple levels of parantheses and brackets | |
Maxim: 13-Oct-2006 | and its not of any help with /deep I often use /deep when creating objects which use words which are the same as values within the code creating it. same thing for dynamic view layouts. | |
BrianH: 13-Oct-2006 | Yeah, with /deep you have to use nested calls to compose and to-paren. | |
Ladislav: 13-Oct-2006 | 'ins and 'only don't jump out visibly as much - 'ins and 'only are not "real keywords". Using the /with refinement you can use any keywords you like. Actually, BUILD [...] is defined as: build/with [...] [ ins: func [x [any-type!]] [get/any 'x] only: func [x [any-type!]] [ head insert/only copy [] get/any 'x ] ] | |
Louis: 14-Oct-2006 | When constantly having to convert from one currency to another is it best to not use the money! datatype? If I change for Rp. to $ and then back to Rp. I lose a few Rp. | |
Volker: 14-Oct-2006 | (Skipping a lot discussions) build [1 [/ins 3 + 2 /ins now]] build [1 /only reduce [3 + 2 now]] and i would like it. Or, because lit-wrds mean exeptions in parse, build [1 ['ins 3 + 2 'ins now]] build [1 'only reduce [3 + 2 now]] | |
Anton: 14-Oct-2006 | Oh I've just got a very basic and customized accounting program. It basically just runs through all my transactions, subtracting expenditures and adding incomes. | |
Anton: 14-Oct-2006 | It can plot a graph of the balance over the last year, so I can see the patterns and trends. | |
Gregg: 14-Oct-2006 | BUILD - 'ins and 'only are good words, it's just that plain words, mixed with a lot of other plain words, don't catch your eye, so using any other word doesn't solve it for me. That's why I used the set-word! syntax in my COLLECT function if you recall. I would probably end up using "special" words or marker values, e.g. puting special chars around the words, like ~ins~ or *only*, or just using special start/end markers. Basically, synthesizing a paren alternative or looking for words that are "marked up" in a ceratin way. e.g. build [1 [|_ 3 + 2 _| |_ now _|]] ; |_ val _| = ins val build [1 ||_ reduce [3 + 2 now] _|| ] ; ||_ val _|| - only val build [1 *this* and *that* but not these] ; marked words, e.g. *-modified, are reduced | |
Ladislav: 15-Oct-2006 | we can conclude, that there is *no amount* expressible in dollars and cents that has got the properties you want it to have | |
Ladislav: 15-Oct-2006 | The solution is up to you - you need to know what you really want and how to get it. | |
Oldes: 15-Oct-2006 | Louis: Ladislav is right, the money shows you just 2 decimals digits and rounds as you can see: >> 777777 / 9220 == 84.3575921908894 >> to-money 777777 / 9220 == $84.36 >> (to-money 777777 / 9220) * 1000 == $84357.59 >> (to-money 777777 / 9220) * 1000000 == $84357592.19 | |
Anton: 15-Oct-2006 | I wish I could divide the money in my bank account into $10 amounts and then just multiply them, but the bank won't let me. I don't know why. | |
Oldes: 15-Oct-2006 | Ok, you are right, I know I can do 10 * $10 and it's probably logical, but anyway, for me money is a number and this is new form me: >> second (to-money 777777 / 9220) == 84.3575921908894 | |
Oldes: 15-Oct-2006 | and it should be possible to do $10 * $10 as in the Louis' example above, the number 9220 should be money datatype as well as it is number of roupies per dollar (if I understand it well) so he should use RP$9220 if he is using money! for dollars | |
Anton: 15-Oct-2006 | and I strongly disagree that you should be able to multiply two money!s. | |
Anton: 15-Oct-2006 | A currency exchange rate (such as Louis' 9220) includes, as part of its definition, two distinct currencies (eg. RP and USD). | |
Louis: 15-Oct-2006 | All this is very interesting. I appreciate all of your comments. Anyway I have a workaround to the problem. First of all, however, I need to tell you why I wanted to be able to convert dollars back to rupiahs. It was just to save space in the database. I enter rupiahs, as that is the currency I am using right now, but the software converts it to dollars and saves the dollar amount to the database. To find out the rupiah amount later if needed, I was going to do a reverse conversion. The other solution is to simply record the rupiah amount in the database also, so that is what I'll do. | |
Louis: 16-Oct-2006 | I've converted the script to decimal, and it works great! | |
BrianH: 16-Oct-2006 | Watch out though - your problem wasn't a decimal vs. money problem, it was a rounding problem. If you are going to store the dollar equvalent in a database make sure to store it as a floating-point value rather than a fixed-point like SQL's decimal type. Otherwise you are going to run into the same problem when you store the data and retrieve it again. | |
BrianH: 16-Oct-2006 | You and me both. | |
Jerry: 19-Oct-2006 | How do I use the CALL native function to call a external program via shell and wait for the program to finish. I try the /wait refinement, but it does not work. * Example: call/wait "regedt32 /E C:\backup.reg" | |
PeterWood: 19-Oct-2006 | It appears to be something specific to the application being called. Both call/wait "cmd" and call/wait "C:\Program Files\rebol\view\rebol.exe" worked as expected for me though call/wait "regedt32" didn't. | |
Jerry: 19-Oct-2006 | About the out-of-memory error, the story is ... I am trying to compare two complete Windows Registry, which are both huge. I export them into files (in little-endian 16-bit Unicode), which are both 300+ MB. To save the space and to make REBOL easy to handle them, I encode these files into UTF-8. they are now 150+ MB. I try to load these two UTF-8 files into memory: >> lines1: read/lines %/c/reg1.reg == ["Windows Registry Editor Version 5.00" "" "[HKEY_LOCAL_MACHINE]" "" ... >> lines3: read/lines %/c/reg2.reg == ** Script Error: Not enough memory ** Where: halt-view ** Near: halt >> rebol/version == 1.3.2.3.1 | |
Jerry: 19-Oct-2006 | Without the /line refinement, it takes less memory, and the situation is much better. When it reach the 1.28 GB Memory (observed by STATS), however, The Out-Of-Memoey Error still happened. Does the 1.28GB-boundary have anything to do with my 1GB physical memory? | |
Maxim: 20-Oct-2006 | recycle will only work if you free all references to data. you can do this by setting any unused global and local vars to none. | |
Anton: 20-Oct-2006 | I would avoid molding by putting length? on the front, and I'd also avoid line conversions done in non-binary mode: length? lines3: read/binary %/c/reg2.reg | |
Maxim: 20-Oct-2006 | and yess, in next R2 version, the doc string should be more explicit, | |
Gabriele: 20-Oct-2006 | Max, the reason behind repend there is that join "a" something and join "a" [something something-else] should produce similar results. | |
Maxim: 20-Oct-2006 | yeah I know, but join is just much more cleaner in the code... and now I realise that its use is quite limited, since most uses of block with words have unbound words. | |
Rebolek: 20-Oct-2006 | Maxim, 'join is much more cleaner in code? That's matter of opinion, I use 'rejoin almost everywhere and 'join just very rare :) | |
Maxim: 20-Oct-2006 | so I guess I'll just use rejoin for blocks and join for strings :-) | |
Rebolek: 20-Oct-2006 | Jerry: For conversion from/to UTF/UCS... you can use Oldes' unicode tools, it handles it very well (unfortunately you have to look around AltMe for some link, because Oldes does not upload to rebol.org and has his files all around the web - shame on you, Oldes! ;) | |
Jerry: 20-Oct-2006 | To Gregg, The diff algorithm I am using ... 2 blocks, one for reg-data-old (block1), the other for reg-data-new (block2). data in these blocks are in the following format: [ key1 value1 key2 value2 key3 value3 ... ] where keyX and valueX are both strings. Example: [ "HKEY_LOCAL_MACHINE_SOFTWARE_ABC" {"sid"=dword:00000001^/"tid"=dword:000000FF} ... ] I use "SORT/SKIP 2" to sort the 2 blocks. It's very fast, I guess that's because the original data are in order already. After sorting, I can comapre these two blocks with the "race" algorithm. The "race" algorithm is very simple ... loop [ if ... the key in block1 is equal to the key in block2 then ... check their values (different values mean modified) if ... the key in block1 is less than the key in block2 then ... the key in block1 is deleted-key. Move the key in block 1 to the next key. if ... the key in block1 is greater than the key in block2 then ... the key in block2 is added-key. Move the key in block 2 to the next key. ] Well, my English is not very good. I hope you understand what I am saying here. | |
Jerry: 20-Oct-2006 | I would like to know ... 1. How to use the OPEN function with the /SEEK refinement to replace the 1,000,000th byte with the 2,000,000th byte in a file. 2. How to truncate a huge file to its helf size, and keep the head helf only. Thanks. | |
PeterWood: 20-Oct-2006 | Some of the statements can, of course be consolidated and there are, no doubt, better ways of doing this. | |
Graham: 20-Oct-2006 | Peter, the second answer would not work well with large files. I think Carl gives an example of how to copy large files and one should use that method. | |
Jerry: 21-Oct-2006 | And loading the registry into a REBOL block is not a problem so far. I simply READ the registry-dump file as a string, then PARSE the long string into block: parse-reg: func [ file /local str blk ] [ str: read file blk: copy [] parse str [ to "[HKEY_" some [ copy txt thru "]" (append blk txt) skip copy txt [ to "[HKEY_" | to end ] (append blk trim txt) ] ] str: none blk ] | |
Ashley: 22-Oct-2006 | Quick question. Assuming I have a script with the following in it: ... either system/script/args [ ... and the following in another script: do/args %my-script.r 42 what do I need to get it working remote. Tried the following without success: do/args http://www.my-site.com/my-script.r42 do-thru/args http://www.my-site.com/my-script.r42 Any ideas? | |
Ashley: 22-Oct-2006 | Got it working. Deleted everything and started from scratch with the do/args version and it now works as expected. Thanks for the lead. | |
Janeks: 23-Oct-2006 | Why this function runs well on some web servers (f.ex. KFWS) but hangs (getting cgi script time out) for MS IIS and how to solve them? I found that problem is in line where read-io is. read-post-data: func [ {Reads the HTTP entity body} /safe "Disables evaluation of content-length header." /local len data tmp ] [ len: load any [ all [safe "65536"] system/options/cgi/content-length "0" ] data: make string! len tmp: make string! len while [ 0 < read-io system/ports/input tmp len ] [ insert tail data tmp clear tmp ] data ] | |
Jerry: 26-Oct-2006 | I got two REBOL functions, say, f1 and f2, which are both time-consuming. How can I make them run simultaneous in the same process? Thank you. | |
Pekr: 27-Oct-2006 | guys, please, just introduce syntax, which will be in-build in R3. Because we are relatively close (well, who knows :-) to R3 alpha, and once we become familiar with some technique, I would not like to learn new habits for R3 eventually .... :-) | |
Jerry: 27-Oct-2006 | I have noticed some REBOL experts designing their own protocols, which, by the way, are very cool. By "protocol," I mean the protocol part of an url, it doesn't have to have anything to do with networking. I would like to design my own protocol, too. So I can write: >> print read DICT://English/English/Cheyenne Cheyenne -noun, plural -ennes, (especially collectively) -enne for 1. 1. a member of a North American Indian people of the western plains, formerly in central Minnesota and North and South Dakota, and now divided between Montana and Oklahoma. 2. an Algonquian language, the language of the Cheyenne Indians. 3. a city in and the capital of Wyoming, in the S part. 47,283. >> Is there any document I can read about this. Thank you for your help. | |
Jerry: 27-Oct-2006 | My mistake. Sorry, DocKimbel. And thank you for bringing us the wonderful Cheyenne web server | |
Anton: 27-Oct-2006 | Jerry, go to http://knowngood.com/rebol/ and search "rebol scheme handler" The first link for me is "Rebol Forces — Writing your own Protocol Handler" which as I remember is written very well by Jeff Kreis. | |
Anton: 27-Oct-2006 | and be prepared to get your hands pretty dirty writing scheme handlers. You will need to understand how words are bound to different contexts. However, your scheme looks pretty easy to write. | |
Anton: 27-Oct-2006 | I have used data: read/binary url and saved data to disk. Now I want, without accessing the disk again, to translate the line terminators as if I had just READ the file at the beginning. Any ideas ? | |
Anton: 27-Oct-2006 | Hmm.. can't be a simple as that. I think READ determines the file's host platform somehow and translates accordingly. | |
Maxim: 27-Oct-2006 | so the above will read DOS and UNIX newlines. | |
Maxim: 27-Oct-2006 | I'm using it myself for http operations on a server. and it works flawlessly. | |
Maxim: 27-Oct-2006 | for a more unified conversion you could do this: data: replace/all replace/all to-string data "^M^/" "^/" "^M" "^/" this way if its CRLF it will strip them and if its only CR it will convert them. | |
Maxim: 27-Oct-2006 | and EDI uses non-printable characters as separators... | |
Maxim: 27-Oct-2006 | and btw, I love REBOL's extended character set for words. being able to use - + = ' &, etc in words just makes words so much more expressive. | |
Gregg: 27-Oct-2006 | I got two REBOL functions, say, f1 and f2, which are both time-consuming. How can I make them run simultaneous in the same process? We don't have threads in REBOL (though the rumored task type in R3 may give us this capability), so you need to do big tasks in little chunks, maybe FSM driven, to simulate things like co-routines. | |
Anton: 28-Oct-2006 | (and has an alternative way, but I think it will operate minutely slower.) | |
Henrik: 31-Oct-2006 | anyone built a function to find duplicate elements in a block and return them in a separate block? | |
Group: Tech News ... Interesting technology [web-public] | ||
Ladislav: 25-Jan-2012 | 'My point is simply how much we “each” trust this all.' - I do not worry. For example in mathematics you do not need to trust anything. You can look up the proof and if you find it correct you are done. If you find it wrong you can: - trust the theorem anyway trying to correct the proof - distrust the theorem trying to find a counterexample | |
Reichart: 25-Jan-2012 | .......indeed, and agreed. There is a lot of "opinion" on WP, and also levels of vagueness that allows people to create subterfuge, and misdirection, and force their opinion on people through this. | |
Reichart: 25-Jan-2012 | Wow, when you get to zero, we jump into philosphy, and questions of "what is matter' etc. i therefore, truly, have zero opinion. | |
Geomol: 26-Jan-2012 | I suspect it varies on the domain you are looking into. Stuff like science should be okay. When I took courses at the university some 5 years ago, WikiPedia was becoming still more popular, and the students used it to get information about science. The professors warned us about WikiPedia, about it's being unreliable, and said it shouldn't be used for scientific facts. Over the years, I find it ok with many banal facts, but not much more than that. I try to remember to tell myself to have my critical glasses on, when I read WikiPedia. | |
Pekr: 26-Jan-2012 | I like Wikipeia - for me, it is kind of psychological. I was e.g. looking at ARM gfx chip options. I orientiated myself thanks to Wikipedia, learning about PowerVR, Adreno, Mali, , their history, list of companies using those chips, etc. When I want white papers, I can visit target company websites, but Wikipedia provided me quickly with the interconnecte/related info, so I got my overview of the situation rather quickly. And that' it - it would be much harder imo to just search for a bits of info here or there ... | |
Geomol: 26-Jan-2012 | I agree, Pekr. I use Wikipedia a lot the same way. To get a quick overview, and as Reichart say, to be able to begin to ask the right questions. I also often use the external links and references at the bottom of most pages. | |
Henrik: 1-Feb-2012 | Regarding Wikipedia, I just finished this interesting podcast, where Dan Benjamin and John Siracusa discuss Wikipedia and why they think it's built on the wrong foundation. Siracusa was misquoted on an article that he wrote for ArsTechnica, but was unable to change it incorrect citation in Wikipedia (it has since the podcast aired been changed): http://5by5.tv/hypercritical/52 Starts at 72 minutes and 30 seconds. |
28201 / 48606 | 1 | 2 | 3 | 4 | 5 | ... | 281 | 282 | [283] | 284 | 285 | ... | 483 | 484 | 485 | 486 | 487 |