EmbLogic's Blog

project-1 ( mdc ): compression of text file (4-bit) : rcs status

1
2 RCS file: mdc.c,v
3 Working file: mdc.c
4 head: 1.22
5 branch:
6 locks: strict
7 access list:
8 symbolic names:
9 keyword substitution: kv
10 total revisions: 22;    selected revisions: 22
11 description:
12 Creating the rcs file
13 first run
14 —————————-
15 revision 1.22
16 date: 2014/07/02 19:19:01;  author: root;  state: Exp;  lines: +78 -2
17 new : added prototype compress_file(char *fileName) to header.h, and implemented the same in mdc.c.
18 now the program compresses the text file instead of the master array.
19 program execution successful.
20 4-bit compression successful.
21 —————————-
22 revision 1.21
23 date: 2014/07/01 11:06:01;  author: root;  state: Exp;  lines: +0 -1
24 removed the problem from the previous revision.
25 successfully compressed the master array.
26 —————————-
27 revision 1.20
28 date: 2014/07/01 11:04:06;  author: root;  state: Exp;  lines: +11 -3
29 changed the datatype of the ch, and c variable from char to unsigned char.
30 Problem : whenever the value of char variable goes beyond 127, it gives unexpectd results.
31 —————————-
32 revision 1.19
33 date: 2014/07/01 06:56:11;  author: root;  state: Exp;  lines: +9 -2
34 testing compressed file.
Type  :quit<Enter>  to exit Vim                                                                                                     1,0-1         Top

Posted in Uncategorized | Leave a comment

MY LINKEDIN PROFILE

Posted in Uncategorized | Leave a comment

conversion of lower case character of string to uppercase character of any string

RCS file: conversion.c,v
Working file: conversion.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this program converts the lowercase or upercase character of string into upercase and lowercase character respectively
we pass the string through command line
—————————-
revision 1.1    locked by: root;
date: 2014/07/01 12:51:41;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment

process duplication and using wait function

RCS file: wait.c,v
Working file: wait.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
implementing the wait()
using WIFEXITED() and WEXITSTATUS()
—————————-
revision 1.1    locked by: root;
date: 2014/07/01 12:43:08;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment

completed upto compression of masterarray

1
2 RCS file: mdc.c,v
3 Working file: mdc.c
4 head: 1.1
5 branch:
6 locks: strict
7 access list:
8 symbolic names:
9 keyword substitution: kv
10 total revisions: 1; selected revisions: 1
11 description:
12 Completed upto to compression of master array
13 —————————-
14 revision 1.1
15 date: 2014/07/01 11:26:33; author: root; state: Exp;
16 Initial revision
17 =============================================================================
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
“log_file” 17L, 418C 1,0-1 All

Posted in Uncategorized | Leave a comment

a prog. to find out Largest & smallest no. from given five no.s………..

1#include<stdio.h>
2 int main()
3 {
4 int x[5],l,s,i,j,k,z=0;
5 while(z<3)
6 {
7 printf(“\nenter any five numbers : “);
8 for(i=0;i<5;i++)
9 {
10         scanf(“%d”,&x[i]);
11 }
12 l=x[0];
13 s=x[4];
14 for(j=1;j<5;j++)
15 {
16  if(l<x[j])
17  {  l=x[j]; }
18 }
19 printf(“largest no. is : %d “,l);
20 for(k=0;k<4;k++)
21 {
22 if(s>x[k])
23 {
24 s=x[k];
25 }
26 }
27 printf(“smallest no. is : %d”,s);
28 z++;
29 } }

Posted in Data Structures with C | Leave a comment

Multiple data compression (upto code length calculation)

RCS file: mdc_using_functions.c,v
Working file: mdc_using_functions.c
head: 1.4
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;     selected revisions: 4
description:
reading characters from the file & adding to the master array
—————————-
revision 1.4
date: 2014/06/30 10:48:53;  author: root;  state: Exp;  lines: +21 -3
gave defination for function code_length_conv for finding code length
—————————-
revision 1.3
date: 2014/06/30 09:44:43;  author: root;  state: Exp;  lines: +4 -1
finding no of distnict in master_array
—————————-
revision 1.2
date: 2014/06/30 09:37:46;  author: root;  state: Exp;  lines: +15 -3
gave the defination for function data_compress for adding distnict char to master array
—————————-
revision 1.1
date: 2014/06/30 07:17:55;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Project 2: Multiple Data Compression and Encryption | Leave a comment

