Straight from the Heart

फिरदोस….

Posted by: Manu on: February 8, 2009

उनकी मु्स्कराहट, हमारे मासूम नतीजे,
थी जन्नत की चाहत, मिले दोजख के छींटे |

और लोग कहते खुदगर्जी इसे, खुदा देखता है……

 

गर ना हम होते शायर, तो अच्छा था,

दास्तान-ऐ-आशिकी तो न यूँ बयाँ करते |

छुपाने से जो चुप जाए वो मोहब्बत क्या है…………

मनु

जल्द ही आएगा वो दिन…

Posted by: Manu on: February 7, 2009

जल्द ही आएगा वो दिन,

बैठेंगे साथ हम दोनों…..

कुछ तुम अपनी सुनाना,

कुछ में अपनी बताऊंगा ….

आखों में होगी सिर्फ़ तुम,

और में जागते हुए सपने सजाऊंगा..

हाथों में तब दे देना हाथ तुम अपना,

और तुम्हारी खुशबू से में मन को भीगाउंगा ….

खामोश रह कर भी कह दूंगा सब,

जो कह न पाया हूँ अब तक, वह बानगी सुनाऊंगा …

कभी हो जो जाओगी नाराज तुम,

लगा कर अपने सीने से दिल की धड़कन सुनाऊंगा ..

तुम्हारी मुश्कराहट की बदली में ,

आस की बारिश बुलाउंगा…

बस तुम रहना सदा पास मेरे,

धुप, छाव, बारिश सब सह जाऊंगा…

जल्द ही आएगा वो दिन,

बैठेंगे साथ हम दोनों…..

कुछ तुम अपनी सुनाना,

कुछ में अपनी बताऊंगा ….

 मनु

Tags:

A Letter to someone special…..

Posted by: Manu on: January 3, 2009

Dear Gappu…

 

This life has never looked as good as it’s today…… and I’ve never been as happy as I am with you …Donno, if it is because of the warmness of you Love or because of some good deeds executed by me; Today… I have you as a soul mate and love of my life.

 

Inadvertently or purposefully…..if you are nice with someone, that altruistic act of yours get save as positive credits in your account….in the account of verve…I believe in this philosophy……may be because of my affinity with mathematics…I do so.

 

And when we have lot of positive credits in our account; Almighty fulfill our wishes, sometimes these wishes are latent, and we are unaware of, what we need…..as we always know what we want.

 

Your presence in my life is the result of such a dormant wish. I am an ordinary guy, who behaves indifferently sometimes, but somewhere close to my heart, I always have a warm feeling for you. Sometimes I reveal…..sometimes not.

 

Just want to tell you…You are Special to me.

 

Wish you all the good things of the world and a great year ahead. 

 

Love you…

 

Yours,
 Manu…….

 

Tags:

They call it crap…

Posted by: Manu on: December 16, 2008

Our life is a one way track as you move ahead. You will encounter some mile stones; you will notice some & some get unnoticed but whatever has passed….no point to anticipate the same. They won’t come in your path as the same way they came. So enjoy the journey as you never know….when this road will get block forever…

Manu

Dirty Pretty Things (2002)

Posted by: Manu on: November 6, 2008

 dirty_pretty_things

         

          Some things are too dangerous to keep secret; true indeed. After a significant hiatus; I watched an aesthetically nice piece of celluloid- Dirty Pretty Things. The story revolves around the two illegal immigrants in the city of London.  Director Stephen Frears has been pretty successful in his artistic attempt by sketching a sensitive movie plot with ingenuous portrayal of illegal immigrant’s life; their daily struggle, aspirations, exploitation and emotions are beautifully crafted by the different sequences. The main lead Okwe is an illegal Nigerian immigrant, and wanted by the Nigerian police in the charge of his wife’s murder. He came to London in the search of mental solace as he somewhere perceive himself a reason behind his wife’s death. In London, he met Senay Gelik (Audrey Tautou), a beautiful Turkish girl in her early twenties as she provides him shelter. Movie moves forward as Okwe discovers the ghastly side of London life. Chiwetel Ejiofor in the main lead as Okwe has done a great job as most of the times his eyes reflects the anguish beats of his wavy life. His acting skills are superb and dialog delivery is commendable. Audrey looks tempting through out the movie and his ingenious French accent provides a clear profundity to her character. In some of the scenes; she is too good as she has got diverse chances to show the true color of love, hate, damage, ecstasy and agony. Film was nominated for 2004 academy awards in the best writing/ screen play category; beside that this movie won many accolades. An honest attempt in the meadow of meaningful cinema, must watch.

  

