Friday, March 20, 2009

Batch transcoding with VLC

I have a bunch of MPG videos from my videocam but neither iPhoto nor iMovie would recognise them. Now VLC has a transcoding wizard that'd do the conversion to MP4 nicely, but to do it interactively through the GUI is just too tedious. Using this tip from the VideoLAN Wiki, I used a script to perform the batch transcoding:

#!/bin/bash
vcodec="mp4v"
acodec="mp4a"
bitrate="3072"
arate="192"
ext="mp4"
mux="mp4"
vlc="/Applications/VLC.app/Contents/MacOS/clivlc"
fmt="MPG"
dst="/Dest/Path/"
for a in *$fmt; do
  $vlc -I dummy -vvv "./$a" --sout "#transcode{vcodec=$vcodec,\
  vb=$bitrate,acodec=$acodec,ab=$arate}:standard{mux=$mux,\
  dst=\"$dst$a.$ext\",access=file}" vlc://quit
  touch -m -r $a $dst$a.$ext
done

If you want to try this on Linux or Windows, you should use vlc instead of clivlc. I included the touch command so that the transcoded videos would still have the original capture date/time as their last modified date.

Thursday, March 12, 2009

ISBN to BibTeX Converter

Kenjutsu posted about an ISBN to BibTeX converter in comp.text.tex. Given an ISBN e.g. 0471976970, it returns:


@book{0471976970,
Author = {D. Grune and H. Bal and C. Jacobs and K. Langendoen},
Title = {Modern Compiler Design},
Publisher = {Wiley},
Year = {2000},
ISBN = {0471976970},
URL = {http://www.amazon.com/Modern-Compiler-Design-D-Grune/dp/0471976970%3FSubscriptionId%3D0JYN1NVW651KCA56C102%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0471976970}
}


The author of the converter stated that he's obliged to include the link to Amazon to comply with the terms and conditions for using Amazon's Web Service API to generate the information.

The converter accepts both 10- and 13-digit ISBNs, but doesn't seem to be able to recognise books with editors instead of authors (you know, a collection of articles). Still, it can be useful.

Friday, March 6, 2009

Episode IV — now in ASCII art!

I first came across this at Random Determinism, where there's an embedded YouTube version as well. But I thought to myself: Is this a geeky blog, or what?[1] And so — open up a terminal and go

telnet towel.blinkenlights.nl

Enjoy!



[1] OMG I can't believe I just admitted that OMG OMG OMG OMG...

Tuesday, March 3, 2009

The Pink Jedi Again


Notice the giant Vader in the background? :)


This would make a nice parody movie poster. One of these days, when I have some precious free time on my hands...

Wednesday, February 4, 2009

Little Jedi in Pink

Pretty in Pink.

MC turned out to know more about Star Wars than I do. The moment he saw Hui Ning in this new dress, he made a beeline for the camel humps at the Penang Municipal Park.


Correction:
As it turned out eventually, no, MC doesn't know more about Star Wars than I do — Banthas don't have humps.

Thursday, January 15, 2009

Can we have a much, much better Sejarah syllabus, please?

For quite some now I've been reproachful about the way Sejarah was taught when I was in secondary school. I absolutely hated the subject at the time, but especially after university, I find myself wishing frequently that I learned the history of my country in a more meaningful way. As opposed to memorising tons of facts without comtemplation and questions, and going by the "heuristic" of "them bad, we good. As in, we good." (You know what that emphasis is for.) And other propagandistic stuff. You know, it's even scarier that most people don't even realise there are propagandistic stuff in the textbooks years after they graduate.

Call me a defeatist or whatever, but I can't even find the energy to start elaborating why I feel this way. I'm sure many of you know why and probably feel the same way. (OK OK, that makes only one of you.) Well nothing sums it up better than this article, "Learning Malaysian History: A Lopsided Formula" written by John Lee for Education in Malaysia. Great read. And I hope for my child's sake that the Sejarah syllabus be given a long-belated overhaul.

In the meantime I'm reading up as much as I can, so that I'll be able to at least give my child a clearer picture when she has... questions. Especially the awkward ones. I hope I'll be able to give her some answer that makes sense from a historical context instead of a lame "sorry kid, that's how it is..."

