Friday, March 4, 2011

Gum

Chupane pe Chuphti nehin, Bhulane pe Bhulti nehin, Gum aisi marz hain mere Dost jiski Dawa Kahin milti nehin!!!

Wednesday, March 2, 2011

Whats in a name?

'Tera Lund' - thats actually a english name. I so hope she never ever has to interview an Indian.

Monday, February 28, 2011

Mind Your Language!!

A boys's family is at Paaji's place to visit the girl and get the would-be groom acquainted with the bride before the betrothal.Punjabis (Indians from a northern state) have this huge habit of show off that both the parties wanted to show that they are good at speaking English and are from an HIGH CLASS society with open views.

The boy politely asks Paaji, " Uncleji with your permission can I speak to your daughter in private.". To this Paaji replies, "Of course beteji of course! You can take my daughter to the side and have intercourse."

Saturday, February 5, 2011

Generation Gap!

This incident happened when I was in India last Oct 2010.

My dad had a small fight with my mom over his eating habits; so he left home and arrived at my sister's place with a hot head and empty stomach.
At sister's place generally they do not have full course meal at night, they eat lite. This day it was Indian pan cakes on the menu.
During dinner time my sister made some4-5 pancakes per head and was serving them hot straight out of the pan. After serving everyone and making a few for herself she was about the close the kitchen when my dad said'' This was delicious stuff. Now that my fast is broken let's bring out the dinner I am hungry". To this my brother - in - law had an empty face, poor fellow couldn't understand what to say.

Me and my sister knowing my dad's antics were having a hearty laugh.

Thursday, January 13, 2011

Lesson 6

Operator Precedence
OperatorsPrecedence
postfixexpr++ expr--
unary++expr --expr +expr -expr ~ !
multiplicative* / %
additive+ -
shift<< >> >>>
relational< > <= >= instanceof
equality== !=
bitwise AND&
bitwise exclusive OR^
bitwise inclusive OR|
logical AND&&
logical OR||
ternary? :
assignment= += -= *= /= %= &= ^= |= <<= >>= >>>=

'+' - this is used for concatenation of
2 strings.
int result = 1;
result--;// this means result = result-1; but after any operation done with result--
1-(result--) = 0;// the new result value is 0 but after the operation hence end result of the expression is 0 
1 -(--result) = 1;// the new result value is 0 but before the operation hence end result of the expression is 1

check - http://download.oracle.com/javase/tutorial/java/nutsandbolts/op1.html for more clarity.

Lesson5

I know been a long time since the previous lesson. But just couldn't - had a lot of reading to catch up with. Here you go next lesson - this will be notes on datatypes.

Primitive -

byte - 8 bits - Number - from -127 to +128
short- 16 bits
int - 32 bits
long- 64 bits
float- 32 bit floating point - do not use this for precision values - may cause rounding issues
double- 62 bit floating point
boolean- true/false - like any language
char- strings characters

Data TypeDefault Value (for fields)
byte0
short0
int0
long0L
float0.0f
double0.0d
char'\u0000'
String (or any object) null
booleanfalse

Array Declaration -
int[] anArray; // declares an array of integers
int [10] anArray; // to restrict to 10 rows

Similarly, you can declare arrays of other types:

byte[] anArrayOfBytes; short[] anArrayOfShorts; long[] anArrayOfLongs; float[] anArrayOfFloats; double[] anArrayOfDoubles; boolean[] anArrayOfBooleans; char[] anArrayOfChars; String[] anArrayOfStrings;
2 Dimensional Arrays
String[][] names = {{"Mr. ", "Mrs. ", "Ms. "},
                            {"Smith", "Jones"}};

Wednesday, December 15, 2010

