Senin, 31 Desember 2012

These are some interview question and answer asked during my recent interview. Oracle interview questions are very important during any programming job interview. Interviewer always want to check how comfortable we are with any database either we go for Java developer position or C, C++ programmer position .So here I have discussed some basic question related with oracle database. Apart from these questions which is very specific to Oracle database you may find some general questions related to database fundamentals and SQL e.g. Difference between correlated and noncorrelated subquery in database or truncate vs delete in SQL etc. Some of the most important topics in Oracle Interview questions are SQL, date, inbuilt function, stored procedure and less used features like cursor, trigger and views. These questions also gives an idea about formats of questions asked during Oracle Interview.
Read more �
 E                                   A
Tak mau lagi aku percaya
       C#m           B               A
Pada semua kasih sayangmu
 E                                   A
Tak mau lagi aku tersentuh
        C#m             B         A
Pada semua pengakuanmu

(*)            F#                               E
Kamu takkan mengerti rasa sakit ini
              A                 F#           B
Kebohongan dari mulut manismu

REFF:
               A                        E
Pergilah kau pergi dari hidupku
                  F#m             C#m
Bawalah semua rasa bersalahmu
                A                       E
Pergilah kau pergi dari hidupku
                  A                    Am
Bawalah rahasiamu yang tak ingin kutahui

INTRO: E  Am

 E                                A
Tak mau lagi aku terjerat
       C#m           B       A
Pada semua janji-janjimu
 E                                A
Tak mau lagi aku tertaut
       C#m             B         A
Pada semua permainanmu

REPEAT: (*), REFF

INTRO: C#m Am  C#m  Am

                F#                             E/G#
Bertahun-tahun bersama ku percayaimu
             A                             E
Kubanggakan kamu kuberikan segalanya
       F#                            E/G#
Aku tak mau lagi, ku tak mau lagi
    A     F#     B
Huoo yeee hee

REPEAT: REFF

E                            A
Pergilah kau, tak ingin.. ku tahui
E                         A                  E
Pergilah kau, yeehee.. ku tahui

Minggu, 30 Desember 2012

java.util.Arrays class provides equals() and deepEquals() method to compare two Arrays in Java. Both of these are overloaded method to compare primitive arrays e.g. int, long, float, double and Object arrays e.g. Arrays.equals(Object[] , Object[]). Arrays.equals() returns true if both Arrays which it is comparing are null If both arrays pointing to same Array Object or they must be of the same length and contains the same element in each index. In all other cases, it returns false. Arrays.equals() calls equals() method of each Object while comparing Object arrays. One of the tricky question in Java related to Array comparison is Difference between Arrays.equals() and Arrays.deepEquals() method. Since both equals and deepEquals is used for array comparison, what is the difference between them becomes important. The short answer of this questions is that, Array's equals() method does not perform deep comparison and fails logical comparison in case of nested Array, on other hand deepEquals() perform deep comparison and returns logical comparison in case of nested array.
Read more �
Some times we need to append text into File in Java instead of creating new File. Thankfully Java File API is very rich and it provides several ways to append text into File in Java. Previously we have seen how to create file and directory in Java and how to read and write to text file in Java and in this Java IO tutorial we will see how to append text into file in Java. We are going to use standard FileWriter and BufferedWriter approach to append text to File. One of the key point to remember while using FileWriter in Java is to initialize FileWriter to append text i.e. writing bytes at the end of File rather than writing on beginning of the File. In next section we will see complete Java program to append text into File in Java. By the way you can also use FileOutputStream instead of FileWriter if you would like to write bytes, instead of text. Similar to FileWriter, FileOutputStream constructoralso takes a boolean append argument to open connection to append bytes into File in Java.
Read more �
Both equals() and "==" operator in Java is used to compare objects to check equality but the main difference between equals method and the == operator is that former is a method and later is an operator. Since Java doesn�t support operator overloading, == behaves identical for every object but equals() is method, which can be overridden in Java and logic to compare objects can be changed based upon business rules. Another notable difference between == and equals method is that former is used to compare both primitive and objects while later is only used for objects comparison. At the same time, beginners struggle to find when to use equality operator (==) and when to use equals method for comparing Java objects. In this tutorial, we will see how equals() method and == operator works in Java and what is the difference between "==" and equals method in Java and finally when to use "==" and equals() to compare objects.
Read more �
This tool needs all bloggers and those interested in promoting his blog for foreigners, the tool shape beautiful and wonderful includes 7 languages ??is essential in the world.

