URDINESH: August 2015

Tuesday, August 11, 2015

KENDO GRID CHANGE HEIGHT TO DISPLAY MANY RECORDS

Hi All,

Many of us struck with displaying more no records in a scroll-able Kendo Grid.

We can adjust the height of the Kendo grid so that we can make more no of records viewed by the users,

Here is the solution,



 If you want all over the application the kendo grid should be of same height then, in the Kendo.default.min.css file give the following style,

div .k-grid-content 
{

max-height: 900px;

}

OR

If you want for a particular page alone means in that page include the above mentioned style in the top where we are declaring script blocks

div .k-grid-content 
{

max-height: 900px;

}

Now Check your kendo grid by running the code...

Saturday, August 1, 2015

Extract text From Shared Memory & Print it in Uppercase


PROGRAM: 

#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/msg.h>
#include<sys/shm.h>
#include<unistd.h>
#include<stdio.h>
#include<sys/stat.h>
#include<string.h>
main()
{
int shmid,i;
char *pa,a[1000];
shmid=shmget((key_t)1300,1024,0600|IPC_CREAT);
if(shmid==-1)
{printf("shmget failed");
return;
}
pa=(char*)shmat(shmid,0,0);
if(pa==(void *)-1)
{
printf("shmat failed");
return;
}
for(i=0;pa[i]!='\0';i++)
{
if(pa[i]>='a'&&pa[i]<='z')
pa[i]=pa[i]-32;
else
continue;
}
printf("\nUppercase Message : %s",pa);

}


OUTPUT:



[user @localhost ~]$ cc umgsh.c
[user @localhost ~]$ ./a.out

Uppercase Message : MESSAGE STORED IN SHARED MEMORY
SHARED MEMORY PROGRAMS
[user @localhost ~]$


Storing Lower case Message in Shared Memory-I


#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/msg.h>
#include<sys/shm.h>
#include<unistd.h>
#include<stdio.h>
#include<sys/stat.h>
#include<string.h>
main()
{
int shmid,i;
char *pa,a[1000];
shmid=shmget((key_t)1300,1024,0600|IPC_CREAT);
if(shmid==-1)
{printf("shmget failed");
return;
}
pa=(char*)shmat(shmid,0,0);
if(pa==(void *)-1)
{
printf("shmat failed");
return;
}
printf("Enter text&press$to terminate\n");
for(i=0;(a[i]=getchar())!='$';i++);
a[i]='\0';
strcpy(pa,a);
printf("The given text is placed into shared memory\n");
}






OUTPUT


[user@localhost ~]$ cc mgsh.c
[user @localhost ~]$ ./a.out
Enter text&press$to terminate
Message stored in shared memory
shared memory programs$
The given text is placed into shared memory

[user @localhost ~]$ 

MarkSheet Preparation Using SharedMemory –II

 PROGRAM:

#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/msg.h>
#include<sys/shm.h>
#include<unistd.h>
#include<stdio.h>
#include<sys/stat.h>
#include<string.h>
struct stud
{char name[25];
int roll,m1,m2,m3,tot;
float avg;
};
main()
{struct stud m,*p;
p=&m;
int shmid;
shmid=shmget((key_t)1300,1024,0660|IPC_CREAT);
if(shmid==-1)
{printf("shmget failed");
return;
}
p=(struct stud *)shmat(shmid,0,0);
if(p==(void *)-1)
{printf("shmat failed");
return;
}
p->tot=p->m1+p->m2+p->m3;
p->avg=(float)p->tot/3.0;
printf("\nNAME: %s",p->name);
printf("\nROLLNO:%d",p->roll);
printf("\nMARK1:%d",p->m1);
printf("\nMARK@:%d",p->m2);
printf("\nMARK#:%d",p->m3);
printf("\nTOTAL:%d",p->tot);
printf("\nAVERAGE:%f",p->avg);
}




OUTPUT:


[user @localhost ~]$ cc cmarsh.c
[user @localhost ~]$ ./a.out

NAME: Kannan
ROLLNO:987
MARK1:89
MARK@:98
MARK#:78
TOTAL:265

AVERAGE:88.333336[user @localhost ~]$

MarkSheet Preparation Using SharedMemory –I

PROGRAM:

#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/shm.h>
#include<unistd.h>
#include<stdio.h>
#include<sys/stat.h>
#include<string.h>
struct stud
{
char name[25];
int roll,m1,m2,m3,tot;
float avg;
};
main()
{
struct stud m,*p;
p=&m;
int shmid;
shmid=shmget((key_t)1300,1024,0600|IPC_CREAT);
if(shmid==-1)
{printf("shmget failed");
return;
}
p=(struct stud *)shmat(shmid,0,0);
if(p==(void *)-1)
{
printf("shmat failed");
return;
}
printf("Enter the name:\n");
scanf("%s",p->name);
printf("Enter the Roll.No:\n");
scanf("%d",&p->roll);
printf("Enter the marks  got in 3 subject: \n");
scanf("%d%d%d",&p->m1,&p->m2,&p->m3);
printf("\nThe given information is placed in shared memory\n");
}


OUTPUT:

[user @localhost ~]$ cc marsh.c
[user @localhost ~]$ ./a.out
Enter the name:
Kannan
Enter the Roll.No:
987
Enter the marks  got in 3 subject:
89 98 78

The given information is placed in shared memory
[user @localhost ~]$


Length of the string using Shared Memory-II

Program:

#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/msg.h>
#include<sys/shm.h>
#include<unistd.h>
#include<stdio.h>
#include<sys/stat.h>
#include<string.h>
main()
{
int shmid,i,len;
char *pa,a[1000];
shmid=shmget((key_t)1300,1024,0600|IPC_CREAT);
if(shmid==-1)
{printf("shmget failed");
return;
}
pa=(char*)shmat(shmid,0,0);
if(pa==(void *)-1)
{
printf("shmat failed");
return;
}
len=strlen(pa);
printf("\nThe length of the text is : %d\n",len);
}




OUTPUT:

[user @localhost ~]$ cc lenshm.c
[user @localhost ~]$ ./a.out

The length of the text is : 54

[user @localhost ~]$

Length of the string using Shared Memory

Program

#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/msg.h>
#include<sys/shm.h>
#include<unistd.h>
#include<stdio.h>
#include<sys/stat.h>
#include<string.h>
main()                 
{
int shmid,i;
char *pa,a[1000];
shmid=shmget((key_t)1300,1024,0600|IPC_CREAT);
if(shmid==-1)
{printf("shmget failed");
return;
}
pa=(char*)shmat(shmid,0,0);
if(pa==(void *)-1)
{
printf("shmat failed");
return;
}
printf("Enter text&press$to terminate\n");
for(i=0;(a[i]=getchar())!='$';i++);
a[i]='\0';
strcpy(pa,a);
printf("The given text is placed into shared memory\n");
}


OutPut


[user@localhost ~]$ cc mgsh.c
[user @localhost ~]$ ./a.out
Enter text&press$to terminate
Message stored in shared memory
shared memory programs$
The given text is placed into shared memory
[user @localhost ~]$ 

Followers