Archive for the ‘Cool Stuff’ Tag

Tesseract + Automator = DragnDrop OCR!

Necessity is the mother of invention it is said.. And sometimes it just takes an annoying repetitive task to psuh someone to do something..

I’ve always been interested in Applescript and Automator. These are Apple’s scripting/automating/batch processing frameworks. Applescript is basically a scripting language which allows you to command many OSX apps. The amount of control you have exert over the running of the apps depends on how the app was made (if they put in the hooks for apple script or not), but most Apple apps are pretty ‘scriptable’. Automator is automation for noobs. Instead of writing a script, you just drag and drop “actions” and create a “workflow“, which lets you pass outputs of one action to another and process them. It seems pretty lame at first, but once you start making your own droplets and ‘workflows’ it’s great fun!

Picture 3

So, during one of my labs, the analyzer we were using was unable to store/save the data we captured during the experiment. It was an old analyzer which used 3.5″ floppy disks, but the disk drive has stopped working. So we decided to take photos of the small screen of the analyzer when it displayed the data, and the transcribe them later.


When I saw the sheer number of file which needed to be transcribed (and also my entire evening gone doing that), I thought of doing some OCR (Optical Character Recognition). Google helped me to find Tesseract, a *nix utility which does OCR. Great. I managed to find a MacPort for it and got it to run on OSX.

OK.So far so good, but Tesseract only accepts 1 file as an input and requires that file to be in .tiff format. Now I could have written a bash (or perl :P) script to convert all the files to .tiff and then loop over all the files and call Tesseract but that’s too much work and surely not the ‘Apple way’. So, I called on Automator.

After a bit of tweaking and testing, here is my final workflow which creates a droplet. Any jpg file dropped on this droplet is duplicated, coverted to .tif and OCRed through Tesseract and the output is stored in a file with a suffix .txt

Picture 2

The OCR output was not the best. I had to massage (crop, rotate, gray-scale, etc) the images to get a good output.

You can download it here, but you’ll need Tesseract to make it work. Yay!

Btw, if you’re interested in Automator, check out the videocast Macbreak Ep235-238. And also Ep4-13 of MacBreak Dev

It will be a cold day in Singapore…

It will be a cold day in Hell Singapore before I will use Windows again…

Rant aside, I went to participate in The REAL Singapore Freeze on Saturday. The idea is simple, all the participants randomly gather at a given location, which is communicated 1h before the stipulated time. And the participants have to freeze on the spot, doing whatever they are doing at the stipulated time for 5 minutes. And then, exactly after 5minutes (timed with synced stopwatches), just walk away like nothing happened… Absolute freeze though… No eye movements, no smiling, to blinking, and no breathing… OK I kid about the last two.

I liked the idea for it’s freshness and it’s tongue in cheek artistic sense. I mean after all it is a kind of performance art, but something different. There is something inanely artistic about freezing in a certain posture. It’s akin to a photograph, where a certain moment is captured in history.. OK enough of artsy stuff..

So finally, we were to freeze outside Ngee Ann City, at 430pm on Saturday. Freeze you say?? At that time, at that temperature, it was more of a Singapore Melt! But in the spirit of the event, we went ahead and melted there for 5 minutes.. It was fun, but being the extreme extroverts that Singaporean are, we only got a couple of stares and mostly murmur of the “crazy lah these people.. who ask them do this kind of stupid things… sure gonna kena mata already” type.

Overall, I thought it was well organized by Mission:Singapore, although the place and the time should have been considered. The place had another event happening, so the effect of “a whole square being frozen in time” didn’t come through, as we couldn’t even see other “freezers” (term copyrighted by hisham). Also, it was too early and too hot to do these things under the sun. I mean yes, we have had our bit of sun during PE lessons back in school, but that was enough wasn’t it??

Here are some videos of the event. The 3rd one covered our area.. :p

P.S. If you like this.. They have another event coming up.. Read more about it here

The rebirth of Apple TV…

During the last Apple keynote at MacWorld.. Among the many other things, Steve Jobs announced “Apple TV take 2“..

Everyone was of course looking at the wonderfully thin MacBook air to actually notice the amazing improvements done to AppleTV.

