Tuesday, June 9, 2009

Line of code of the day #3

So... remember that little problem i had to 'compact' selected bits? i think i solved it... By using a very special look-up table i manage to do the trick using this 'easy' to read line:
(( f[(m & 0xF0) | (val & 0xF0) >> 4] >> 3) >> (f[(m & 0x0F)<< 4 | (val & 0x0f )] >> 3 ) & 0xF)

Oh, this code is just for 8bits, a simple expansion allows me to use it for 32bits (with look-up table taking up 2Mb)... and no... I won't explain what is in f table has... and yes... I might screw up with the parentesis... I didn't compile that piece of code, but tested it manually instead... it should work... efficiency wise it's better that scan all bits one by one...

You can now commit suicide.

PS: By reading this you agree that i'm not responsible for any harm occoured both physically or mentally when reading the text above... really...

Tuesday, June 2, 2009

Line of code of the day #2

Who would guess its another LOCOTD, this time we have some C code to show... solution[batch] = solution[batch] | ~((polar_0[batch] ^ polar_1[batch])&polar_0[batch]) | ((polar_0[batch] ^ polar_1[batch])&polar_1[batch]); In case you're wondering ... yes i could load the values of polar_0 and polar_1 on index batch, but since i don't know what kind of effect that will have on performance, i'll try both and see... compilers and assemblers do magic sometimes... :p I leave the moment to show you some magic ... long live to SWAR Algorithms! Jokes aside, using general CPU instructions to make some crazy highly efficient operations is always good, while it is wise to check such approaches also keep moderation in mind, you can end up with some brain damage... Now... a little puzzle for anyone who is willing to take it: I have an array of 32-bit masks, that in reality represents a very huge mask for a very huge matrix, now ... i want to grab those bits masked (the number of masked bits is known) and pack them all in another array, all of that must be done fast, since speed is what we want. I leave a little example for 8-bit masks, 4 length array: mask 01111000 01001001 10101110 10111100 masked 01101011 10100101 11101110 11010010 result 00000000 00000001 10100111 11110100 I do not have a (eficient) solution for this problem (yet - i kinda have an idea), i hope to find one since this is kinda crucial to optimize the speed of the rest of the algorithm. With that said, feel free to comment and give sugestions about it... Good coding...

Friday, May 22, 2009

Need a media center/entertainment PC?

I was checking ASUSTeK website when i was surprised by this little fella: Rampage II Gene It's tiny.... but packs everything needed to make a quite powerful machine.... problem: costs more than 200€ so ... a PC build with it will cost quite something ... (specially if you pair it with 2 BFG Nvidia GTX 295 H2O, 6Gb DDR3 2000Mhz and a i7 Extreme CPU) ... and to keep things silent and cool, the V1... and this monster... or this puppy - hmmm ... 250+1200+500+1000+500+50 = 3500€ given or taken... pair it with a G9x and a G19, hmmm ... some G51 and the G25 (well... you buy 2 of G's series, you could as well buy the whole set) and a Samsung Led-TV ... That would power up a room :p but is around 5000€ ... ah well ...

Thursday, May 21, 2009

Cleaning fail...

So... today, after have some work done i solve to clean up and desktop since my sister is using it, she cares little over the dust that accumulates on filters... My computer case is very nice, a Thermaltake Tsunami, so i got the moment to clean up the cables as well, a year ago or so, i buyed a lcd panel for temperature monitoring and a card reader, sata plugs and usb extra plugs were freebies (even with the case usb plugs my motherboard still has room for more) by the time i connected everything and just rearrange the cables just enough to allow a good air flow. So today, i rearrange the cables not only for the air flow, but to give it a cleaner look, since the 5,25" panel has around 40 cables that was no easy task, but i'm happy with the result, even the graphic board agrees, since now it won't fire the fan into hi-speed (hi-noise) that easily. So... where is the fail? well... after all the work to clean and correct stuff, i ended up with this: Link (i wonder if this link works properlly) Well, not exacly that one, but you get the idea. A screw from the floppy drive went missing... just to be found right after close the case and connect all cables... oh well... i won't mess with the case any time soon again >_> *resumes work*

Monday, May 4, 2009

Hmm...

Well ... i'm dead tired, have a pile of work above me and it each time i try to reduce the pile, it increases size.... Hmm ... right... i won't sleep till i finnish this piece of code, so ... don't expect for me to be very cooperative into helping in something... In 5 days or so, we shall see if i'm alive after being up and wake working non stop for more that 4 days... not that i never did it before, but by the looks of it i gain a couple of years (or lose, depends on view point) each time i do it... So... 'till then folks *resumes work*

Thursday, April 30, 2009

Swine Flu...

So.... first was the avine flu ... well ... now is swine flu... evolution ...

Quando o frio aperta....

Quando o frio aperta: link Bem... de volta ao trabalho...