** The picture is taken from the web.

Tags:

Some bits and pieces related to java Serialization

Posted by: Manu on: October 23, 2008

One of the interesting concepts of the java is Serialization. We all know in java we can create reusable objects in the memory as long as the JVM is in the running state. Serialization provides the flexibility of object persistence beyond JVM lifecycle.

 

In the short serialization is the process of saving state of an object in a file. For that purpose, that object should implement the Serializable interface; same we are doing in the class Sedan.

 

A simple example of serialization is as follows-

 

public class Sedan implements Serializable{

private double price=44000.0;

 

public Sedan(double price){

      this.price=price;

}

public double getPrice() {

      return price;

}

 

public void setPrice(double price) {

      this.price = price;

}

}

 

public class SerializeSedan {

      public static void main(String[] args) {

 

            Sedan sedanObject= new Sedan(55000.0);

            FileOutputStream outputStream;

            try {

                  System.out.println(sedanObject.getPrice());

                  outputStream = new FileOutputStream(“myTestFile.ser”);

                  ObjectOutputStream obystr= new ObjectOutputStream(outputStream);

                  obystr.writeObject(sedanObject);

                  obystr.close();

 

                  FileInputStream in= new FileInputStream(“myTestFile.ser”);

                  ObjectInputStream objin= new ObjectInputStream(in);

                  try {

                        sedanObject=(Sedan)objin.readObject();

                        System.out.println(sedanObject.getPrice());

                  } catch (ClassNotFoundException e) {

                        e.printStackTrace();

                  }

                  objin.close();

            } catch (FileNotFoundException e) {

                  e.printStackTrace();

            }catch (IOException exp) {

                  exp.printStackTrace();

            }

      }

}

 

 

Run the SerializeSedan Class. The output will be-

Before- 55000.0

After- 55000.0

 

 

Now change the Sedan a bit.

 

 

public class Sedan extends Car implements Serializable { private double price=44000.0;

private Gearbox gearbox=null;

 

public Sedan(double price, Gearbox gearbox){

      this.price=price;

      this.gearbox=gearbox;

}

public double getPrice() {

      return price;

}

 

public void setPrice(double price) {

      this.price = price;

}

public Gearbox getGearbox() {

      return gearbox;

}

public void setGearbox(Gearbox gearbox) {

      this.gearbox = gearbox;

}

}

 

public class Car implements Serializable{

      private int yearModel=2005;

 

      public int getModelyear() {

            return yearModel;

      }

 

      public void setModelyear(int modelyear) {

            this.yearModel = modelyear;

      }

     

}

 

public class Gearbox {

 

private int gearCaseNumber=0;

 

public int getGearCaseNumber() {

      return gearCaseNumber;

}

 

public void setGearCaseNumber(int gearCaseNumber) {

      this.gearCaseNumber = gearCaseNumber;

}

 

}

 

Now we have an instance variable of type Gearbox, now for serialization of Sedan object, Gearbox should also implement Serializable interface.

And what if the Gearbox itself had references to other objects? This gets fairly complex. If it were up to the programmer to know the internal structure of each object the Sedan referred to, so that the programmer could be sure to save all the state of all those objects…..Which is really difficult to achieve. The good thing about java is – java Serialization mechanism internally take care of the whole object graph. In the case, we are unaware of the structure of Gearbox class or Gearbox is not implementing Serializable interface and we are not able to the change code also.

We can create a sub class of Gearbox, which eventually implement Serializable interface and what if Gearbox is final class.

 

Here transient modifier comes in picture. Transient is used to skip an instance variable during serialization.

 

public class Sedan implements Serializable{

private double price=44000.0;

private transient Gearbox gearbox=null;

 

Now during serialization, variable gearbox will be skipped.  We are skipping the gearbox variable so we can not read the gearCaseNumber while reading the state of the object as it will throw a null pointer error while getting Gearbox object.

 

Java provides solution for that problem also, for that some change requires in the Sedan class.  Add these two methods in Sedan class and these methods will solve the purpose.

 

private void writeObject(ObjectOutputStream os)