Lesson4 - Some tips

  • Java is case sensitive. Syntax words need to be declared or written in the required cases. For eg. String has to be written in INIT CAPs. 'if else' statements the words have to be in lower case.
  • '+' is the string connector operator.
  • Every application has to have a main method.
  • PATH - is the system parameter where the JDK exists along with the other JAVA libraries which contain apis or methods that can be used in your programming. System.out.println is one such method.
  • CLASS PATH - is the system variable where the .class files are stored. For any method to invoke a method of some other class, both the classes need to be stored in the same class path.
  • public static void main - public : method has to be defined as public if you want other applications to call the method.
  • void - void signifies that the method doesn't return any data.
  • static - static signifies that the method can be invoked without object. Generally methods are called as object.method, but if declared as static then you can just invoke the method without the object.

Tuesday, December 14, 2010

Lesson3

BASIC CONCEPTS Of OOP (Object Oriented Programming)

Objects - You can say that Objects are representations of physical elements. For eg. Bicycle. A complete status or Objects will have properties and states. This is similar to objects in pl/sql; in pl/sql we define the objects in terms of the attributes or columns.

Bicycle states (current speed, current pedal cadence, and current gear).

Methods - Method is the process by which the states are changed. This is analogous to a procedure in pl/sql.

Classes - You can think of class as a collection of methods and object properties.
For eg. In the below Bicycle class pedal cadence, speed and gear are the properties/states.
changeCadence, changeGear, etc are methods to bring about changes in the
states or properties.
class Bicycle {         int cadence = 0;        int speed = 0;        int gear = 1;         void changeCadence(int newValue) {             cadence = newValue;        }         void changeGear(int newValue) {             gear = newValue;        }         void speedUp(int increment) {             speed = speed + increment;           }         void applyBrakes(int decrement) {             speed = speed - decrement;        }         void printStates() {             System.out.println("cadence:"+cadence+" speed:"+speed+" gear:"+gear);        } }

Inheritance - In reality there are many kinds of bikes like mountain bikes, dirt bikes, etc ... Each of the above can be classified as a class in its own due to some unique features while some features would be same in all the bikes. Say the properties of the class Bicycle would apply to both MountainBikes and DirtBikes hence you would like to extend the properties and methods of class Bicycle to Classed MountainBikes and DirtBikes - this lending of a properties and methods of a class to another is called inheritance.

Syntax ...
class MountainBike extends Bicycle {       // new fields and methods defining a mountain bike would go here 
}

Interfaces - collection of methods without bodies. In analogy with pl/sql you can say its a package specification.
interface Bicycle {         void changeCadence(int newValue);   // wheel revolutions per minute         void changeGear(int newValue);         void speedUp(int increment);         void applyBrakes(int decrement); } 
To implement this interface, the name of your class would change (to a particular brand of bicycle, for example, such as ACMEBicycle), and you'd use the implements keyword in the class declaration:
class ACMEBicycle implements Bicycle {     // remainder of this class implemented as before  } 
Implementing an interface allows a class to become more formal about the behavior it promises to provide. Interfaces form a contract between the class and the outside world, and this contract is enforced at build time by the compiler. If your class claims to implement an interface, all methods defined by that interface must appear in its source code before the class will successfully compile.

Packages - A package is a namespace that organizes a set of related classes and interfaces.


  • Real-world objects contain state and behavior.

  • A software object's state is stored in fields.

  • A software object's behavior is exposed through methods.

  • Hiding internal data from the outside world, and accessing it only through publicly exposed methods is known as data encapsulation.

  • A blueprint for a software object is called a class.

  • Common behavior can be defined in a superclass and inherited into a subclass using the extends keyword.

  • A collection of methods with no implementation is called an interface.

  • A namespace that organizes classes and interfaces by functionality is called a package.

  • The term API stands for Application Programming Interface.
  • Saturday, December 11, 2010

    Lesson2

    Code Snippet provided earlier -
    /**
    * The HelloWorldApp class implements an application that
    * simply prints "Hello World!" to standard output.
    */
    class HelloWorldApp {
    public static void main(String[] args) {
    System.out.println("Hello World!"); // Display the string.
    }
    }
    -------------------------------------------------------------------------

