Funky Waves..

We were trying to animate a mode which we measured on a beam for one of the labs at school… Ofcourse, Matlab it was for all the data processing and animation. We used the ‘patch‘ command to generate a surface with many elements and then moved them individually as per the measurements.

Now of course Matlab let’s you save each plot as a bitmap and play them back as a movie, but then it’s stuck in Matlab.. So how do you render it to a ’standard’ file? Well, there is mpgwrite. You can find it at Matlab Central which is a really cool community where you can get tonnes of Matlab help and pre-written scripts and libraries which help you do lots of things..

Now, that’s all cool, but mpgwrite uses a Matlab executable(.mex) to do all the heavy lifting in C. So that mean I had to compile it myself. Not a problem I thought.. With macports, I should have all the things I need.. So we ‘make‘.. But I had some errors.. Looking at the forum for mpgwrite, I saw this solution…

A few hints on how to compile would be nice. I see others have had the same problem, so I’ll share how I managed to compile it under Mac OS X 10.4.8 running on an Intel Mac Pro.

1) First, you must change file pbmplus.h, at line 101 change to

2) Locate where you mex compiler is. In my case it is /Applications/MATLAB73/bin/mex. The full path must be written in the Makefile, i.e. it says simply “mex” on line 8, however it must be the full path to the mex compiler (as written above).

3) Type make at the command line (not in MatLab) – of course you must be in the src/ directory to do this.

4) Enjoy your .mex*-file!

Hope this helps.

And Voila!! It compiled.. So I continued to export the matlab animation and made an mpeg out of it… Check it out..

For those who are interested.. This is a mixed mode with some part torsional and some part bending wave..

Best Kanelbulle in Stockholm..

In Sweden, like the rest of Scandinavia, they love their pastries and sweet breads. And the most famous are the Cinnamon Rolls, or Kanelbulle in Swedish. Especially since they’re one half of the traditional, fika, which basically means coffee break. The other half being coffee, which the Swedes are known to consume in crazy amounts.

Anyway, so I’ve really been enjoying Kanelbulle in Sweden, and I was searching for places in Goteborg, which are knows for their Kanelbulle. I was told there was a very traditional bakery, somewhere in the old town which makes really good Kanelbulle. While searching for it on the internet, I came across Kanelbulle.tv, and their video of finding the best Kanelbulle in Stockholm.

So when I was in Stokholm last week, I decided to try to find this place Saturnus. Thanks to Google maps, I figured it was pretty near where I was staying, so I went there for Lunch and ofcourse Kanelbulle.


View Larger Map

So what’s the verdict? Yup. These guys are correct this is the best Kanelbulle I’ve had (at least in my 1month here). It’s absolutely tasty and absolutely HUGE!

DSC_4749

Kanelbulle at Saturnus, Stockholm

DSC_4747

HUGE Kanelbulle at Saturnus, Stockholm

My Kanelbulle

My Kanelbulle

And to be fair to the place, the Sandwiches there were pretty awesome too.

So next time you’re in Stockholm, you know where to go.. :)

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.

DSC_4634_23

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

If..

I heard this Poem at the Göteborg Toastmasters Club meeting today.. It was written by Rudyard Kipling of the Jungle Book fame.. It’s very well known (except to me, that is..) and was even voted to be the “Britain’s favorite poem”.

If you can keep your head when all about you
Are losing theirs and blaming it on you;
If you can trust yourself when all men doubt you,
But make allowance for their doubting too;
If you can wait and not be tired by waiting,
Or, being lied about, don’t deal in lies,
Or, being hated, don’t give way to hating,
And yet don’t look too good, nor talk too wise;

If you can dream – and not make dreams your master;
If you can think – and not make thoughts your aim;
If you can meet with triumph and disaster
And treat those two imposters just the same;
If you can bear to hear the truth you’ve spoken
Twisted by knaves to make a trap for fools,
Or watch the things you gave your life to broken,
And stoop and build ‘em up with wornout tools;

