Monday, 21 November 2011

Living organism traced in Dead Sea

Dead Sea of Israel is the most saline sea. Here everything floats on here. Due to extreme salinity it is impossible for any organism to stay alive here. But the scientists of Max Planck Institute have collected samples of certain bacteria that are present in Dead Sea. They are now wondering about that how it is possible for the bacteria to stay alive. Research is now going on to find out the reason behind it.

Friday, 18 November 2011

Java program to create a music pattern

This program is done using Java Swing to create the GUI pattern. The music pattern is developed using Java MIDI Sequemce. The user can create different music pattern by clicking related check boxes.The user can also change the tempo factor.

Click to DOWNLOAD the archive from

Java program to design a GUI based 15 puzzle game

It is simply a game of arranging numbers 1-15 which are placed in a 4*4 2D array with one block left blank. One will have to arrange by moving the blank block. Here a timer is included to count total time to solve it. This logic is given a GUI with help of Java Swing.Here is the code for you -->
The Screenshot shown alongside is actually the picture how the game will look like when run on Windows7. It will look same as to the code of JAVA file link given below but different from the below code only in respect with game menubar. Try writing below code and also that is written in file (link given at last). Hope you will enjoy.

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import java.text.*;

public class FifteenPuzzle2 extends JPanel {
  public static JMenuItem newItem;
  public static javax.swing.Timer t;
  JButton[][] jb = new JButton[4][4];
  static int minute, second;
  static JFrame jf;

  public FifteenPuzzle2() {
       setLayout(new GridLayout(4, 4));

       int i, j, k;
       for (i = 0; i < jb.length; i++)
      for (j = 0; j < jb[i].length; j++)
             new ActionListener() {
               public void actionPerformed(ActionEvent e) {
              String command = e.getActionCommand();
              String[] indices = command.split(" ");
              int i = Integer.parseInt(indices[0]);
              int j = Integer.parseInt(indices[1]);
              int[] r = {i - 1, i, i + 1, i};
              int[] c = {j, j + 1, j, j - 1};
                for (int k = 0; k < 4; k++) {
                 if (r[k] >= 0 && r[k] < 4 && c[k] >= 0 && c[k] < 4){
                    JButton button = jb[r[k]][c[k]];
                    if (button.getText().equals("")) {

            new ActionListener() {
                public void actionPerformed(ActionEvent e) {
    public void init(boolean firstTime) {
        ArrayList a = new ArrayList();
        int i, j, k;
        for (i = 1; i <= 15; i++)
            a.add(new Integer(i));
        a.add(new Integer(0));

        k = 0;
        for (i = 0; i < jb.length; i++)
            for (j = 0; j < jb[i].length; j++) {
                Integer val = (Integer)a.get(k++);
                if (firstTime) {
                    jb[i][j] = new JButton(val.intValue() + "");
                    jb[i][j].setActionCommand(i + " " + j);
                    jb[i][j].setText(val.intValue() + "");
            minute = 0;
            second = 0;

    public static void main(String[] args) {
        jf = new JFrame();

        JMenuBar jmb = new JMenuBar();

        JMenu gameMenu = new JMenu("Game");
        newItem = new JMenuItem("New");


        FifteenPuzzle2 fp = new FifteenPuzzle2();

        final DecimalFormat dc = new DecimalFormat("00");

        t = new javax.swing.Timer(
            new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    jf.setTitle(dc.format(minute) + ":" + dc.format(second));
                    if (second >= 60) {
                        second %= 60;
        Dimension d=Toolkit.getDefaultToolkit().getScreenSize();
        int w=(int)d.getWidth();
        int h=(int)d.getHeight();

You can also download the source code from following links -
DOWNLOAD the JAVA source code from MediaFire
DOWNLOAD the JAVA source file from 4shared

Java program to create a Kaun Banega Crorepati game

This one multi file application. It is done using concept of thread, Java Swing, Java2D, elementary file handling and inheritance. Its completely a fun game which is quite like a quiz. The questions are in a random manner which are initially in several text files. The text are placed according to co-ordinate systems.Images are added to give a different look.
Click to DOWNLOAD the ZIP file from

Wednesday, 16 November 2011

Java program to design a Minesweeper game.

This program creates a Minesweeper game as on WindowsXP. It basically uses 2 arrays to save the position of hidden mines. Every time mine position changes using random function. JButton is used and it returns a action value to check which one has been hit. A timer is also added to calculate the total time to solve it.

Click to DOWNLOAD the archive from

C program to perform deletion of nodes in a doubly link list

This program includes deletion of head node, last node and any node from middle. This program is not a menu driven one. The program is a memory efficient one as it releases the memory which contained the data after its deletion using free() function.

Click to DOWNLOAD the C file from

Java program to do simple animation

This program is a simple ball jumping animation. This one is done using concept of co-ordinates, inheritance, java2D and threading. It is displayed on frame with JPanel. After each movement of ball the background is repainted to erase the trail of ball.

Click to DOWNLOAD the JAVA file from

Monday, 14 November 2011

C program for insertion in a doubly link list

This program is done by using linked list. The insertion program here os not menu-driven. It inserts at head , last, middle after a particular node and in the middle before a particular node.The forward and backward links are done using structure pointers inside a structure definition.

Click to DOWNLOAD the C file from

Sunday, 13 November 2011

C program to convert infix to postfix

This program converts a given infix expression to its equivalent postfix. It is done using stack. It considers operators +,-,*,/,^ and also brackets, it only does not checks whether the infix expression is correct or not. Here it first checks whether operatoe or not. If operator then it is inserted into stack on priority basis. If left bracket it is pushed onto stack and if a right bracket elements are popped from stack and added to postfix till a left bracket encountered. Otherwise if operand it is added to postfix.

Click to DOWNLOAD the C file from

C program of implementation of stack

This program creates a stack and perforns push, pop and display operations on a stack. It is implemented using linked list. Stack is a Last In First Out (LIFO) data structure. To follow this insertion in linked list is done at head node and deletion is also done from head end. Another method can also be followed by insertion at end and deletion from the last node.

Click to DOWNLOAD the C file from

Neutrino travels faster than light

Click hereread the article