Skip to main content

Posts

Showing posts from April, 2013

What is Client Application Development in .net ?

Client applications are the closest to a traditional style of application in Windows-based programming. These are the types of applications that display windows or forms on the desktop, enabling a user to perform a task. Client applications include applications such as word processors and spreadsheets, as well as custom business applications such as data-entry tools, reporting tools, and so on. Client applications usually employ windows, menus, buttons, and other GUI elements, and they likely access local resources such as the file system and peripherals such as printers. Another kind of client application is the traditional ActiveX control (now replaced by the managed Windows Forms control) deployed over the Internet as a Web page. This application is much like other client applications: it is executed natively, has access to local resources, and includes graphical elements. In the past, developers created such applications using C/C++ in conjunction with the Microsoft Foundation Cl

What is .NET Framework Class Library ?

The .NET Framework class library is a collection of reusable types that tightly integrate with the common language runtime. The class library is object oriented, providing types from which your own managed code can derive functionality. This not only makes the .NET Framework types easy to use, but also reduces the time associated with learning new features of the .NET Framework. In addition, third-party components can integrate seamlessly with classes in the .NET Framework. For example, the .NET Framework collection classes implement a set of interfaces that you can use to develop your own collection classes. Your collection classes will blend seamlessly with the classes in the .NET Framework. As you would expect from an object-oriented class library, the .NET Framework types enable you to accomplish a range of common programming tasks, including tasks such as string management, data collection, database connectivity, and file access. In addition to these common tasks, the class lib

What is Common Language Runtime in .net ?

The common language runtime manages memory, thread execution, code execution, code safety verification, compilation, and other system services. These features are intrinsic to the managed code that runs on the common language runtime. With regards to security, managed components are awarded varying degrees of trust, depending on a number of factors that include their origin (such as the Internet, enterprise network, or local computer). This means that a managed component might or might not be able to perform file-access operations, registry-access operations, or other sensitive functions, even if it is being used in the same active application. The runtime enforces code access security. For example, users can trust that an executable embedded in a Web page can play an animation on screen or sing a song, but cannot access their personal data, file system, or network. The security features of the runtime thus enable legitimate Internet-deployed software to be exceptionally feature rich

What is Microsoft.NET Framework ?

The .NET Framework is a computing platform that simplifies application development in the highly distributed environment of the Internet. The .NET Framework is designed to fulfill the following objectives: To provide a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely. To provide a code-execution environment that minimizes software deployment and versioning conflicts. To provide a code-execution environment that guarantees safe execution of code, including code created by an unknown or semi-trusted third party. To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments. To make the developer experience consistent across widely varying types of applications, such as Windows-based applications and Web-based applications. To build all communication on industry standards to ensure that

C program to read a file and display its contents along with line numbers before each line.

#include<stdio.h> void main() { FILE *fp; char ch; char source[67]; int count = 1; clrscr(); puts("enter the file name:"); gets(source); fp=fopen(source,"r");// read only mode for the source file if(fp==NULL) { puts("unable to open the file:"); getch(); exit(); } clrscr(); printf("file name:%s",source); printf("\n line:-%d\t",count); while((ch=getc(fp))!=EOF) { if(ch=='\n') { count++; printf("\nline:-%d\t",count); } else { printf("%c",ch); } } printf("\n press any key..."); getch(); fclose(fp); } Also Read :  1)  Principles of Server Virtualization https://codingpush.blogspot.com/2021/01/principles-of-server-virtualization.html  2) Top Ten Data Storage Tools https://codingpush.blogspot.com/2021/01/top-ten-data-storage-tools.html 3) Implement a simple calculator (detailed comments on JAVA code) https://codingpush.blogspot.com/2021/01/implement-simple-cal

C++ program to find LCM and HCF of given 3 numbers

#include<iostream.h> #include<conio.h> void lcm(int, int, int); void hcf(int, int, int); void main() { char choice; do { int a,b,c; clrscr(); cin>>a>>b>>c; lcm(a,b,c); hcf(a,b,c); cout<<"\n\nDO YOU WANT TO REPEATTHE PROGRAM?(Y/N): "; cin>>choice; }while(choice=='Y'||choice=='y'); } void lcm(int x,int y, int z) { long max,lcom, count, flag=0; if(x>=y&&x>=z) max=x; else if(y>=x&&y>=z) max=y; else if(z>=x&&z>=y) max=z; for(count=1;flag==0;count++) { lcom=max*count; if(lcom%x==0 && lcom%y==0 && lcom%z==0) { flag=1; cout<<"\nTHE LCM OF "<<x<<","<<y<<","<<z<<" IS "<<lcom; } } } void hcf(int p, int q, int r) { int gcf=1,flag=0, count; for(count=1; flag==0;count++) { if(p%count==0&&q%count==0&&r%count==0) gcf=count; if(count>p&&count>q&&count&

C program to find the reverse of a given number

#include<stdio.h> #include<conio.h> void main() { int no,d,sc,rev=0; clrscr(); printf("\nenter no(find for reverse)="); scanf("%d",&no); sc=no; //second copy of no while(no>0) { d=no%10; rev=rev*10+d; no=no/10; } printf("\n \n %d is rev",rev); getch(); } OUTPUT enter no(find for reverse)=123 321 is rev Tweet