After all, that's the whole point of History, isn't it?

Thursday, January 8, 2009

I want a cubicle like this!

Google engineers are having lots of fun building various stuff both decorational and functional, out of giant Lego-like blocks called "Bloxes". These are

"interlocking cardboard boxes that were something like giant legos that connected on all six sides. They ... were originally intended to be used to build flexible workspaces (like easily morphable cubicles)."

Here's a cubicle office with an attached lounge area:


More photos here. Gee, I wish I could have a Blox cubicle. Can I? Can I? What? No funding? Dang.

Friday, January 2, 2009

C'mon, Tajel!

Awwww c'mon, Tajel! LaTeX has lots of goodies for the Humanities, too!

Sunday, December 14, 2008

Formatting Large Hard Disks with FAT32

I badly needed a new external hard disk. My boss gave me one of 150GB — in NTFS.

Darn. I hardly use Windows these days, only GNU/Linux and Mac. And WinXP wouldn't let me format it to FAT32.

Darn darn darn.

Until I came across fat32format. All I did was to issue at the command prompt

fat32format e:

and the hard disk was formatted in, like, what? 2 seconds.

*Blink*.

Wheee!!!

Thursday, November 27, 2008

EOL character conversions

I need to inspect/process large text files (mostly dictionary data) on a regular basis, and for a quick preview I'd use the trusty less. But one thing nearly always drives me crazy: end of line (EOL) characters.

So what's up with all the EOLs? Read all about them.

Luckily since I'm working on *nix systems anyway, there are nifty little utilities, nay, bash commands that'll do the EOL conversions in a blink.

For conversions between DOS files (CR-LF EOL) and *nix files, use dos2unix and unix2dos. (Or use sed if you're old school, as shown in this Linux FAQ HowTo.)

On the other hand, if you need to convert Mac files to/from *nix files, try out this trick with tr, or awk, or perl.

And finally, if you also need to convert between character encodings/sets, you might want to use the versatile recode utility instead. I use it all the time now since I need to process multilingual dictionaries very often.

Thursday, November 13, 2008

Transitional and Strict DOCTYPEs

Every now and then, I write some HTML with some CSS thrown in. I'd insert the ol' XHTML DOCTYPE directive, but I'd never bothered validating my code (aaaarrghhh you sinner!!), nor finding out about the differences between Transitional and Strict DOCTYPEs. Well, I just found out today when I came across this article, extolling why we should go Strict (and CSS).

Wednesday, November 5, 2008

Picasa Albums in Facebook

A while ago I was finally egged on by Hussein to get into Facebook. I was really reluctant at first, since I'm quite skeptical with most other social networking sites (except LinkedIn, which sorta has a more career-oriented feel to it and hence, feels less "adolescent" — sorryyyyy, didn't mean to offence!).

I was pleasantly surprised once I joined. Apparently Facebook's new interface was already in operation when I joined, so all my user experience only applies to the new Facebook. Clean interface, useful tools (non-obtrusive friend invites, people-you-may-know), etc.

I had only one gripe though. I've already uploaded tons of photos (mainly of my baby) to Picasa Web Albums, and was loathe to re-upload them to Facebook. Now there should be Facebook apps to embed/link Picasa albums in my profile/wall, right? Right. Only that they don't work with the new Facebook.


Today I finally found a new Facebook app, Picasa Tab, that actually works.


It pulls all your public Picasa albums into a Wall tab, and displays the photos right inside the Facebook interface, unlike the other apps which would actually redirect you to the Picasa website.


Viewers can even comment on the photos right in Facebook, although these comments won't be updated through to Picasa itself, as the app author wanted to keep Facebook comments more private.


The only caveat right now is that you'll only get a photo still for videos, but I guess that's asking too much for now. :)

US election day on Facebook


The whole world is watching eh.

Saturday, October 18, 2008

iGoogle haz new lookz

iGoogle's just got a new look yesterday:



The tabs are now all lined up at the left of the screen, instead of across the top. This is quite alright if you have a wide screen, but for people like me who's got smaller resolutions, the screen real estate has really shrunk. Each widgets may now be "maximised" to fill up the whole content frame, like the Google Reader widget in the screenshot above.

