There is no pleasure in having nothing to do; the fun is in having lots to do and not doing it.
courtesy : Anjali
Wednesday, December 12, 2007
Tuesday, December 11, 2007
Happiness
Being happy doesn't mean everything is perfect. It means you have decided to look beyond the imperfections.
courtesy : Anjali
courtesy : Anjali
Monday, December 10, 2007
Java Interview FAQ
Below is a list of most frequently asked interview questions in Java. I am not furnishing any answers here because you can easily find them on google for one reason. And for many questions there is no single correct answer. So people are free to post their versions in the comments. Also, please do add to the list any other FAQ which I might have missed.
- Why is Java Platform independent? How does it acheive it?
- abstract class vs interface
- What is polymorphism?
- What is multiple inheritance? Does Java support it?
- overloading vs overriding
- String vs StringBuffer
- Why is String immutable? How do you make a class immutable?
- Hashtable vs HashMap
- What is multi-threading?
- How do you make a program multi-threaded?
- What is synchronized?
- What is final?
- final vs finally vs finalize
- How are Exceptions handled in Java?
- Checked Exception vs Unchecked/Runtime Exception
- What is serialization?
- What is singleton design pattern?
- What are inner classes?
Thursday, December 6, 2007
Right vs Left
There is nothing Right in the Left brain while there is nothing Left in the Right brain.
courtesy : Priya
courtesy : Priya
Deja Vu and Amnesia
Right now I am feeling Deja vu and Amnesia at the same time. I think I have forgot this before.
courtesy : baki
courtesy : baki
Wednesday, December 5, 2007
MySQL import data from flat file
Type the following SQL at the mysql prompt:
LOAD DATA LOCAL INFILE '/importfile.csv' INTO TABLE test_table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1, filed2, field3);
This is taken from How do I import delimited data to MySQL where more details can be found.
LOAD DATA LOCAL INFILE '/importfile.csv' INTO TABLE test_table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1, filed2, field3);
This is taken from How do I import delimited data to MySQL where more details can be found.
Java Class Loader
In a J2SE 2 (that is, J2SE 1.2 or later) environment, class loaders are arranged in a parent-child tree. Normally, when a class loader is asked to load a particular class or resource, it delegates the request to a parent class loader first, and then looks in its own repositories only if the parent class loader(s) cannot find the requested class or resource.
A crisp article on Java Class Loading explains the concepts.
A crisp article on Java Class Loading explains the concepts.
MySQL convert or cast int to string
Suppose you have a table with 2 columns one int and other varchar. Now if you want to update varchar fields in all the records with the int value, use this query :
update table_name set varchar_Field = CAST(int_Field AS CHAR);
If you want to some text in addition to the int field, then use :
update table_name set varchar_Field = CONCAT(CAST(int_Field AS CHAR), 'sampleText');
update table_name set varchar_Field = CAST(int_Field AS CHAR);
If you want to some text in addition to the int field, then use :
update table_name set varchar_Field = CONCAT(CAST(int_Field AS CHAR), 'sampleText');
vi search and replace all
:%s /search_text/replace_text/g
If either of the search or replace texts has a forward-slash '/', use the backward-slash '\' to escape it.
If either of the search or replace texts has a forward-slash '/', use the backward-slash '\' to escape it.
Subscribe to:
Posts (Atom)