I have a small mess in an upcoming B-School in Kolkata dealing in products- soft drinks, eggs, milk, bread etc. There are 20 salesmen who go around the hostel collecting orders. It has to be ensured that the order quantity is not more than inventory. Thus there has to be a mechanism by which salesmen are aware of inventory status. If the inventory is adequate, then the order is accepted, and if the inventory is inadequate, then the order is rejected. To facilitate this process, the following is done:
There will be two forms naming Mess_Inventory and Mess_Order.
The inventory application will add and remove items from the inventory. It will update the quantities and price of items available in the warehouse.
The order application will take order from customers. Once the product name is entered, it will show whether the order can be met or not. If the product is out of stock, it will reject the order. If there is sufficient inventory, then the order is carried out and the customer details are updated in the database. After the order is executed, the application updates the inventory.
Mess Inventory
Mess Invetory View
Mess Order
Mess Order View
Sunday, March 23, 2008
Monday, March 3, 2008
Sunday, February 24, 2008
How was the first compiler, compiled?
History
The first compiler for Pascal was written on paper by Wirth, who then ran it by hand on itself, and then manually entered the resulting machine code. By dint of attention to detail, he then had a working Pascal compiler.
The intermediate step is assembler. The first programs written in binary quickly gave way to assembler as it was far more 'human readable'. After assembler the macro assembler came along which allowed reuse of modules of code.
After that, why write in binary anymore? Use the compiler you made before to "build" a new compiler. Many compilers still support a switch to output assembly language for debugging and optimization.
The A-0 system, written by Grace Hopper in 1951 and 1952 for the UNIVAC I, was the first compiler ever developed for an electronic computer. The A-0 functioned more as a loader or linker than the modern notion of a compiler. 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. The A-0 system converted the specification into machine code that could be fed into the computer a second time to execute the program.
The first compiler for Pascal was written on paper by Wirth, who then ran it by hand on itself, and then manually entered the resulting machine code. By dint of attention to detail, he then had a working Pascal compiler.
Evolution over time
First was machine code: First programs written directly in the hardware's machine code
Then was assembler: A program written in machine code to interpret asm into machine code.
Then was a compiler: a set of programs (lexical analyser, parser linker etc) which could convert source code to assembler/machine code.
Then was assembler: A program written in machine code to interpret asm into machine code.
Then was a compiler: a set of programs (lexical analyser, parser linker etc) which could convert source code to assembler/machine code.
The intermediate step is assembler. The first programs written in binary quickly gave way to assembler as it was far more 'human readable'. After assembler the macro assembler came along which allowed reuse of modules of code.
After that, why write in binary anymore? Use the compiler you made before to "build" a new compiler. Many compilers still support a switch to output assembly language for debugging and optimization.
Monday, February 18, 2008
SQL Statements
Creating two database tables-
1) Sign in to http://db.zoho.com/
2) On the create database page select one of the four options indicated.
3) In the create database (import) window that appears (step 1 of 2), enter the database name and description. Select the data location option i.e. pasted data or local drive.
4) Select Next.
5) Enter the table name in the window that appears next(step 2 of 3), click create. In the Import Data Details window that appears next, click close. The database table would get created.Repeat the procedure for the second database table.
Creating three select queries:
1) Locate the New option in the top left corner of the page and in the drop down box click the New Query Table option.
2) A new query table creation option would appear next. Enter the select command that you require, in the space provided and click execute. The query table would get created.
3) Repeat the procedure for the other two query tables.
4) In each of the query table select the embedding option frpm the Publish option on the top of the page. Select the URL from the window that appears.
5) Paste the URL in the post in your blog after making the necessary changes to the size of the table.
6) Publish the post.
Query 1
SELECT "Stream", Count("Stream") FROM "Marks" group by "Stream"
Output 1
Query 2
SELECT "Name", "Surname", 'from', "Home", 'has scored first class throughout his career' from "Marks" where ("10th" > '60' and "12th" > '60' and "Grad." > '60') order by (("10th"+"12th"+"Grad.")/3) desc
Output 2
Query 3
SELECT "Name", "E-mail", "Specialisation","Location" FROM "Placement" where ("Location" = 'Mumbai' or "Location" = 'Kolkata') and "Placement Status" = 'Placed'
Output 3
1) Sign in to http://db.zoho.com/
2) On the create database page select one of the four options indicated.
3) In the create database (import) window that appears (step 1 of 2), enter the database name and description. Select the data location option i.e. pasted data or local drive.
4) Select Next.
5) Enter the table name in the window that appears next(step 2 of 3), click create. In the Import Data Details window that appears next, click close. The database table would get created.Repeat the procedure for the second database table.
Creating three select queries:
1) Locate the New option in the top left corner of the page and in the drop down box click the New Query Table option.
2) A new query table creation option would appear next. Enter the select command that you require, in the space provided and click execute. The query table would get created.
3) Repeat the procedure for the other two query tables.
4) In each of the query table select the embedding option frpm the Publish option on the top of the page. Select the URL from the window that appears.
5) Paste the URL in the post in your blog after making the necessary changes to the size of the table.
6) Publish the post.
Query 1
SELECT "Stream", Count("Stream") FROM "Marks" group by "Stream"
Output 1
Query 2
SELECT "Name", "Surname", 'from', "Home", 'has scored first class throughout his career' from "Marks" where ("10th" > '60' and "12th" > '60' and "Grad." > '60') order by (("10th"+"12th"+"Grad.")/3) desc
Output 2
Query 3
SELECT "Name", "E-mail", "Specialisation","Location" FROM "Placement" where ("Location" = 'Mumbai' or "Location" = 'Kolkata') and "Placement Status" = 'Placed'
Output 3
Monday, February 11, 2008
Normalisation
The Table name is given in the form : <TABLE>
The Primary key is given in the form: <primary key>
The Foreign key is given in the form : <foreign key>
Un-Normalised form
name, email_id, phone_no, address, membership date, fine_outstanding, book_isbn, library_catalog_no, book_title, book_author, book_price, subject, no_of_copies, issue_date,
return_date
Normalised form
STUDENT
roll_no
name
email_id
address
membership date
fine_outstanding
LIBRARY_LIST
library_catalog_no
subject
no_of_copies
BOOK_DETAILS
book_isbn
library_catalog_no
book_title
book_author
book_price
ISSUE_DETAILS
issue_id
roll_no
library_catalog_no
issue_date
return_date
The Primary key is given in the form: <primary key>
The Foreign key is given in the form : <foreign key>
Un-Normalised form
name, email_id, phone_no, address, membership date, fine_outstanding, book_isbn, library_catalog_no, book_title, book_author, book_price, subject, no_of_copies, issue_date,
return_date
Normalised form
STUDENT
roll_no
name
email_id
address
membership date
fine_outstanding
LIBRARY_LIST
library_catalog_no
subject
no_of_copies
BOOK_DETAILS
book_isbn
library_catalog_no
book_title
book_author
book_price
ISSUE_DETAILS
issue_id
roll_no
library_catalog_no
issue_date
return_date
Tuesday, February 5, 2008
Systems Engineering
It was early morning and I had just gone to sleep after a late night out and my mobile started ringing. My brother Ankur was on the other side of the phone.
Ankur: Bro, I’ve to submit an assignment on System’s Architecture today. I’ve collected some information about it from the net but not being able to understand what is it? Can you please help me out?
Me: Can you send me the data or any presentation which you have collected. I’m going online.
Ankur: Ok, wait a minute.
Me (after studying the ppt): Systems architecture is the design or set of relations between the parts of a system. You can say it is the structure of components, their interrelationships with each other and the environment, and the principles and guidelines governing their design and evolution. The first principle says, “Data is different from the application”.
Ankur: But, where are these two separate entities located?
Me: Let me explain you. First tell me, do you know about tiers in system architecture?
Ankur: No
Me: Hmm… Ok, there are basically 3 tiers of system architecture.
In a single tier, the data and processing are on a single machine (which can be either a desktop, laptop or a server)
In two tier architecture - the client executes on a user workstation, and a database server executes on another node in the network. The presentation is handled by the client and data is stored on and accessed on the server. But the application or business logic can reside on the client or on the database server in the form of stored procedures. The LAN connects client machines to the server using TCP/IP protocols.
In three tier architecture, the business logic is kept centrally and presentation logic is kept locally. To give you an example, a bank’s database at the main head-office contains the user database and basic business application, whereas, all the presentations, which need more graphics and thus, high bandwidth, are done on the client’s machine. Due to this the data transfer over the network is minimized.
In multiple tier, the end-user's browser communicates with Web. All the presentation logic occurs on standard servers.
Ankur: Ok
Me: One thing I forgot to tell you regarding the architecture- as you keep on going from single tier to a multi-tier architecture, flexibility, user independence and availability increases, but the security, manageability and control decreases, which has to be taken care of very carefully.
Ankur: What about the security issues when we use database and its application on different machines?
Me: Yes and now comes the role of a firewall. Internet is a public network and is prone to hacker attacks and to counter this you would require firewalls such as ZoneAlarm, or better still, anti-virus software such as Norton on our system.
Ankur: Thanks Bro, now that I’ve a fair idea about what is System Architecture, I think, I can now make a decent enough project. I’ll let you know if I need some more help.
Me: You are welcome. Good bye and God bless.
Ankur: Bro, I’ve to submit an assignment on System’s Architecture today. I’ve collected some information about it from the net but not being able to understand what is it? Can you please help me out?
Me: Can you send me the data or any presentation which you have collected. I’m going online.
Ankur: Ok, wait a minute.
Me (after studying the ppt): Systems architecture is the design or set of relations between the parts of a system. You can say it is the structure of components, their interrelationships with each other and the environment, and the principles and guidelines governing their design and evolution. The first principle says, “Data is different from the application”.
Ankur: But, where are these two separate entities located?
Me: Let me explain you. First tell me, do you know about tiers in system architecture?
Ankur: No
Me: Hmm… Ok, there are basically 3 tiers of system architecture.
In a single tier, the data and processing are on a single machine (which can be either a desktop, laptop or a server)
In two tier architecture - the client executes on a user workstation, and a database server executes on another node in the network. The presentation is handled by the client and data is stored on and accessed on the server. But the application or business logic can reside on the client or on the database server in the form of stored procedures. The LAN connects client machines to the server using TCP/IP protocols.
In three tier architecture, the business logic is kept centrally and presentation logic is kept locally. To give you an example, a bank’s database at the main head-office contains the user database and basic business application, whereas, all the presentations, which need more graphics and thus, high bandwidth, are done on the client’s machine. Due to this the data transfer over the network is minimized.
In multiple tier, the end-user's browser communicates with Web. All the presentation logic occurs on standard servers.
Ankur: Ok
Me: One thing I forgot to tell you regarding the architecture- as you keep on going from single tier to a multi-tier architecture, flexibility, user independence and availability increases, but the security, manageability and control decreases, which has to be taken care of very carefully.
Ankur: What about the security issues when we use database and its application on different machines?
Me: Yes and now comes the role of a firewall. Internet is a public network and is prone to hacker attacks and to counter this you would require firewalls such as ZoneAlarm, or better still, anti-virus software such as Norton on our system.
Ankur: Thanks Bro, now that I’ve a fair idea about what is System Architecture, I think, I can now make a decent enough project. I’ll let you know if I need some more help.
Me: You are welcome. Good bye and God bless.
Subscribe to:
Posts (Atom)
