World: r3wp
[Core] Discuss core issues
older newer | first last |
Geomol 19-Dec-2011 [2682] | What's the idea with SHIFTing a binary! ? >> b: #{80402010} == #{80402010} >> shift b 2 == #{20100804} >> shift b 2 == #{08040201} ; so far so good >> shift b 2 == #{02010000} ; but now we're loosing information >> shift b 2 == #{00000000} So SHIFT of a binary! just shift each byte and don't carry bits over to the next. What is this used for? |
Endo 20-Dec-2011 [2683] | Its no sense SHIFTing bytes in binary, we can simply use series functions, append #{00}, copy/part etc. Shifting bits in binary could be more useful for graphics operations (not so sure) |
Geomol 20-Dec-2011 [2684] | My example is doing bit shifting right (decreasing value) by 2 bits at a time. The bits falling off each byte isn't carried over to the next byte. |
Endo 20-Dec-2011 [2685x2] | In your example above it shifts bytes not bits. Even shifting bits in binary without carrying bits over to the next bytes doesn't look useful. |
Oh sorry, your second example. Ok. | |
Louis 26-Dec-2011 [2687x2] | Does anyone have |
a function to sort jpeg files from a digital camea by exif date? | |
Pekr 26-Dec-2011 [2689] | IIRC, someone did EXIF reader. Have you tried looking into rebol.org? |
Louis 26-Dec-2011 [2690] | Pekr, thanks for responding. I'll look there. |
Pekr 26-Dec-2011 [2691x6] | There are two scripts from Piotr Gapinski, related to EXIF. IIRC Oldes did ImageMagick wrapping,maybe it can do some EXIF stuff too ... |
or you can use command line tool like Exiftool, and wrap the result using CALLL in REBOL and parse the output? | |
>> buff: copy "" >> call/wait/output "exiftool img_0033.jpg" buff | |
works like a charm, returning several pages of txt formatted output - http://www.sno.phy.queensu.ca/~phil/exiftool/ | |
parse/all buff [thru "Create Date" thru ": " copy EXIF-create-date to newline] | |
your value is in EXIF-create-date .... | |
Louis 26-Dec-2011 [2697] | Wow! Thanks for the help Pekr! |
Pekr 26-Dec-2011 [2698] | Dunno how fast it is going to be though, exiftool looks slow, when called from REBOL. Might take some time to extract info from xy files in directory ... |
Oldes 26-Dec-2011 [2699x2] | I have uploaded my latest EXIF-parser version at github - https://github.com/Oldes/rs/blob/master/projects/exif-parser/latest/exif-parser.r To sort files you can use for example: dir: %/e/DCIM/100CANON/ t: now/time/precise result: copy [] foreach file read dir [ error? try [ ctx-exif/parse-file dir/:file exifdate: ctx-exif/get-tag-value 306 repend result [exifdate dir/:file] ] ] sort/skip result 2 print ["sorted" (length? result) / 2 "files in" now/time/precise - t] result ;>>sorted 120 files in 0:00:00.153 |
(it could be probably optimized as the script is from year 2004, but I don't care too much) | |
Louis 26-Dec-2011 [2701] | Oldes, many thanks! I can''t work on this right now, but as soon as I can I'll report back. |
nve 28-Dec-2011 [2702] | Any news about a new year version of REBOL ? |
Pekr 28-Dec-2011 [2703] | Carl is still not apparently available, or he would blog something. |
Andreas 6-Jan-2012 [2704] | Anyone knows of a simple way to get to the binary encoding of a decimal! using just REBOL/Core (i.e. no struct!, no /library)? |
Steeve 6-Jan-2012 [2705x2] | why don't you want ti use struct!, it simple enough ? |
Ah! already left | |
Andreas 6-Jan-2012 [2707] | Because it doesn't work on /Core. |
Steeve 6-Jan-2012 [2708] | don't want R3 neither ? |
Andreas 6-Jan-2012 [2709x2] | Nope, then I'd ask in another channel :) R2/Core it is. |
Asked another way: anyone has decimal to binary ieee754 conversion routines that work on /core handy? | |
Steeve 6-Jan-2012 [2711] | and you googled everywhere you could I suppose :-) |
Andreas 6-Jan-2012 [2712] | i checked the usual sources, yes :) |
Steeve 6-Jan-2012 [2713] | Nop, I just looked on Rebol.org, nothing around ;-) |
Andreas 6-Jan-2012 [2714x5] | rebol.org has a binary32 conversion function, but it only seems to be half-done (as far as i can understand) |
http://www.rebol.org/view-script.r?script=ieee.r | |
(LGPL) | |
2. zakres -0.5 > x > 0.5 nie jest suportowany | |
gues that means "not supported" :) | |
Rebolek 6-Jan-2012 [2719] | yes :) |
Louis 6-Jan-2012 [2720] | Has the esmtp code in rebol core been completely debugged? Is there some documentation somewhere that discusses how to overcome problems is sending e-mail? A script that worked for years can no longer send e-mail, and I have no idea what the problem is. We are using a bluehost server. trace/net on is not revealing the problem. |
Oldes 7-Jan-2012 [2721x3] | you may want to check this one as well: http://www.nwlink.com/~ecotope1/reb/decimal.r |
Just cannot find the format.r script | |
Also Erick's script is only 64bit | |
Dockimbel 7-Jan-2012 [2724] | Thanks Oldes, that script should help a lot. |
Oldes 7-Jan-2012 [2725] | I can try to fix the 32bit version if you want.. but later |
Dockimbel 7-Jan-2012 [2726x2] | I should be able to do that, looks easy enough. I'll call you if I get stuck. :-) |
Got it working for single precision floating points. | |
Oldes 7-Jan-2012 [2728x3] | Fine... I just updated the Eric's version: https://github.com/Oldes/rs/commit/37c6e8e8bc316b06bf8eef1638225551421199b2 |
But it sometimes returns results which are not exactly identical like with the struct! version... like: #{BDCCCCCC} versus #{BDCCCCCD} for -.1 I guess it's because of rounding error in Rebol itself. | |
update: https://github.com/Oldes/rs/commit/19771ea6a7991dd6960ec8c9a1a2a2690c6cd527 fixed the rounding so now the result is same like in the struct! version and added real/from-native32 | |
Dockimbel 7-Jan-2012 [2731] | I've added a +1 in my version to compensate for that. |
older newer | first last |