a simple program to add ‘n’ numbers…

1 #include<stdio.h>
2 int main()
3 {
4  int num[100],sum=0,n,i,ret;
5  printf(“enter the number of values u want 2 add\n”);
6  scanf(“%d”,&n);
7  printf(“enter the values\n”);
8  for(i=0;i<n;i++)
9   {
0   scanf(“%d”,&num[i]);
1   sum=sum+num[i];
2   }
3   printf(“sum=%d\n”,sum);
4   ret = printf(“sum=%d\n”,sum);
5   printf(“ret=%d\n”,ret);
6   return 0;
7
8  }

Posted in Data Structures with C | Leave a comment

Multiple Data Compression completed upto Code Length Calculation

RCS file: mdc.c,v
Working file: mdc.c
head: 1.5
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 5; selected revisions: 5
description:
This is the program with an array storing all the present characters in the file.
—————————-
revision 1.5
date: 2014/06/28 19:43:49; author: root; state: Exp; lines: +26 -4
finding codelength for the no of distinct characters in file.
/
—————————-
revision 1.4
date: 2014/06/28 19:23:09; author: root; state: Exp; lines: +6 -6
returned ndc from copy_masterarray function to obtain no of distinct characters
—————————-
revision 1.3
date: 2014/06/28 18:42:56; author: nitesh; state: Exp; lines: +2 -1
calculated ndc
—————————-
revision 1.2
date: 2014/06/28 17:51:11; author: nitesh; state: Exp; lines: +54 -34
this program generates an array of distinct characters of file.
—————————-
revision 1.1
date: 2014/06/28 16:02:14; author: nitesh; state: Exp;
Initial revision
=============================================================================
“log_mdcproram” 34L, 1130C 34,1 All

Posted in Project 2: Multiple Data Compression and Encryption | Leave a comment

mdc : completed upto code length calculation.

1
2 RCS file: mdc.c,v
3 Working file: mdc.c
4 head: 1.9
5 branch:
6 locks: strict
7 access list:
8 symbolic names:
9 keyword substitution: kv
10 total revisions: 9;     selected revisions: 9
11 description:
12 Creating the rcs file
13 first run
14 —————————-
15 revision 1.9
16 date: 2014/06/29 20:11:56;  author: root;  state: Exp;  lines: +31 -0
17 added cal_codeLength() to header.h (calculate the code length for a given no. of distinct characters).
18 implemented the cal_codeLength() function.
19 output : as intended; printed the correct code length.
20 —————————-
21 revision 1.8
22 date: 2014/06/29 19:55:27;  author: root;  state: Exp;  lines: +7 -2
23 solved the problem from the previous revision.
24 converted the characters to lower case before adding them to the master array.
25 program executed successfully.
26 —————————-
27 revision 1.7
28 date: 2014/06/29 19:50:33;  author: root;  state: Exp;  lines: +1 -0
29 problem : the addition of the characters to the masterArray is case sensitive.
30              “I” and “i” are treated as different characters.
31 change :
32              added the <ctype.h> header file in header.h
33 —————————-
34 revision 1.6
“log_file” 68L, 2747C                                                                                                               1,0-1         Top

Posted in Project 2: Multiple Data Compression and Encryption | Tagged | Leave a comment

MDC : adding only the distinct characters to the master array.

