Thursday, June 25, 2009

Circuit design --game--

Here's a really interesting game. It involves designing circuits
at the silicon level (not the gate level, or the transistor level
-- but the silicon level)

This is fun once you kind of get into it, and look up NPN and PNP
on wikipedia :)

eNrtWmGa4yAInfD6Z86wV9j/e5a9/0V2NGJAQU3Tdqb7kXxp2j5ARPOK0tvv26/P
v9vnn+32cc8ZiqFofE2Tz47ilk//86KrmzoXFB2Fc8FZUtyc81SLdN84bqPWV/q4
1V4e76oildNytz+VorJntJoUjHFs7A0UqVd0hroq7uGi1T62EaZzrk7HcQvOCcVQ
DMUFxZzOkX9kFIB5XUfzgXSh3Mt7jZJAE+zrpleJ5qZ8tCAAy5lobgMwUaB8oVAQ
imcgy2f2CvypR+mL/ZHGaH9pRYpL6X77IAve9XcB7Tx7tguUNrKsngw8XBzIbqpY
KERIkuk2PBXmqOvQcsT4Rso2hybfcrdSAwKXk+aY5lAiqBa+RLKU5T+PQRFI7fST
0pcoA8h+FGf2iLRRRv9gGtYgojaARbdZRH4jwuuJGdaoleqbPOiCqJMQSobXkDOl
x+uEsVAJGijRii5exHQmwy5RcKCBvgKtz4yvi4hVoN+DBlU+B0Vzf5ce4ZplTl5X
ddE02FjGiR6hRRFzMtCgyp9OhnVBf8C9ZYhXc5F22iu07Z8lQ4iFElbJEL1tOGTY
5I0wuBIekdZdEicakLpwWDiINNCgyv8ub8QF9GV5Y0c5zLUFbekOkHvrBtmJ/Sht
HLxrZbcbZBhoUOX7oaKINMgqcZRWugoC/E3yQVbJx71ECggbS7rKT5Qt8tUFuO7l
Qau1cmP+PrBuF0zlFYIqA305VT6mdt5co9r5ECUMLHvV8Ullvcp4KFkVffnADmrn
5NbOvco6TVAoS7pkfiRnew+sSqaHEk1L6dT1V5bKe7SpdpM5gg5qqQ5Rq4JuLu1p
htJFFLSAOpskPxgd1bjpSo17iNJDK+BPpkr7uo4uTq02s1jf2etzC3Mx62R3mkH8
/UZ3z/BJv3c6aTpRL55EA8M4X13qlj96TXJONaXV0zsbI2f31eoR8IBRGEYSC7p1
GN8myxqvkka6uNAuvoOR2uMfaifJtw==

Tuesday, June 23, 2009

Vertigris Solution (Codex Alchemal Engineering)

Here's a note to myself so I don't forget how I solved this level:

http://www.kongregate.com/games/krispykrem/the-codex-of-alchemical-engineering

p,11,9;c,5,9;b,3,11;b,1,6;b,1,1;m,11,7,0,1,orcl;m,13,5,90,1,crol;m,5,13,180,3,crddoluu;m,3,13,180,1,wwcrolww;m,1,11,0,3,cddloruu;m,2,9,270,1,cuod;m,1,8,270,2,odrrcrru;m,11,13,0,1,clor;m,9,9,0,3,cdou;m,13,11,270,1,olcr;m,7,9,0,3,orcl;m,9,5,90,1,olcr;m,6,7,0,2,wwwjclluodrr;m,5,7,0,3,clowwwrw;m,1,4,270,2,odrrcllu;m,2,3,0,2,wwwjwwcdloru;m,4,2,180,2,wwjcrr11oll;

Friday, April 18, 2008

...Imagine what it would feel like to loose 37 years of emotional baggage...

Brain researcher Jill Bolte Taylor studied her own stroke as it happened -- and has become a powerful voice for brain recovery.


This is a _must_see_. She explains how we see the world, almost to the point of telling is what we really are.



Scroll about halfway down the page to see the video. It's her TED speech from the Monterey, CA 2008 conference.

Friday, March 21, 2008

Dang, this thing is creepy

I swear this thing looks (and sounds) like an overgrown housefly.

Thursday, March 13, 2008

MySQL 64 bit hash

What do you do to create a fast lookup for about 40 million email addresses for a client? I was inspired by this article in the MySQL performance blog

And by fast I mean around 10 ms. Well the first thing was to normalize, since there was not a table with unique email addresses, but that was about 1GB of data, and another 1GB of index.

So I hashed it, but 32 bits is only enough of a hash (without collision handling) for about 10,000 to 100,000 items. crc32 is actually quite a bit worse than a random hash, it collides almost 1% of the time; which frankly seems remarkably bad, almost malicious really. And MySQL doesn't have a 64 bit hash, so I did a 64 bit hash using crc32. My first (failed) attempt was this:

crc32(invitee_email)*1234567890 + crc32(concat('x', invitee_email))

However, after the first inevitable 32 bit hash collision, it turns out that

if crc(x) == crc(y), then crc( salt + x ) == crc( salt + y )

as well. Which I guess makes almost enough sense I should have noticed that going in. Anyway, anagram collisions aside, the following overcomes that, and did not generate any collisions across all 40 million addresses:

crc32(invitee_email)*1234567890 + crc32(reverse(invitee_email))


So this is about 28% of the size of the original both data and index-wise, and produces a three times speed up, from about 40 ms to about 12 ms, and is easier on the cache.

Saturday, March 8, 2008

More than meets the eye?

So while looking through YouTube for some way to kill time, I ran across this video called "無15", which just means #15 in Japanese.



It's this young teenage girl just staring at the camera, and kind of smirking. Okay, that's weird. More weird is that I'm watching. Even more weird is that it has 500,000 pageviews, in addition to the views from 無14, 無13, ... Plus they have spawned a whole family of response videos from



to



So I'm thinking there's more to this than meets the eye. I know what you're thinking -- there's "less" to this than meets the eye -- but isn't it kind of reminiscent of this:

Mona Lisa

except Japanese instead of Italian, and predating YouTube? And 500 years older? They're both teenage girls, kind of awkwardly posing, yet happy and somewhat self satisfied. Yes, I'm suggesting that in the year 2508, people may be watching this video in a museum someplace. Or people will move on next week. :P

Tuesday, February 26, 2008

Art _and_ Science

I wasted (time well wasted, I might add) many hours on this website http://moma.org/. They have put all of their exhibits (and more) onto their webpage. Some of the more notable ones include the Water Sign, the Newton Virus , the Pac Man, the Inner Cell life, and finally the Molecubes. These are really remarkable.




From the video "Inner Cell life", a three minute animated walk through inner cell functions at the molecular level