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: 29201 end: 29300]
world-name: r3wp
Group: Core ... Discuss core issues [web-public] | ||
[unknown: 5]: 2-May-2008 | Thanks Gregg and Henrik. At least I know I should expect to "see" an immediate release of the memory by the REBOL process. I just wanted to make sure I wasn't missing some REBOL magic somewhere. | |
Gabriele: 3-May-2008 | i don't think there is any way to force rebol to return the memory to the OS, and I don't think there's any need either, but that depends on the OS i guess. | |
TimW: 6-May-2008 | I looked around a bit and couldn't really find a good solution. Is there an easy way to reorder a block that's not sorting it - To just move one element. Say my-block: [a b c d e] Is there a function to just move c to the front of the block, or to push it to the back? | |
PeterWood: 6-May-2008 | I've just checked and move is in Core 2.7.6 | |
Gregg: 6-May-2008 | I don't think I've ever used it, so it may be something that hasn't been tested enough. If you can create a small example and post it to RAMBO, that would be great. | |
BrianH: 6-May-2008 | PeterWood, you should definitely try MOVE. We were very careful to avoid the aliasing and overlap issues that often happen with move functions; getting it right the first time was the whole point of its inclusion. :) | |
BrianH: 6-May-2008 | Fortunately you can still use AT, SKIP and HEAD if you need to :) | |
Geomol: 7-May-2008 | What's the best way to produce random passwords? I have an algorithm, that use RANDOM. I figured, I would use seed to start the random generator like this: random/seed to decimal! now/time/precise to be sure, it starts in the most random way. In theory this will give the same result, if the routine is called two times right after each other, and the time didn't evolve meantime. Maybe I shouldn't use seed? How does REBOL start its random generator, when REBOL launch? What does RANDOM/secure do? | |
Pekr: 7-May-2008 | I used the same and added random copy/part to it :-) | |
Gabriele: 7-May-2008 | Geomol, use RANDOM/SEED NOW/PRECISE (no /time and no to decimal!) | |
Sunanda: 7-May-2008 | You could drop the seeding and just use random/secure loop 10 [prin [random/secure 100 " "]] 99 22 67 18 31 6 54 80 94 24 | |
Geomol: 7-May-2008 | What I'm after, is a secure way to produce a password, also in a webservice, that could be called many times each second. RANDOM/secure can produce the same output again and again, as can be seen with this: >> loop 10 [random/seed now/precise prin [random/secure 100 ""]] 61 61 61 61 61 61 61 61 61 61 See the block as the webservice. So here it's not good to use random/seed. If I leave out random/seed, what then define the initial state of the random generator? I need to know this to figure out, if this is a secure way to produce a password or not. | |
Geomol: 7-May-2008 | I need to do something like Sunanda suggest. But before I do that, I would like to know, if I can do it in another way. And then it would be cool, if I learned, what exactly random/secure mean. | |
Gregg: 7-May-2008 | Generate pools of passwords, and store a counter to use when you need to re-seed and generate a new pool. That way you can generate them over a long period of time and just pull them as necessary. | |
Geomol: 7-May-2008 | Great idea! :-) And a simple solution. | |
Reichart: 8-May-2008 | what happens if no random/seed is used in a REBOL program? That same thing that happens with almost all random generators, which is a pattern is used. REBOL has a starting seed value (unknown with out extensive testing). However, it will (and should) have the same value upon start up. The problem (you are perceiving) is with the word "RANDOM" Perhaps it should be called PATTERN instead. However, if seeded, RANDOM in turn will use a formula to generate more in the series. This is indeed true random, in as much as the seed's size sets the size of the universe. So, if you want to always have a random set, you need to get fresh random data (hmmm, I seem to recall mentioning this in another thread). Of note, the RANDOM we use in slot machines is NOT like REBOL's random function. REBOL's RANDOM (like most language random functions) is really SEED+OFFSET in a series. (thus a pattern). I'm not sure what Carl did to make it secure, but my best guess is he is sucking in what ever he can find to make it Random (this doing what I'm suggesting in the first place). For example, reading the mouse port, temperature, current time (to the jiffy), etc. This would make RANDOM what you expected it to be in the first place…but in theory this would be slower. In your case, this would be the way to go. | |
Geomol: 8-May-2008 | Ah yes, there is a 24 hour cycle problem with my approach. I could construct a more unique decimal taking year, month and day into account. Hm, random/seed returns a value, if called with a decimal!? Called with an integer, it doesn't. A reason for this? >> random/seed 100 >> random/seed 100.0 == 41.0 | |
Geomol: 8-May-2008 | Maybe random ignore the /seed and just give me a decimal random number? | |
Pekr: 8-May-2008 | try to switch you PC to 23:59 and do some loop which will print time :-) | |
Geomol: 8-May-2008 | A suggestion for an algorithm to produce a random seed from the time: s: to integer! 2 ** 32 / 86400 * (to decimal! now/time/precise) - (2 ** 31) s: enbase/base debase/base to-hex s 16 2 reverse s s: to integer! to issue! enbase/base debase/base s 2 16 random/seed s It does this: 1) convert now/time/precise to an integer using all possible bits 2) make a string of 0 and 1 from it 3) reverse the string 4) convert it back to an integer 5) And finally use it as a seed Doing it this way, I hope to have a good span of possible start values for the random generator. Did I miss anything? | |
Geomol: 8-May-2008 | This might be a good example to illustrate my point in the other thread about randomness and the difference between digital computers and analog human brains. In my example, I'm about to produce a 8 character random password. Each character can be one of 60 possible chars. So I set up a random/seed with 2 ** 32 = 4'294'967'296 possible start values, so I can at best produce the same amount, 4'294'967'296, different passwords with my routine. I can't change this by putting new random/seed in after each character found, because of the determinism in how a computer work. I would need to get input from the outside to produce more different 8 char passwords. As a human, I can pick between 60 possible chars, and I have to do it 8 times, so I can make 60 ** 8 = 167'961'600'000'000 different passwords. That's a lot more than the computer. When we go to abstract thoughts with no clear limits (like 60 and 8), we are far superior to the digital computer. It would be much easier to make an artificial intelligence, if our computers were analog. | |
Reichart: 8-May-2008 | John wrote "It seems to be 1." And this is probably correct from a social point of view. But I will stick with "unkown without extensive testing" because many integers can give the same sequence, and might even give the same sequence for a long time before they diverge. This is the subtle point I'm trying to make about what is random vs pattern. Things that "seem" are the reason hackers crack codes…this is where I used to start when I cracked other people's systems… | |
Geomol: 8-May-2008 | Peter, yes random.org is a solution, and a good one. But it doesn't hold in a real application, because what if there's no web connection. I have a routine, that is good enough for my problem. What I'm after, is the best way to do this. I and others might learn from this. | |
Geomol: 8-May-2008 | So a way to get good random numbers over a long period of time, is to start such a routine (like the Mersenne twister) only once. The routine should then work with a high number of bits, the more the better and store the state, it has come to, to disk. Every time the computer is turned on, it can pick the state from disk, and start from where it left off. A password generator should use this routine and call it between each character in the password. If the routine has high enough resolution, it should be possible to produce 60 ** 8 different passwords. | |
Geomol: 8-May-2008 | And if a hacker get acces to the state stored on disk, we're screwed again. ;-) | |
Gregg: 8-May-2008 | This is the randomize func I use, FWIW: Alan Parman did quite a bit of R&D and posted this as his best solution. randomize: func [ "Reseed the random number generator." /with seed "date, time, and integer values are used directly; others are converted." ][ random/seed either find [date! time! integer!] type?/word seed [seed] [ to-integer checksum/secure form any [seed now/precise] ] ] | |
Reichart: 8-May-2008 | And if a hacker get acces to the state stored on disk, we're screwed again. ;-) And that is why we set the random seed randomly... | |
btiffin: 8-May-2008 | John; If you ever get a chance, check out R. http://www.r-project.org It's a statistical analysis language (in the main) and goes to great length to ensure a reproducible random sequence on each run. This allows for verification, stable screen shots of sample graphs etc. I like the fact that REBOL has the same feature of "known" random numbers across runs, until a forced seeding. In Quebec, someone figured out the sequence of the provinicial Keno game. He won three times before someone got suspicious. The lotto corp wanted to deny him his prize money. A judge ruled that if they did, they would have to deny and claw back all winnings from everyone. So they paid. And fumed and puffed out their chest, and then went back to school to learn better programming. :) Last I heard, the guy hasn't cracked the new sequence ... yet. | |
btiffin: 8-May-2008 | Yep. Bean counter code by bean counter people. :) But the random packages, there are at least five, go into great detail and the issues. Then again, this is REBOL/Core. Beats the pants off R, we just lack the bean counters. :) | |
Geomol: 9-May-2008 | I'm not fair using the word "ignorance". I don't think, you are. I base my conclusion on the following: See the password generator as a black box, that you feed with an integer, and out come a password. The integer input has 2 ** 32 different combinations and is used for the random/seed. Out come a password, and there can only be 2 ** 32 different passwords coming out at most. It doesn't matter, how the algorithm is constructed, if you put time delay in, call random or random/seed more than once, etc, as long as you don't get other input as the first integer. This is basic in information theory. And it's related to the determinism in digital computing. | |
Dockimbel: 9-May-2008 | Given a good algorithm (like Mersenne twister), and a true random generator for seeding (like hardware sensors) a computer could cover the 60**8 range. A humain brain, even given enough time, can't (I'm talking about generating random combinations, not using loops to generate every single combination). Even worse, humain results would show heterogeneous distribution of results, while computer will give a uniform distribution. So in that case, computers would give you better randomness than analog brains. | |
Geomol: 9-May-2008 | Yes, valid points, but it's not what I described at first. If I should construct a random password given the rules, my output will land in a pool of 60 ** 8 possible passwords. I don't have to actual do it. The statement holds anyway. If a computer should construct a random password given the rules (using any deterministic computer and any algorithm, but only with a 32-bit integer input, as in the case of REBOL random/seed), the output will land i a pool of 2 ** 32 possible passwords at most. Of course we can change the frame and get a better result from the computer, but then we change the 'experiment'. In general, I would say the pool from human thoughts and decisions is infinite. It's not from a deterministic computer. So we need true random input and true analog computing with infinite states, if we want our computers to be as good as our brains. | |
Dockimbel: 9-May-2008 | In general, I would say the pool from human thoughts and decisions is infinite . That needs to be proved. It can be very high without being infinite. | |
Dockimbel: 9-May-2008 | By using a better than REBOL default RANDOM function and using a source of true randomness for seeding. | |
Geomol: 9-May-2008 | How do I use a better random function, now that it's a routine programmed in REBOL? I could get the source of a better routine and implement it myself. That will give me a better result, yes. I'm not going to do that, as my current routine is good enough for the purpose. How do I access a source of true randomness from within REBOL? random.org has been suggested. Other ways? | |
Gabriele: 10-May-2008 | about 2 ** 32, that's a limitation of *your* algorithm, not RANDOM. indeed, if you don't reset the seed each time, and use random/secure, you probably get all of the possible passwords (and very likely more than humans would pick). besides, it is not proven that random/seed only takes 32 bits of data when seeded with a date!. (C rand() is most likely 32 bit, but random/secure could be using more than that.) | |
Gabriele: 10-May-2008 | if you feed a human a 32 bit int and ask him/her to get you back a password, and it has to give you the same password for the same int, then how many password would the user give you? | |
btiffin: 10-May-2008 | A psych prof I knew, wrote papers on the quantum clock in our brains. Google "kristofferson professor rate of tone and brain clock" for some references to his research. Sorry for clogging Core. But yeah, his experiments concluded that we definetly think in "waves"; some events go undetected if they occur between 'brain ticks'. He couldn't explain the 'how or why', but he could measure the effect. | |
Oldes: 19-May-2008 | Use Resource Hacker http://www.angusj.com/resourcehacker/to change the title and or icons. | |
Dockimbel: 24-May-2008 | Clean and simple solution. | |
Graham: 1-Jun-2008 | If I wish to compute a checksum on an image file, I can do this checksum read/binary %image.png but how do I get the same result when I have the image as image data ? eg. i: load %image.png and to compute the checksm on i ? | |
Graham: 1-Jun-2008 | Since I might be grabbing the image as jpg and then saving it to png, I guess I should save it to memory as binary and do the calculation that way. | |
[unknown: 5]: 16-Jun-2008 | Ok, I checked for a file size limitation in REBOL but haven't found one. I noticed the documentation for open/direct for example says that /direct can be used for files of any size. I don't see how that can be if it is calculating the size as an integer and integer has a limitations. | |
[unknown: 5]: 16-Jun-2008 | Well I'm testing a new indexing system for TRETBASE and need to know some significant data to fine tune it. | |
[unknown: 5]: 16-Jun-2008 | when the port/state/tail value reaches 2 ** 31 it converts it to a negative number and gives an error which is an "access error writing to port". | |
[unknown: 5]: 16-Jun-2008 | REBOL should be able to break this limitation. Even if it means holding a pointer to a file position and then looping over again. | |
[unknown: 5]: 16-Jun-2008 | I tried Oldes method and able to get it over the limit. | |
[unknown: 5]: 16-Jun-2008 | Well I would assume that the 32 bit integers are being used on open/direct so I'm not sure why this limitation only affect /seek and not /direct as well. | |
BrianH: 16-Jun-2008 | I expect that /direct is just using file handles and isn't setting offsets like /seek. | |
[unknown: 5]: 16-Jun-2008 | Would be nice to have the feature to access the currently indexed position of the open port and perform a function on it. For example, modify /awake to work with files. Such that any reference to the file or altering of the position can be handle via an awake/handler. | |
[unknown: 5]: 18-Jun-2008 | I have a handy little function I made and don't know if there is already an easy way to do this in REBOL but I have a function called 'any+ that simply keeps me from repeating any statements. For example: >> a: 3 == 3 >> if any+ [1 2 4 > a][print "cool"] cool Got a bit tired of writing ANY [1 > a 2 > a 4 > a] This is one of those things that I often wonder if we already can do this easlier and I just don't know what it is. | |
Gregg: 18-Jun-2008 | There isn't anything built in that does that. For simple min/max comparisons, you could do something like this: if a < first maximum-of [1 2 4] [print "cool"] I also have a shortcut for FIRST MAXIMUM-OF. pick-max: func [series [series!]] [attempt [pick maximum-of series 1]] if a < pick-max [1 2 4] [print "cool"] For the general case, I would use a map and anonymous func combo. R3 has a native MAP func, but you have to roll your own in R2. | |
[unknown: 5]: 18-Jun-2008 | for the any+ function you put the multiple items on the left side of your block and the single item to compare to on the right side | |
[unknown: 5]: 18-Jun-2008 | My function is actually very restricted in that it looks for the op! as the second to last value and the comparator as the last item. | |
[unknown: 5]: 18-Jun-2008 | I could make that change to my function and easily accomodate that. | |
[unknown: 5]: 18-Jun-2008 | Shouldn't < > and = return as a logic values as well as being op values? | |
[unknown: 5]: 18-Jun-2008 | yeah I know I thought it would return logic and op depending on the test. | |
Graham: 21-Jun-2008 | and if you copy the index? as well? | |
Henrik: 21-Jun-2008 | half a feature request and half trying to find a quick way to solve it. seems there is not an easy way. | |
[unknown: 5]: 23-Jun-2008 | It appears to see a broken path and sees the rest of the path as an argument. Not sure where it is checking yet to get this information. | |
[unknown: 5]: 23-Jun-2008 | I went into the registry and found the reference to rebview and deleted its registry keys and reassociated the .r extension with the rebol/view 2.7.6 product. | |
Chris: 28-Jun-2008 | Usage: assert-all [ a < 10 [print "a is more than 10"] a > 0 [print "a is less than 0"] ] It's the opposite of 'case really. If any of the cases are false, the related block is evaluated and the function returns none/false. If all cases are true, it returns the value of the last successful case. | |
Chris: 28-Jun-2008 | Paul: it's a common enough pattern, I'd like to find the most appropriate way to express it. Actually, that's the principle behind QM (which of course, this is intended for). The alternative case above would be: case [ not a < 10 [print "a is more than 10"] not result: a > 0 [print "a is less than 0"] ] result Requires a 'not statement for each test, requires an extra word to track the result and does not return a meaningful value. Consider this: if assert-all [ user/has-role? 'editor [make error! "You do not have required permission"] article: get-param 'article [redirect-to %/articles/create] 10'000 < length? article [make error! "Article is too long"] ][ save %article.txt article redirect-to %/articles/list ] | |
Chris: 28-Jun-2008 | I'm curious re. approach, expression and naming... | |
Henrik: 28-Jun-2008 | well, I tried a single line of code with it, and it didn't do what I wanted. I guess I could ask myself if I would write that kind of code today. :-) | |
Janeks: 30-Jun-2008 | I am working on sript, that composes and sends html e-mail. It is rather simple, but now I would like that e-mail will contain inline images. I found out that they are multipart messages, and that image is referenced with cid in html image and in image part it is marked as Content-ID: </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3D"Courier New" size=3D2></FONT><IMG height=3D47=20 src=3D"cid:26DB76551F2E4591BBC3B599C3A7CCAE" width=3D320></DIV> <DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV> </BODY></HTML> ------=_NextPart_001_00A9_01C8DAAB.A817E460-- ------=_NextPart_000_00A8_01C8DAAB.A817E460 Content-Type: image/bmp; name="ML.bmp" Content-Transfer-Encoding: base64 Content-ID: <26DB76551F2E4591BBC3B599C3A7CCAE> Qk22vQEAAAAAADYAAAAoAAAADwIAAEgAAAABABgAAAAAAIC9AQDEDgAAxA4AAAAAAAAAAAAA//// //////////////////////////////////////////////////////////////////////////// How to implement such html e-mail generation in rebol script? | |
Graham: 1-Jul-2008 | Anyone know how to use sort on some data where eg. skip value is 10 and you want to sort of anything but the first element? | |
Dockimbel: 8-Jul-2008 | For checking if a port! value is "opened", you can use this function : open?: func [port][zero? port/state/flags and 1024]. But that just checks for the "close" flag, it doesn't check the real TCP connection state. | |
TimW: 9-Jul-2008 | Is there a way to specify precision with rounding? My specific example has to do with money. Not only does it always chop it off to exact cents, but it rounds down. so .125 -> $0.12 This is horrible for accounting purposes. I just put everything in decimal and completely ignore the money! datatype, but this seems like a real shame. So is it possible to specify the decimal out to 4 or 5 places? | |
Henrik: 9-Jul-2008 | As a note: In R3, money! is of much greater precision (infinite?) and should round properly using conventional ROUND/TO (once bug #492 is fixed, that is :-)). | |
Henrik: 21-Jul-2008 | what I mean is that for single-standing tags, like <br>, XHTML 1.0 and upwards requires them to end with a slash. This creates a correct tag for this case: >> build-tag [input type checkbox value test /] == <input type="checkbox" value="test" /> But this is not correct: >> build-tag [input type checkbox value test checked /] == <input type="checkbox" value="test" checked="/"> | |
Graham: 23-Jul-2008 | It's annoying having to work round this .. and also that rename doesn't work except in the current directory. | |
Chris: 23-Jul-2008 | And is limited to Windows. | |
Henrik: 23-Jul-2008 | there are also problems with using non-english characters at times. it backfires when you type a directory name in a macOSX script that makes a directory on a windows machine. results in chaos, because the dir name is read differently depending on the platform and whether you are reading it across the network. | |
[unknown: 5]: 23-Jul-2008 | Yeah Chris, I guess it depends on what your going. For example, if you collecting directory information and must parse thru it then the spaces are obviously a pain. | |
Sunanda: 23-Jul-2008 | It's been a longstanding problem, Tim. These two blog posts discuss it and a solution. I do not know if the solution has been implemented: http://www.rebol.com/article/0198.html | |
Henrik: 3-Aug-2008 | I know :-) I guess you have to wonder what result you want back, because it has to search each string in the block. what you are looking for is a find on each string in the block and what if that is not found in the beginning? Does it return two indexes, one for the string and one for the block? That's where /deep comes in. | |
ICarii: 3-Aug-2008 | too slow with 50,000+ words and pattern matching? | |
ICarii: 3-Aug-2008 | ill probably just use C# and use regex :) | |
Henrik: 3-Aug-2008 | I use similar code in LIST-VIEW and it searches about 30000 words in 0.1-0.2 seconds. It does no t use expression matching, though. | |
Henrik: 3-Aug-2008 | and it also gets all results | |
ICarii: 3-Aug-2008 | im testing parse at the moment - ill test it on R2/R3 and see how it rates | |
Graham: 2-Sep-2008 | I've got an encapped application which is failing, and it can only be failing if there is no timezone in the 'now data. | |
Oldes: 2-Sep-2008 | I'm changing timezones in settings and check 'now in Rebol... I got it without timezone once | |
Oldes: 2-Sep-2008 | and I guess it's related to the red icons bug in old IOS times. The timezone is not updated in Rebol if it changes in system. | |
Graham: 19-Sep-2008 | and this sends the cookie header with the get request | |
Graham: 19-Sep-2008 | can refine that by removing the dummy place holder and changing the post-data/3 => post-data/2 | |
Graham: 20-Sep-2008 | If you mean that the cookie is automatically captured by the http protocol, and then sent with every GET/POST, then that would imply you need to acquire the cookie first .. whereas sometimes you know what the cookie is and so don't need to get it first. | |
Oldes: 20-Sep-2008 | If you know the cookie, you can set it inside the cookies block, where are stored all cokies used for automated (transparent) sending. But I never used it. My clasic scenario is to simulate an user with the web browser. That means read page with login form, submit the form and do whatever like normal logged user. With some pages I can skip the first step, but there are pages which are giving you unike session ids in this step and don't let you login without this first step. | |
Graham: 20-Sep-2008 | sure ... and some of them insist on referring ids as well. | |
Graham: 20-Sep-2008 | we ought to check on the http protocol for R3 and make sure that it has all this stuff. | |
Louis: 20-Sep-2008 | Thanks for responding Henrik. You are always willing to help, and I apprciate it very much. | |
amacleod: 20-Sep-2008 | Having a bock of blocks that I want to look more readable how do I get each block to start on a new line... I've tried to append 'newline to end of each block but it does not seem to work. Now I'm having a similar problem using Paul's tretbase. I've been using MySQL to store formatted text that when I load it I can run my parse function on. When I sttore the same text in tretbase and load it my parse function fails. When I probe the text from each tehy look different: MySQL preserves the carriage returns: [5 "FFP-LADDERS" "1-PORTABLE LADDERS" "2.1.2" { \table Straight Weight^-Ladders 20'^-55 lbs. 20'(Hook)^-60 lbs. 12'(Hook)^-35 lbs. /table } "" "2008-07-22 00:12:24"] Tretbase seems to store the carriage return's character code but displays 'flat': [5 "FFP-LADDERS" "1-PORTABLE LADDERS" "2.1.2" { \table Straight Weight^-Ladders 20'^-55 lbs. 20'(Hook)^-60 lbs. 12'(Hook)^-35 lbs. /table } "" 20-Sep-2008/3:07:19-4:00] What Might I be doing wrong? | |
Henrik: 21-Sep-2008 | they are not entirely done, but doc uploading and syncing should work. | |
Graham: 22-Sep-2008 | So, I guess I need a way to add the PUT method, and then switch the IO from lines mode to binary and then back again. | |
Graham: 22-Sep-2008 | From my understanding, R3 implements http prot all as binary and does not use lines mode | |
Graham: 22-Sep-2008 | calculate the content-length, add the new headers, insert the file as binary and then switch back to lines mode for R2 ? | |
Graham: 22-Sep-2008 | And it's working :) | |
Graham: 22-Sep-2008 | read/custom URL compose/deep [ PUT %file.png [ Cookie: (cookie) ]] will use the http put method to upload a binary file and sets the cookie | |
Graham: 22-Sep-2008 | So, this will work with large files, it should be changed so that it does a skip/binary and inserts the file in chunks. |
29201 / 48606 | 1 | 2 | 3 | 4 | 5 | ... | 291 | 292 | [293] | 294 | 295 | ... | 483 | 484 | 485 | 486 | 487 |