1
2 RCS file: mdc.c,v
3 Working file: mdc.c
4 head: 1.5
5 branch:
6 locks: strict
7 access list:
8 symbolic names:
9 keyword substitution: kv
10 total revisions: 5;     selected revisions: 5
11 description:
12 Creating the rcs file
13 first run
14 —————————-
15 revision 1.5
16 date: 2014/06/29 19:22:07;  author: root;  state: Exp;  lines: +23 -5
17 Changes :
18 Implemented inMasterArray() function , to check if the element is already present in the array.
19 Added a new prototype inMasterArray(char, int) in the header.h.
20 Output:
21         as intended;
22         prints the master array with only the distinct characters stored in it.
23 —————————-
24 revision 1.4
25 date: 2014/06/28 19:33:11;  author: root;  state: Exp;  lines: +3 -1
26 removed the problem of the preceding revision.
27 program executed as intended. (read contents from the file and copy all the contents to the master array).
28 —————————-
29 revision 1.3
30 date: 2014/06/28 19:29:55;  author: root;  state: Exp;  lines: +38 -0
31 Created the master array.
32 Added all the characters of the file in the master array.
33 Problem : not printing the complete master array at the end, as intended.
34 —————————-
1,0-1         Top

Posted in Project 2: Multiple Data Compression and Encryption | Leave a comment

Multiple Data Compression Program Upto Code Length

#include<stdio.h>
#include<stdlib.h>
#include<fcntl.h>

int open_file(char *);
int creat_masterarray(int );
int find_loc(char , char *, int);
int code_length(int );
int open_file(char *filename)
{
int fd;
fd = open(filename,O_RDONLY);
if(fd<0)
{
perror(“open”);
goto OUT;
}
printf(“File Opened Successfully. fd = %d\n”,fd);
return fd;

OUT:   exit(EXIT_FAILURE);
}

int creat_masterarray(int fd)
{
char ch,*master;
int count,flag=0,loc;

while(1)
{
count = read(fd,&ch,1);

if(count<0)
{
perror(“read”);
goto OUT;
}

if(ch == 10)
{
break;
}

if(flag==0)
{
master=(char *)malloc(1);
*master=ch;
flag++;
}
else
{
master=realloc(master,flag+1);
loc = find_loc(ch,master,flag);
if(loc)
{

*(master+flag)=ch;
flag++;
}
}

}

printf(“master array = %s”,master);
return flag;

OUT:
exit(EXIT_FAILURE);
}

int find_loc(char ch,char *ma,int size)
{
int i;
for(i=0;i<size;i++)
{
if( ch == *(ma+i))
return 0;
}

return i;
}
int code_length(int ndc)
{
if(ndc<=3)
return 2;
else if(ndc<=7)
return 3;
else if(ndc<=15)
return 4;
else if(ndc<=31)
return 5;
else if(ndc<=63)
return 6;
else if(ndc<=127)
return 7;
else
;
}

int main(int argc,char *argv[])
{
int fd,ndc,cl;

fd = open_file(argv[1]);
ndc = creat_masterarray(fd);
cl = code_length(ndc);

printf(“\nNDC  = %d”,ndc);
printf(“\ncode length  = %d”,cl);

return 0;
}

Posted in Uncategorized | Leave a comment

Character driver upto write in multiple qsets

1
2 RCS file: newwrite.c,v
3 Working file: newwrite.c
4 head: 1.1
5 branch:
6 locks: strict
7 emblogic1: 1.1
8 access list:
9 symbolic names:
10 keyword substitution: kv
11 total revisions: 1; selected revisions: 1
12 description:
13 write in multiple qsets successfully.
14 —————————-
15 revision 1.1 locked by: emblogic1;
16 date: 2014/06/29 09:24:43; author: emblogic1; state: Exp;
17 Initial revision
18 =============================================================================
~

Posted in Uncategorized | Leave a comment

How to create FTP server on Linux ?

In the Last session we learn how to create FTP Server On Linux. To create FTP server there are few steps to follow which are given below. Mostly FTP are used as one of the most common  means of copying files between server over the internet . there are several steps which are given below

[1] first become super user by using su - command

[2]then check rpm package by using rpm -i vsftpd

[3] now configure FTP server according to our requirement by using vim/etc/vsftpd.conf

and change it according to the our requirement

[4] now start the service by using service vsftpd start command

[5]setup

[6]FTP

 

 

 

Posted in Uncategorized | Leave a comment

FTP server configuration

day before yesterday i’ve learnt how to configure FTP server, & also added one group with some users in that server whose directory is in / & changed the ownership & permission given to group users using chmod command………….

Posted in Data Structures with C | Leave a comment