Some of the terms programmers frequently use. Part Two

Message An object in isolation is of no use. Its value comes from its interactions with other objects. This interaction takes place through messages. A message consists of three parts (i)   A receiver object (ii)   A method the receiver knows how to execute (iii)   Parameters, if any. Cohesion Cohesion is a measure of how much an item, say for e.g. a class or method, makes sense. Objects with low cohesion are more likely to be changed. A method is highly cohesive if it does one thing and only one thing.  High cohesion is desirable. Coupling Object coupling describes the degree of inter relationships among the objects that make up a system. The more any one object knows about any other object in the system, the tighter the coupling is between those objects. In other words, coupling is a measure of how two items, such as classes or methods, are interrelated. When one class depends on another class they are said to be coupled. When one class interacts with another class, but does not

C program to find a given number is pallindrome or not

#include<stdio.h> #include<conio.h> void main() { int no,d,sc,rev=0; clrscr(); printf("\nenter no(chek for pallinrome)="); scanf("%d",&no); sc=no; //second copy of no while(no>0) { d=no%10; rev=rev*10+d; no=no/10; } if(rev==sc) { printf("\n \n %d is pallindrome",sc); } else { printf("\n \n%d is not pallindrome",sc); } getch(); } OUTPUT enter no(chek for pallinrome)=121 121 is palindrome enter no(chek for pallinrome)=132 132 is not pallindrome Tweet

C program to enter two matrix and print its multiplication

#include<stdio.h> #include<conio.h> void main() { int a[10][10],b[10][10],c[10][10]={0},i,j,k,m,n,p,q; clrscr(); printf("enter rows of matrix a="); scanf("%d",&m); printf("enter columns of matrix a="); scanf("%d",&n); for(i=0;i<m;i++) { for(j=0;j<n;j++) { printf("a[%d][%d]=",i,j); scanf("%d",&a[i][j]); } } printf("\n"); for(i=0;i<m;i++) { for(j=0;j<n;j++) { printf("%3d",a[i][j]); } printf("\n"); } printf("\n\n enter rows of matrix b="); scanf("%d",&p); printf("enter columns of matrix b="); scanf("%d",&q); for(i=0;i<p;i++) { for(j=0;j<q;j++) { printf("b[%d][%d]=",i,j); scanf("%d",&b[i][j]); } } for(i=0;i<p;i++) { for(j=0;j<q;j++) { printf("%3d",b[i][j]); } printf("\n"); } printf("\n\n"); for(i=0;i<m

C program to find maximum number from array of ten numbers

#include<stdio.h> #include<conio.h> void main() { int a[10],max=0,i; clrscr(); for(i=0;i<=9;i++) { printf("enter the number:"); scanf("%d",&a[i]); } for(i=0;i<=9;i++) { printf("a[%d]=%d\n",i,a[i]); if(max<a[i]) { max=a[i]; } } printf("the maximum is %d",max); getch(); } OUTPUT enter the number:21 enter the number:45 enter the number:26 enter the number:35 enter the number:44 enter the number:66 enter the number:58 enter the number:12 enter the number:32 enter the number:52 a[0]=21 a[1]=45 a[2]=26 a[3]=35 a[4]=44 a[5]=66 a[6]=58 a[7]=12 a[8]=32 a[9]=52 the maximum is 66 Tweet

C program to find gcd(hcf) and lcm of any two numbers using function

#include<stdio.h> #include<conio.h> void gcd(int,int); void main() { int n1,n2; clrscr(); puts("enter no1 ==>"); scanf("%d",&n1); puts("enter no2 ==>"); scanf("%d",&n2); gcd(n1,n2); getch(); } void gcd(int n1,int n2) { int product,temp,lcm; product=n1*n2; while(n1>0) { if(n1<n2) { temp=n1; n1=n2; n2=temp; } n1=n1%n2; } printf("gcd=%d",n2);/*greatest common diviser(gcd)/(hcf)*/ lcm=product/n2; printf("\nlcm=%d",lcm); } OUTPUT enter no1 ==> 12 enter no2 ==> 18 gcd=6 lcm=36 Tweet

C program to count odd numbers from entered numbers

#include<stdio.h> #include<conio.h> void main() { int i,j,no,n,o=0; clrscr(); printf("how many nos.you want to enter ="); scanf("%d",&no); for(i=1;i<=no;i++) { printf("no[%d]=",i); scanf("%d",&n); if(n%2!=0) { o++; } } printf("odd=%d",o); getch(); } OUTPUT how many nos.you want to enter =5 no[1]=1 no[2]=2 no[3]=5 no[4]=6 no[5]=7 odd=3 Tweet

C program to sort numbers using bubble sort

#include<stdio.h> #include<conio.h> void main() { int a[5],i,j,temp=0; clrscr(); for(i=0;i<=4;i++) { printf("enter (%d) no=",i+1); scanf("%d",&a[i]); } for(i=0;i<=4;i++) { for(j=i+1;j<=4;j++) { if(a[i]>a[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; } } } for(i=0;i<=4;i++) { printf("%d\n",a[i]); } getch(); } OUTPUT enter (1) no=9 enter (2) no=5  enter (3) no=42  enter (4) no=6  enter (5) no=2  2  5  6  9  42 Tweet