Its code
<style> 
.google_translate img {
filter:alpha(opacity=100);
-moz-opacity: 1.0;
opacity: 1.0;
border:0;
}
.google_translate:hover img {
filter:alpha(opacity=30);
-moz-opacity: 0.30;
opacity: 0.30;
border:0;
}
.google_translatextra:hover img {
filter:alpha(opacity=0.30);
-moz-opacity: 0.30;
opacity: 0.30;
border:0;
}
</style> 
<div> 
<a class="google_translate" href="#" target="_blank" rel="nofollow" title="English" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=id%7Cen&hl=en'); return false;"><img alt="English" border="0" align="absbottom" title="English" height="32" src="http://lh6.ggpht.com/_pt7i0nbIOCY/SWwjycGEnLI/AAAAAAAAA1o/7p6S3-tipsA/English_thumb%5B3%5D.png?imgmax=800" style="cursor: pointer;margin-right:13px" width="24"/></a>
<a class="google_translate" href="#" target="_blank" rel="nofollow" title="French" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=id%7Cfr&hl=en'); return false;"><img alt="French" border="0" align="absbottom" title="French" height="32" src="http://lh3.ggpht.com/_pt7i0nbIOCY/SWwj1AdOWZI/AAAAAAAAA1w/lWUkGNrOFYo/French_thumb%5B5%5D.png?imgmax=800" style="cursor: pointer;margin-right:13px" width="24"/></a> 
<a class="google_translate" href="#" target="_blank" rel="nofollow" title="German" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=id%7Cde&hl=en'); return false;"><img alt="German" border="0" align="absbottom" title="German" height="32" src="http://lh5.ggpht.com/_pt7i0nbIOCY/SWwj4Ab0NaI/AAAAAAAAA14/3H56LPKtijA/German_thumb%5B1%5D.png?imgmax=800" style="cursor: pointer;margin-right:13px" width="24"/></a> 
<a class="google_translate" href="#" target="_blank" rel="nofollow" title="Spain" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=id%7Ces&hl=en'); return false;"><img alt="Spain" border="0" align="absbottom" title="Spain" height="32" src="http://lh3.ggpht.com/_pt7i0nbIOCY/SWwj8KhadjI/AAAAAAAAA2A/GNyl8VBie3o/Spain_thumb%5B1%5D.png?imgmax=800" style="cursor: pointer;margin-right:13px" width="24"/></a> 
<a class="google_translate" href="#" target="_blank" rel="nofollow" title="Italian" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=id%7Cit&hl=en'); return false;"><img alt="Italian" border="0" align="absbottom" title="Italian" height="32" src="http://lh3.ggpht.com/_pt7i0nbIOCY/SWwj-14HeyI/AAAAAAAAA2I/TN52dIqkO9Q/Italian_thumb%5B1%5D.png?imgmax=800" style="cursor: pointer;margin-right:13px" width="24"/></a> 
<a class="google_translate" href="#" target="_blank" rel="nofollow" title="Dutch" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=id%7Cnl&hl=en'); return false;"><img alt="Dutch" border="0" align="absbottom" title="Dutch" height="32" src="http://lh5.ggpht.com/_pt7i0nbIOCY/SWwkBmKewNI/AAAAAAAAA2Q/43NEAnyNo1I/Dutch_thumb%5B1%5D.png?imgmax=800" style="cursor: pointer;margin-right:13px" width="24"/></a>
<br/><br/>
<a class="google_translate" href="#" target="_blank" rel="nofollow" title="Russian" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=id%7Cru&hl=en'); return false;"><img alt="Russian" border="0" align="absbottom" title="Russian" height="32" src="http://lh4.ggpht.com/_pt7i0nbIOCY/SWwkESa-0pI/AAAAAAAAA2Y/i0X4cKgxq3g/Russian_thumb%5B1%5D.png?imgmax=800" style="cursor: pointer;margin-right:13px" width="24"/></a> 
<a class="google_translate" href="#" target="_blank" rel="nofollow" title="Portuguese" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=id%7Cpt&hl=en'); return false;"><img alt="Portuguese" border="0" align="absbottom" title="Portuguese" height="32" src="http://lh4.ggpht.com/_pt7i0nbIOCY/SWwkG0osjzI/AAAAAAAAA2g/_kM2A16R_Ho/Portuguese_thumb%5B1%5D.png?imgmax=800" style="cursor: pointer;margin-right:13px" width="24"/></a> 
<a class="google_translate" href="#" target="_blank" rel="nofollow" title="Japanese" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=id%7Cja&hl=en'); return false;"><img alt="Japanese" border="0" align="absbottom" title="Japanese" height="32" src="http://lh5.ggpht.com/_pt7i0nbIOCY/SWwkJ6RBJAI/AAAAAAAAA2o/lpsTh893J3k/Japanese_thumb%5B1%5D.png?imgmax=800" style="cursor: pointer;margin-right:13px" width="24"/></a> 
<a class="google_translate" href="#" target="_blank" rel="nofollow" title="Korean" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=id%7Cko&hl=en'); return false;"><img alt="Korean" border="0" align="absbottom" title="Korean" height="32" src="http://lh4.ggpht.com/_pt7i0nbIOCY/SWwkMouNMKI/AAAAAAAAA2w/L5l6J-Hh8XA/Korean_thumb%5B1%5D.png?imgmax=800" style="cursor: pointer;margin-right:13px" width="24"/></a> 
<a class="google_translate" href="#" target="_blank" rel="nofollow" title="Arabic" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=id%7Car&hl=en'); return false;"><img alt="Arabic" border="0" align="absbottom" title="Arabic" height="32" src="http://lh5.ggpht.com/_pt7i0nbIOCY/SWwkPdkvXBI/AAAAAAAAA24/A1LSG1lcuac/Arabic_thumb%5B1%5D.png?imgmax=800" style="cursor: pointer;margin-right:13px" width="24"/></a> 
<a class="google_translate" href="#" target="_blank" rel="nofollow" title="Chinese Simplified" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=id%7Czh-CN&hl=en'); return false;"><img alt="Chinese Simplified" border="0" align="absbottom" title="Chinese Simplified" height="32" src="http://lh6.ggpht.com/_pt7i0nbIOCY/SWwkSgrv4ZI/AAAAAAAAA3A/jQqZ1l6avts/Chinese-Simplified_thumb%5B1%5D.png?imgmax=800" style="cursor: pointer;margin-right:13px" width="24"/></a> 
</div><div style="font-size:10px;margin:10px 0px 3px 0px">
</div>

