New line character / OS dependence

The new line character depends on your OS \n for Unix, \r\n for Windows and \r for old Macs

Always use

System.getProperty("line.separator")

To find out OS specific line separator instead of judging yourself and hard coding it.

This error can lead to many bugs in system

Katya karoon lyrics meaning

I was asked by my Non punjabi friends about meaning of Katya karoon , the famous song from Rockstar . Thought to translate full.

Kateya Karoon is an old punjabi folk song- The women in old days used to make cotton on the spinning feel . Still this is common time pass in villages but not in cities.  Group of ladies join and sing , talk things of here and there.

Often they sing for for their husbands or lovers..

Following is the detailed analysis


Ting ling ling ling ting ling ling ling >>>> Punjabi rhyme sort of kids do this often
Ting ling ling ling ting ling ling

Kateya karoon kateya karoon >>>> I will spin the cotton wheel ,

Tera roon kateya karoon >>>> Girl is saying to his beloved i will spin your cotton >>> roon means cotton
Tera roon tera roon tera roon roon roon roon roooon  >>>> tera means yours
Saari raati kateya karun  >>> I spin your cotton all night >>>> literal means in your thoughts all night
Kateya karoon kateya karoon
Sari raati kateya karoon
Saara din sochhan vich langhda >>>>> The entire day is spent in this thought
Tere lai hun jiyun te marun  >>>>> I shall live and die for you
Eh tan mera charkha hove  >>>>> My body will be the spinning wheel
Hove ulfat yaar di chittaa roon   >>>>>> And let the love of my beloved be pure cotton
Nachdi phiroon tapdi phiroon >>>>> Let me dance let me fly jumping all around
Keeli mai napdi phiroon >>> Let me be in ecstasy , full speed no stop :P   >>>>> keeli napdi phiroon is often used in punjabi to do things fast
Hadh karoon, hadh karoon >>>>  Crossing all boundaries all barriers
Hadh karoon roon roon roon rooooon
Yaara bulle luteya karoon  >>>>>  I will enjoy full

Mainu darr hun naiyo jag da  >>>>>> Now I dont fear this world
Tere lai hun jiyun te maroon   >>>>> I shall live and die for you
Mai saari raat kateya kateya karoon....

 

Update

 

The one more thing which you might be interested

In song Nadaan parindey there are few lines written by Sheik farid who was
a 12th-century Sufi preacher and saint of the Chishti Order of South Asia.

IF you listen song below from time 4.06 min

You can listen following lines

The original lines are as follows  ( In Punjabi with english translation)

 

 

Babafarid_quote  

English transliteration

kaga karang dhandolya sagla khaya maas

eh do naina mat chuho pir dekhan ki aas

The image below says all about feelings behind these original lines. 

300px-Babafarid_1

http://www.sikhiwiki.org/index.php/Sheikh_Farid

 

Although film people have copied and modified the lines to make suitable for the film but

i just wanted to share the original person behind those lovely lines

The bani ( text ) written by Sheik farid has been incorporated into Guru Granth Sahib ( the holy book of Sikhs)

How to share folder between Ubuntu guest and Windows host in Virtual box

My host is Windows XP , although it matters very less as for most of windows you can guess the process from these steps

Step 1

After you start your virtual machine , Click on Devices and Install Guest Additions , Guest additions is bunch of tools which makes life easy :)

Let the install finish

Step 2


Click Device > Shared folders and click Add

In the window which appears , enter the folder path of windows which you want to share , for example D:\Virtualmachineimages\shared

In Folder name give the friendly name with which you want your folder to appear in Ubuntu , i chose myshared

Select the options to Auto mount and Make permanent if you want this folder to be automatically made available to Ubuntu and changes are synchronized.

Step 3

Add your user with which you are logged into Ubuntu to group named vboxsf

You can do this by going to System > Administration > Users and Groups

Select the user with which you are logged in , Click Advanced settings

Change the group of user to vboxsf

Log out of Ubuntu and login again

Step 4

Go to root folder of Ubuntu

You can see your shared folder at /media/sf_myshared

Enjoy

IF you are struck you can watch the following video also on YouTube

Hadoop development environment in eclipse

The sample steps are

Create a Java Project
In Build path add the hadoop jar files , which come by default when you download hadoop binary from apache website.
It is also suggested that you link javadoc and source files for the above jars also

Now create one sample program based on famous WordCount example of hadoop

The example present on the official documentation for version 0.20.203 is based on old API , if you want to see the latest example you can see the link below

http://shuyo.wordpress.com/2011/03/08/hadoop-development-environment-with-eclipse

The example also shows detailed steps to setup eclipse

Sample code which you can use , just create one folder named input within your project workspace folder
Click Run

package com.hadoop;

import java.io.IOException;
import java.util.*;

import org.apache.hadoop.fs.Path;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.Job;

import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.Mapper.Context;

import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

import org.apache.hadoop.util.GenericOptionsParser;

public class WordCount1 {

public static class SimpleMapper extends Mapper {

private Text word = new Text();
private static final IntWritable one = new IntWritable(1);

public void map(Object key, Text value, Context context)
throws IOException {

StringTokenizer itr = new StringTokenizer(value.toString());
while (itr.hasMoreTokens()) {
word.set(itr.nextToken());
try {
context.write(word, one);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

}
}

public static class SampleReducer extends Reducer {

private IntWritable result = new IntWritable();

protected void reduce(Text key, Iterator values,
Context context) throws IOException, InterruptedException {
// TODO Auto-generated method stub

int sum = 0;
while (values.hasNext()) {
sum += values.next().get();
}
context.write(key, new IntWritable(sum));

}

}

public static void main(String[] args) throws Exception {

Configuration conf = new Configuration();
GenericOptionsParser g = new GenericOptionsParser(conf, args);
String[] otherArgs = g.getRemainingArgs();
Job job = new Job(conf, "Example Hadoop 0.20.1 WordCount");
job.setJarByClass(WordCount1.class);
job.setMapperClass(SimpleMapper.class);
job.setReducerClass(SampleReducer.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
FileInputFormat.addInputPath(job, new Path("input"));
FileOutputFormat.setOutputPath(job, new Path("output"));
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
}