Saturday, January 22, 2011

QR Codes - Embrace!

Being away from my blog for some time (around 5 months) I felt like giving it some new life. Even I was bored with the old template which was filled with graphics and thought of going to a simpler standard one – and hence this dark theme which will load faster and... oh well, will at least save some power :)

Anyway getting back to the topic, seeing these 2D bar code around, I was enthusiastic to investigate more on them. Among the types like CM , PDF417, MaxiCode , DataGlyphs etc I was really interested in one category I have been seeing around quite often which encodes data in the form of squares.

This type I am talking about is officially known as QR Code (Quick Response). A code can store up to 4,296 alphanumeric characters of arbitrary text. Since it stores a bunch of characters, this text can be anything, ranging from a name, URL, contact information, or even a geeky way to represent of a short romantic poem! This has been mainly used in the Japanese automobile industry to track production line elements. But, today its utility has expanded to a broader scope and is being used to store different types of information in different domains - specially marketing.

Here’s my contact info in QR Code (basically ‘MY’ QR Code) :




As you would have already seen, my blog already has its own QR Code.

ZXing’s neat online utility to generate your own QR Code can be found at http://zxing.appspot.com/generator/

The google visualization API has all what you need to embed QR Codes in your web content. The chart API will show you all the options available. The following is the simplest form of getting what you need embedded.

<img src="http://chart.apis.google.com/chart?cht=qr&chs=WIDTHxHEIGHT&chl=YOUR DATA STRING" />

I already added the ‘QR Droid’ android app to my mobile and I am loving it already. This allows me to embed all sorts of info in QR Codes and also retrieve them pretty effectively.

Happy QR Coding!




Monday, July 19, 2010

Going LED!!!


This weekend was a rather industrious one for me since I was in a mood to fix stuff at home. It started off with fixing a damaged component of the car which would have cost over 15k LKR if went for a replacement. After this, I was eager to fix something else. Then I remembered that the fluorescent light based emergency lamps at home were giving trouble all the time, without serving the purpose. Their light was so dull and the emergency lamp was gradually becoming a decoration.

Then I thought, “hey, why not replace the dull tube with LEDs?!” Without a second thought, I got to work and formulated a quick and dirty plan. The lamp already has a chargeable 6V 4.5 Ah battery. So, my job is going to be really easy if I connect the LEDs properly without drawing out too much current from the battery and also without letting a high current flow through the LEDs which would bust them off instantly.

So, it was shopping time! Well, there’s nothing to exaggerate here. I simply bought 40 white LEDs, some circuit wire, soldering lead and a switch.

The light panel was the crucial element of the project. So, I took a thick cardboard and marked where the bulbs would go. My plan was to have two arrays of LEDs 20 on each array. 6V across two series LEDs seemed fine. Therefore, the entire light panel became a set of parallel connected two series LED units.

In this entire endeavor, I had an assistant who was very eager to help – my little sister :) . Since she also wanted to help, she was given the task of testing all LEDs to see whether they were working and she also helped to hold things in place while I soldered.

Once the light panel was made, I had to open up the lamp and make the connections to the power source. Since I had a rep to maintain, I needed to have something up and running before I left back to Colombo. So, my plan was to have the basic functionality up and running. Without any fancy stuff, I gave a direct connection to the battery and attached a new switch on the side of the lamp since the original switch was acting more like an insulator :P

And Voila!!! There’s my simply DIY project to make the emergency lamp LED powered!

This is not yet complete. I am yet to make the surface of the panel reflective and also need to run some tests to see if I can improve the power utilization. Let that be phase 2.

I know, this is not rocket science, but it was fun to get my hands on something ‘non-binary’ after a long time :)

Here are some snaps of the intermediate stages.







Monday, July 12, 2010

Watching a Java app die!


When you start living with Java, and extend that to eating and drinking java you start realizing amazing similarities between the language/paradigm and life. You start seeing java as a living organism which breaths and eats.