Let’s go from basics, AppleTV was basically a DVR /Set-top box kinda device that Apple started selling since last year. Something that you attach to your TV, and watch Media content off. It was like an extension of your Mac into your living room. But it’s major weakness was that you had to have another Mac (or PC) with iTunes, and the AppleTV would stream stuff from it.. In the Take 2.. all this changed.

The Take 2 is a software upgrade which makes the Apple TV your Mac in your living room. It doesn’t need a Mac, and can directly download stuff from directly to the iTunes on itself.

Further more, it supports Movie rentals, Flickr, Youtube and other services. The part I am most excited about is that it supports Podcasts. So you can subscribe to your favorite Video/Audio podcast on the iTunes on AppleTV, and watch it on your TV. And, since AppleTV supports 720p HD, you can watch HD podcasts in HD!!

With this and movie/TV rentals, I am really thinking this would be my perfect living room entertainment device.. Especially with people like revision3 coming up with Podcasts on all themes, and that too with high production value, and even in HD, I don’t think I need normal TV anymore.

Maybe it is time to get an HD TV, and trash that Starhub Cable Vision Box..

Oh, but the movie/TV rental doesn’t work in Singapore yet… ARGH APPLE!!!!

Another trip down the memory lane..

I was listening to a random selections of tracks form my collection, when iTunes started playing Tangerine Dream‘s “Street Hawk Theme”.. and I was suddenly transported back to my childhood..

Street Hawk was an 80s TV show which I loved when I was like 10! It was about… well, I’ll let the intro do the job..

Jessie Mach, an ex-motorcycle cop, is injured in the line of duty. Now a Police Troubleshooter, he’s been recruited for a top-secret government mission to ride Street Hawk, an all-terrain, attack motorcycle designed to fight urban crime. Capable of incredible speeds up to 300mph and immense firepower. Only one man, Federal Agent Norman Tuttle, knows Jessie Mach’s true identity: The Man; The Machine; Street Hawk.  

I remember they would air it on DD2, which was difficult to pick up with the antenna we had, so I had to move it around and tweak it until we got the best video and audio quality.. I also remember, once I actually tried to record the intro theme from the TV onto our good old Technics Tape player.. I messed up once, but I got it the next week.. The quality of the recording was so horrible, that i’d barely consider it as noise.. but I didn’t have a choice.. and didn’t know better..

A few years ago, I managed to get the original track, and guess what I found today.. Videos!!.. It’s very lame, and full of cliches.. but what do you expect from the 80s?

Having said that, I’d still love to watch it.. I believe there is the entire season somewhere, on DVD. Need to search.. :)

The xkcd saga…

This is my latest addiction on the Internet.. xkcd..

It’s one of the geekiest web-comic around.. touching stuff from programming, to mathematics, geek community, love and life.. and a great attitude. And what wins me, is the ability of the author to make obscure references to seemingly unrelated things.. and still make it funny…

But the latest set of comics, 1337, has to be the best comics strip mini-series in my reading… It has references to the some of the greatest geeks and hackers around.. as well as some of the most controversial issues in technology.. plus the attitude..

Here they are.. in sequence.. including one more, which seems like a pre-lude to the 1337 series… (Hint: The name of the son…)

Her daughter is named Help I'm trapped in a driver's license factory.

Exploits of a Mom.

If you're not cool enough to do it manually, you can look up tools like Upside-Down-Ternet for playing games with people on your wifi.

1337 Part 1.

Elaine is actually her middle name.

1337 Part 2.

O(n lg(lg n)))… hehehe

I once asked an NSA guy whether they'd broken RSA. And I know I can trust him, because I asked if he was lying to me and he said no.

1337 Part 3.


Mrs. Roberts would have gotten up sooner, of course, but she was busy piping find ~ and find ~nomad into xargs shred, just in case.

1337 Part 4.

(Stallman FTW!!!!)

This digital music thing will probably reach its endgame sometime in the next decade or so. These are very exciting times.

1337 Part 5.

Tag Clouds.. :p

Somewhere at the edge of the curve…..

The bell curve to the rescue!!!!


Mac or PC??

This one is for all you right-clickers…

I’m a right-clicka
I’m an iBook flippa
Macs and PCs – no fight gets bigga
Surf Safari or browse in I.E.
Better know what you rep – a Mac or PC!

