Posts

Showing posts from 2015

Producer Consumer Problem > Java Program

Producer Consumer Problem > Java Program Operating Systems import java.util.Vector; public class S3 {

To implement Distance Vector Routing > C Program

To implement Distance Vector Routing > C Program Computer Networks #include<stdio.h> struct node {     unsigned dist[20];     unsigned from[20]; }rt[10]; int main() {

To carry out Subnetting for entered IP Adddress > Java Program

To carry out Subnetting for entered IP Adddress > Java Program Computer Networks import java.io.*; import java.util.*; public class Subnet {

Bankers Algorithm (Resource and Safety Algoritm) > Java Program

Bankers Algorithm (Resource and Safety Algoritm) > Java Program Operating Systems Program:

To implement Bit Stuffing > Java Program

To implement Bit Stuffing > Java Program Computer Networks import java.io.*; public class BitStuffing {    

To multiply two 16-Bit Numbers > Mixed Language Program

To multiply two 16-Bit Numbers > Mixed Language Program Microprocessor Program: #include<stdio.h> #include<conio.h> void main() {

To count characters of Multiple String > Java Program

To count characters of Multiple String > Java Program Computer Networks import java.io.*; import java.util.*; class CharacterCount {

Producer Consumer Problem with Wait and Notify > Java Program

Producer Consumer Problem with WAIT and NOTIFY > Java Program O perating Systems   Program: import java.util.Vector; import java.util.logging.Level; import java.util.logging.Logger;

Program to check whether a number is Even or Odd using Procedure > Assembly Language

Program to check whether a number is Even or Odd using Procedure > Assembly Language Microprocessor ASSUME CS:CODE,DS:DATA

Program to check whether a number is Even or Odd using Macro > Assembly Language

Program to check whether a number is Even or Odd using Macro > Assembly Language Microprocessor ASSUME CS:CODE,DS:DATA

Program to check whether a number is Even or Odd > Assembly Language

Program to check whether a number is Even or Odd > Assembly Language Microprocessor ASSUME CS:CODE,DS:DATA

Program to print characters from A to Z > Assembly Language

Program to print characters from A to Z > Assembly Language Microprocessor ASSUME CS:CODE

To Display reverse of entered String > Assembly Program

To Display reverse of entered String > Assembly Program Microprocessor assume cs:code,ds:data

Client-Server Chat > Java Socket Programming

Image
Client-Server Chat > Java Socket Programming Computer Networks File: MyServer.java import  java.net.*;     import  java.io.*;     class  MyServer{  

To find Subnet Mask and Network ID for given IP Address > Java Program

Computer Networks To find Subnet Mask and Network ID for given IP Address > Java Program import java.io.*; import java.net.InetAddress; public class subnet {       public static void main(String[] args) throws IOException {               System.out.println("ENTER IP:");         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));         String ip = br.readLine();         String checkclass = ip.substring(0, 3);

To use fork() to get the Parent and Child Process ID > C Program

Operating Systems Program using fork() to get the Parent and Child Process ID #include<stdio.h> #include<string.h> #include<fcntl.h> #include<sys/stat.h> #include<sys/types.h> int main() { int pid, p1, c;

I/O System Calls > C Program

Operating Systems I/O System Calls > C Programs Program 1 #include<stdio.h> #include<stdlib.h> #include<sys/types.h> #include<sys/stat.h> #include<unistd.h> #include<errno.h> int main(int argc,char*argv[]) { pid_t pid; pid=fork();

Linux Networking > Terminal Commands 1

Operating Systems Linux Networking > Terminal Commands  [root@localhost ~]# mkdir PRATHAMESH [root@localhost ~]# cd PRATHAMESH [root@localhost PRATHAMESH]# cd .. [root@localhost ~]# vi LMN [root@localhost ~]# cat LMN This is the new file to demonstrate the vi command. we are operating Linux Red Hat.

To find Sum and Average of Block of n-Bytes > Assembly Language

Microprocessor To find Sum and Average of Block of n-Bytes > Assembly Language ASSUME CS:CODE , DS:DATA DATA SEGMENT

Windows and Linux Networking > Terminal Commands 2

Computer Networks Windows and Linux Networking > Terminal Commands  Windows Commands Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\admin>ipconfig Windows IP Configuration Ethernet adapter VMware Network Adapter VMnet8:         Connection-specific DNS Suffix  . :         IP Address. . . . . . . . . . . . : 192.168.88.1         Subnet Mask . . . . . . . . . . . : 255.255.255.0         Default Gateway . . . . . . . . . :

To Find Average of two Bytes > Assembly Language

Microprocessor To Find Average of two Bytes > Assembly Language ASSUME DS:DATA, CS:CODE DATA SEGMENT

Full Adder > Java Program

Full Adder > Java Program Computer Organization and Architecture import java.util.*; class FULLADDER { public static void main(String args[]) { int a[],b[]; Scanner sc=new Scanner(System.in); System.out.println(“ENTER NUMBER OF BITS : “); int n=sc.nextInt(); a=new int[n]; b=new int[n];

Binary Division using Non Restoring Algorithm > Java Program

Binary Division using Non Restoring Algorithm Computer Organization and Architecture import java.io.*; class NONRESTORING { public static int[] lshift(int s1[],int s2) { int s[]=new int [4]; for(int i=0;i<3;i++) { s[i]=s1[i+1]; } s[3]=s2; return(s); }

Binary Division using Restoring Algorithm > Java Program

Binary Division using Restoring Algorithm > Java Program Computer Organization and Architecture import java.util.*; class RESTORING { public static void lshift(int a[],int q[]) {

Booth's Algorithm > Java Program

Booth's Algorithm > Java Program Computer Organization and Architecture import java.util.*; class BOOTH { public static int[] add(int a[],int m1[]) { int carry=0; int sum[]=new int [4];

CRC Cyclic Redundancy Check > Java Program

Computer Networks CRC Cyclic Redundancy Check > Java Program import java.util.Scanner; class CRC { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int m,g[],n,d[],z[],r[],msb,i,j,k;

Client Server > Java Program

Computer Networks Client Server > Java Program TCPClient.java File import java.io.*; import java.net.*; class TCPClient { public static void main(String argv[]) throws Exception {

Checksum > Java Program

Computer Networks Checksum > Java Program import java.io.*; import java.util.*; class checksum { public static void main(String args[]) {

Insertion Sort > Java Program

Insertion Sort > Java Program import java.io.DataInputStream; class InsertionSort { public static void main(String args[ ]) { int i,n=0; int x[]=new int[25];

Binary Search Tree > Java Program

Binary Search Tree > Java Program import java.util.Scanner; class TreeNode { TreeNode left,right; int info; public TreeNode(int data) {

8 Queens Problem > Java Program

Analysis of Algorithms 8 Queens Problem > Java Program import java.io.*; class operation {

Sorting > C Program

Sorting Quick Sort, Heap Sort, Insertion Sort, Radix Sort, Merge Sort > C Program #include<stdio.h> #include<conio.h> #define MAX 50

Hamming Code Generation for Error Detection and Correction > Java Program

Computer Networks Hamming Code Generation for Error Detection and Correction > Java Program import java.util.*; class hamming {   public static void main(String args[])      {

Round Robin Scheduling Algorithm > Java Program

Operating Systems Round Robin Scheduling Algorithm > Java Program Round robin Scheduling algorithm (RR) is designed especially for time sharing system.It is similar to FCFS scheduling,but preempted is added to switch between processes.A small unit of time called a time quantum is defined.a time quantum is generally from 10 to 100 milliseconds.The CPU scheduler goes around the ready queue ,allocating the CPU to each process for a time interval of up to 1 time quantum. 

First Come First Serve (FCFS) Scheduling Algorithm > Java Program

Operating Systems First Come First Serve (FCFS) Scheduling Algorithm > Java Program First come first serve (FCFS) scheduling algorithm with this schema the process that request the CPU First is allocated the CPU first.the Implementation of the First come first serve (FCFS) policy is easily managed with fifo queue.when a process enters into the ready queue ,its PCB is linked onto the tail of the queue.when the CPU is free it is allocated to the process at the head of the queue.the running process is then removed from the queue.the code for First come first serve (FCFS) scheduling is simple to write and Understand.The First come first serve (FCFS) sheduling algorithm in non preemptive.The First come first serve (FCFS) algorithm is particularly troublesome for time sharing system.  import java.io.*;  class fcfs  {  public static void main(String args[]) throws Exception  {  int n,AT[],BT[],WT[],TAT[]; 

Bankers Algorithm > Java Program

Operating Systems Bankers Algorithm (Safety Algorithm) > Java Program import java.util.Scanner; public class bankers1{     private int need[][],allocate[][],max[][],avail[][],np,nr;

Dining Philosophers Problem > Java Program

Operating Systems Dining Philosophers Problem > Java Program Dining Philosophers Problem: Consider five philosophers who spend time in thinking and eating.the philosophers share a common circular table surrounded by five chairs,each belonging to one philosopher.In the center of the table is a bowl of rice and the table is laid with five single chopsticks.when a philosopher thinks she does not interacts with her colleagues.From time to time philosopher gets hungry and tries to pick up the two chopsticks that are between her left and right philosopher. philosopher may pick up only one chopstick at a time.Obviously,she cannot pick chopstick in hand of neighbor.When hungry philosopher has both her chopstick at the same time she eats without releasing her chopstick.When she is finished eating she puts down chopstick and start thinking. import java.io.*; class Philo {

Least Recently Used (LRU) Page Replacement Algorithm > Java Program

Computer Organization and Architecture Least Recently Used (LRU) Page Replacement Algorithm > Java Program In Least Recently Used (LRU) page replacement algorithm we use the recent past as an approximation of the near future,then we will replace the pagethat has not been used for the longest period of time. In Least Recently Used (LRU) page replacement algorithm is associated with the each page the time of that page's last use.When a page must be replaced,In Least Recently Used (LRU) page replacement algorithm chooses that page has not been used for longest period of time.The In Least Recently Used (LRU) page replacement algorithm Policy is often used as page replacement algorithm and is consider to be good.The major problem is how to implement In Least Recently Used (LRU) page replacement algorithm.An In Least Recently Used (LRU) page replacement algorithm may require substantial hardware assistance.  import java.util.*; class LRU { public static void main(String

First In First Out (FIFO) Page Replacement > Java Program

Computer Organization and Architecture First In First Out (FIFO) Page Replacement > Java Program The Simplest page replacement algorithm is First In First Out (FIFO) .A First In First Out (FIFO) replacement algorithm associated with each page the time when that page was brought into memory.When a page must be replaced ,the oldest page is chosen.We can create First In First Out (FIFO) queue to hold all pages in memory.The First In First Out (FIFO) page replacement algorithm is easy to understand and program. import java.io.*; class FIFO {         public static void main(String args[]) throws IOException         {                                  int n;                 int f;

Turing Machine Program (Equal Number of 0's and 1's) > Java Program

Theoretical Computer Science Turing Machine Program (Equal Number of 0's and 1's) > Java Program import java.io.*;  import java.lang.*;  class turing_machine {

Finite State Machine (String abab) > Java Program

Theoretical Computer Science Finite State Machine (String abab) > Java Program import java.io.*; class FSMS1 {

Finite State Machine (4 Bit Numbers) > Java Program

Theoretical Computer Science Finite State Machine (4 Bit Numbers) > Java Program import java.io.*;  class FSM  { 

Convert Channel > Java Program

System Security Convert Channel > Java Program Covert Channel is type of computer security attack that transfers information in a way that violates a security policy.Covert channel have been defined by Lampson in 1973 as a communication channel not designed for any kind of information transfer.There are different types of covert channels such as storage Channel ,Timing Channel,Termination Channel,Resource Channel,Power Channel.A covert channel is so called because it is hidden from the access control mechanisms of ultra-high-assurance secure operating systems

CAPTCHA > Java Applet Program

Image
System Security CAPTCHA > Java Applet Program CAPTCHA is challenge response test most often placed within form to determine that the user is a human being and not a machine. CAPTCHA is a form of access control.A CAPTCHA images shows a random string which user has to type to submit a form. CAPTCHA generates and grades the test that human can pass but current computer program cannot.since computers are assumed to be unable to solve CAPTCHA,any user entering a correct format is presumed to be human. CAPTCHA are mainly used by websites that offers services like online polls and registration forms.

Caesar Cipher > Java Program

System Security Caesar Cipher > Java Program In cryptography Caesar cipher is one of the simple and most widely used Encryption algorithm.Caesar cipher is special case of shift cipher.Caesar cipher is substitution cipher where letter in plain text is replaced by some other letter.If shift is 3 then A letter is replaced by D,B is replaced by E and so on. import java.io.*; import java.lang.*; class CaesarCipher {

RC4 Encryption Algorithm > Java Program

System Security RC4 Encryption Algorithm > Java Program In cryptography  is most widely used software stream cipher and is used popular protocols such as secure socket layer(SSL) and wep. RC4 has variable length key. RC4 is developed by Ronald Rivest which require secure exchange of shared key..RC4 algorithm operates in OFB (output feedback mode) ,where block cipher is implemented as stream cipher.RC4 generates pseudo-random stream of bits.In RC4 algorithm key stream is completely independent of plain text.  import java.io.*;  class rc4  { 

RSA Algorithm > Java Program

System Security RSA Algorithm > Java Program RSA is a public key encryption algorithm and the name RSA derived from it's investors Rivest,Shamir,Adleman.RSA works on the principle that says it is too difficult to find the factor of large prime numbers.   import java.io.*;  import java.math.*;  class rsa  {  public static void main(String args[])throws IOException  { 

Intrusion Detection System (IDS) > Java Program

System Security Intrusion Detection System (IDS) > Java Program  Intrusion Detection System-IDS is a device that provides early warning of an intrusion so that defensive action can be taken to prevent or minimize damage.Intrusion Detection System-IDS detects unusual pattern of activity which may be malicious or suspicious.Intrusion Detection System-IDS consist of counter measure response unit.Event database,Event generator,event analyzer.Intrusion Detection System-IDS is responsible for monitoring and analyzing both user and system activities,Tracking user policy violations etc. import java.io.*; import java.util.*; class IDS 

To Perform Binary Search > C Program

Analysis of Algoritm To Perform Binary Search > C Program #include<stdio.h> #include<conio.h> int binarysearch(int arr[],int n,int x); void main() {

Quick Sort > C Program

Analysis of Algorithm Quick Sort > C Program #include<stdio.h> #include<conio.h> void quick(int a[],int lb,int ub); int partition(int a[],int lb,int ub); void main() {       

Selection Sort > C Program

Analysis of Algorithm Selection Sort > C Program #include<stdio.h> #include<conio.h> void select(int x[],int n); void main() {

Fibonacci Series > Java Program

Analysis of Algorithm Fibonacci Series > Java Program import java.util.*;  class Fibonacci  {   public static void main(String args[])throws Exception   {   

Merge Sort (Non Recursive) > C Program

Analysis of Algorithm Merge Sort (Non Recursive) > C Program #include<stdio.h> #include<conio.h> void merge(int x[],int lb1,int ub1,int ub2) {

Merge Sort (Recursive) > C Program

Analysis of Algorithm Merge Sort (Recursive) > C Program #include<stdio.h> #include<conio.h> void merge(int x[],int lb1,int ub1,int ub2) {

Knapsack Problem > Java Program

Analysis of Algorithm Knapsack Problem > Java Program import java.io.*;  class knapsack  {  public static void main(String args[])throws IOException  { 

Hamiltonian Cycle > Java Program

Analysis of Algorithm Hamiltonian Cycle > Java Program import java.io.*;  public class Hamiltonian  {  static boolean found = false;  public static void main(String args[]) throws IOException  { 

Merge Sort > Java Program

Analysis of Algorithm Merge Sort > Java Program import java.io.*;   class MergeSort   {   public static void main(String args[ ])   {  

Kruskal's Algorithm > Java Program

Analysis of Algorithm Kruskal's Algorithm > Java Program import java.io.*;  class kruskal  {  p ublic static void main(String args[])throws IOException  { 

Prim's Algorithm > Java Program

Analysis of Algorithm Prim's Algorithm > Java Program import java.io.*; class prim { public static void main(String args[])throws IOException {

Graph Coloring > Java Program

Analysis of Algorithm Graph Coloring > Java Program import java.util.*;  class GraphColoring  {   private int adj[][],x[],m,n;   public GraphColoring()   {   

Next Fit > Java Program

Computer Organization and Architecture Next Fit > Java Program import java.io.*;  class NFit  {  public static void main(String args[]) throws IOException  {         

Shortest Job First (SJF) Scheduling Non - Preemptive > Java Program

Computer Organization and Architecture Shortest Job First (SJF) Scheduling > Java Program /* A different approach to CPU scheduling is Shortest job first(sjf) scheduling algorithm.This associates with each process the length of the latter next CPU burst.When the CPU is available it is assigned to the process that has the smallest next CPU burst.if two processes have same length next CPU burst,FCFS scheduling is used to break the tie.Note that a more appropriate term would be the shortest next CPU burst ,because the scheduling is done by examining the length of the next CPU burst because the scheduling is done by examining the length of the next CPU burst of a process,rather than its total length.The real difficulty in Shortest job first(sjf) scheduling algorithm is knowing the length of the next process.Shortest job first(sjf) scheduling algorithm is provably optimal.in that it gives the minimum average waiting time for a given set of processes. */

Best Fit Algorithm > Java Programs

Computer Organization and Architecture Best Fit Algorithm > Java Programs import java.io.*; class best { public static void main(String args[])throws IOException {

First Fit Algorithm > Java Program

Computer Organization and Architecture First Fit Algorithm > Java Program import java.io.*; class firstfit  {  public static void main(String args[])throws IOException {

2D Transformations > C Program

Computer Graphics 2D Transformations > C Program #include<stdio.h> #include<conio.h> #include<graphics.h> #include<math.h> int x1,x2,x3,y1,y2,y3,x11,x22,x33,y11,y22,y33,xc,yc,xmax,ymax;

Sutherland-Hodgeman Polygon Clipping Algorithm > C Program

Computer Graphics Sutherland-Hodgeman Polygon Clipping Algorithm > C Program #include<stdio.h> #include<conio.h> #include<graphics.h> #define round(a) ((int)(a+0.5)) int k; float xmin,ymin,xmax,ymax,arr[20],m; void clipl(float x1,float y1,float x2,float y2) {

To Perform Strassen's Matrix Multiplication > C Program

Analysis of Algorithm To Perform Strassen's Matrix Multiplication > C Program #include<stdio.h> #include<conio.h>     int main() {

N Queen Problem > C Program

To implement NQueen Problem > C Program Analysis of Algorithm, Artificial Intelligence Program: #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<math.h> int *x; int place(int k,int i) {

Finding Longest Common Sub-sequence > C Program

Analysis of Algorithm Finding Longest Common Sub-sequence > C Program #include<stdio.h> #include<conio.h> #include<string.h> char b[20][20]; int c[20][20]; int m,n; void lcs(char x[],char y[]) {

All Pair Shortest Path Algorithm > C Program

Analysis of Algorithm All Pair Shortest Path Algorithm > C Program #include<stdio.h> #include<conio.h> int cost[10][10],a[10][10],i,k,j,c; int min(int a,int b) {

Midpoint Ellipse Algorithm > C Program

Computer Graphics Midpoint Ellipse Algorithm > C Program   #include <stdio.h>   #include <conio.h>   #include <graphics.h>   #include <dos.h>   int main() {

Moving Car > C Program

Computer Graphics Moving Car > C Program #include <graphics.h> #include <dos.h> #include <conio.h>  main() {

Polygon Clipping Algorithm by sutherland and hodgeman > C Program

Computer Graphics Polygon Clipping Algorithm by sutherland and hodgeman > C Program #include<stdio.h> #include<conio.h> #include<graphics.h>

Dynamic Programming > Optimal binary search tree > C Program

Analysis of Algorithms Dynamic Programming > Optimal binary search tree > C Program #include<stdio.h> #include<conio.h> #define MAX 10 void main() {

Fitting a Binomial Distribution>Scilab

 Applied Mathematics Fitting a Binomial Distribution>Scilab X=[0 1 2 3 4] P=[0 0 0 0 0] F=[17 52 54 31 6]

E(X) AND V(X) AND MOMENTS OF PROBABILITY DISTRIBUTION FUNCTION> Scilab

Applied Mathematics E(X) AND V(X) AND MOMENTS OF PROBABILITY DISTRIBUTION FUNCTION> Scilab X=[0 1 2 3 4] PX=[0.41 0.41 0.15 0.02 0.01] EX=0,VX=0,M1=0,M2=0,M3=0,M4=0,s1=0,s2=0,s3=0; for(i=1:5)

Minimum And Maximum using Divide and Conquer > C Program

Analysis of Algorithm Minimum And Maximum using divide and conquer #include<stdio.h> #include<conio.h> void minmax(int i,int j,int *min, int *max); int a[20]; void minmax(int i,int j,int *min, int *max) {

REGRESSION LINES > Scilab

Applied Mathematics REGRESSION LINES > Scilab X=[10 12 13 16 17 20 25] Y=[19 22 24 27 29 33 37] Sx=0;Sy=0;Sx2=0;Sy2=0;Sxy=0;byx=0;bxy=0;Mx=0;My=0;

CORRELATION COEFFICIENT BY KARL PEARSON METHOD > Scilab

Applied Mathematics CORRELATION COEFFICIENT BY KARL PEARSON METHOD > Scilab X=[12 17 22 27 32] Y=[113 119 117 115 121] Sx=0;Sy=0;Sxy=0;Sx2=0;Sy2=0;r=0;Mx=0;My=0;

Implement Multiplication of two unsigned n-bit binary numbers with shift and add method. > Java Program

Computer Organization and Architecture A Java Program for Implement Multiplication of two unsigned n-bit binary numbers with shift and add method. The numbers are taken as input from the user in decimal form and must be converted from decimal to binary form as required. The final answer should be shown to the user in both decimal and binary form. import java.util.*; //Importing all classes of Util Package public class BitMultiply //Creating a class named BitMultiply  {

Bezier Curve > C Program

Computer Graphics Bezier Curve > C Program #include<graphics.h> #include<math.h> int x[4],y[4]; void bezier(int x[4],int y[4]) { int gd=DETECT,gm,i;

Bresenham's Line Drawing Algorithm > C Program

Computer Graphics Bresenham's Line Drawing Algorithm > C Program #include<stdio.h> #include<conio.h> #include<graphics.h> void main() {