    Comments - text to be ignored by compiler
    have to written between /*

    'class' is like a package name in PL/SQL and is always a must. Begin and End of a class are denoted by curly brazes.
    class followed by application name is the general convention.

    Every application must contain a main method - this is similar to a procedure in pl/sql.

    public static void main(String[] args) {
    System.out.println("Hello World!");
    }
    Note the declaration - enclosed within the round bracket are the parameters passed to the method.
    String[] args -- is a declaration for an array of input strings; 'args' is just a name to the input array and not a key word.

    System.out.println("Hello World!") - syntax to print messages on the screen. println method exists in the System class and hence called using the mentioned syntax.

    That concludes Lesson2

    Lesson

    Suddenly Started learning Java . have been thinking to do this since long. I have decided to pen all my learnings and what better place than my own blog. Here goes the first day learnings.


    I am not using any IDE (some Development Environ.) hence have to go through the hassles of downloading JDK and setting the compiler path also called as CLASS PATH.

    JDK is the Java Compiler. You need to install the JDK in your machine.
    The source code files are to be saved with an extension .java. After compilation a new file (which is the executable) gets created and has the same file name as the source code file but has a new extension called .class. You can take this .class file to any machine and run your program, the machine need not contain your source code.


    After installing JDK you need to set the Class Path. Locate the JDK Bin folder and note/copy the path.
    Go to Control Panel > System > Advanced Tab > Environment variable; in system variables you will find a variable called path - edit this; to the existing text add a ';' and paste the class path.

    Now that the class path is set, you are ready for compiling your source code. Go to Command Prompt (Run > CMD) and traverse to the folder where you have saved your .java file. From here type javac and then hit enter. This should create your executable.

    Now to run the program. From command prompt type java then hit enter.

    Lesson1 Over.

    BTW here is the snippet of HelloWorldApp -
    /**
    * The HelloWorldApp class implements an application that
    * simply prints "Hello World!" to standard output.
    */
    class HelloWorldApp {
    public static void main(String[] args) {
    System.out.println("Hello World!"); // Display the string.
    }
    }

    Monday, November 15, 2010

    Arrow vs Letter

    This one's picked off a movie.

    A letter thats posted is like an arrow which has left the bow for like the arrow you can not retrieve it back till it.

    Monday, October 18, 2010

    Smirnoff

    When I close my eyes, I see you as clear as the crystal sky
    With you in me I feel no pain as there is nothing to gain
    With you around there is nothing to fear as there is no chasing spear
    When drinking you, there are no shameful dots around as you just blot the world around

    People around dont take thee words for real...
    For these are words of a shaken soul which is just on a roll
    For these are just a farse that is sure to fade at the dawn ...

    Thursday, September 2, 2010

    Alif Allah, Arif Lohar & Meesha - Coke Studio

    Nice Recording - was amazed the whole recording seems to be done in one take

    Sunday, July 18, 2010

    Trust

    Just wondering what is trust?

    These were the n number of definitions that I got after googling.

    Trust 1

    Trust 2

    Definition: Credit given; especially, delivery of property or merchandise inreliance upon future payment; exchange without immediate receipt of anequivalent; as, to sell or buy goods on trust.

    Trust 3

    Definition: Assured anticipation; dependence upon something future orcontingent, as if present or actual; hope; belief.

    Trust 4

    Definition: That which is committed or intrusted to one; somethingreceived in confidence; charge; deposit.

    Trust 5

    Definition: The condition or obligation of one to whom anything isconfided; responsible charge or office.

    Trust 6

    Definition: That upon which confidence is reposed; ground of reliance;hope.

    Trust 7

    Definition: An estate devised or granted in confidence that the devisee orgrantee shall convey it, or dispose of the profits, at the will, or for thebenefit, of another; an estate held for the use of another; a confidencerespecting property reposed in one person, who is termed the trustee, forthe benefit of another, who is called the cestui que trust.

