Satya's blog - 2006/

Dec 26 2006 17:15 Waxing the car

I waxed my car with a wet-wax. I hope it works. I just did the roof, hood (bonnet), and quarter-panels, because I haven't done this before.

It was windy and cold.

Tag: car

Dec 01 2006 20:23 I am a defensive driver!

I just saved a bunch of money on my car insurance by... doing a defensive driving course.
http://nscddconline.com/

Tag: silly

Nov 20 2006 11:17 DMV test in LA
I just realised, I passed my US driving test in downtown Los Angeles (5 years ago).

Tag: self hmm

Nov 11 2006 23:20 R2D2 as a jedi

Wild theory time. In Star Wars, I think R2D2 was a full-fledged Jedi Master. Always there are two, right? So he took C3PO as his padawan (student). It explains so much!

Tag: starwars

Oct 23 2006 19:44 Webcam images to Flash FLV on Linux

Okay, here's how to convert a series of images, say from a web cam, to flash video. On linunx, no less. This little trick uses mencoder and flvtool2 (the latter is a ruby script). Here's the command:

mencoder "mf://*.jpg" \
-ofps 25 \
-o test.flv \
-of lavf \
-ovc lavc \
-lavcopts vcodec=flv:keyint=50:vbitrate=600:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 \
-vop scale=320:240 \
-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames

Follow that up with flvtool2 -UP test.flv. Then you will need a Flash video player, such as the one from Jeroenwijering.com. That one's free for non-commercial use.

So make an HTML file with content similar to:

<html>
<body>
<object type="application/x-shockwave-flash" width="320" height="220" wmode="transparent"
data="flvplayer.swf?file=test.flv&autostart=false">
<param name="movie" value="flvplayer.swf?file=test.flv&autostart=false" />
<param name="wmode" value="transparent" />
</object>
</body> </html>

...and Bjorn Stronginthearm's your uncle.

Update: I got instructions from Homo-Adminus Blog which helped me. Also, if you want sound you need to add this to the mencoder command line:

-oac mp3lame \
-lameopts abr:br=64 \
-srate 22050 \

Tag: geeky howto

Oct 19 2006 22:07 USB in the logs
I was wondering what was causing USB events in my server log when I don't have USB devices connected to the server. Looking at the back of the coimputer, I found a USB cable plugged in and realised it was the printer. Duh.

Tag: geeky

Oct 05 2006 13:11 Dijkstra's algorithm

In a game I play, there are maps. Movement costs differently per type of tile. Moving uses up action points. Players make maps of the sectors. I write an auto-mapper Firefox Extension. I now have a lot of map data in a database. I make pretty maps in HTML and as images using Imagemagick (in perl). Much goodness ensues.

"Hmm," I think, "why don't I write something that will calculate the path across the sectors for a of minimum action points, i.e. shortest path. Ah, Dijkstra's algorithm gives me shortest paths. After all, the relevant map data can be expressed as a graph." I used the data in the Dijkstra's algorithm Wikipedia article.

Well, Dijkstra's algorithm gave me distances from the start point. I struggled a bit, and eventually this site (PDF) showed me that I also need to track the "previous" vertex. Once I did that, I got the shortest, cheapest, route. Some more struggling with Javascript and I can generate shortest routes as much as I want, and their cost is shown to me.

That's right, I have implemented Dijkstra's algorithm in Javascript. I will post it soon.

Tag: geeky

Oct 04 2006 07:54 Run over
I was itting on my bike at the corner of Doughty and Ashley waiting for traffic to clear when this slate-gray( don't know if that's the right name) Jeep Cherokee-ish scraped past me. It would have run over my foot if I hadn't jumped away. The lady stopped around the corner and was all like are you hurt, I'm sorry, etc. I said no (mistake!) and never mind (mistake!) and you have to watch where you're going (NO SHIT!). What I should have done is screamed and called for police. She had kids in the car, though, which made me unreasonably sympathetic. It still pisses me off that she got off too easy. I suppose it's my fault for riding a bike while brown.

Tag: rant

Oct 03 2006 13:37 Battle Beyond the Stars

Remember Serenity? From Firefly (or Serenity the movie) Yesterday I was watching Battle Beyond the Stars, a cheesy SF flick from the 50s or something. Okay, it's from 1980. Think Seven Samurai/China gate/Magnificent Seven set in space. Well, there was a ship in it similar to Serenity, and a big ship like a Star Destroyer but shaped like a like a Rebel Corvette. Go look it up.

Tag: movie

Oct 02 2006 11:20 Stardates in TNG

This was months ago. I read somewhere that the stardates on the Captain's log in Star Trek: The Next Generation were 5 digits, started with 4, and the second digit was the season number.

So when I got (from the library) what I thought was season 1, and heard the Captain say "Stardate four six..." I was prompted to check, and sure enough, I had season 6 by mistake.

Tag: geeky startrek

Sep 25 2006 22:18 DVD authoring
I put together a few scripts when I was putting my son's videos on DVD. Here they are. As-is, if tehy work for you, fine, if they delete all your stuff, don't blame me. This is for experts. And it relies on tovid and imagemagick if not more stuff. The download page.

Tag: code howto tip