why spinlocks are not appropriate for single-processor systems yet are often used in multiprocessor systems ?

ANSWER : Spinlocks are not appropriate for single-processor systems because the condition that would break a process out of the spinlock could be obtained only by executing a different process. If the process is not relinquishing the processor, other processes do not get the opportunity to set the program condition required for the first process to make progress. In a multiprocessor system, other processes execute on other processors and thereby modify the program state in order to release the first process from the spinlock. why interrupts are not appropriate for implementing synchronization primitives in multiprocessor systems. ANSWER: Interrupts are not sufficient in multiprocessor systems since disabling interrupts only prevents other processes from executing on the processor in which interrupts were disabled; there are no limitations on what processes could be executing on other processors and therefore the process disabling interrupts cannot guarantee mutua

Defination of the essential properties of operating systems

Define the essential properties of the following types of operating sys-tems:  Batch  Interactive  Time sharing  Real time  Network  Parallel  Distributed  Clustered  Handheld ANSWERS: a. Batch processing:-   Jobs with similar needs are batched together and run through the computer as a group by an operator or automatic job sequencer. Performance is increased by attempting to keep CPU and I/O devices busy at all times through buffering, off-line operation, spooling, and multi-programming. Batch is good for executing large jobs that need little interaction; it can be submitted and picked up later. b. Interactive System:-   This system is composed of many short transactions where the results of the next transaction may be unpredictable. Response time needs to be short (seconds) since the user submits and waits for the result. c. Time sharing:-   This systems uses CPU scheduling and multipro-gramming to provide economical interactive use of a system. The CPU switches rapidl

C program to find the size of a text file without traversing it character by character

#include<stdio.h> #include<conio.h> #include<dos.h> void main() { struct entry { char fname[8]; char ext[3]; char unusual[17]; long int size; }; struct entry e[16]; int i,j,c; char yname[8]; char ch=1,len,len1; clrscr(); absread(0,1,5,e); for(i=0;i<16;i++) printf("%s %s %d\n",e[i].fname,e[i].ext,e[i].size); printf("enter the filename whose size is to be found"); scanf("%s",&yname); len1=len=strlen(yname); i=0; while(i<16) { while(len--!=0) { if(e[i].fname[len]==yname[len]) ch=0; else { ch=1; break; } } if(ch==0&&len==-1) break; len=len1; i++; } if(ch==0) { printf("%s",e[i].fname); printf("\t%ld bytes",e[i].size); } else printf("h"); getch(); } Tweet

Some of the terms programmers frequently use. Part one

Classes and Objects The class represents or defines the common characteristics/attributes of an object of a particular type. For e.g. you might want to define a class of “ Person”. Every person will share some common characteristics/attributes like first name, last name, address etc.. So, a class serves as a blueprint for similar type of object. A class is made up of attributes and behavior. Attributes are defined in terms of member variables and behavior is expressed in terms of function. An object is an instance of a class. It is a representation of a real world thing. Object can have both attributes/data and behaviors. For e.g. You, me are instance of t he “Person” class. We share some common attributes like we both have a first name, a last name and so on. We have some common behaviors like walking, talking etc. Abstraction Abstraction refers to the act of representing essential features without unnecessarily including the background details or information i.e. representing a co

The differences among short-term, medium-term, and long-term scheduling

What are the differences among short-term, medium-term, and long-term scheduling Answer : • Short-term(CPU scheduler) —selects from jobs in memory those jobs that are ready to execute and allocates the CPU to them. • Medium-term —used especially with time-sharing systems as an intermediate scheduling level. A swapping scheme is implemented to remove partially run programs from memory and reinstate them later to continue where they left off. • Long-term(job scheduler) —determines which jobs are brought into memory for processing. The primary difference is in the frequency of their execution. The short-term must select a new process quite often. Long-term is used much less often since it handles placing jobs in the system and may wait a while for a job to finish before it admits another one. Also Read :  1)  Principles of Server Virtualization https://codingpush.blogspot.com/2021/01/principles-of-server-virtualization.html  2) Top Ten Data Storage Tools https://codingpus

Give two reasons why caches are useful. What problems do they solve? What problems do they cause?

QUESTION: Give two reasons why caches are useful. What problems do they solve? What problems do they cause? If a cache can be made as large as the device for which it is caching (for instance, a cache as large as a disk), why not make it that large and eliminate the device?. ANSWER:  Caches are useful when two or more components need to ex-change data, and the components perform transfers at differing speeds. Caches solve the transfer problem by providing a buffer of intermediate speed between the components. If the fast device finds the data it needs in the cache, it need not wait for the slower device. The data in the cache must be kept consistent with the data in the components. If a component has a data value change, and the datum is also in the cache, the cache must also be updated. This is especially a problem on multiprocessor systems where more than one process may be accessing a datum. A component may be eliminated by an equal-sized cache, but only if:  (a) the ca