My first impression: Whoa, it's like launching a new applications when you maximise these widgets, and something like a preview when you only expand them. Hmmmm... is Google going to make this into its own operating system? Y'know, do everything online, forget about installing OSes locally on your own machine and be tied to it?

UPDATE: iGoogle gives a tour of its new features.

Thursday, September 25, 2008

New fun stuff from Google.

Google Chrome. Ooooh. Me like.

PicasaWeb update with face recognition and name tags. Ooooooh. Me like. (Yeah yeah I know Flickr had it ages ago...)

Monday, September 22, 2008

Geeky Fan Girl!


My colleagues, Sara and Gan, recently went to a Web-related conference in Singapore. Anticipating that Google and hence Dr Lee Kai-Fu would very likely be there, they took along a couple of his books (including my own copy of 《做最好的自己》 "Be Your Personal Best") to see if they could get his autograph.

Guess what? They got it! (The Google stickers and bookmark were from Google's exhibition booth. I thought at first Dr Lee had a Santa's sack with him to hand out Google goodies wherever he went...)



They told me Dr Lee was pretty surprised to see people bringing books "all the way to Singapore???" (he thought they were from Taiwan initially) just to get his autograph. Well Dr Lee, it's so rare to find someone who combines the best of both worlds from the Western "go-getter" attitudes and Oriental "ethical values of integrity and humility", and is happy to share his views on the younger generation. After reading your book and articles, I know that I'm not "stupid and naive" to want to do things my way all the time.

Friday, September 5, 2008

Wanted: Suggestions for Superheroine Moniker

(I know I've said before that I'd post all baby fluff in the other blog, but she's just too cute for words and I really want more people to see her, even if it's really just one more...)

Needing the service of a superheroine? Look no further than me, the... er... ah.... hmmm. I need a superheroine moniker. Any suggestions?




Hush. I just sneaked into the enemy's secret hideout and trying to find out where they're keeping the hostages.




I hear a scream! Hang on, I'm coming!




You ain't getting away, you baddie!




Take that! *POW* *SMASH*




Another day, another baddie in the garbage can. I'm off!

Sunday, August 17, 2008

Aging Laptop

(Just to remind anyone who wants news of Hui Ning, my new daughter — head on to my other blog. And if you decide to venture there do be aware that there might be TMI at times...)

My Fujitsu laptop's showing symptoms of age, even though I've only had it for about a bit over two years. Then again I showed it no mercy, using it for >16 hours per day frequently, coupled with the temperature in M'sia...

Bottomline is, the fan refused to work, even at startup, about 2 months back. I get a loud beep at boot-up and an erroring declaring that the fan system is off. I was trying to knock off some projects before the baby arrived, so I continued using the laptop anyway. It probably wasn't a good idea. A few days back I found that after about 30 minutes of usage (without air-conditioning), the graphics card seems to go all wonky: in Windows, the screen just froze. I restarted the machine, and I see vertical stripes interspersed with the usual BIOS startup splash. In Debian though, X.org seemed to work OK, but come shutting down time, the console messages are a bunch of garbled text.

Uh-oh. Sounds like some stuff are getting fried. Back-up time. And only use the machine with air-conditioning on when it's absolutely necessary (like uploading Hui Ning's photos and videos, heheh.)

Then today, immediately on startup, the vertical stripes were already there in the BIOS startup. Windows is rendered unusable as even the login screen can't be displayed. Debian though... ok so the startup console messages look like some pig-latin encrypted code, but in due time X.org starts up fine and I'm here writing this blog post while backing up whatever else I should be backing up. (Why do I feel like writing "We cannot get out. They are coming. We cannot get out."??)

This laptop goes to the service centre tomorrow — hopefully we're not too late.

Monday, August 4, 2008

Welcome, Baby Hui Ning!

Baby Hui Ning 慧宁 arrived roughly a week earlier, at 12:58pm on 30 July 2008. My water broke around 6a.m., so I guess my labour wasn't too long for a first child...



I'm still pretty exhausted (and time-constrained!) to blog much -- you know the drill ;-D In the meantime, here are some photos.

Tuesday, July 29, 2008

38 weeks



Until I saw myself on film I had no clear idea how big I've actually become....

1.5 weeks to go (assuming we're following strict due dates) :D !