Saturday, February 18, 2012

Gulzar -Tribute to Jagjit Singh

एक  बौछार  था  वो ..

एक  बौछार  था  वो  शख्स  बिना  बरसे 
किसी  अब्रा  की  सहमी  से  नमी से  जो  भिगो  देता  था ..

एक  बौछार  ही  था  वो 
जो  कभी  धुप  की  अफशां  भर  के  
दूर  तक  सुनते  हुए  चेहरों  पर  छिड़क  देता  था 
नीम  तारीक  से  हॉल  में  आँखें  चमक  उठती  थीं 

सर  हिलाता  था  कभी  झूम  के  टहनी  की  तरह 
लगता  था  झोंका  हवा  का  था  कोई  छेड़  गया  है .. 

गुनगुनाता  था  तो  खुलते  हुए  बादल  की  तरह 
मुस्कराहट  में  कई  तर्बों  की  झंकार  छुपी  थी 

गली  कासिम  से  चली  एक  ग़ज़ल  की  झंकार  था  वो 
एक  आवाज़  की  बौछार  था  वो ...

Saturday, October 09, 2010

Apache Lucene +Apache Tika = Awesome Duo

Apache Lucene has already widely known for its indexing and full text searching capabilities.But when we add the Apache Tika,a parsing api from apache to this scene,it becomes more powerful and too easy to parse any type of document formats like .doc ,pdf,zip,tar etc and consequently create indexes on the contents of those documents through lucene.

The following example demonstrates how to create lucene documents from different type of files formats using Apache Tika api.

public Document getDocument(File f) {

ContentHandler textHandler = new BodyContentHandler();
Parser parser = null;
Metadata metadata = new Metadata();
FileInputStream fi=null;
try {
fi = new FileInputStream(f);
if(f.getName().toUpperCase().endsWith(".PDF"))
{
parser = new PDFParser();
parser.parse(fi, textHandler, metadata, new ParseContext());
}
else if(f.getName().toUpperCase().endsWith(".ZIP"))
{

new ZipParser().parseArchive(fi, textHandler, metadata, new ParseContext());
}
else
{
parser= new AutoDetectParser();
parser.parse(fi, textHandler, metadata, new ParseContext());
}
}
catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (SAXException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (TikaException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}

try {
fi.close();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}



Field authorfield = getField("author", metadata.get("Author"));

Field titlefield = getField("title",f.getAbsolutePath());

Field contentfield = getField("content", textHandler.toString());
System.err.println("textHandler "+textHandler);
if (authorfield == null && titlefield == null

&& contentfield == null) {

return null;

}

Field[] fields = new Field[] { authorfield,titlefield,contentfield };

Document doc = new Document();

for (Field field : fields) {

if (field != null)

doc.add(field);

}

return doc;

}
private Field getField(String fname, String data) {

if (data == null || fname == null) {

return null; }
Field field = null;
if(fname.equals("content"))
field = new Field(fname, data,Field.Store.YES,Index.ANALYZED,Field.TermVector.WITH_POSITIONS_OFFSETS);
else
field = new Field(fname, data, Store.YES, Index.ANALYZED);

return field;

}


}

Thursday, September 30, 2010

Gulzar's Lines for Mehndi Hasan

Awesome start line - aankhon ko visa nahin lagta ,typical gulzar saab.

Aankhon Ko Visa Nahi lagta
Sapno Ki Sarhad Hoti Nahi
Band Aankhon Se Roz Main Sarhad Paar Chalaa Jaata Hun Milne
‘Mehadi Hasan’ Se!

Sunta Hoon Unki Aawaaz Ko Chot Lagi Hai
Aur Ghazal Khamosh Hai Saamne Baiti Huyi
Kaamp Rahey Hai Hont Ghazal Ke!
Fir Bhi Unn Aankon Ka Lahjaa Badlaa Nahi
Jab Woh Kehatey Hai…
Sookh Gaye Hai Phool Khitaabon Mein
Yaar ‘Faraaz’ Bhi Bichad Gaye Hai, Shayad Miley Woh Khwaabon Mein!
Band Aankhon Se Aksar Sarhad Paar Chalaa Jaata Hoon Main!

Aankhon Ko Visa Nahi Lagta
Sapno Ki Sarhad, Koi Nahi!

Sunday, June 27, 2010

Mr Singh & Mrs Mehta -Ae Khuda

The movie is talked about for various other reasons(Aruna Shields offcourse - 34 kisses and 10 min nude scene).But one thing,Sitar maestro Shujaat Husaain making debut as a music director.

What a lovely gazal,enjoy it

Ai Khuda

RadioReloaded.com

Monday, June 14, 2010

Nice Ghazal by Hariharan

जब कभी बोलना , वक़्त पर बोलना ,
मुद्दतों सोचना ,मुख्स्त्सर बोलना

मेरी खानाबदोशी से पूछे कोई ,
कितना मुश्किल है रस्ते को घर बोलना

old but nice song to listen
here is the
link

Thursday, May 06, 2010

Tip Of The Day- JAVA

#To redirecting system.out messages to a text file rather being printed on console

PrintStream newOut=new Printstream(new FileOutputStream("kuldeep.txt"));
System.setOut(newOut);

Stay tuned for more tips.

Sunday, May 02, 2010

Housefull - Movie Review

this movie is crap from every angle.....no storyline ,no humour. I like the music although.it seems sajid is still in the hangover of hey baby success and thinks audience will like every movie they make. No wonder farha and sajid are siblings.damn sure housefull is not going to be houseful in theaters............