Spring Example

pom.xml —————————————————- <?xml version=”1.0″ encoding=”UTF-8″?><project> <modelVersion>4.0.0</modelVersion> <groupId>Spring3HibernateMaven</groupId> <artifactId>Spring3HibernateMaven</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <description></description> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.0</version> </plugin> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.1.9</version> <configuration> <contextPath>/Employee</contextPath> <scanIntervalSeconds>3</scanIntervalSeconds> <scanTargetPatterns> <scanTargetPattern>… Continue reading


The arguments to the functions are: nCount [in] The maximum number of object handles is MAXIMUM_WAIT_OBJECTS minus one. pHandles [in] The array can contain handles to multiple types of objects. It may not… Continue reading

J2ME get and post

import javax.microedition.midlet.*; import javax.microedition.lcdui.*; import javax.microedition.io.*; import java.io.*; public class GetNpost extends MIDlet implements CommandListener { private Display display; // Reference to Display object private Form fmMain; // The main form private Alert… Continue reading

Producer Consumer problem using shared memory

/* Producer-Consumer program to accept data into shared memory and perform operations using semaphores */ // Producer part. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/shm.h> #include <sys/sem.h> #include <sys/types.h> #include <unistd.h> #include… Continue reading

Maven Spring Hibernate MySQL

I would like to discuss , a sample working program using Maven, Hibernate, Spring ad MySQL The development IDE is eclipse. Step 1: If we do not have Maven plugin, we can download… Continue reading

Web Browser using Java

import java.io.*; import java.net.*; import javax.swing.*; import javax.swing.event.*; import java.awt.event.*; public class WebBrowser extends JFrame{ String temp,urlQueue[]=new String[20]; int F=0,R=-1; JButton go=new JButton(“Go”); JButton prev=new JButton(“Prev”); JButton next=new JButton(“Next”); JTextField url=new JTextField(30); JEditorPane… Continue reading

Java Socket – Client and Server Communication

/*  UDP – User Data Protocol – Client and server communication A Graphical User Interface Program */   import java.net.*; import javax.swing.*; import java.awt.event.*; import java.awt.*; public class GUIClient extends JFrame { JButton… Continue reading

Dijkstra’s Shortest Path Algorithm Implementation

// Dijkstra’s Algorithm #include<stdio.h> #include<conio.h> #include<process.h> #include<alloc.h> #include<ctype.h> struct node { struct node *llink,*rlink; int data,wt; }; typedef struct { int wt,v,via; }tab; struct node *find(struct node *head,int s) { struct node *t; t=head;… Continue reading

Linux Signals

Signals /* Program to  perform operations depending on external signals */ #include<stdlib.h> #include<stdio.h> #include<sys/types.h> #include<unistd.h> #include<signal.h> int a,b; void division(int sig) { int c=0; c = a/b; printf(“\n\t QUOTIENT = %d”,c); printf(“\tSignal =… Continue reading

Shared Memory – Linux O.S

/* Program using shared memory */ #include <stdio.h> #include <sys/shm.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> int main() { key_t key1 = 1000,key2 = 2000,key3 = 3000,shmid1,shmid2,shmid3; int *A,*B,*C,i,j,k,m,n,p,q; shmid1=shmget(key1,100*sizeof(int),IPC_CREAT); if(shmid1==-1) { printf(“\n\t… Continue reading

Dining Philosophers problem using Mutex – Linux O.S

/* To implement the DINING PHILOSOPHER problem*/ Author  Raymond Antony #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <semaphore.h> #define phil 5 // phil –> PHILOSOPHERS. void * thread_func(int n); pthread_mutex_t cs[phil]; // cs… Continue reading

Chat program using Java RMI

A Chat program using Remote Method Invocation ( RMI ) import java.rmi.*; public interface Chat extends java.rmi.Remote { public String send()throws RemoteException; public void receive(String str)throws RemoteException; } —– import java.rmi.*; import java.rmi.ServerError.*;… Continue reading

Epsilon Closure (E-Closure) to Convert NFA to DFA

Epsilon closure and transitions on input symbols for a set of NFA States #include<stdio.h> #include<conio.h> #include<stdlib.h> void eclose(int); void trans(int,int); struct nfastates { int initial; int final; char inputsym; }nfa[50]; int abtrans[50],ai=0,bi=0,ei=0,eclosure[50],queue[50],n,start; void… Continue reading

Singly Linked List

struct node{ int x; node *next; }; /* We have created a data structure named ‘node’ , this consists of two parts  1. a value variable  2. a pointer variable of that can hold address… Continue reading

C++ Constructors

Let us consider an exmaple: 1. Multilevel Inheritance – Order of Constructor invocation class A { public: A() { cout<<”Constructor of base class Invoked “; } } class B: public A { public:… Continue reading

J2ME – Bluetooth Chat – Full source code

/* * BTC.java * * Created on March 7, 2008, 11:28 AM */ import com.sun.midp.lcdui.Text; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; /** * * @author raymond * @version */ public class BTC extends MIDlet {… Continue reading

8086 Assemly

A simple 8086 program to check if a string is palindrome or not, using macros. message macro arg lea dx,arg mov ax,0900h int 21h endm data segment cr equ 0dh lf equ 0ah sent db… Continue reading

8086 Assembly program

A simple and complete 8086 assembly program to add numbers, using macros. message macro arg lea dx,arg mov ax,0900h int 21h endm number macro arg mov ax,arg mov cx,0000h mov bx,000ah conv: mov… Continue reading

Binary Search Tree

A complete working program of binary search tree. #include<stdio.h> #include<conio.h> #define null 0 struct tree { int info; struct tree*lchild; struct tree*rchild; }; struct tree* Insert(struct tree *root,int x) { struct tree*newnode,*p,*q; newnode=(struct… Continue reading

Processor and its programming aspects

The first Intel processor, as we all know is 4004, where 4 signifies the word length or the number of bits that the processor can execute at a particular point of time. Let us discuss… Continue reading