Compiler

February 23, 2008

Earlier computer programmers actually wrote programs in machine code, but assembler languages or instruction sets were soon developed to speed up programming. Today, assembler programming is used only where very efficient control over processor operations is needed. It requires knowledge of a particular computer’s instruction set, however. Historically, most programs have been written in “higher-level” languages such as COBOL, FORTRAN, PL/I, and C. These languages are easier to learn and faster to write programs with than assembler language. The program that processes the source code written in these languages is called a compiler. A compiler is not one piece of software. It starts out with a lexer analyser, then a parser linker … and ends with the assembly code which the linker takes to map virtual address to the physical addresses. So, basically, it’s a tool which checks for syntax and semantics of a language, creates the code readable by the machine. Similar to the assembler that takes higher-level language statements and reduces them to machine code.

Grace Hopper was credited with devising the first compiler. Grace Brewster Murray was born on December 9, 1906 in New York City. She helped develop the Flow-Matic programming language (1957) and the Common Business-Oriented Language (COBOL; 1959-61) for the UNIVAC, the first commercial electronic computer.

In 1949 she joined the Eckert-Mauchly Computer Corporation and provide businesses with computers. There she began pioneering effort of UNIVAC I, the first large-scale electronic digital computer. To ease their task, Admiral Hopper encouraged programmers to collect and share common portions of programs. Even though these early shared libraries of code had to be copied by hand, they reduced errors, tedium, and duplication of effort.

By 1949 programs contained mnemonics that were transformed into binary code instructions executable by the computer. Admiral Hopper and her team extended this improvement on binary code with the development of her first compiler, the A-O. A program was specified as a sequence of subroutines and arguments. The subroutines were identified by a numeric code and the arguments to the subroutines were written directly after each subroutine code. Basically A-0 system converted the specification into machine code that could be fed into the computer a second time to execute the program. The A-O series of compilers translated symbolic mathematical code into machine code, and allowed the specification of call numbers assigned to the collected programming routines stored on magnetic tape. One could then simply specify the call numbers of the desired routines and the computer would “find them on the tape, bring them over and do the additions. The A-0 functioned more as a loader or linker than the modern notion of a compiler. The A-0 system was followed by the A-1, A-2, A-3 (released as ARITH-MATIC), AT-3 (released as MATH-MATIC) and B-0 (released as FLOW-MATIC).

This is how the evolution of compiler by an American lady took place. Thus making computer ubiquitous in this century.

STEPS REQUIRED FOR SQL QUERY

February 17, 2008

STEPS REQUIRED FOR SQL QUERY

Creating your own database and running SQL query is now not an enigma anymore. With zoho being launched it is now similar to playing any of the computer games.

There are certain steps which are to be followed to execute the above mentioned.

  • Create an user account in www.db.zoho.com
  • Then create a database via any of the four options displayed i.e. import via excel sheet, enter data right away, create database from template, create blank database. Then name the tables(in my case EMPLOYEE & DEPARTMENT).
  • Now run SQL query according to your need.
  • Finally execute and get the desired view.
  • If there is an error in the SQL statement,it displays the error.Through which one can correct the query statement.

According to my database views three SQL queries were run and thus three query tables(views) were generated namely JOIN, AVERAGE QUERY & CONDITIONS. But the main issue is ‘How to run a query?’ There is a myth that for running SQL query one needs to have knowledge of some kind of computer language. But zoho nullifies the myth as it is user friendly such as default select query is given for sample. Here one can write query functions and can also get SQL functions(table and column name) from the box besides query writing area.

There are three query tables one is for joining the tables and the syntax is

Select <”Table1 Column Name1”>,<” Table1 Column Name2”>,<” Table1 Column Name3”>,<” Table2 Column Name1”>,<” Table2 Column Name2”> from <”Table1”>,<”Table2”> where <”Table1”>.<”Table1 Column Name4”> = <”Table2”>.<”Table2 Column Name2”>

Where

Table1=Employee

Table2=Department

After ’where’ command column name4 elements of table1(Employee) is made equal to column name2 elements of table2(Department).this means that combination of rows satisfying above restriction are only displayed. This helps in joining two tables but with customized view. As all the details of database is not needed by everyone.

SQL query for getting average salary of the firm’s employee. Which is in average value of salary in table1(Employee).

Syntax for this SQL query is

SELECT avg < (Column Name)> from “<Table Name>”

Here column name is salary and its respective table is employee wherein the column name salary is.

This gives the average of the values of the column chosen. This is a multiple row function. Accordingly there are other functions also such as sum, max, etc.

SQL query for various restrictions such as OR, AND, wild cards is to obtain constrained view.

Syntax for this query is

Select “< Column Name1>”,”< Column Name2>”,”<Column Name3>” from “<Table Name>”where (“< Column Name 2 >”=’< Element1 of Column Name2 >’ OR “< Column Name2 >”=’<Element2 of Column Name2 >’ or “<Column Name1>” like ‘D%’) and “<Column Name 3>” < Constant

According to my DB constrained view