Installation Procedure

To begin using this new gadget, go to Layout>and click "Add a Gadget" and
select HTML/JavaScript , In the latter save tool.

Drop Your Comments And Questions Below.
INTRO: D  F#  Em  A
  D  F#m  Em  A

          D
Kemarin kau datang menemui aku
        G
Saat aku ragu saat aku layu
      A                                                   D   A
Canda tawamu tenangkan aku, Yolanda
      D
Ku bawa cinta sebesar dunia
          G
Agar engkau tahu besarnya cintaku
        A                                                         D
Apa kau tak m�rasa kau tak meraba, Yolanda

INTRO: D  F#  Em  A
  D  F#m  Em  A

        D
Aku menunggumu di tempat biasa
         G
Kuharap kau datang menemui aku
     A                                                        D   A
Jangan terlambat ku harap cepat, Yolanda
          D
Lelah hati ini mencari dirimu
          G
Lelah kaki ini untukku melangkah
     A                                           D
Untuk temui dirimu kasih, Yolanda

REFF:
     G
Kamu di mana dengan siapa
                 D
Semalam berbuat apa
     G
Kamu di mana dengan siapa
       D                          A
Di sini aku menunggumu dan bertanya

REPEAT: REFF

INTRO: D  G  A  D
  G  D  G  A

