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....










Sunday, January 24, 2010

Do we have what it takes?


We, being children of the 'Pearl of the Indian Ocean' are descendants of a proud heritage which was able to construct engineering marvels, export grain to other countries and have highly civilized societies when the Western world was still evolving.

But, where are we now? Since we got independence in 1948, what was the direction we headed to as a country? How could Lee Kuan Yew once look at our country and say "I am going to bring Singapore to this level", and to see that now Singapore is thousands of miles ahead of us? Being a country with so much of natural resources and low probability for acts of God, why have we encouraged a mentality geared towards aids and free rations? Why do we always tend to overlook the integrity of the country and have the nerve to complain about everything that happens in the country which has an inconvenience for us? Why do we consider Nelson Mandela, Martin Luther King and Nehru to be true heroes and yet ignore the valiant efforts taken by our own people to bring peace and integrity to the country?


We have claimed pristine independence after a 30 year old terrorist crisis, and are in a position to take our country from the 3rd world to the 1st world. No one can argue that despite the war, world economic crisis and food crisis we pulled through as a nation without much of a hassle. Now is the chance for us to take our country to where it really should be. But are we ready for that? Has each and every Sri Lankan understood that each one of them has a role to play other than futile commentary?


The answers to all of these, lie within what Dr. Abdul Kalam has stated in a speech he has made in Hyderabad. I think we all must read it with a Sri Lankan abstraction over it and realize the relevance it has to re-condition our nationalistic attitudes.


Here goes…


“Why is the media here so negative?
Why are we in India so embarrassed to recognize our own strengths, our achievements? We are such a great nation. We have so many amazing success stories but we refuse to acknowledge them. Why?


We are the first in milk production.
We are number one in Remote sensing satellites.
We are the second largest producer of wheat.
We are the second largest producer of rice.


Look at Dr. Sudarshan, he has transferred the tribal village into a self-sustaining, self-driving unit. There are millions of such achievements but our media is only obsessed in the bad news and failures and disasters. I was in Tel Aviv once and I was reading the Israeli newspaper. It was the day after a lot of attacks and bombardments and deaths had taken place. The Hamas had struck. But the front page of the newspaper had the picture of a Jewish gentleman who in five years had transformed his desert into an orchid and a granary. It was this inspiring picture that everyone woke up to. The gory details of killings, bombardments, deaths, were inside in the newspaper, buried among other news.


In India we only read about death, sickness, terrorism, crime. Why are we so NEGATIVE? Another question: Why are we, as a nation so obsessed with foreign things? We want foreign T. Vs, we want foreign shirts. We want foreign technology.


Why this obsession with everything imported. Do we not realize that self-respect comes with self-reliance? I was in Hyderabad giving this lecture, when a 14 year old girl asked me for my autograph. I asked her what her goal in life is. She replied: I want to live in a developed India. For her, you and I will have to build this developed India. You must proclaim. India is not an under-developed nation; it is a highly developed nation. Do you have 10 minutes? Allow me to come back with a vengeance.


Got 10 minutes for your country? If yes, then read; otherwise, choice is yours.


YOU say that our government is inefficient.
YOU say that our laws are too old.
YOU say that the municipality does not pick up the garbage.
YOU say that the phones don’t work, the railways are a joke, The airline is the worst in the world, mails never reach their destination.
YOU say that our country has been fed to the dogs and is the absolute pits.


YOU say, say and say. What do YOU do about it?


Take a person on his way to Singapore .. Give him a name - YOURS. Give him a face - YOURS. YOU walk out of the airport and you are at your International best.


In Singapore you don’t throw cigarette butts on the roads or eat in the stores. YOU are as proud of their Underground links as they are. You pay $5 (approx. Rs. 60) to drive through Orchard Road (equivalent of Mahim Causeway or Pedder Road) between 5 PM and 8 PM. YOU come back to the parking lot to punch your parking ticket if you have over stayed in a restaurant or a shopping mall irrespective of your status identity… In Singapore you don’t say anything, DO YOU? YOU wouldn’t dare to eat in public during Ramadan, in Dubai. YOU would not dare to go out without your head covered in Jeddah. YOU would not dare to buy an employee of the telephone exchange in London at 10 pounds ( Rs.650) a month to, ’see to it that my STD and ISD calls are billed to someone else.’YOU would not dare to speed beyond 55 mph (88 km/h) in Washington and then tell the traffic cop, ‘Jaanta hai main kaun hoon (Do you know who I am?). I am so and so’s son. Take your two bucks and get lost.’ YOU wouldn’t chuck an empty coconut shell anywhere other than the garbage pail on the beaches in Australia and New Zealand .


Why don’t YOU spit Paan on the streets of Tokyo ? Why don’t YOU use examination jockeys or buy fake certificates in Boston ??? We are still talking of the same YOU. YOU who can respect and conform to a foreign system in other countries but cannot in your own. You who will throw papers and cigarettes on the road the moment you touch Indian ground. If you can be an involved and appreciative citizen in an alien country, why cannot you be the same here in India ?


Once in an interview, the famous Ex-municipal commissioner of Mumbai , Mr. Tinaikar, had a point to make. ‘Rich people’s dogs are walked on the streets to leave their affluent droppings all over the place,’ he said. ‘And then the same people turn around to criticize and blame the authorities for inefficiency and dirty pavements. What do they expect the officers to do? Go down with a broom every time their dog feels the pressure in his bowels?


In America every dog owner has to clean up after his pet has done the job. Same in Japan .. Will the Indian citizen do that here?’ He’s right. We go to the polls to choose a government and after that forfeit all responsibility. We sit back wanting to be pampered and expect the government to do everything for us whilst our contribution is totally negative. We expect the government to clean up but we are not going to stop chucking garbage all over the place nor are we going to stop to pick a up a stray piece of paper and throw it in the bin. We expect the railways to provide clean bathrooms but we are not going to learn the proper use of bathrooms.


We want Indian Airlines and Air India to provide the best of food and toiletries but we are not going to stop pilfering at the least opportunity. This applies even to the staff who is known not to pass on the service to the public.


When it comes to burning social issues like those related to women, dowry, girl child! and others, we make loud drawing room protestations and continue to do the reverse at home. Our excuse? ‘It’s the whole system which has to change, how will it matter if I alone forego my sons’ rights to a dowry.’ So who’s going to change the system? What does a system consist of ? Very conveniently for us it consists of our neighbours, other households, other cities, other communities and the government. But definitely not me and YOU. When it comes to us actually making a positive contribution to the system we lock ourselves along with our families into a safe cocoon and look into the distance at countries far away and wait for a Mr.Clean to come along & work miracles for us with a majestic sweep of his hand or we leave the country and run away. Like lazy cowards hounded by our fears we run to America to bask in their glory and praise their system. When New York becomes insecure we run to England . When England experiences unemployment, we take the next flight out to the Gulf. When the Gulf is war struck, we demand to be rescued and brought home by the Indian government. Everybody is out to abuse and rape the country. Nobody thinks of feeding the system. Our conscience is mortgaged to money.


Dear Indians, The article is highly thought inductive, calls for a great deal of introspection and pricks one’s conscience too…. I am echoing J. F. Kennedy’s words to his fellow Americans to relate to Indians - ‘Ask what we can do for India and do what has to be done to make India what America and other Western countries are today’


Now tell me how the essence of this speech is not applicable to Sri Lanka!


( On a related note, if we look around more attentively, visionaries with such patriotism can be found within our country too )