Once you hook up a java application for a monitoring tool like JConsole, you start seeing wondrous things. Analogically speaking this is similar to hooking up a person to an ECG machine. Once you get to analyze how the heap space keeps on increasing and how the garbage cleaner frees up memory from time to time it really starts looking like the ECG output. As a part of my geeky investigations, I felt like checking out whether I could recreate the ECG representation of a dying person on the JConsole using a dying Java program.
So, I chose one app which was throwing out of memory exceptions randomly, and decided to crank up the environment to the max and let the app run with probably the most resourceful environment. So, I turned on the –XX:+AggressiveHeap option which greedily expands the heap space and sets other relevant parameters. Then I also turned off the overload detection for the garbage collector. This latter was done by setting the -XX:+UseGCOverheadLimit option. This evaluates the proportion of time spent on GC and if it is significantly high, throws an out of memory error since it is very likely that it will run out of memory anyway.
After firing up the application, the awesome started to happen. I could see how the application started choking for life, until the heap space could not be expanded anymore, and the GC could not clean up anything further. After a tough battle, the application just died…!
Have a look at the JConsole output below.


Isn’t it fascinating? :)
FYI, here’s a list of VM options which you might not try out everyday.
Long live Java!!!


Friday, July 9, 2010

The UNnecessary intervention and our response...

Every Sri Lankan knows by now, or should know what this country went through over the last 30 years and how we got over that curse, despite the stereotype that the fallen villain has put on us saying that we remember something only for 2 weeks. When we are trying to remove the ‘developing country’ tag and move forward, it hurts the Western powers who were eyeing on SL’s bad times to hook in and take advantage of the extremely strategic location in the Indian Ocean. They would love it very much if we as a nation become a debtor to them eternally and cry and suck up for them to survive.

But when the ball starts rolling the other way, they panic. The UN is supposed to be an elite organization which is aimed at “facilitating cooperation in international law, international security, economic development, social progress, human rights, and the achieving of world peace” – at least that is what has been coined as its objectives. I agree that it has helped the member states significantly. But, again that is why it was created. How good the intentions might be, it seems to be in evil hands right now, and I have no hesitation is saying that the current secretary is tarnishing the UN’s reputation and obscuring our country’s rights as a nation.

The last few years in which the war came to an end thanks to the gallant efforts of the forces and associated leadership, it was visible in black and white how the so called saints tried to rejuvenate the terrorists who were falling day by day. There are so many atrocities taking place throughout the world by their own leading member countries, and yet they are ignored and these guys are chasing after our country with all sorts of awful charges. I need not go in to details.

So, how do we respond? At the end of the war, every one of us joined hands and hailed as one nation. It was a treat to see the national flag flying high in all corners of the country and how festivities took place in the island. A question is to be asked as to whether we still have that unity. The default answer would be ‘politicians are to be blamed’! I agree to a greater part of it. But, we are not idiots. We have brains to think and figure out who the bad guy is. When Mr. Ki-moon and his committee is trying to trample down our country, what are we doing? I know we all can’t go and declare war with those guys. But, at we should have a heart to backup the efforts taken by the government to defend us. Afterall, who has to go and face this in the end? It is not you and me. It is the government of the country who will be the interface. So, no matter whether you like the people in it or not, at a point like this everyone should ‘back em up’. Everyone can give their opinions on stages and thorough media. But, it is just a small set of people which has the ability and most importantly the spine to do something for it.

One person had the spine to walk up to the UN office and start a death fast. How realistic or not that might be, at least he had the guts to do it for the country. And it is extremely heartbreaking to see how he has become a joker on the face of many. Some guy who is excreting in cyberspace has even started a competition to predict the day that this person dies. Should we look at these and have a hearty laugh? Or should we condemn such treachery?

Think about it… This is not Iraq or Afghanistan! This is Sri Lanka!

We have only one country and the choice of everyone matters...

Disclaimer : This is a generic thought of mine as someone who loves the country which has nurtured him up to now, and is not aimed at promoting the government, a person or anything like that :)



Sunday, May 2, 2010

Reminiscence of beautiful Colorado


Thanks to the awesome company I work for, I got an opportunity to visit the United States for the first time in my life. And where was it all set to start? The beautiful Colorado! Now, that is one cool place to start it off!

