Sunday, 3 November 2013

Computer Science Engineer unemployment in INDIA

Dear readers,
                 As i found most 80% of computer science engineers are unemployed in India.Even qualified students are rejected since they are fresher.This causing ultimate unemployment of students who had completed their courses.Many movie actress/actor are getting lavishly paid despite their work.I saw people working in movie getting 500000 rupee per week and University topper working in small IT company and getting 230000 rupee p.a .What does the company needs? How does this issue can be solved? How education in India going to boom? These questions are not yet answered.This may or may not be changed,please comment your review.
                                                                                                                    Thank you,
                                                                                                                 Naren Viswanath S.M 

Tuesday, 23 July 2013

Simulation of ARP/RARP using client&server


//ARP SERVER
#include<stdio.h>
#include<sys/types.h>
#include<sys/shm.h>
#include<string.h>
main()
{
int shmid, a, i;
char *ptr, *shmptr;
shmid=shmget(3000,10,IPC_CREAT | 0666);
shmptr=shmat(shmid,NULL,0);
ptr=shmptr;
for(i=0;i<3;i++)
{
puts("enter the mac");
scanf("%s",ptr);
a=strlen(ptr);
printf("string length:%d",a);
ptr[a]= ' ' ;
puts("enter ip");
ptr=ptr+a+1;
scanf("%s",ptr);
ptr[a]='\n' ;
ptr= ptr+a+1;
}
ptr[strlen(ptr)]= '\0';
printf("\n ARP table at serverside is=\n%s", shmptr);
shmdt(shmptr);
}

ARP table at serverside is
a.b.c.d 1.2.3.4
e.f.g.h 5.6.7.8
i.j.k.l 9.1.2.3

//ARP CLIENT
#include<stdio.h>
#include<string.h>
#include<sys/types.h>
#include<sys/shm.h>
main()
{
int shmid,a;
char *ptr, *shmptr;
char ptr2[51], ip[12], mac[26];
shmid=shmget(3000,10,0666);
shmptr=shmat(shmid,NULL,0);
puts("the arp table is");
printf("%s",shmptr);
printf("\n1.ARP\n 2.RARP\n 3.EXIT\n");
scanf("%d",&a);
switch(a)
{
case 1:
puts("enter ip address");
scanf("%s",ip);
ptr=strstr(shmptr, ip);
ptr-=8;
sscanf(ptr,"%s%*s",ptr2);
printf("mac addr is %s",ptr2);
break;
case 2:
puts("enter mac addr");
scanf("%s",mac);
ptr=strstr(shmptr, mac);
sscanf(ptr,"%*s%s",ptr2);
printf("%s",ptr2);
break;
case 3:
exit(1);
}
}



SAMPLE INPUT OUTPUT:

the arp table is
a.b.c.d  1.2.3.4
e.f.g.h   5.6.7.8
i.j.k.l     9.1.2.3
1.ARP
2.RARP
3.EXIT
enter your choice: 1
enter ip address: 1.2.3.4
mac addr is a.b.c.d
enter your choice:2
enter mac address: e.f.g.h
ip addr is 5.6.7.8

Wednesday, 6 March 2013

New 2 pass assembler Program

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
FILE *fp1,*fp2,*fp3,*fp4;
char label[10],opcode[10],operand[10],symbol[10],code[10];
char mnemonic[5],character,add[10],objectcode[10];
int flag,flag1,locctr,location,loc;
clrscr();
fp1=fopen("out.dat","r");
fp2=fopen("p2out.dat","w");
fp3=fopen("optab.dat","r");
fp4=fopen("symtab.dat","r");
if(fp1==NULL)
{
printf("The file cannot be open");
}
if(fp2==NULL)
{
printf("The file cannot be open");
}
if(fp3==NULL)
{
printf("The file cannot be open");
}
if(fp4==NULL)
{
printf("The file cannot be open");
}
fscanf(fp1,"%s%s%s",label,opcode,operand);
if(strcmp(opcode,"START")==0)
{
fprintf(fp2,"%s\t%s\t%s\n",label,opcode,operand);
fscanf(fp1,"%d%s%s%s",&locctr,label,opcode,operand);
}
while(strcmp(opcode,"END")!=0)
{
flag=0;
fscanf(fp3,"%s%s",code,mnemonic);
while(strcmp(code,"END")!=0)
{
if((strcmp(opcode,code)==0)&&(strcmp(mnemonic,"*"))!=0)
{
flag=1;
break;
}
fscanf(fp3,"%s%s",code,mnemonic);
}
if(flag==1)
{
flag1=0;
rewind(fp4);
while(!feof(fp4))
{
fscanf(fp4,"%s%d",symbol,&loc);
if(strcmp(symbol,operand)==0)
{
flag=1;
break;
}
}
if(flag1==1)
{
itoa(loc,add,10);
strcpy(objectcode,strcat(mnemonic,add));
}
}
else if(strcmp(opcode,"BYTE")==0 || strcmp(opcode,"WORD")==0)
{
if((operand[0]=='C')||(operand[0]=='X'))
{
character=operand[2];
itoa(character,add,16);
strcpy(objectcode,add);
}
else
{
itoa(atoi(operand),add,10);
strcpy(objectcode,add);
}
}
strcpy(objectcode,"\0");
fprintf(fp2,"%s\t%s\t%s\t%s\n",label,opcode,operand,locctr,objectcode);
fscanf(fp1,"%d%s%s%s",&locctr,label,opcode,operand);
}
fprintf(fp2,"%s\t%s\t%s\n",label,opcode,operand,locctr);
fclose(fp1);
fclose(fp2);
fclose(fp3);
fclose(fp4);
getch();
}
INPUT FILE:
Out.dat
** START 2000
2000 ** LDA FIVE
2003 ** STA ALPHA
2006 ** LDCH CHARZ
2009 ** STCH C1
2012 ALPHA RESW 1
2015 FIVE WORD 5
2018 CHARZ BYTE C’Z’
2019 C1 RESB 1
2020 ** END **
Optab.dat
START *
LDA 03
STA 0F
LDCH 53
STCH 57
END *
Symtab.dat
ALPHA 2012
FIVE 2015
CHARZ 2018
C1 2019
OUTPUT FILE:
P2out.dat
** START 2000
** LDA FIVE 2000 032015
** STA ALPHA 2003 0F2012
** LDCH CHARZ 2006 532018
** STCH C1 2009 572019
ALPHA RESW 1 2012
FIVE WORD 5 2015 5
CHARZ BYTE C'Z' 2018 5a
C1 RESB 1 2019
** END ** 2020
A new programming language based on Arabic characters has been designed to try to open up software coding to more people from the Arab world.

The new coding language, dubbed Alb, which means heart in Arabic, has been developed by Lebanese computer scientist Ramsey Nasser, a fellow at the Eyebeam Art and Technology Center in New York, United States.
There was an error in this gadget