Column Name1=Name

Column Name2=Employee Designation

Column Name2=Salary

Table Name =Employee

Element1 of Column Name2=Clerk

Element2 of Column Name2=Cleaner

Column Name3=Salary

this give the customized view of the database. Here according to the command the three respective columns are selected. Which are encompassed through restrictions that are elements of column2 are equal to two of the identified elements of column2 itself. Means only those rows are selected which have identified elements in them. Also column name1 which is ‘name’ is subjected to constrain that name should start with ‘D’. Finally salary should be less than a constant i.e. 90000.Here OR and AND conditions acts as addition and multiplication respectively similar to the gate or BODMAS rule concept. Also whole of the OR condition is given inside round bracket because BODMAS rule needs to be followed here also. Else the function preceding ‘and’ and following ‘and’ is only considered by ‘and’ function.

In this SQL query one thing should be kept in mind is that ‘select’ command should start the query and ‘from’ command should also be used so as to locate from which table the entities are taken from.

Limitation of db.zoho.com is that only SELECT query can run.

Isn’t it easy to perform the above mentioned queries.

 

To view Query tables please view the below link:

http://db.zoho.com/ZDBDataSheetView.cc?DBID=22860000000004024&OBJID=22860000000004025

 

Library Information System Normalization

February 11, 2008

Entities- Student, Book, Date of Issue, Issued Item.

Attributes- Student Enrolment Number, Name, email Address, phone number, late fine outstanding, book title, book author, book ISBN ( globally unique), book price, library catalogue number ( for the copy), quality of the copy ( “perfect” / “damaged” ) date issued, date to be returned.

UNNORMALISED FORM

Student Enrolment No. 
Name
E-mail ID
Phone No.
Late Fine Outstanding
Book Title
Book Author
Book ISBN 
Book Price
Library Catalogue No.
Quality Of The Copy
Date of Issue
Date of Return

3rd NORMALIZED FORM

STUDENT

Student Enrolment No. PK
Name
Email ID
Phone No.
Late Fine Outstanding

DATE OF ISSUE

Issue Date  PK 
Student Enrolment No. FK 
Date of Return

BOOK

Book ISBN No. PK
Book Price
Book Author
Book Title

ISSUED ITEM

Library Catalogue No PK
Book ISBN No. FK
Issue Date FK
Quality of the Copy

dialogue on system architecture

February 3, 2008

 This is a conversation between Pallav a Mechanical Engg. Working in a well recognised automobile firm and me. The dialogue is on system architecture. Its starts with my explanation on system architecture.

“System architecture is the design or set of relations between the different parts of a system or in other words it is mapping between the functionality of hardware onto software or vice versa and to human interaction with these components. In this data and application is distinct. Data is not embedded in application.” 

Then the dialogue follows

P: Can you tell me the different types with their advantages over other?

M: There are four typesSingle tierData and application are on the same system and needs to be separatedIts advantage isLess data travel. So faster processing.Its disadvantage is Duplication is high. Updating of data needs to be done on every system.

 Two tier

Here data and applications are separated. Data is stored in servers and application resides on each system. Here all systems and data server are integrated through a common network. Its advantages areConvenient graphic user interfaceProcessing burden is in individual machines only data flow occurs. Therefore server is not burdened.Its disadvantages are as data transfer is required high bandwidth is needed.WAN and maintenance is an issue.

Three tier

Data and application separated but business application is at the server side and presentation application at the user side. This reduces data travel. Server and systems connected through common network. Specialist software needed at each end to talk.changes in application needed to be done at one end only.

Multi tier

Server side is divided into three data server, application server, web server as the machines are integrated through internet. Here all the three servers can me merged in one big machine or can have combination on 2 and one machine.AdvantagesCheap networkNo need for special software at each end to talk

Disadvantages are attack prone as internet most unsecured one.Business application has to be web enabled.

P: Which on is best?

M: It is according to the firm’s strategy and surely single tier isn’t good.Two tier system can have specific applications such as sales, finance HR. These applications are on the user machines and the data in the partitioned server. These applications are platform independent i.e. any vendor or any language.it is decided as per the advantages offered and advantages desired.

P: How complexity can be managed?

M:Today to manage complexity an integrated database is used (RDBMS).this is done to ensure no redundancy, seamless flow of data, easy backup and finally secure to have integrated database.Another way to reduce complexity is to use modules and integrated database so that client needs only software i.e. implement ERP. In addition special requirements can be handled by having special server with database in line with main. But with lower speed as it will not be used often. In large and complex distributed system in which end users are integrated to servers through WAN basically server is divided into 3 parts web server, application and data server.

P: How to secure the network?

M: For security reasons from hackers firewalls are needed on both sides of connection although it slows down the data flow.Development of application system depends on the platform being used for relational model and development. Basically ZOHO is used on the both fronts.

Finally his questions stopped as he was satisfied with the answers he got and also his queries were over.He conceived it to be a useful dialogue.

Hello world!

January 30, 2008

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!


Follow

Get every new post delivered to your Inbox.