Why learn a second language ??

Well, I actually asked this question myself a little too late.
It was too late because, by that time I had was already speaking a bunch of languages.
While there are myriad read reasons as to why someone should be learning a language, ranging from Social interaction benefits to adding a skill to your Resume, I have made an attempt to pen down a few of them which are reasonable.

1. Adaptable in Business/work/study

If you are emigrating to a country or a region due to work/studies knowing local language would help you to communicate with the people around and learn there culture, way of thinking and experience there ways.

2. Socializing with Family/Friends/Relatives

Or if your partner comes from another country/language, it helpy you understand your inlaws, relatives and friends and hence helps you socialize better and have a healthy relationship.

3. Traveling

If you are one of those who love to travel, and feel the Itch very summer to travel to another country or region, then learning the language of the region you travel makes the difference in your travelling experience. It also helps you greatly in making your holidays more comfortable and enjoying the locality.

4.Religion

Interestingly there is also a spiritual reason to learning languages :) . Most of the times, the religion we follow are written in a language which we dont speak  like Arabic, Hebrew, Sanskrit. What could be more cherishing than understanding your own religion in its own language, rather than reading the translated texts, which are unclear and altered to convey the closest meaning at best.

5. Improve cognitive skills

6. Better/New way of thinking,  speaking and writing

“A language that doesn’t affect the way you think about programming, is not worth knowing”.

7. Challenging yourself

For those who love taking a challenge, there couldnt be a better challenge than taking a language to learn.

And the reward stays forever!. Learning a language is a challenge, it takes time, determination, motivation and ability along with lot of mental energy. During the process, you understand yourself better in terms of ability to learn, memorize things, makes you disciplined (if you have structure the learning plan in a certain time) . At the end of it, you come stronger and with a great sense of achievement, which you can boast for rest of your life.

8. To understand Love, Music, History or Art

Every language has its own beauty. While some language are strict with rules (German), others are fun to speak and sing (Spanish).

Language also show how people think and behave. If you love music of a region, or like History of a region, or interested in the Art popular in a region, there can not be greater motivation to learn that language.

9. Better opportunities

Learning a language clearly increase the opportunity to get employed in that geaographical region. Especially if your job has to do something with Public relation, the better you know the language, the greater your opportunities to land up in a lucrative job are.

10. Fun

While majority of people are objective and question the worth of learning a language, there are people out there, who first

plunge into it and have fun with it, without worrying about how they could reap the benefits out of it.

 

Happy learning !

A sneak peek into the latest edition of Oxford Dictionary

With FIFA world cup rocking the world, summits on climate change, the economic downturn and the current trendz in the internet, so called the social media, people of the world have given birth to many more english worlds.

I have made an attempt to compile few of them here, these are picked from sources like Guardian, trak.in and wiktionary among others.
If you find any more interesting please put in the comment ll be glad to add it up here

vuvuzela – A trumpet-shaped horn, now usually plastic, that produces a loud buzzing sound.

staycation – A holiday spent in one’s home country

bargainous – Costing less than usual , reflets the hot topic of bet-tighting among consumers during downturn

defriend – Remove from a list of friends or contacts on social networking stire

tweetup – Meeting organised via posts on twitter

bromance – Close but not sexual relationship between two men.

buzzkill – 1.Something or someone that spoils an otherwise enjoyable event.
2.A person who attends a social event and occupies his or her time with other activities than those offered at the event

cheeseball – Someone or something lacking taste, style or originality

chillax – Blend of chill out and relax

frenemy – Someone who pretends to be your friend, but is really your enemy.

interweb – Blend of internet and web

wardrobe malfunction – 1. (euphemism) An accidental instance of indecent exposure caused by a fault in someone’s clothing (especially that of a performer) or by an error made while changing this costume.

climate change – the process of trapping and storing carbon dioxide produced by burning fossil fuels

toxic-debt – a debt that has a high default risk, and the rather less snappy quantitative easing: the introduction of new money into the national supply by a central bank.

dictionary attack – An attempt to gain illicit access to a computer system by using an enormous set of words to generate potential passwords

national treasure – someone or something regarded as emblematic of a nation’s cultural heritage

hikikomori – The Japanese word for the acute social withdrawal that occurs in some teenage boys.

paywall – Something that blocks access to a website so that restricted content can be viewed only by paid-up subscribers.

furgling – Act of fumbling in your pocket for key

wurfing – Surfing the web at work

earworm – a catchy tune that frequently gets stuck in your head

nonversation – A worthless conversation among millions of other words.

OAuth with cakephp Oauth consumer component

