World: r3wp
[Core] Discuss core issues
older newer | first last |
Graham 3-Sep-2010 [18118] | http://www.rebol.net/cgi-bin/rambo.r?id=-4777& Delete does not take a port spec ( Gabriele are you still reviewing Rambo submissions? ) |
Gabriele 3-Sep-2010 [18119] | I think that can be worked around by using REMOVE on the port opened on the directory that contains the file... worth testing maybe. Anyway, yes. Ticket is now #4401. |
Graham 3-Sep-2010 [18120] | Would this stop rebol working ? http://downloads.zdnet.com/abstract.aspx?docid=2111429&tag=nl.e530 |
Maxim 4-Sep-2010 [18121] | i don't think so. |
Graham 13-Sep-2010 [18122x2] | Henrik, what's this bug regarding 'encloak that you have mentioned on your blog? |
encloak uses SHA1 I think | |
Henrik 13-Sep-2010 [18124] | Graham, link? I can't remember that blog entry. |
Graham 13-Sep-2010 [18125x3] | This is BSD C code for SHA 224 - 512 ... can someone review this to see if we can include in 2.7.8 ? |
http://www.hmkdesign.dk/rebol/files/category-rebol-3.html | |
http://www.ouah.org/ogay/sha2/ | |
Henrik 13-Sep-2010 [18128] | I can't remember what the bug was. It may have been fixed in the meantime. |
Graham 13-Sep-2010 [18129x2] | I looked on rambo and saw no entries for encloak |
35kb of C source | |
Henrik 13-Sep-2010 [18131] | I think the issue was around R3's encloak, not R2. |
Graham 13-Sep-2010 [18132] | oh .ok |
Pekr 15-Sep-2010 [18133x2] | sorry if I will propose a nonsense, or if the solution already exists, but - when using REBOL for data extraction (using parse) and forming a block or CSV as a result, I often come to the need of append-only-if-the-item-does-not-exist-already, so using following idiom: if not found? find target value [append target value] What about adding /not refinement (or other name), so that I could append only unique values? |
Also - is there any way of how to easily find out, if the block is unique? Should I apply 'unique, and compare the length before and after? Pity 'unique has /skip refinement, but does not have /compare one (as 'sort has), so that I can't set, when I have e.g. record of 5 items, I want to 1) set the record size (/skip) 2) select fields, upon which we want to define uniquess - could be an integer offset, or a block of positions [1 3] ... 'sort allows at least the offset via /compare | |
Sunanda 15-Sep-2010 [18135] | Two partial workarounds to your first issue Petr (I've used them both or various data sets): 1. simply APPEND each time, then when the set is complete use UNIQUE to deduplicate 2. if not alter target value [append target value] this ensures that VALUE is the last entry in TARGET |
Henrik 15-Sep-2010 [18136] | 2 is more efficient, since UNIQUE always copies. |
Pekr 15-Sep-2010 [18137] | but as for efficiency, does the alter really differs from "if not found? find?" |
Henrik 15-Sep-2010 [18138] | ALTER removes a value, if it's found. |
Pekr 15-Sep-2010 [18139] | which is the reverse, but the same, as appending only in the case, if not found :-) |
Henrik 15-Sep-2010 [18140] | ALTER is not really useful in its current form. |
Oldes 15-Sep-2010 [18141x3] | I found not use ALTER as it's not native.. I usually use the solution UNIQUE where the block is not much large, but if efficiency is needed, I would just go with: unless find blk val [append blk val] |
(I found = I would) | |
I don't want to add new refinements for such a easy to do solutions as they would slow every APPEND a little bit. | |
Pekr 15-Sep-2010 [18144] | it is just, at least for me, when using append at all - it is very often used idiom ... |
Graham 15-Sep-2010 [18145] | some people prefer this construct all [ find blk val append blk val ] |
Henrik 15-Sep-2010 [18146] | that would be ANY instead of ALL. |
Graham 15-Sep-2010 [18147x2] | oh yeah :) |
two characters shorter than Oldes' solution | |
Pekr 15-Sep-2010 [18149x2] | that's programmer's solution, but it does not read as nicely as - if not found? find blk val [append blk val] :-) |
yes, Oldes' version reads even nicely ... | |
Graham 15-Sep-2010 [18151x3] | Who says? |
These are just idioms ... | |
I always have to think twice or more when i come across 'unless :) | |
Pekr 15-Sep-2010 [18154x2] | And I have to think more than twice, when using combination of NOT ALL, NOT ANY :-) |
Can I somehow get a difference of two blocks, with different sizes? Trying to avoid loops, but I will use loop most probably anyway ... blk1 structure: [contract user tarif] blk2 structure: [contract user street town tarif] I know there are functions like intersect/difference, they even have /skip refinement, but those most probably can't treat different record sizes? | |
Oldes 15-Sep-2010 [18156] | Graham, you are not english native speaker? For me it's easy.. I learned that UNLESS = IF NOT and so I use it:) http://www.edufind.com/english/grammar/IF9.cfm |
Pekr 15-Sep-2010 [18157] | I remember UNLESS from extended basic of ZX Spectrum. And I lowed the word itself, dunno why :-) |
Oldes 15-Sep-2010 [18158x2] | Are you looking for this? >> difference [contract user tarif] [contract user street town tarif] == [street town] |
or what result do you expect? | |
Pekr 15-Sep-2010 [18160x2] | no, sorry ... those are just structures, but blocks contain real data, hundreds and thousands of records ... |
but never mind, I will use loop and look-up, no problem, just laziness :-) | |
Graham 15-Sep-2010 [18162] | unless is one more character than if not .. so why use it? |
Ladislav 15-Sep-2010 [18163] | I guess, that what Pekr wants should be implemented carefully, otherwise it may end up being slow... |
Oldes 15-Sep-2010 [18164] | Graham.. that's easy... because UNLESS is faster then IF NOT |
Maxim 15-Sep-2010 [18165] | I really think, again, that 'append-or-insert-only-if-the-item-does-not-exist-already should be a native in R3. its a function MOST of us would use on a frequent basis. it would be very usefull and its very powerfull with a /skip refinement |
Pekr 15-Sep-2010 [18166] | agreed ... |
Ladislav 15-Sep-2010 [18167] | As opposed to that, my opinion is, that it should not be a native, since no significant speedup against a mezzanine would be observable |
older newer | first last |