REPEAT: REFF (3x)

         D
Yolanda



Sabtu, 29 Desember 2012

Adding days, hours, month or years to dates is a common task in Java. java.util.Calendar can be used to perform Date and Time arithmetic in Java. Calendar class not only provides date manipulation but it also support time manipulation i.e. you can add, subtract hours, minutes and seconds from current time. Calendar class automatically handles date transition or month transition for example if you ask date after 30 days it will return you date based on whether current month is 30 or 31 days long. Same is true in case of adding and subtracting years, Calendar takes care whether current or following year is a leap year or not. For example 2012 is a leap year and it has February with 29 days, if you ask Calendar day before 365 it will return 24th July (assuming current date 23rd July) which shows it take care of leap year. By the way there are couple of more date and time related articles e.g. How to find current date and time in Java and How to convert Date to String in Java. If you haven�t read them already, It�s worth checking to know more about Date and Time in Java.
Read more �
(Update): Internet Download Manager (IDM) Patch (scroll down for detail)

In this short post I am going to show you how to register your trial (free) version of IDM for life time and most importantly for free. You first need to install any version of Internet Download Manager (IDM) on your PC and then follow the steps below:
  • First of all open the C:\ Drive of you computer and then open the WINDOWS folder
  • Once you open the WINDOWS folder now search the system 32folder in it. In system 32 folder find the Drivers folder and open it.
  • In Drivers folders you will see a folder titled �etc� open it and find the hosts file in it
  • Now open the hosts file in Notepad
Copy and paste the following code in hosts file

127.0.0.1 tonec.com
127.0.0.1 www.tonec.com
127.0.0.1 registeridm.com
127.0.0.1 www.registeridm.com
127.0.0.1 secure.registeridm.com
127.0.0.1 internetdownloadmanager.com
127.0.0.1 www.internetdownloadmanager.com
127.0.0.1 secure.internetdownloadmanager.com
127.0.0.1 mirror.internetdownloadmanager.com
127.0.0.1 mirror2.internetdownloadmanager.com



  • Save and close it
Note: In order to avoid any interruption disable you antivirus software for a moment
  • Now open IDM and click on registration button a dialogue box will appear
  • Enter your name, email address and in serial number option enter one of the following keys

RLDGN-OV9WU-5W589-6VZH1
HUDWE-UO689-6D27B-YM28M
UK3DV-E0MNW-MLQYX-GENA1
398ND-QNAGY-CMMZU-ZPI39
GZLJY-X50S3-0S20D-NFRF9
W3J5U-8U66N-D0B9M-54SLM
EC0Q6-QN7UH-5S3JB-YZMEK
UVQW0-X54FE-QW35Q-SNZF5
FJJTJ-J0FLF-QCVBK-A287M

 You will see a registration update notice after successful registration of IDM full version
You have done it! Now enjoy IDM for life time share you experience or issues in the comment section below. Have Fun!!

Update:  From last few days I was receiving emails that the method I have shared above is not working well with some guys. So today I am going to share with you Internet Download Manager Patch, a very useful tool for the lifetime activation of IDM.


How to Install IDM Patch:
 