OAuth is an open standard for cross site authorization and authentication, what it means is you can authorize a site(consumer of service) to access your profile data in another site (an OAuth service provider) without giving away the login name/email and password.
There is one comprehensive tutorial at hueuniverse

Here is how it works, below is the diagram that illustrate the flow between the consumer site and the service provider.

A service provider is the site with whom you are registered. Yahoo, twitter and google are great examples.
The consumer sites, uses these service to integrate or fetch in you profile from these sites.

The oauth_consumer cakephp component provides you with the essential classes required.
Thanks to Daniel Hofstetter for coming up with this helpful component.
You can download it from here.

oauth_consumer
This class acts like a facade for all the communication between you and the oauth service provider.

For this exercise let us build an application for twitter which tweets on behalf of the user.
You first have to login to twitter and create a new application.
At the end of creating a new application with twitter, you get a key and secret for your application.

To initiate the oauth authorization process,

$consumer  = new oauth_consumer(key, secret);

Second step is to retrieve a request token from the service, step A in the diagram.
you do this by invoking

$request_token = $consumer->getRequestToken(request_token_rul);

you need this request token for requesting the authentication.

Third step is to redirect the user to the twitter and request the authorization, for this you need to redirect the user to twitter with the request token you just acquired

$this->redirect(twitter_oauth);

Ater this step, user sees a login page of the twitter if he has not already logged in, or is asked with a question whether twitter should allow this application to access you personal data.

Once the user authorizes on twitter, twitter redirects the user to the consumer callback url, with the same request token and request_verified id.

At this point, application has the authorization to acces the user’s data, this data is specific to each service provider.

Fourth step is to access the data, you need an access token composed of a key and the secret.
You need the access token for all your requests to access the user data.

$access_token = $consumer->requestAccessToken(access_url, $request_token);

Fifth step is to actually access the twitter data or modify it, depending on the kind of application you have.
In this exercise, let us tweet on behalf of user

$consumer->update($access_token, "hey, just registered with #XYZ applicaiton, this is koool");

The above message will soon appear in your and your followers time line, with the tweet source as XYZ .

Editing json in linux

Edit json is an amazing package that lets you browse and edit json as though, you are traversing it as folders in an explorer.
There is also prettify_json tools that is packaged into it. With prettify acts as a filter, taking a valid json file and giving yo a well formatted json string.

To install edit_json in Debian based linux distros, just run this

apt-get install edit-json

or if needed

sudo apt-get install edit-json

happy JSONing

Continuous Progress bar in GXT

GXT as is the case with all toolkits, has a good collection of UI components.
But these components cannot to used out of the box to solve your problems.
One such is the progress bar in the GXT, when I felt a need to use the progress bar to indicate the progress of the operation being performed,
I quickly googled and found some interesting examples . But it involved calculating the amount of work remaining/done to update the progress.
So I wrote this little extension of the progress bar, which I call Continuos Progress bar, it works pretty much like the Windows Vista progress indicator (unlike Ubuntu’s).
Code is small and self explanatory, so I dont want to bother myself explaining the code, and rather save myself time to catch some sleep :)

Code included here is distributed under Apache v2.0 license, so you can freely modifiy, distribute or make commercial use of the code.

class ContinousProgressBar extends ProgressBar {

 private boolean stopProgress = true;
 private Timer timer;

 public ContinousProgressBar() {
 setBounds(10, 10, 200, Style.DEFAULT);
 timer = new Timer() {
 int counter = 0;

 @Override
 public void run() {
 if (stopProgress) {
 updateProgress(10.0, "");
 return;
 }

 if (counter == 10) {
 counter = 0;
 }

 counter++;
 updateProgress(counter / 10.0, "");
 this.schedule(100);
 }
 };

 }

 public void start() {
 if (stopProgress) {
 timer.schedule(100);
 stopProgress = false;
 }
 }

 public void stop() {
 stopProgress = true;
 }

}

This is how it can be used with start/stop button. Below is a sample EntryPoint for the GWT demonstrating the thing.

public class ContinousProgressDemo implements EntryPoint {

 private boolean stopProgress = true;

 public void onModuleLoad2() {

 ContentPanel cp = new ContentPanel();
 cp.setSize(200, 100);

 final ProgressBar bar = new ProgressBar();
 bar.setBounds(10, 10, 200, Style.DEFAULT);
 final Timer timer = new Timer() {
 int val = 0;

 @Override
 public void run() {
 if (stopProgress) {
 bar.updateProgress(10.0, "");
 return;
 }

 if (val == 10) {
 val = 0;
 }

 val++;
 bar.updateProgress(val / 10.0, "");
 this.schedule(100);
 }
 };
 cp.add(bar);

 final ToggleButton toggle = new ToggleButton("Start/Stop");
 toggle.addListener(Events.Toggle, new Listener<ButtonEvent>() {
 @Override
 public void handleEvent(ButtonEvent be) {

 boolean oldState = stopProgress;
 stopProgress = !toggle.isPressed();
 if (oldState && !stopProgress) {
 timer.schedule(100);
 }
 }

 });
 toggle.toggle(false);
 cp.getButtonBar().add(toggle);
 RootPanel.get().add(cp);
 }