      {                          

            try {

                  os.defaultWriteObject();                         

                  os.writeInt(gearbox.getGearCaseNumber());           

            } catch (Exception e) { e.printStackTrace(); }

      }

 

 

      private void readObject(ObjectInputStream is) {

            try {

                  is.defaultReadObject();                            

                  gearbox = new Gearbox(is.readInt());             

            } catch (Exception e) {

                  e.printStackTrace();

            }

      }

 

Now output is-

68686After- 55000.0

68686After- 55000.0

Here, when you invoke defaultWriteobject() from within writeObject() you’re telling the JVM to do the normal serialization process for this object. When implementing writeObject(), you will typically request the normal serialization process, and do some custom writing and reading too. Please read sun java doc for the clear understanding of methods related to ObjectOutputStream class.

This was just an introduction of the Serialization, Lots more to follow. Hope it helps.

Cheers,

Manu

Tags:

Love….

Posted by: Manu on: September 21, 2008

I read a post on this lovely creation of almighty.
.
Whatever the situation is, but the wondrous feeling of being in love is great, I feel strongly that everybody should fall in love at least once in a life time. Obviously we all are in love with our parents, siblings, our beloved things but to fall in love with a person you don’t have any prior association, truly ineffable. There is also a vital difference; generally we do love things because of the qualities they encompass or some genial association, but here situation is contradictory we love first without giving attention to acquisitive or non-materialistic qualities and sans any affable link and then comes in picture the penchant towards the persona of that individual, which is selfless, truly altruistic. Oceans of ink have been spilled in hopes of defining love in all its many facades but this voyage is eternal. In love, destination is not the key as joy is in the journey.

 

 
 
 

 

Eclipse Trader- An Open Source RCP Project

Posted by: Manu on: September 16, 2008

Today, I was going through a cool open source trading project– Eclipse Trader. It is a RCP (Rich Client platform) and developed using eclipse technologies mainly SWT, JFace etc.

 

PRO’s and CON’s-

 

The good thing about the application is you can define your own data feed say MSN-Money and it will populate all the charts, news and data information fetched from the MSN-Money. By default they are providing yahoo-money, open-tick feed implementation. The UI is really cool and user friendly with proper help feature.

 

This application is in the beginning state you can encounter some issues but due to its functional flexibility, it is one of its kinds in the market.

 

Now comes, the problem with the application. For non coders and non eclipse guys, it’s not an easy choice as creation and implementation of new feed need knowledge of java and eclipse plug-in framework. Although application comes with few implementation examples but still it need some effort. I feel in future they can provide some UI drag and drop or API sort of thing which make this task easy.

 

Technology-

 

Each building block of trading application, say Feed is provided as an extension point. So developer can write their own extensions to these extension points. The application emphasizes on the flexibility of customization.

 

Features-

Full fledge trading application features are given with this application. Like

 

You can create Security, Account, Transactions, Trading orders, Stock watch list, Security History, Charts for graphical analysis of Securities. Beside that portfolio view, pattern view, news views are like icing on the cake.

 

For more info, please refer-

http://eclipsetrader.sourceforge.net/

 

Charts

Charts

 

Main View

Main View

 
 

 

 

 


चिट्ठाजगत अधिकृत कड़ी

कुछ लम्हें त्रिवेणी के साथ………

 

मेटी है आज कुछ बिख्ररी यादों की कतरने,

कुछ मीठे सपनो की रातें, मु्स्कराहटों का कोना |

शब की दहलीज पर ढूढां करता हूं, रोशनी मैं…..

 

 

दिल की दीवारों का भी है अजब आलम,

परतें उखड़ती हैं पर रंग उतरता ही नही |

इस घर के दरवाजे पर ताला जो लगा है…….

 

 

मीठी सुबह मै उड़ती ये नमकीन खुशबू,

जिलाती है अह्सास उनके पास होने का |

कि बेखब्रर सोने का भी अपना इक मजां है……

 

                                                                                                       -मनु

Tags:

EMMA: a free Java code coverage tool

Posted by: Manu on: July 28, 2008

How to Use EMMA-

 

ANT and Emma can be used together to automate the generation of code coverage report. Following Steps are solving the same purpose-

 

First define properties-          

            <!– EMMA BEGIN –>

            <property name=”emma.dir” location=”bin/emma” />

            <property name=”emma.thresholds” value=”class:100,method:100,block:100,line:100″ />