Run the program and then click on patch it will ask you to select IDMan application. It will take few seconds to complete the process. Now you have done it! Now enjoy the full features of a registered Internet Download Manager. If you are facing any issue please let us know in the comment section. Enjoy!
The main difference between Primary key and Foreign key in a table is that it�s the same column which behaves as primary key in the parent table and as a foreign key in a child table. For example in Customer and Order relationship, customer_id is the primary key in Customer table but a foreign key in Order table. By the way, what is a foreign key in a table and difference between Primary and Foreign key are some of the popular SQL interview questions, much like truncate vs delete in SQL or difference between correlated and noncorrelated subquery? We have been learning key SQL concepts along with these frequently asked SQL questions and in this SQL tutorial, we will discuss what is a foreign key in SQL and purpose of the foreign key in any table. By the way, this is the third article related to a primary key in SQL, other being difference between primary and unique key and How to find second highest salary in SQL. If you are preparing for any technical job interview where you expect some SQL questions, check out these questions, they are worth preparing.
Read more �
As name suggests ClassCastException in Java comes when we try to type cast an object and object is not of the type we are trying to cast into. In fact ClassCastException in Java is one of most common exception in Java along with java.lang.OutOfMemoryErrorand ClassNotFoundException in Java before Generics was introduced in Java 5 to avoid frequent instances of java.lang.classcastexception cannot be cast to while working with Collection classes like ArrayListand HashMap, which were not type-safe before Java 5. Though we can minimize and avoid java.lang.ClassCastException in Java by using Generics and writing type-safe parameterized classes and method, its good to know real cause of ClassCastException and How to solve it. In this Java tutorial we will see Why java.lang.ClassCastException comes and how to resolve ClassCastException in Java. We will also see how to minimize or avoid ClassCastException in Java by using Generics, as prevention is always better than cure.
Read more �
Class and Object are two most important concept of Object oriented programming language (OOPS) e.g. Java. Main difference between a Class and an Object in Java is that class is a blueprint to create different objects of same type. This may looks simple to many of you but if you are beginner or just heard term Object Oriented Programming language it might not be that simple. I have met many students, beginners and programmers who don�t know difference between class and object and often used them interchangeably. Also Java API having classes like java.lang.Object and java.lang.Class also adds more confusion in beginners mind. Both of them are totally different things, class and object in OOPS are concepts and applicable to all Object oriented programming language e.g. C++ or Scala. On the other hand java.lang.Class and java.lang.Object are part of Java API. Along with other OOPS concepts like Abstraction, Encapsulation, Inheritanceand Polymorphism, this is also one of the most fundamental of Object oriented programming (OOPS) which needs to be clearly understood before proceeding into serious application programming. Without clear understanding of Class and Object you are more prone to make errors, not able to comprehend an already written program and it would be pretty hard for you to find bugs or fix errors or exceptions in Java code. By the way difference between class and object is also a popular programming interview question, which is quite frequently asked at fresher level interviews. In this article we will look this on different angles to differentiate Class and object in Java. Once you get hold of key OOPS concepts, I would recommend to read 10 OOPS and SOLID design principles for Java programmer, which is tried and tested design pattern for writing better code.
Read more �

Jumat, 28 Desember 2012


Sumber:sukasukapaktri.blogspot.co.id/2012/12/wonderful-running-led-with-atmega8535.html

Projek Wonderful Running Led With Atmega8535. Awalnya dia tertarik untuk belajar mikrokontroler khususnya belajar pemrograman BASCOM AVR.

Wonderful Running LED

Mengapa menggunakan chip ATMEGA8535 itu karena selain banyak di pasaran, IC ini juga memiliki fitur yang cukup kompleks sehingga akan mudah diaplikasikan ke dalam bentuk pengontrolan yang lain. Untuk lebih jelasnya mengenai ATMEGA8535 bisa download datasheetnya di sini.

Sebagai langkah awal pembelajaran, saya aplikasikan mikrokontroler ATMEGA8535 sebagai pengendali running led yang diprogram dengan software BASCOM AVR.




Pemrograman dengan BASCOM AVR




LED akan secara bergantian hidup dan mati sesuai dengan instruksi program yang tersimpan dalam chip mikrokontroler. Dengan bahasa pemrograman basic kita menggunakan istilah pengondisian DO - IF - THEN - END - IF - LOOP.


Berikut contoh programnya:


$regfile = "m8535dat"


$crystal = 11059200


config portb = input


config porta = output


config portc = output


sw1 Alias PORTB.1

LED Alias PORTC



Ddrb = &B00000000

PORTC = &B11111111

'--------------------------------


Do


If sw1 = 0 then