First things first! Well, the flight to the US was itself a totally ‘unique’ experience. Having the route set up as Colombo – Dubai – Houston – Denver that was one long journey! Specially Dubai to Houston it was over 17 hours and the entire journey went on for about 30 hours! Yeah. That’s right! The cycle of eating, watching movies and sleeping continued for hours and hours until I finally reached Houston – the entry point to the country. Now that was one huge airport I must say! Being in this 6th largest airport in the world, I really felt its size when I had to go on a train, a bus and walk for like another 15 mins to catch my plane to Denver. Anyway, after all the plane travel, I finally got in to Colorado once I came out of the Denver airport, and that is where the entire Colorado/US experience begins.


Colorado itself is a big state which is the 8th largest state in the US. It has an area of 269,837 sq km (Sri Lanka’s area is 65,610 sq km). So, although I say I was in Colorado, I really was in a city called Broomfield which is home to the client I was visiting – one of the largest Communications companies in the world, being a Tier 1 network and operating one of the largest backbone networks of any Internet service provider. I settled down in a cozy place called Towne Place Suites operated by Marriott Hotels, and I must say that I really loved the 2 weeks I spent there.

So, how did being in Colorado/US feel? Let me summarize;

Friendly atmosphere

I was really impressed by the friendliness of the people I met on and off. Probably it might be partly because Broomfield being kind of a laid back area opposed to a big city with hustle and bustle. A good natured ‘hi, how are you doing’ is something that is built in to the DNA of the people here. I am not saying that people in my country are not courteous. But, being a complete alien in a new environment, I noticed this to be far beyond my expectations.


Huge roads and landmass

The highway system here is really impressive. The combination of freeways, arterials, collectors, and local roads seem to have been put together with a lot of thought. In a way, this can be expected owing to the vast land mass they have. With all these roads and buildings, they still the mount of free land space is more than the occupied space!

Where did all the buses go?

Well, I was asked to get ready for the travel in a hurry, and therefore the amount of research I could do before my travel was bit limited. I realized this when I started noticing that there is no means of public transport in the area. Why is that? Simple answer - everyone has a vehicle! Luckily my colleague from India knew what was coming through experience, and had reserved a rental car and that made our lives easier. Being used to roads filled with buses and trishaws, it was pretty weird at first to see just personal vehicles on the streets. Thinking about it, I just felt the implied message of this observation is, ‘if you can’t afford a vehicle, keep out of Broomfield’ :)

Remarkable discipline on the road

Now, this is the most important thing I noticed as someone who has been battling with the rest of the vehicles on the way to work using the weapon called ‘the horn’. Everyone was extremely concerned about road rules and the discipline shown on the road was really striking. Here, priority is given to the pedestrian. If a person is crossing the road anywhere, vehicles stop a good 50 yards away to let the person cross the road. I was finding this too good to be true. The usage of the horn is virtually zero, and if one is to blow the horn at some point, it is considered to be a sign of extreme irritation.

No policemen?

I’m sure they might be around at least for the sake of having them. But, I didn’t see a single police officer within the city. I just saw a police car parked outside a McDonalds, and that was it! But, I am sure this doesn’t apply to the entire US. Looks like citizens of this area are ‘self disciplined’ enough :)

Never step out without your maps

When you are on the road, you are on your own! That is a disadvantage we have here. Back in my country I could just pull down the shutter and ask someone the direction to get to any part of the island. But, not here! If you get on to a freeway by mistake, there’s no turning back until you catch the next exit. Even if you manage to get out of the freeway, you need to figure out how to get on to the freeway again on the other side of it. Now I get the point of features like the compass appearing on the iphone and why integrating GPS for mobiles was so much sought after. Anyway, when you drive here you need to know where you are going, and ‘when’ you get lost (like it happened to us few times) you also need to know where you have ended up. So, maps are a ‘must have’ here. After all, it is good to get used to that structured way of navigating :)

The never ending natural beauty

