Posts from: August, 2007

22 Aug 2007

Please no more Red Book CDs

The Red Book standard defined how audio was to be encoded on a CD, and it was great for 1980, but it, well, kinda sucks now. 1. The error correction is too minimal to withstand real-world abuse (cars, friends, etc.). 2. Tracking is pretty loose, and a lot of players have trouble seeking to the [...]

16 Aug 2007

Robot pucks will destroy man

Really cool technology with video.

15 Aug 2007

Average direction in SQL

Given a column of polar directions in degrees, this is a single SQL expression to compute their average, for use in a GROUP BY query. Some functions may be MySQL-specific. IF(DEGREES(ATAN2( -AVG(SIN(RADIANS(direction_deg))) ,-AVG(COS(RADIANS(direction_deg)))) ) < 180 ,DEGREES(ATAN2( -AVG(SIN(RADIANS(direction_deg))) ,-AVG(COS(RADIANS(direction_deg)))) ) + 180 ,DEGREES(ATAN2( -AVG(SIN(RADIANS(direction_deg))) ,-AVG(COS(RADIANS(direction_deg)))) ) – 180 ) Thought someone might like to run [...]