waitms 50

LED = &B00000000

waitms 20

LED = &B11111111

waitms 50

LED = &B00000000

waitms 20

LED = &B11111111

waitms 50

LED = &B00000000

waitms 20

LED = &B11111111

waitms 50

LED = &B00000000

waitms 20

LED = &B11111111

waitms 50

'----------------------------------


LED = &B11111110


waitms 10


LED = &B11111101


waitms 10


LED = &B11111011


waitms 10


LED = &B11110111


waitms 10


LED = &B11101111


waitms 10


LED = &B11011111


waitms 10


LED = &B10111111


waitms 10


LED = &B01111111


'------------------------------------- 1


waitms 10


LED = &B01111110


waitms 10


LED = &B01111101


waitms 10


LED = &B01111011


waitms 10


LED = &B01110111


waitms 10


LED = &B01101111


waitms 10


LED = &B01011111


waitms 10


LED = &B00111111


'------------------------------ 2


waitms 10


LED = &B00111110


waitms 10


LED = &B00111101


waitms 10


LED = &B00111011


waitms 10


LED = &B00110111


waitms 10


LED = &B00101111


waitms 10


LED = &B00011111


'------------------------------- 3


waitms 10


LED = &B00011110


waitms 10


LED = &B00011101


waitms 10


LED = &B00011011


waitms 10


LED = &B00010111


waitms 10


LED = &B00001111


'----------------------------------- 4


waitms 10


LED = &B00001110


waitms 10


LED = &B00001101


waitms 10


LED = &B00001011


waitms 10


LED = &B00000111


'---------------------------------- 5


waitms 10


LED = &B00000110


waitms 10


LED = &B00000101


waitms 10


LED = &B00000011


'---------------------------------- 6


waitms 10


LED = &B00000010


waitms 10


LED = &B00000000


'--------------------------------- 7

waitms 30

LED = &B11100111

waitms 10

LED = &B11000011

waitms 10

LED = &B10000001

waitms 10

LED = &B00000000

waitms 10

LED = &B10000001

waitms 10

LED = &B11000011

waitms 10

LED = &B11100111

waitms 10

LED = &B11111111

'---------------------------------

waitms 30

LED = &B11100111

waitms 10

LED = &B11000011

waitms 10

LED = &B10000001

waitms 10

LED = &B00000000

waitms 10

LED = &B10000001

waitms 10

LED = &B11000011

waitms 10

LED = &B11100111

waitms 10

LED = &B11111111

'--------------------------------

waitms 30

LED = &B11100111

waitms 10

LED = &B11000011

waitms 10

LED = &B10000001

waitms 10

LED = &B00000000

waitms 10

LED = &B10000001

waitms 10

LED = &B11000011

waitms 10
LED = &B11100111
waitms 10
LED = &B11111111
End If
Loop


Videonya dapat dilihat dibawah ini:

Attaching source of any Jar in Eclipse e.g. JDK or open source libraries like Spring framework is a good idea because it help during debugging and code development. As a Java programmer at least you should attach the source of JDK in Eclipse IDE to find out more about JDK classes. Though Eclipse IDE is pretty good on code assist, sometimes You want to know what's going inside a library or a JDK method, rather than just reading the documentation. Interview questions like How HashMap works in Java or How substring cause memory leak can only be answered if you are familiar with the source code of these classes. Once you attach source code of Java or Spring in Eclipse IDE, You can check code with just a single click. Some one may argue for Java decompiler like JAD which can create source from the .class file which is also a smart way to look code for open source library, but decompiled source file is not same as the original source file, as you lost comment and readability. As per my experience attaching source code corresponding to JAR file is much better than decompiling a class file using JAD decompiler.
Read more �
How do you find middle element of LinkedList in one pass is a programming question often asked Java and non-Java programmers in telephonic Interview. This question is similar to checking palindrome or calculating the factorial, where Interviewer sometimes also ask to write code. In order to answer this question candidate must be familiar with LinkedList data structure i.e. In the case of singly LinkedList, each node of Linked List contains data and pointer, which is the address of next Linked List and the last element of Singly Linked List points towards the null. Since in order to find middle element of Linked List you need to find the length of LinkedList, which is counting elements till end i.e. until you find the last element of Linked List. What makes this data structure Interview question interesting is that you need to find middle element of LinkedList in one pass and you don�t know the length of LinkedList. This is where candidates logical ability puts into the test, whether he is familiar with space and time trade off or not etc.
Read more �
Recursion is one of the tough programming technique to master. Many programmers working on both Java and other programming languages like C or C++ struggles to think recursively and figure out the recursive pattern in the problem statement, which makes it is one of the favorite topics of any programming interview. If you are new in Java or just started learning Java programming language and you are looking for some exercise to learn the concept of recursion than this tutorial is for you. In this programming tutorial, we will see a couple of example of recursion in Java programs and some programming exercise which will help you to write recursive code in Java e.g. calculating Factorial, reversing String and printing Fibonacci series using recursion technique. For those who are not familiar with recursion programming technique here is the short introduction: "Recursion is a programming technique on which a method call itself to calculate result". It's not as simple as it look and mainly depends upon your ability to think recursively. One of the common trait of recursive problem is that they repeat itself, if you can break a big problem into small junk of repetitive steps then you are on your way to solve it using recursion.
Read more �
Referential Integrity is set of constraints applied to foreign key which prevents entering a row in child table (where you have foreign key) for which you don't have any corresponding row in parent table i.e. entering NULL or invalid foreign keys. Referential Integrity prevents your table from having incorrect or incomplete relationship e.g. If you have two tables Order and Customer where Customer is parent table with primary key customer_id and Order is child table with foreign key customer_id. Since as per business rules you can not have an Order without a Customer and this business rule can be implemented using referential integrity in SQL on relational database. Referential Integrity will cause failure on any INSERT or UPDATE SQL statement changing value of customer_id in child table, If value of customer_id is not present in Customer table. By the way What is Referential Integrity in SQL is also an important SQL question similar to finding second highest salary in SQL or difference between truncate and delete and should be prepared well before going for any job interview, where knowledge of SQL is one of the requirement.
Read more �
Thread safe Singleton means a Singleton class which returns exactly same instance even if exposed to multiple threads. Singleton in Java has been a classical design pattern like Factory method pattern or Decorator design pattern and has been used a lot even inside JDK like java.lang.Runtime is an example of Singleton class. Singleton pattern ensures that exactly one instance of class will remain in Java program at any time. In our last post 10 Interview questions on Singleton in Java we have discussed many different questions asked on Singleton pattern, One of them was writing Thread safe singleton in Java. Prior to Java 5 double checked locking mechanism is used to create thread-safe singleton in Java which breaks if one Thread doesn't see instance created by other thread at same time and eventually you will end up with more than one instance of Singleton class. From Java 5 onwards volatile variable guarantee can be used to write thread safe singleton by using double checked locking pattern. I personally don't prefer that way as there are many other simpler alternatives to write thread-safe singleton is available available like using static field to initialize Singleton instance or using Enum as Singleton in Java. Let�s see example of both ways to create thread-safe Singleton in Java.
Read more �
ST 12 � Cari Pacar Lagi
Dok: kapanlagi.com
INTRO: G

      G
Cintaku cintaku padamu
                         Em
Tak besar seperti dulu
                     Am
Kamu kok begitu menilai cintaku
                        D
Begitu rendah di matamu

      G
Sayangku sayangku padamu
                        Em
Tak indah seperti dulu
                 Am
Maumu begini maumu begitu
                                 D
Tak pernah engkau hargai aku

(*)              C
Oo ooh I am sorry
      D                              G
Ku tak akan love you lagi

      G
Ku peluk memeluk dirimu
                           Em
Tak hangat seperti dulu
                Am
Ku jadi selingkuh kar�na kau selingkuh
                            D
Biar sama-sama kita selingkuh

REPEAT: (*)
REFF:
                                C