NTT’s Bored Weekend #1

The weekend’s just started and I am already bored. I have tons of work to do… “work work” as well as “play work” but I am gonna be lazy…

Soldering and Toys!!!

I went to help a friend solder his guitar amp jack all the way to clementi in the morning.. I had to make a trip down to SLT to stock up on supplies. Got some “Stannol lötfett”. It’s the best flux (solder paste) I have used. Others are mostly crappy and smell really bad..

After fixing my friend guitar, he showed me the lastest set of ‘toys’ he bought for his lab!!

He had a really cool guitar interface which had digital effects for many amps and speakers. And it sounded awesome on his moniters!! I totally forgot the name…

Then he showed his Hercules DJ Console. That’s really cool stuff. OK. It’s not anywhere near as cool as the stuff professional DJs use, but you can spin some good stuff off it at home.. or in my friend’s lab!

Then he took out an AKG C1000S. Just the case looks soo cool!. I wonder what kind of amps he has for that.

Finally he showed me his new M-Audio Axiom 25. Reminded my of the Kaoss Pad and M-Audio that EML used during their concert..

Oh and he mentioned the motorized 8 channel Digi-Design mixer that has in the lab!!!

I was almost drooling.. I really should have taken up the job when I was offered it.. Sigh…

NTUC and Linux.

How do you know the Linux has reached the masses? When you can see it in NTUC!

Saw of the the “product promo” screens in NTUC booting into Linux! It was soo cool. I must have looked like an idiot staring at the booting screen.  I should have had a camera. :(

I have seen this at the Pacific Coffee Company as well. I guess it makes sense to use some kind of embedded Linux for such devices. But I really wonder why they set the display to be active during boot up. In my opinion, it looks unprofessional.

Singapore Tech Podcasts.

Recently, I found this tech podcast done by a couple of Singaporean guys. It’s called 65bits. Do check it out.

It has small episodes (10-20mins) and 2 guys chatting about technology wrt. Singapore. I have been catching up on the last few episodes, and I am liking it..

Now to start brain storming for ideas…

Nintendo Wii in Singapore

Wii are here!! This is very very surprising. I did not hear or see ANY advertisements, but the Nintendo Wii has been “Soft launched” in Singapore. The “Official Launch” is in October so they say.

G3 at Suntec is selling it at $800 bundled with an extra wiimote+nunchuk and 3 games (wii sports + ultimate alliance + your choice). S$800 is expensive. Cannot lah! The Wii is supposed to be cheap, and a fun console. Sigh.. I will wait…

Suntec for Lunch…  

What’s good at Suntec for lunch?? We could not find anything. Either too expensive or too crappy.. :(

FoxTrot + Bored Geeks = Hilariousness

 Another classic from Foxtrot just got better, thanks to some geeks. :D


Of Pings and Pongs.

Unfortunately, I have run out of excuses to give as to why I am blogging this almost 4 days late. But anyway, here goes.

I attended the meet up on Monday. For those who do now know, (and I really doubt such people exist), it’s basically like a blog directory, where the number of clicks per blog from the directory are counted, and blogs are rated using this number. The rating system has a “Top in last 24hrs” section which tends to be similar to Digg front page (Yay! Flame Bait).

Boring stuff aside, it was a really fun meet up. I met many people, who are normally hidden behind the nicknames on Looks like the community at is an interesting mixture of people from all age groups and backgrounds.

To my surprise, the meet up was attended by quite a few. According to the official list; uzyn, veron, harro, jugend, matthewchong, brennan, sweska, cibailang (2 persons), lostin, dk99, ridz84. Though, I think I missed dk99. Anyway, it was fun to see all of them ‘exposed’ (pun intended).

There were some interesting discussions about politics, local blogging scene, the internet trends, and Singapore in general. Many pingers showed off their cameras and other gadgets, while others drank really sour lemonade. There was a lot of picture taking and also some accidents :P. Oh and a whole lot of sucking up to…. Just watch the video, and you will know. I rushed off before the games part, so I cant say much about that.. :(

Overall, it was a nice evening. Got to know a lot of interesting people. I hope the pingers will organize more such meetings..