            <path id=”emma.libraryclasspath”>

                        <pathelement location=”lib/emma.jar” />

                        <pathelement location=”lib/emma_ant.jar” />

            </path>

            <taskdef resource=”emma_ant.properties” classpathref=”emma.libraryclasspath” />

            <!– EMMA END –>

 

 

1) Create ant target for the instrumentation of java classes-

 

      <!– ============================================ –>

      <!– Instrument the classes –>

      <!– ============================================ –>

      <target name=”emma.instrument”>

      <!– Instrument the class files. –>

      <emma enabled=”true”>

      <instr instrpath=”bin” destdir=”bin” metadatafile=”${emma.dir}/metadata.emma” merge=”true” mode=”overwrite”>

      <filter excludes=”com.XXX.somefolder.SomeJavaFile” />            

      </instr>

      </emma>

   </target>

 

 

2) Create ant target for the generation of code coverage report.

 

<!– ============================================ –>

      <!– Create coverage report –>

      <!– ============================================ –>

      <target name=”emma.report”>

      <emma enabled=”true”>

      <report sourcepath=”src” sort=”+name” metrics=”${emma.thresholds}”>

      <fileset dir=”${emma.dir}”>

      <include name=”*.emma” />

      <include name=”*.ec” />

      </fileset>

 

      <xml outfile=”${emma.dir}/coverage.xml” depth=”method” />

      <html outfile=”${emma.dir}/index.html” depth=”method” columns=”name,class,method,block,line” />

      </report>

      </emma>

      </target>

 

3) Create ant target for the generation of Junit report.

      <target name=”junitreport”>

        <junitreport todir=”${junit.output.dir}”>

            <fileset dir=”${junit.output.dir}”>

                <include name=”TEST-*.xml”/>

            </fileset>

            <report format=”frames” todir=”${junit.output.dir}”/>

        </junitreport>

    </target>

 

After the creation of above ant targets, first of all run emma.instrument target, it will create metadata file of instrumented classes at PROJECT_HOME/bin/emma folder and all classes will get instrumented.

Now there are two ways to create converage.ec file, depend on the nature of project-

 

I) If project is a simple java project, run your junit test cases and coverage.ec file will create in your PROJECT_HOME folder. Copy this file into the PROJECT_HOME/bin/emma folder and run emma.report ant target. This will generate code coverage report in the PROJECT_HOME/bin/emma folder.

 

II) If project is an enterprise application project, export the .EAR file of your project into the concern folder of your application server. For example if you are using JBOSS, export .EAR into the JBOSS_HOME\server\default\deploy folder. This .EAR file should contain metadata.emma file. Now put the URL into the browser and play with your (read as launch/run) application. This will create coverage.ec in the JBOSS_HOME\bin folder. Now Copy this file into the PROJECT_HOME/bin/emma folder and run emma.report ANT target. This will generate code coverage report in the PROJECT_HOME/bin/emma folder.

 

Finally Run jnitreport ANT target for junit report. So this is a simple way to generate code coverage and junit report through ant, Hope it helps. Good luck and please contact me if you have any difficulties or leave a comment below to help out other users.

 

Thanks,

Manu

Tags:

Translator

a

The Calendar..तारीख

July 2009
M T W T F S S
« Feb    
 12345
6789101112
13141516171819
20212223242526
2728293031  

पन्ना

Pitara….पिटारा

हिसाब-किताब

  • 6,024 hits

Tashveerein.......तसवीरें

Road Trip!

Screaming Trees

painted in his true colors

Untitled

Tiger Tiger Coffee Bar

THE.TWILIGHT.ZONE

Red Latte

Flowers for a Ghost         |explore!|

London Eye

Different Worlds

More Photos

Thanks for the Visit…आने का शुक्रिया

website statistics

Rumbling of Mind

  • its raining here...got fully drenched...after a long time.. 3 days ago
  • Struggling with transactions@hibernate......old JDBC was so good...:).. 1 week ago
  • why Implementation of Generics in java is so confusing.....ex. Map put(K key, V value) and get(Object key) ..:o.. 2 weeks ago
  • @shakhan Jamun...thats great..forgot when i ate it last... 3 weeks ago
  • Playing with crude version of java script based widgets. 3 weeks ago

Aaate-Jaate..आते-जाते

Top Clicks..पसंदीदा

The Selected One's..चुनिन्दा

U come from..