 @Override
 public void onModuleLoad() {

 final ContinousProgressBar contProgress = new ContinousProgressBar();

 final ToggleButton toggle = new ToggleButton("Start");
 toggle.addListener(Events.Toggle, new Listener<ButtonEvent>() {
 @Override
 public void handleEvent(ButtonEvent be) {

 if (toggle.isPressed()) {
 toggle.setText("Stop");
 contProgress.start();
 } else {
 toggle.setText("Start");
 contProgress.stop();
 }
 }

 });
 toggle.toggle(false);

 ContentPanel cp = new ContentPanel();
 cp.setHeading("Continuos progressbar");
 cp.setSize(200, 100);
 cp.setFrame(true);
 cp.add(contProgress);
 cp.getButtonBar().add(toggle);

 RootPanel.get().add(cp);
 }
}

Connect your wordpress blog with twitter and yahoo …

I came across one publicize plugin in  wordpress, that helps you promote your blog.

With this you can connect your wordpress account to twitter and yahoo, and once you authorize wordpress to connect to twitter and  yahoo, it automatically tweets your new post in the wordpress.

Needless to say, saving you the time it takes to  punch in even those 140 char !

Happy tweeting the blogging ..

Installing the 32 bit JDK on Ubuntu AMD64

Few days ago I ran into this problem when trying to run GWT hosted mode browser on the AMD 64 version of Ubuntu 9.0.4.

Here is the problem:

1.GWT Hosted browser doesnt run on 64 bit JAVA, so have JAVA_HOME point to 32-bit JRE.

2.To install a 32 bit jre, run :  sudo apt-get install  ia32-sun-java6-bin

3. This does not solve the problem completely, coz maven and sometime eclipse tries to download tools.jar from sun !

And this tools.jar exists in JDK, what it means is that you have to install the 32 bit JDK on your 64 bit Linux.

No, you dont have any deb package for 32 bit Jdk on 64bit linux, you have to manually download the 32 bit jdk, compile it to a .deb package and isntall it.

In rest of the post I will show you how I have spent half of my day solving this problem.

Follow below steps to install 32 bit JDK for 64 bit linux Ubunutu AMD 64 distro:
1. Download the 32 bit version for linux from sun.java.com, I downloaded the version update 17, and file name is jdk-6u17-linux-i586.bin .
2. We need java-package to create a .deb debian package  from the binary, if you dont have java-package already installed on your machine, download java-package with:
sudo apt-get install java-package

3.Next, create the 32 bit debian package for JDk with the command:
DEB_BUILD_GNU_TYPE=i486-linux-gnu DEB_BUILD_ARCH=i386 fakeroot make-jpkg jdk-6u17-linux-i586.bin

where:

make-jpkg – is the command to create a debian java package,
fakeroot  – run the make-jpkg command as root
make-jpkg generates a .deb package installable on debian base linux distros.
In our case it generates sun-j2sdk1.6_1.6.0+update17_amd64.deb

4. Now is when you can install the 32bit JDK you want with
sudo dpkg -i sun-j2sdk1.6_1.6.0+update17_amd64.deb

5. After this, if you run java from shell, you should be able to see:
amjed@amjed-laptop:/usr/share/man$ java -version
java version “1.6.0_17″
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)

6. To select a different version, and to see where the new jdk is installed use update-alternatives ( this needs sudo access):

amjed@amjed-laptop:/usr/share/man$ sudo update-alternatives –config java