    Trust 8

    Definition: An organization formed mainly for the purpose of regulatingthe supply and price of commodities, etc.; as, a sugar trust.

    Trust 9

    Definition: Held in trust; as, trust property; trustmoney.

    Trust 10

    Definition: To place confidence in; to rely on, to confide, or repose faith,in; as, we can not trust those who have deceived us.

    Trust 11

    Definition: To give credence to; to believe; to credit.

    Trust 12

    Definition: To hope confidently; to believe; usually with a phrase orinfinitive clause as the object.

    Trust 13

    Definition: to show confidence in a person by intrusting (him) withsomething.

    Trust 14

    Definition: To give credit to; to sell to upon credit, or in confidence offuture payment; as, merchants and manufacturers trust their customersannually with goods.

    Trust 15

    Definition: To risk; to venture confidently.

    Trust 16

    Definition: To have trust; to be credulous; to be won to confidence; toconfide.

    Trust 17

    Definition: To be confident, as of something future; to hope.

    Trust 18

    Definition: To sell or deliver anything in reliance upon a promise ofpayment; to give credit.

    trust 19

    Definition: the trait of trusting; of believing in the honesty and reliability ofothers; "the experience destroyed his trust and personal dignity"

    trust 20

    Definition: certainty based on past experience; "he wrote the paper withconsiderable reliance on the work of other scientists"; "he put more trustin his own two legs than in the gun"

    trust 21

    Definition: complete confidence in a person or plan etc; "he cherished thefaith of a good woman"; "the doctor-patient relationship is based on trust"

    trust 22

    Definition: a consortium of independent organizations formed to limitcompetition by controlling the production and distribution of a product orservice; "they set up the trust in the hope of gaining a monopoly"

    trust 23

    Definition: something (as property) held by one party (the trustee) for thebenefit of another (the beneficiary); "he is the beneficiary of a generoustrust set up by his father"

    trust 24

    Definition: a trustful relationship; "he took me into his confidence"; "hebetrayed their trust"

    trust 25

    Definition: have confidence or faith in; "We can trust in God"; "Rely onyour friends"; "bank on your good education"; "I swear by mygrandmother''s recipes"

    trust 26

    Definition: be confident about something; "I believe that he will comeback from the war"

    trust 27

    Definition: expect and wish; "I trust you wil behave better from now on";"I hope she understands that she cannot expect a raise"

    trust 28

    Definition: extend credit to

    trust 29

    Definition: confer a trust upon; "The messenger was entrusted with thegeneral''s secret"; "I commit my soul to God"

    trust 30

    Definition: allow without fear


    Believe me in someway or the other with so many humans around us it is shattered to pieces daily.

    But daily morning I see it back in its shining beautiful shape to be broken yet again.


    Sunday, June 6, 2010

    Sarab Kavita

    Thank God for making alchohol it helps you forget pain - physical as well as mental.

    Saturday, May 22, 2010

    Sharab

    Phir Haath mein Sharaab hain Sach Bolta hoon main - this Pankaj Udhaas ghazal touches your heart no matter in which part of the universe u r in and fi you are drunk then dont even ask - this ghazal seems so true that u completely immerse in the soul of the song.

    You start to remember the small things - the times when you dropped her to the various places she asked you to drop her. Then you remember of the times when you went to her work place on some behest and she came to yours on some but deep down both of us knew we were there just to have glimpse of each other.

    Then you realise that she completes you then why am I alone here with a glass filled with 200 ml of JD.

    Enjoy the song ..

    Sunday, May 16, 2010

    Quotes ...

    Below Quotes made my parents anxious ---

    I have a question - why do people have so many questions?

    In a relationship no matter whoso ever's fault it is, the distaance between the two is what icreases.


    Life - The Journey Never Ends

    This is the topic of my book - btw I do plan to author a book, when this happens you will know...