Skip to main content

Posts

Showing posts from February, 2013

Inverted Pyramid, playing with stars

Playing with stars in C# *******  *****   ***     *     class Program     {          static void Main( string [] args)         {             int row, col = 0, n = 5;                                   int k = n;             for (row = 0; row <= n; row++)             {                 for ( int r = 0; r <= row; r++)                 {          ...

Worlds First Worm in C

The problems in C are not confined to just the language. Some routines in the standard library have  unsafe semantics. This was dramatically demonstrated in November 1988 by the worm program that wriggled through thousands of machines on the Internet network. When the smoke had cleared and the investigations were complete, it was determined that one way the worm had propagated was through a weakness in the finger daemon, which accepts queries over the network about who is currently logged in. The finger daemon, in.fingerd, used the standard I/O routine gets(). The nominal task of gets() is to read in a string from a stream. The caller tells it where to put the incoming characters. But gets() does not check the buffer space; in fact, it can't check the buffer space. If the caller provides a pointer to the stack, and more input than buffer space, gets() will happily overwrite the stack.  The finger daemon contained the code: main(argc, argv) char *argv[]; { ...

Structured Query Language/Relational Databases

Before learning SQL, relational databases have several concepts that are important to learn first. Databases store the data of an information system. We regroup data by groups of comparable data (all the employees, all the projects, all the offices...). For each group of comparable data, we create a table . This table is specially designed to suit this type of data (its attributes). For instance, a table named employee which stores all the employees would be designed like this: employee the table id_employee the primary key an integer firstname a column a string of characters a column type lastname a string of characters phone 10 numbers mail a string of characters And the company employees would be stored like this: employee id_employee firstname lastname phone mail 1 a column value Big BOSS 936854270 big.boss@company.com 2 John DOE 936854271 john.doe@company.com 3 Linus TORVALDS 936854272 linus.torvalds@co...

Structured Query Language/Introduction to SQL

Structured Query Language/Introduction to SQL The main drive behind a relational database is to increase accuracy by increasing the efficiency with which data is stored. For example, the names of each of the millions of people who immigrated to the United States through Ellis Island at the turn of the 20th century were recorded by hand on large sheets of paper; people from the city of London had their country of origin entered as England, or Great Britain, or United Kingdom, or U.K., or UK, or Engl., etc. Multiple ways of recording the same information leads to future confusion when there is a need to simply know how many people came from the country now known as the United Kingdom. The modern solution to this problem is the database. A single entry is made for each country, for example, in a reference list that might be called the Country table. When someone needs to indicate the United Kingdom, he only has one choice available to him from the list: a single entry called "Uni...

Using try/catch/finally --- Exception Handling

Introduction Software Programmers write code to perform some desired actions. But every software may fail to perform its desired actions under some of its internal or external failures. The exception handling system in the C# language allows the programmer to handle errors or anomalous situations in a structured manner that allows the programmer to separate the normal flow of the code from error-handling logic. An exception can represent a variety of abnormal conditions that arise from several possible external or internal conditions of software application. External conditions of execution failures includes, for example, network failures in connecting to a remote component, inadequate rights in using a file/system resource, out of memory exception or exception thrown by a web service etc. These are mainly due to failures thrown by environment components on which our application depends on e.g. operating system, .net runtime or external application or components. Internal f...

What is Software Architecture?

When you build your house, you would never think about building it without an architect, correct? However, many medium to large size software projects are build without a software architect. That seems kind of scary, and you might wonder why? Well, the role of the software architect has neither been widely understood, nor his necessity been acknowledged. Even to date there is still no agreement on the precise definition of the term “software architecture”. Matthew R. McBride writes, "a software architect is a technically competent system-level thinker, guiding planned and efficient design processes to bring a system into existence. He is viewed by customers and developers alike as a technical expert. The architect is the author of the solution, accountable for its success or failure." The term software architecture also refers to documentation of a system's software architecture. Documenting software architecture facilitates communication between stakeholders, documen...

My First WCF Program

My First WCF Program. I am starting with very dumb way to start a WCF program, just follow the steps below.(Click the image to enlarge) Step 1:  Open Visual Studio and click on File -->New-->Project Step 2 : Click on Visual C# then WCF Service Application, Use the same file name as shown MyFirstWCF. Step 3: You will get an inbuilt template as shown in below picture, with some pre-written method.