Sunday, November 27

ANDROID GRAPHICS APPLICATION ~ BASIC CODES

 This post include: Complete code for a simple graphics application in Android. Concept of process in Android. Use of Thread in Android programming. Welcome friend,  Here I'm posting the basic code for a simple Graphics application in Android ~ a "WELCOME-SCREEN"..!! For any application, welcome screen is a must .(remember any game starts with an attractive welcome note,isnt it?).So chose to start graphics coding with craeting a welcome screen.  summary of application:: When we open this application, a welcome screen will splash out and stay for a while. We can also close this screen by pressing DOWN...

Thursday, November 24

Disable Java Update Notification

Fed up with getting prompted to update Java, or if you have some web application like Banner that requires a particular version??? You can use a simple registry hack to disable notification of available updates...!!! (1). Open the Registry Editor by going to the Start button and typing in regedt32. (2).Navigate through to the following key: HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Update\Policy (3).Change the value of EnableAutoUpdateCheck to 0 and the value of EnableJavaUpdate to 0. Java should no longer prompt you for the annoying updates. Enjoy..!!! Is this trick useful??  Comment here.. Thank you.!!  ...

Tuesday, November 22

5 PROCESSES TO CHECK ARMSTRONG AND REVERSE OF NUMBER~ Unix Program

Hi reader,   Here our task is : Create 5 processes. Find whether a number is Armstong and Reverse the same using these processes. A :Accept number. C:Find whether it is armstrong. D:Print Result. B:Calculate Reverse of the Number. E:Display Reverse. Here is the complete Program. #include<stdio.h> #include<unistd.h> main() {             //initially in A int num,f1,f2,f3,f4,p1[2],p2[2],p3[2],p4[2],arm,rev,flag=0; pipe(p1); pipe(p2); f1=fork();  //A created B if(f1>0)    //A is working .. { f2=fork();  //A created...

Monday, November 21

Lex program ~ Read and copy file content

This lex program will read an input file and copy the content with line number to another file. %{ #include<stdio.h> #include<string.h> char line[20]; int count=0,i=0; FILE *out; %} %% ['\n'] { fprintf(out,"%d %s\n",++count,line);} (.*) { strcpy(line,yytext); }%% main() { yyin=fopen("in.c","r"); out=fopen("out.c","w"); yylex(); getch(); } int yywrap() { return 1; } input main() { int i=9, j=900,k=115; printf("%d,i+j+k); } output file 1 main() 2 { 3 int i=9, j=900,k=115; 4 printf("%d,i+j+k); 5 } 6...

Read a file and copy content to other file~ C code

This C program will read an input file and copy the content to another file with Line numbers..!! #include<stdio.h> main() {       FILE *f1,*f2;       int t=0;       char line[20];       f1=fopen("in.c","r");       f2=fopen("out.c","w");           while(!feof(f1)){       fgets(line,20,f1);       t++;       fprintf(f2,"%d  %s",t,line);       }     ...

Lex- Collect Tokens and sort

Hello friend,   Here I am with an interesting Lex program which sorts all the nubers from input file and sort them. If you are well-familiarised with lex paradigm, it is very easy task. Things to remember: The definition [0-9]+ can detect all the numbers from input The number detected at present will be pointed by yytext and have length yyleng Whenever a new token (here a number) is detected, yytext will be replaced with new value.  Logic Read the input If a number is detected, store it in an array (we can use yytext and yyleng for this). Read each digit --> multiply with 10 --> add next digit -->continue upto last digit.   for eg, to read 123 initialise num=0; read 1--> num=num*10+1-->num=0+1-->num=1 read 2--> num=num*10+2-->num=10+2-->num=12 read...

Sunday, November 20

Quadruple ~ C code

#include<stdio.h> #include<string.h> main() {  char line[20]; int s[20]; int t=1;       int i=0;      printf("Enter string..  :"); gets(line); for(i=0;i<20;i++)s[i]=0; printf("op\ta1\ta2\tres\n"); for(i=2;line[i]!='\0';i++) { if(line[i]=='/' || line[i]=='*') {                 printf("\n"); if(s[i]==0) { if(s[i+1]==0) { printf(":=\t%c\t\t t%d\n",line[i+1],t); s[i+1]=t++; } printf("%c\t",line[i]); (s[i-1]==0)?printf("%c\t",line[i-1]):printf("t%d\t",s[i-1]); printf("t%d \t t%d",s[i+1],t); s[i-1]=s[i+1]=t++; s[i]=1; } } } for(i=2;line[i]!='\0';i++) { if(line[i]=='+' || line[i]=='-') {                ...

Friday, November 18

Lex and Yacc in Windows 7 - Compile and Run

Hi Friend, I was in search for a long time to get a platform in windows-7 to run lex and Yacc ,for academic purposes. Many of my friends also had the same problem and often forced to choose Linux only for merely executing Lex & Yacc programs..!!! At last, I found one solution and its my pleasure to share it with all of you.!!  :) Its very simple.You need to download two very small files. You have to download two executable( i.e.,   .exe files). In total,its size may have about 370KB. To download them click the links below. Link 1:   Flex Link 2:  Bison Save both files in same place....

Wednesday, November 16

1. Copy this line. 2. Paste it as a comment. 3.Delete "+" sign 4.press enter See the magic..!!! :) @+[178952746....:0]

‎ Hi friend ..  This time I would like to share a trick to make a nice 'magic' comment in FB. For example..the post will be like this: 1. Copy this line. 2. Paste it as a comment. 3.Delete "+" sign 4.press enter See the magic..!!! :) @+[258129740903222:0] On doing  as this post, the number will automatically vanished and replaced by "LoVe U my dear friend - by vipin" :):):) wow.. Cool na?? You too can make your own magic comment (with your name, to ur dear ones)!! Only 5 steps are needed. # Make your own Facebook page.  You can find the option for page creation at the bottom side of the page as...

Tuesday, November 15

LEX program to check a Date (dd/mm/yyyy)

Hello dude..                I would like to discuss a problem asked by my teacher in our internal lab exam- LEX program to check the validity of a Date. Ahem..In normal programming (i.e, that with C or Java) this is not a big deal!! But in Lex paradigm,it require some more effort..!!                                                 ...

Tuesday, November 1

FOLLOW OF GIVEN GRAMMAR USING C PROGRAM

Hello reader, In this post I am posting implementation of FOLLOW in C. Note: If your production statements contain multiple terms connected by '|'  then give these terms as separate productions   #include<stdio.h> #include<string.h> int n,m=0,p,i=0,j=0; char a[10][10],followResult[10]; void follow(char c); void first(char c); void addToResult(char); int main() { int i; int choice; char c,ch; printf("Enter the no.of productions: "); scanf("%d", &n); printf(" Enter %d productions\nProduction with multiple terms should be give as separate productions \n", n); for(i=0;i<n;i++) scanf("%s%c",a[i],&ch); ...
Page 1 of 3012345Next