If you can make one heap of all your winnings
And risk it on one turn of pitch-and-toss,
And lose, and start again at your beginnings
And never breathe a word about your loss;
If you can force your heart and nerve and sinew
To serve your turn long after they are gone,
And so hold on when there is nothing in you
Except the Will which says to them: “Hold on”;

If you can talk with crowds and keep your virtue,
Or walk with kings – nor lose the common touch;
If neither foes nor loving friends can hurt you;
If all men count with you, but none too much;
If you can fill the unforgiving minute
With sixty seconds’ worth of distance run -
Yours is the Earth and everything that’s in it,
And – which is more – you’ll be a Man my son!

—Rudyard Kipling

Main Kyaa Jaanuun..

Main Kyaa Jaanuun Kyaa (Jaaduu Hai \- 3) \- 2
In Do Matavale Nainon Mein (Jaaduu Hai \- 3)
Main Kyaa Jaanuun …

Ek Ek Athah Sagar Sa Hai \- 2
In Do Matavale Nainon Mein (Jadu Hai \- 3)
Main Kyaa Jaanuun …

(Man Puchh Raha Hai Ab Mujhase
Nainon Ne Kaha Hai Kya Tujhase ) – 2
Jab Nain Mile (Nainoin Ne Kaha – 2)
Jab Nain Mile Nainoin Ne Kaha
Ab Nain Base Ke Nainon Mein
Main Kyaa Jaanuun Kyaa Jaaduu Hai

-(unknown) Zindagi, 1940

Hello Sweden..

I have been in Sweden for the past four days, and I have been really enjoying it. The weather has been amazing, and so have the people. It feel really easy in a country where almost everyone speaks decent English. Most of the signs are in English as well, or can be inferred from Swedish very easily (more on that later).

DSC_3997

I’ve also been meeting many interesting. The current suspects are dutch student, a french teacher, a dutch bagpacker. Hehe. We went out on a day trip to the Göteborg Archipelago. It was really great weather and interesting company. Although we didn’t manage to solve all the worlds problems over the lunch table, we tried.. :P

I’m also enjoying the food here.. My guilty pleasure is the supermarket trip. But, I am trying not to buy too many things for now, since I will be moving into a new place soon. But still I couldn’t resist a huge block of Gouda cheese (much to the disappointment of the dutch who don’t like their cheese made from pasteurized milk.. ah well)

I have also started a Posterous Travelog at http://chinpen.posterous.com. Do check it out and give comments and suggestion. I would love to interact with all of you during my travels and allow you to see Europe as I see it.

Shifting’s a Bitch but…

When I last moved, I had complained about how shifting is a bitch. This time however, I am using MANY of the things I mentioned about last time.

1. I am taking MANY days to pack.. I have started sorting almost 2 weeks before.

2. I am not taking MANY MANY things with me. Those will either be stored with a someone in Singapore, or sent to India with parents.

3. I am trashing even more things. This is the big one.. As I keep sorting, I come across many things which have no use now, and will most probably have no use in the future.. So what to do with them?? Trash them!!!

4. Scanning most of the documents I need. Bills, IncomeTax stuff, CFP stuff, financial stuff and all are getting scanned and saved to something like Evernote. That way I will have access to them everywhere and not have to lug thick folders around. Now only if I had that Fujitsu ScanSnap scanner..

Hopefully with all this, I should be able to fit everything I need to bring over in the 30Kgs that I am allowed and the box I am going to ship over afterwards. Let’s see!!!

Europe beckons.. and I will go!

Last year in March, I blogged about wanting to to go Europe.

Europe has always charmed me with it’s culture, it’s people, the food (especially the food) and the way people think. It might not be the best place on earth, but I do like it quiet a bit.

Having had a great exprience during my exchange days in Denmark, I have decided to go back to Europe for further studies. I will be studying Sound and Vibration, at the Chalmers University in Goteborg, Sweden.

I’ve always loved to study. My days at NUS were some of the best till then. I am hoping to learn and explore even more things in another area of my interest while I am there in Sweden. Hopefully it will open many news avenues and give me many new opportunies in the next few years.

So yes, a new chapter to my life will start in about a month’s time. It’s a two year course and so I’ll be Goteborg for next two years… :)