As you can see, there are 3 alternatives which provide `java’.

Selection    Alternative
———————————————–
1    /usr/lib/jvm/java-6-sun/jre/bin/java
2    /usr/lib/jvm/ia32-java-6-sun/jre/bin/java
*+        3    /usr/lib/j2sdk1.6-sun/bin/java

Press enter to keep the default[*], or type selection number:

You can anytime switch between the jdk in you machine.

GNUPlot

While searching for a good 3d plotting framework for my product, I stumbled upon this tool GNUPlot.
GNUPlot is an awesome tool which does a wonderful job of rendering as plot, your 2d functions and data , what more could you ask , it goes ahead of my expectations to plot 2d projecttions of 3d surfaces and data.

Among all the features like changing the X,Y axes labels, setting ranges, number of samples to take,
setting title, line types, colors, screen size, I liked the terminal type the most.
With this feature you can actually plot your data to any device, include you HP printer sitting at the corner of your office floor.
Termincal type for MS Windows is surprising enough named as window and X11 for *nix,.
Plots can be exported to png, postrcript, aifm (Adobe Illustrator ), corel (Corel Draw) files to name a few.
For example to get a postscript file of your plot, all you have to do is

set terminal postscript
set output “sample.png”
plot {<function>| {“file”}>

I will be posting a series of blog in the coming day on GNUPlot, with new discoveries am going to make in this tool.

Licensing :
This seems to be a boring topic, which often takes software engineers to yawning, nevertheless it is the most important criteria when you select a piece of software to be used in your development of product.
You might not want to call unsolicited legalities :)

While the name GNUPlot hints that this software is covered under GPL Licence, ironically it is not.
Although it is free which allows you to use, copy and modify it, authors Thomas Williams, Colin Kelley restricts you from redistributing it with modifications.
Still you can redistribute your changes and modifications as a separate patch, with the source code.
And the nest part of this license is that you can use it in you commmercial software product

Sceptical about the blogger’s point?

As the advert frequently goes, Bloggers have the ability to bend the truth.
I just read a blog on blogopreneur.com, which shows how a SEO enthusisast can tweak in his pages and show his blog at the top of the search result
on the most popular search site on the internet.
Netizens tend to google or even cuil, everything that they sense as new and happening,
be it news, sports, finance or any subject for that matter.And there is nothing stopping any one to jot down his perceptions on the subject and maligning the actual facts.
A blogger can scribble any biased views, taking sides.And researches have found that netizens believes in whatever they read from the internet, most of the times without even knowing the facts,
hence polarising the society we live in.

This is one of the most concerned cons of web2.0, authenticity of the information.
Is any on out there you can hold responsible for authenticity of the contents on Wikis?? but the tradeoff is that you get the information within the blink of an eye.
SO when things come for free, they are not guaranteed to be genuine.

The next time you see any blog with the craziest ideas in it, dont be baffled with that, there are always black sheeps in the communities.

Bug repellant ??

Hii folks,

From the very beginning of my career in Aditi, I have been part of the bug fixing team, in one project or the other, be it Goldman Sachs or Accenture.

And peeking in the future I see a lot of scope and requirement in this new Vertical, at least for a fresher software engineer.

Of late this thought crossed my mind, that I walked out of the interview with a triumph on my face and a bunch of papers so called ”Offer Letter” in my hand.

And ya we were around 6-7 guys among that 3500 + huge and bloody crowd out there stepping on each other’s toes, trying to give the best in them to make it to the ‘Think Product ‘ family.

And this very moment I ask myself “And you thought you were the real hero?? “, “you had the talent they are looking for ??”.

This recent past of 9 months seems to be very short for I have put my larger chunk of day time in snapping the states of the bugs from Assigned to Resolved in that bug life cycle.

And that equally large part of my night was conquered by these filthy bugs surfacing my application, what the world named those moments of life as nightmares.

Of course the same subject “Life Cycle” I studied in my school days as part of the Biology curriculum, and all we really knew about the bug life cycle was very less, I joined the IT industry only to realize that the bug life cycle is not so trivial as it seems in text books, its far more pathetic and sometimes hectic too J.

If you scratch the surface of a bug, you only discover a very small part of it, move it to Assigned state and watch out for how loathsome it can get.

And there are QA wagons who come with the prophecy and blow back the life into the bugs, I understand that’s all part of the bug life cycle again, and we hear our managers saying this is “a process”.

Oh sorry, let me not veer the topic, I was talking about the Offer letter, yep the Offer letter , I read it as “Development Engineer” with my broken English.

At the same time my hands fumbling and eyes scanning through the pages to pick that bountiful “CTC”, and send the signal to the stuff behind my temple which was already neck-deep in euphoria, yep you got it right I am talking about my brains.

What sound me very interesting was the position “Development Engineer”, coz I was expecting something like either Software Engineer or Associate Software Engineer.

Back to the present J , ok let me be straight in the face, I have coined a new term for the kind of job we(all my peers who have expertise in bug life cycle) do, its “Bug Repellant”, for the bugs we fix.

I have plans of proposing this to management, for the change in position, and to add a new rung to the career ladder.

And going forward, working our way up in the ladder we can gain more experience over time as a Senior Bug Repellant, Bug Repellant Lead.. and perhaps Director of Bug technology.

Please give your precious inputs, to make Aditi a better place to work

Actual Dat:Sunday June 8, 2008