Biar ku putuskan saja
D                           Bm
Ku tak mau hatiku terluka
Em                           Am
Lebih baik ku cukupkan saja
D                              G
Ku tak mau batinku tersiksa
                                      C
Jangan kau s�lalu merasa
D                          Bm
Wanita bukan dirimu saja
Em                          Am
Lebih baik ku putuskan saja
D                  G
Cari pacar lagi

INTRO: G  Em  Am  C  G
  Em  C  D  G

REPEAT: REFF  (2x)

D                  G
Cari pacar lagi
D                  G
Cari pacar lagi

Kamis, 27 Desember 2012

Many time we need SQL query which return data page by page i.e. 30 or 40 records at a time, which can be specified as page size. In fact Database pagination is common requirement of Java web developers, especially dealing with largest data sets. In this article we will see how to query Oracle 10g database for pagination or how to retrieve data using paging from Oracle. Many Java programmer also use display tag for paging in JSP which supports both internal and external paging. In case of internal paging all data is loaded in to memory in one shot and display tag handles pagination based upon page size but it only suitable for small data where you can afford those many objects in memory. If you have hundreds of row to display than its best to use external pagination by asking databaseto do pagination. In pagination, ordering is another important aspect which can not be missed. It�s virtually impossible to sort large collection in Java using Comparator or Comparablebecause of limited memory available to Java program, sorting data in database using ORDER BY clause itself is good solution while doing paging in web application.
Read more �
Do you want to convert milliseconds to Date in Java ? Actually java.util.Date is internally specified in milliseconds from epoch. So any date is number of millisecond passed since January 1, 1970, 00:00:00 GMT and Date provides constructorwhich can be used to create Date from milliseconds. Knowing the fact that Date is internally maintained in milliseconds allows you to store date in form of millisecond in Server or in your Classbecause that can be effectively expressed with a long value. In fact many experienced Java programmer store Date as long value while writing Immutable class which requires Date, one of the reason for that is Date being mutable and long value of Date can be very handy. By the ways this is next in Date related article, we have already discussed How to convert String to Date and How to get current month, year and day of week from Date in Java. If you haven�t read them already, you may find them useful. In this Java tutorial we will see example of converting millisecond into Date in Java.
Read more �
Printing array values in Java or values of array element in Java would have been much easier if arrays are allowed to directly prints its values whenever used inside System.out.println() or format and printf method, Similar to various classes in Java do this by overriding toString() method. Despite being an object, array in Java doesn't print any meaningful representation of its content when passed to System.out.println() or any other print methods. If you are using array in method argument or any other prominent place in code and actually interested in values of array then you don't have much choice than for loop until Java 1.4. Things has been changed since Java 5 because it introduced two extremely convenient methods for printing values of both primitive and object arrays in Java. Arrays.toString(array) and Arrays.deepToString(twoDimensionArray) can print values of any array. Main difference between Arrays.toString() and Arrays.deepToString is that deepToString is used to print values of multidimensional array which is far more convenient than nesting of multiple for loops. In this Java tutorial we will see 3 different ways of printing array values in Java or value of element from Array in Java.
Read more �
How to check if a number is a palindrome or not is a variant of popular String interview question how to check if a String is a palindrome or not. A number is said to be a palindrome if number itself is equal to reverse of number e.g. 313 is a palindrome because reverse of this number is also 313. On the other hand 123 is not a palindrome because reverse of 123 is 321 which is not equal to 123, i.e. original number. In order to check if a number is a palindrome or not we can reuse the logic of How to reverse number in Java. Since in most of interview, you are supposed to solve this question without taking help from API i.e. only using basic programming construct e.g. loop, conditional statement, variables, operators and logic. I have also seen programmer solving this question by first converting integer to String and than reversing String using reverse() method of StringBuffer and than converting String back to Integer, which is not a correct way because you are using Java API. Some programmer may think that this is just a trivial programming exercise but it�s not. Questions like this or Fibonacci series using recursion can easily separate programmers who can code and who can�t. So it�s always in best interest to keep doing programing exercise and developing logic.
Read more �