TODDBLOG
hollywood perception

Hollywood has ruined our perception not only socially but of interactions of physical objects:

Sometimes, too, we need what's best described as 'Hollywood physics'. When a crate falls from a height, if you accurately simulate that, you can look at the screen and think, 'well, that doesn't look right'. But then you start tweaking the numbers and changing gravity, making things accelerate faster – it's almost like this Hollywood expectation of motion simulation - and that actually looks correct. You have to remember games are an entertainment after all…"

The hidden story of the 3D engine

Posted Sat 19 Dec 2009 09:08:56 PM UTC
engine failures in commercial aircraft

This Everything2 post The most engine failures in one flight has some great quotables:

More than one airliner has been lost because engines literally fell off, and the pilots' report to ATC that they had "lost" said engines was interpreted merely as them failing, since the vernacular is, rather inconveniently, the same.

Also good:

...passengers going to the toilet caused an engine to fall off at least three Boeing 727s in flight, and caused an engine shutdown on two others. In all cases the blame was laid on> ice accumulating around a service panel on the fuselage near the drain outlet for the cabin lavatory. The ice broke away in-flight and was ingested by one of the engines, which on the 727 are all at the rear.

Incidentally, Everything2 is a bastion of knowledge- it was hacker's wikipedia long before there was wikipedia.

Posted Sat 19 Dec 2009 08:41:26 PM UTC
how to keep an ovrloaded db running

Here is my new trick to keep a website running when mysql is overloaded:

Assuming you can narrow down your problem to a bad query on the site and you have no sensible way to disable what is causing it [or if you don't know the source of the bad queries] you can kill queries by regex using something like this

MYSQL="mysql -u root --password=passwd"
BAD_QUERY_REGEX=".*select * from users limit 100000.*"

while `true`; do 
  for x in echo 'show processlist'|$MYSQL|grep $BAD_QUERY_REGEX|awk '{ print $1 }'; do
    echo kill $x | $MYSQL
    done
  sleep 2
done

This will kill any query matching BAD_QUERY_REGEX every 2 seconds. This technique is valuable when some part of a site is killing the whole site because of bad queries. It's not immediately obvious that you can do this to save a site.

Posted Wed 28 Oct 2009 11:51:01 PM UTC Tags:
do we have x running y why not

Do we have X running Y? Why not? It is funny- often times I make design decisions based on some parameters to have them challenged later (a week, a month, several years) -- the problem is by this time I've forgotten the reasons why I made the calls and am apt to agree with someone proposing a reason to change them. "Why do we have X threads for Y and not Z" or something.

Many times I've ended up changing something when prompted, and even though I felt uncomfortable about making the change, I couldn't verbalize why.. couldn't think of any reason why they could be wrong. Later it blows up, and I remember why, and it's usually painfully obvious why I made the original call :) I think it is more compact for my brain to store something like "doing X is bad" rather than the actual reason why. Maybe it's a binary datatype in a brain-hash table :)

It is an annoying cognitive bug, but I suspect that carrying around reasons for doing everything will slow me down. Maybe not? I suppose that is one of the issues facing large companies in which everything has to be justified -- the more checks you have, the more reasons you have to remember to defend yourself, and the slower you move.

Hmm!

Posted Sat 29 Aug 2009 07:06:37 PM UTC
how to learn anything well

I've been hearing it over and over lately -- this formula for mastering things.

Researchers (Bloom (1985), Bryan & Harter (1899), Hayes (1989), Simmon & Chase (1973)) have shown it takes about ten years to develop expertise in any of a wide variety of areas, including chess playing, music composition, telegraph operation, painting, piano playing, swimming, tennis, and research in neuropsychology and topology. The key is deliberative practice: not just doing it again and again, but challenging yourself with a task that is just beyond your current ability, trying it, analyzing your performance while and after doing it, and correcting any mistakes. Then repeat. And repeat again. There appear to be no real shortcuts: even Mozart, who was a musical prodigy at age 4, took 13 more years before he began to produce world-class music. In another genre, the Beatles seemed to burst onto the scene with a string of #1 hits and an appearance on the Ed Sullivan show in 1964. But they had been playing small clubs in Liverpool and Hamburg since 1957, and while they had mass appeal early on, their first great critical success, Sgt. Peppers, was released in 1967.

Via: Learn Emacs in Ten Years

Posted Wed 15 Jul 2009 12:27:18 AM UTC Tags:
arduino heartbeat code

I recently got a mail from Chris McGuire asking about how I made the LED heartbeat effect.

For anyone interested, my code is here

Posted Mon 02 Mar 2009 09:49:49 PM UTC Tags:
2008 email sending statistics

Somehow I figured these numbers would be higher. I ran statistics back to 2004:

lolz% ./toys/mailstat ~/Mail/sent-mail
Mail sent by month: 2008
{1: 174,
 2: 293,
 3: 274,
 4: 322,
 5: 207,
 6: 238,
 7: 222,
 8: 274,
 9: 322,
 10: 473,
 11: 276,
 12: 193}
total: 3268
avg: 272

Avg for 2008: 272
Avg for 2007: 193
Avg for 2006: 187
Avg for 2005: 126
Avg for 2004: 159
Posted Sat 17 Jan 2009 11:37:25 PM UTC Tags:
startups and freedom

Paul Graham makes some intelligent calls on scale with regard to size and age and freedom of companies. The article is about allowing your team to ship code, but I found the part about startups being more free most interesting. I have noticed this pattern too. Since there are no established patterns and rules in young companies, they are free to do things now that will take much longer to pass in established companies. It is no wonder that art happens in the trenches.

For good programmers, one of the best things about working for a startup is that there are few checks on releases. In true startups, there are no external checks at all. If you have an idea for a new feature in the morning, you can write it and push it to the production servers before lunch. And when you can do that, you have more ideas.

From: The Other Half of "Artists Ship"

Posted Tue 02 Dec 2008 11:05:23 PM UTC Tags:
awesome wm

I have been very happy with the awesome window manager for several months since switching from Ion.

Here is a screenshot of my config:

awesome screenshot

Posted Tue 19 Aug 2008 09:02:39 AM UTC Tags:
what querycache sounds like

Last night Andrew, Viddler's frontend guy suggested to me that the MySQL querycache free space graph looked like a waveform and that MySQL was trying to tell us something.

So of course I had to convert the RRD data into a waveform.

The resulting sound is here.

I can't make anything out. It could be a different language.

Here is the code I used to make the sound:

#!/usr/bin/python

import pygame
import time

from Numeric import array
pygame.mixer.init(800, 8, False)

#sndarray = pygame.sndarray.array()

sndarray = []

f = open('vals.txt')
for line in f:
    val = float(line.strip())
    sndarray.append(int(val*10))
f.close()
#numsndarray = numpy.array(sndarray)
numsndarray = array(sndarray)
snd = pygame.sndarray.make_sound(numsndarray)
snd.play()
time.sleep(20)

Posted Fri 08 Aug 2008 04:11:54 PM UTC Tags:

Powered by ikiwiki