I really loved starting my US experience in the state of Colorado, since this is one of the most beautiful states in the US. It was a treat for the eye to see snow capped mountains every morning as soon as I wake up and gaze out of my window. During the two week’s stay I was fortunate to get the chance to see two highlights of the state – Eldorado Canyon State Park and Pikes Peak.

The Eldorado Canyon state park was an amazing creation of nature which was made up of thousands of rocks. This is said to be one of best location for climbing, and it showed! It was bloodcurdling to see so many climbers clinging on to vertical rock faces 100s of feet above the ground. I simply enjoyed the natural beauty of the area and headed back :)



More pics >>

Pikes peak was a different experience. As a matter of fact Pike Peak region itself has so many attractions like the Garden of Gods, Cave of Winds and so on. But, due to the time limitation we chose the Pikes Peak Cog Railway. This is a unique ride on a rain which goes to the peak which is 14,000 feet above sea level. Unfortunately we traveled only about 70% of the journey since the train could not go further due to the heavy snow on the top. But that partial trip alone was so great. The views were magnificent and traveling in a train which sometimes climbs gradients as much as 25% (possible due to the drive mechanism involving cog wheels meshing in to a toothed line on the track) was pretty exhilarating.

More pics >>


Rapidly varying climate

All these days I thought the climate in my hometown had a fast changing climate. But in the area I was, the changes were pretty dramatic. During the two weeks stay, there were sunny days, rainy days, gloomy days and to top it all, a day with a pretty heavy snowfall out of nowhere! Walking in a snowfall was awesome for me for the first few minutes. But, the fact that it is still heavy, frozen chunks of water makes all the difference in a while :).

- Finale -

Although I was supposed to fly back to my lovely country Sri Lanka, my stay got extended by 3 more weeks where I was to fly to the state of Ohio. The start I got at Colorado was extremely pleasant and I would love to explore the rest of it someday.

Anyway, let’s see what Columbus, Ohio has in store for me!!!





Friday, March 12, 2010

Chakithaya – the sizzling release by Nemesis!

Nemesis – one of the hottest rock bands in town led by my good pal Mackie is out with their debut music video – Chakithaya!

Ever since their inception in 2006, Nemesis has thrived through thick and thin. A major achievement was them bagging the
victory in TNL OnStage 2008 – The most grueling test for unorthodox music excellence in Sri Lanka.

With Chakithaya they sure have set another milestone in their career!




This blog post is a tribute to you Mackie! Awesome feat among you academics and professional career! The combo you have with Losh, Mayya and Sithija is superb! Super track! Super music! Super first video! It's all simply S-U-P-E-R!!!

Well, this is the best I can do in terms of writing right now coz I am no longer with the paper :(

(Btw, saw that the
article I did for you guys is among the references in your Wikipedia page. Awesome!!! :)

Keep rocking guys!

Looking forward to your next video ;)

NE-ME-SIS!!! NE-ME-SIS!!! NE-ME-SIS!!!





Wednesday, February 10, 2010

It's time to 'buzz'!



When I started using twitter and was thinking of the how social networking can flourish further, I was thinking how nice it would have been if we had a twitter with multimedia support. It slipped off my mind after that, and Voila! Look who’s in the news! It’s Google again! And I was amazed to see what I thought in a little way was what Google has actually made a reality, of course taking it to greater heights than I was thinking.

Earthlings, say hello to ‘Google buzz’ - the latest, most revolutionary, groundbreaking integrated social networking solution by Google!

It lets you post updates in the form of text, video, photos and few other feeds. With the massive integration Google has within its components, this connects you to your contacts as and when buzz is activated, and resides in Gmail. I am yet to see all the good stuff of Buzz, but I can already feel how rich real time social networking is going to be.

Anyway, here’s a little heads up for getting buzz working for those who cannot see Buzz in Gmail. There are few pre-requisites.

  1. You need to have a Google profile.
  2. Fill it up and keep saving until it says that your profile is eligible to be caught by searches.
  3. Subscribe to a couple of Google services (you would generally have these already)
  4. Do some activity on one of them (Like sharing a post on Google Reader)
  5. Log back in to Gmail and say hello to the Buzz tab :)

Check out what it is all about....