P.S. If you’re gonna be in that part of the world, just drop me an email/im and we can surely meetup.. :)

Where Toastmasters has brought me..

This post is a continuation from the last one, to talk about Toastmasters club.. And specically the kind of experiences and opportunities it gave me..

Being a semi-regular attendent of the club meetings (it was first year and I really didn’t have anything better to do), I was encouraged to take up the position for the club ex-co in my 2nd yr.. After much convincing I agreed, and together with my good friend who’d introduced me to the club, I stood for the ‘elections’.

I rememeber, due to some last minute changes, my election which was supposed to be a walk through (the old ex-co had planned it all), I had to stand up against my own mentor from the club. It was a wierd election speech if you’ve ever seen one. Finally, I was voted in as the SAA (Seargent-at-arms) and thus started another ride.

Being in the exco was fun and yet challenging. Managing people was hard, but successful meetings and growing members made us feel really great. We ourselves got loads of chances to become TME (Toastmaster of the Evening) and TTM (Table Topics Master) and as Evaluators as well. That was a great time to learn organisation, logistics as well as communications and public speaking.. Though we did not get to do many projects ourselves..

In my 3rd year, I went for exchange to Copenhagen. During my 6 months there, I managed to attend 1 meeting of the only local Toastmasters club. It was a bilingual club, with alternate meetings in Danish and English. I managed to attend the English meeting and take part in not only the table topics but also be the ‘Ah counter’. It was a very different experience.

The next few years were the busy years. With other commitments, my time in Toasmasters reduced to just attending meetings. Though I managed to attend quiet a few workshops, do a few more projects, take part in a few competitions, visit many other clubs. I was just trying to keep up with Toastmasters rather than acheiving anything.

Last year, two very enthusiastic ladies in my old company decided to start a Toastmasters Club inhouse. I was really excited. I attended all the meetings and was ofcourse nominated for the ex-co again having had Toastmasters experience before. It was great to see a club starting form nothing. We put in loads of efforts to spread the word, get more people in, get them excited, teach them the way of Toastmasters and make them grow.. We had to create the club culture, and induce enthusiasm into the members.

Toastmasters has really brought me a long way. The thing I learnt there don’t just stop at public speaking and communication, but are lessons in life itself. It is there I have heard some of the most motivating and also the most heart-breaking speeches.

If you’re interested in finding our more about Toastmasters, check out Toastmaster’s International. And here’s a list of clubs in Singapore.

How I started Toasting..

After listening to an episode of the The Public Speaker from the Quick and Dirty Tips network, I thought about blogging about Toastmasters.

Toastmasters

I joined Toastmasters in my first year of university. I remember going to the matriculation fair and seeing the booth. Although I did not sign up there. I did keep a mental note to revisit the club when I had a chance.

I had been very nervous of public speaking then. I remember being made to deliver an inspirational speech at a workshop in secondary school. We were supposed to inspire and motivate our groups with speeches, to get them to rise against the other group. While the ‘leader’ of the other group gave a great speech, I, having been “saboed” by my group to be the ‘leader’ made a complete fool of myself by copying the other leader’s speech.

4 months after joining NUS, I joined the NUS Toastmaster’s Club. The meeting was in a tutorial room in the Science faculty. I was warmly welcomed and quietly sat at the back of the room. Everything was going fine, the speakers introduced the club, and how things worked and started of the meeting. And then, they asked everyone to introduce themselves! I still remember the butterflies in my stomach when I it was my turn. I had prepared my introduction before hand and was rehearsing it in my mind. When it was my chance to speak, I stood up and froze. I couldn’t get any words out of my mouth. After muttering a string of words which didn’t make any sense.. I sat down.. This was going to be a looong ride..

It took me another 6 months before I did my first speech at the club and many many more to be loose the fear I had of speaking in front of an audiance. I also ended up taking up a role in the ex-co of the club and hosting many meetings. It was a great experience and it taught me not only speaking/communication skills but also made me conformable is many situations I’d have been otherwise very nervous in..

That’s how I started with Toastmasters.. :)

You can listen to the episode of the The Public Speaker here..

Next Page »