Deprecated: Assigning the return value of new by reference is deprecated in /home/techmasa/public_html/wp-content/plugins/sem-cosmos-link/sem-cosmos-link.php on line 90

Deprecated: Assigning the return value of new by reference is deprecated in /home/techmasa/public_html/wp-content/plugins/sem-recent-posts.php on line 942

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/techmasa/public_html/wp-content/plugins/sem-cosmos-link/sem-cosmos-link.php:90) in /home/techmasa/public_html/wp-content/plugins/wordpress-automatic-upgrade/wordpress-automatic-upgrade.php on line 121

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/techmasa/public_html/wp-content/plugins/sem-cosmos-link/sem-cosmos-link.php:90) in /home/techmasa/public_html/wp-content/plugins/wordpress-automatic-upgrade/wordpress-automatic-upgrade.php on line 121
TechMasala - Technology Spice Rack » 2006 » March

Archive for March, 2006

Foundation stone #3 - BIOS part 2 - The interrupt vector table

In my post Foundation stone #2 we saw that BIOS is the one that takes in charge when you switch on your PC. After collecting the inventory of available and properly working hardware, the BIOS sets up what is called as the Interrupts area. An interrupt is a signal to the processor that there is something that needs its attention. As such each and every piece of hardware that is put together in your PC is useless unless it is orchestrated well. Take for example the keyboard, if the attention is not given at the right time when you press a key and reciprocated accordingly wherever you are then you can call the thing that is sitting in front of you as dumb

So when the BIOS is done with the inventory of hardware, it initializes a memory space of 1024 bytes starting at 0000:0000h (this is a representation of memory location in the form of segment:offset in hexadecimal). An interrupt is a small routine or code that has the necessary details of the interrupt and occupies 4 bytes. So starting at memory location 0000:0000h interrupts are stored. So a total of 256 interrupts can be stored in a the allotted 1024 bytes but all is not being initialized by the BIOS. There are different types of interrupts, hardware interrupts, software interrupts, user interrupts and so on. The BIOS fills up the hardware interrupts and the software interrupts are mostly added by the OS.

The Interrupt Vector Table (IVT) is a mapping of the interrupt number and the memory location in the form of segment:offset. This memory location contains the  interrupt code for that particular interrupt. It is the responsibility of the OS to keep track of the IVT and monitor for interrupt and notify the processor. So what happens when you press a key or release a key, the keyboard send signals that contain information on what key was pressed or released. This gets stored in the memory location assigned for the keyboard interrupt (traditionally interrupt 09h is for keyboard). The OS which is constantly looking for these interrupts immediately captures the information and sends it for processing accordingly. The interrupt number and other details could differ from one BIOS manufacturer to other. You can get a lot of information about BIOS and interrupts from the BIOS central site.


Deprecated: Function ereg_replace() is deprecated in /home/techmasa/public_html/wp-content/plugins/sociable/sociable.php on line 64
Blink this Foundation stone #3 - BIOS part 2 - The interrupt vector table at blinklist.com    Bookmark Foundation stone #3 - BIOS part 2 - The interrupt vector table at blogmarks    Bookmark Foundation stone #3 - BIOS part 2 - The interrupt vector table at del.icio.us    Digg Foundation stone #3 - BIOS part 2 - The interrupt vector table at Digg.com    Fark Foundation stone #3 - BIOS part 2 - The interrupt vector table at Fark.com    Bookmark Foundation stone #3 - BIOS part 2 - The interrupt vector table at Furl.net    Bookmark Foundation stone #3 - BIOS part 2 - The interrupt vector table at NewsVine    Bookmark Foundation stone #3 - BIOS part 2 - The interrupt vector table at reddit.com    Bookmark Foundation stone #3 - BIOS part 2 - The interrupt vector table at Simpy.com    Bookmark Foundation stone #3 - BIOS part 2 - The interrupt vector table at Spurl.net    Bookmark Foundation stone #3 - BIOS part 2 - The interrupt vector table with wists    Bookmark Foundation stone #3 - BIOS part 2 - The interrupt vector table at YahooMyWeb

Comments      Cosmos

Web 2.0 culture

Roman Mittermayr has written a wonderful article in vipedio on web 2.0 culture. Every one talks about the technology aspect of Web 2.0 but Roman goes a step above and talks about the do’s and dont’s of a web 2.0 application UI design. While it is becoming more common that web sites are moving towards web 2.0 and lot of sites focus on appealing web pages, there still needs to be some best practices and guidelines on what is right and wrong. More such articles can really help in achieving that.


Deprecated: Function ereg_replace() is deprecated in /home/techmasa/public_html/wp-content/plugins/sociable/sociable.php on line 64
Blink this Web 2.0 culture at blinklist.com    Bookmark Web 2.0 culture at blogmarks    Bookmark Web 2.0 culture at del.icio.us    Digg Web 2.0 culture at Digg.com    Fark Web 2.0 culture at Fark.com    Bookmark Web 2.0 culture at Furl.net    Bookmark Web 2.0 culture at NewsVine    Bookmark Web 2.0 culture at reddit.com    Bookmark Web 2.0 culture at Simpy.com    Bookmark Web 2.0 culture at Spurl.net    Bookmark Web 2.0 culture with wists    Bookmark Web 2.0 culture at YahooMyWeb

Comments      Cosmos

Programming Tip #5 - Understand API’s

If I ask you to write a Hello World program, I know you would do it right the first attempt and you probably could do it in your sleep.  But have you ever thought about what comprises of the Hello World program and how it works? Take Java, the stateent to display Hello World would be the below one.

System.out.println(”Hello World”);

But have you ever thought in the above line, what is System, what is out and what is println? And from where do they come from? As a developer, System.out.println would be a common statement that you would be using using on a day to day basis. If you had learned it right from the beginning, probably you would be thinking what’s the big deal, but if you had not learnt it right, here is a minute for you.  Just think and answer to yourself the questions that I just raised. If you could not convince yourself or you want to validate yourself then probably you would want to look at the java.lang package and look at the System class API. If you are starter, you should start thinking and looking for answers to how every statement in your code works.


Deprecated: Function ereg_replace() is deprecated in /home/techmasa/public_html/wp-content/plugins/sociable/sociable.php on line 64
Blink this Programming Tip #5 - Understand API's at blinklist.com    Bookmark Programming Tip #5 - Understand API's at blogmarks    Bookmark Programming Tip #5 - Understand API's at del.icio.us    Digg Programming Tip #5 - Understand API's at Digg.com    Fark Programming Tip #5 - Understand API's at Fark.com    Bookmark Programming Tip #5 - Understand API's at Furl.net    Bookmark Programming Tip #5 - Understand API's at NewsVine    Bookmark Programming Tip #5 - Understand API's at reddit.com    Bookmark Programming Tip #5 - Understand API's at Simpy.com    Bookmark Programming Tip #5 - Understand API's at Spurl.net    Bookmark Programming Tip #5 - Understand API's with wists    Bookmark Programming Tip #5 - Understand API's at YahooMyWeb

Comments      Cosmos

Programming tip #4 - Beware of the short circuit

Nested if conditions can cause side effects sometime. When there is an if condition in your program and there is more than one condition with a conditional operator like AND or OR then you need to be aware that there could be a side effect(depending on what you have in that condition). In case of Java, during run time the JVM (Java Virtual Machine) could bypass a second condition based on the result of the first condition because logically it does not make sense to evaluate the second condition. Say for example you have a condition like the one below.

if(x > 50 && y < 20)

In case of an AND condition, if the first condition evaluates to be false then there is no point in evaluating the second condition becuase the result is going to be anyway false. So in the above program statement if x had a value of 30 then the condition y < 20 will not be evaluated at all. Similarly in case of an OR condition if the first condition evaluated to be true then there is no point in evaluating the second condition because anyway the result will be a true.

So where does the side effect come into picture? Side effect comes into picture if you are combining assignment and coniditions together. Look at the below example.

if (x > 50 && (y=y*2) < 2)

If the first condition is true then whatever you expected would be correct. Now if x has a value of 30 then the second condition that includes an assignment of y=y*2 will never take place, and if you didn’t know this then you would be under the assumption that whatever code that executes after the if statement will use a y*2 value for y. In software programming terms, this is called as short circuiting. So beware of the side effects of short circuiting when you are having nested conditions.


Deprecated: Function ereg_replace() is deprecated in /home/techmasa/public_html/wp-content/plugins/sociable/sociable.php on line 64
Blink this Programming tip #4 - Beware of the short circuit at blinklist.com    Bookmark Programming tip #4 - Beware of the short circuit at blogmarks    Bookmark Programming tip #4 - Beware of the short circuit at del.icio.us    Digg Programming tip #4 - Beware of the short circuit at Digg.com    Fark Programming tip #4 - Beware of the short circuit at Fark.com    Bookmark Programming tip #4 - Beware of the short circuit at Furl.net    Bookmark Programming tip #4 - Beware of the short circuit at NewsVine    Bookmark Programming tip #4 - Beware of the short circuit at reddit.com    Bookmark Programming tip #4 - Beware of the short circuit at Simpy.com    Bookmark Programming tip #4 - Beware of the short circuit at Spurl.net    Bookmark Programming tip #4 - Beware of the short circuit with wists    Bookmark Programming tip #4 - Beware of the short circuit at YahooMyWeb

Comments      Cosmos

Object Thinking - Object Redefined

The first rule that you need to follow before you dive deep into OOP, is to fist understand how objects work in the real world. Lets go through it again. What is the definition of an object? I mean a physical object in the real world, say you might have learnt or could refer books or get the definition from net. I am sure you would find the words attribute, behavior, characteristics, operations and related words wherever you search for. Lets go by that definition first. Here is a simple definition that I pulled out from the result of a google “define:object search”.

In object-oriented design or programming, a concrete realization of a class that consists of data and the operations associated with that data.

If you had seen my post titled “Object Thinking - Thinking Objects”, you would have realized that these attributes and behavior are well defined and has a definitive scope (remember you cannot light a gas stove using a vessel or cup). But think about this, a well defined object is as equivalent to a stone sitting in the north pole. Every object needs a message to act. Yes you heard it right, objects can hear and act just like how you would when somebody talks to you. You act upon the objects by passing a message.

Take the same coffee example, just by keeping all the objects around, you wont get coffee, come on be serious. Remember the chain reaction, yes you started it and was there to pass on the message whenever and wherever required. So what happens when you pass on a message, the object reacts and changes its state (a state is value change in the object’s attribute). You strike the match stick against the match box and bingo there you have the flame, so the match stick’s state changed from being just a match stick to a match stick with its head on flame. Flame is passed on to the gas stove, the heat message is passed on to the vessel and it passes it to the milk, result is the milk’s temperature state changes. Wow, isn’t that cool? Did you ever think about it?

So aren’t we missing something drastic from the definition of an object to just being attribute and character/behavior. Let’s redefine it. An object is a well defined set of attributes with behavior or characteristics with the ability to react to a message and change its state. How does that sound? Now start looking at all the exercises you did in collecting objects and scenarious from the “Object Thinking - Thinking Objects” post exercise and analyze them, what message is passed and what state gets changed in each object.


Deprecated: Function ereg_replace() is deprecated in /home/techmasa/public_html/wp-content/plugins/sociable/sociable.php on line 64
Blink this Object Thinking - Object Redefined at blinklist.com    Bookmark Object Thinking - Object Redefined at blogmarks    Bookmark Object Thinking - Object Redefined at del.icio.us    Digg Object Thinking - Object Redefined at Digg.com    Fark Object Thinking - Object Redefined at Fark.com    Bookmark Object Thinking - Object Redefined at Furl.net    Bookmark Object Thinking - Object Redefined at NewsVine    Bookmark Object Thinking - Object Redefined at reddit.com    Bookmark Object Thinking - Object Redefined at Simpy.com    Bookmark Object Thinking - Object Redefined at Spurl.net    Bookmark Object Thinking - Object Redefined with wists    Bookmark Object Thinking - Object Redefined at YahooMyWeb

Comments      Cosmos

Foundation Stone #2 - BIOS

You must have seen your keyboard lights, optical mouse light, CD-ROM drive light, floppy drive light blink when you switch on your computer. Ever wondered what happens when you switch on your PC? Did you think the OS in your machine picked up control once you switched on? If you thought so then you are mistaken. Then who gets the control? It is a program that is burned into a ROM (Read Only Memory) chip. It is called BIOS - Basic Input Output System. The purpose of this program is to take an inventory of hardware that is available and working properly and to initialize these hardware devices. Once intialized it transfers some of these information into the Random Access Memory (RAM) to be used by the Operating System and other programs. Once done then it looks up which is the booting device, whether it is in floppy disk, or the hard disk or from the CD-ROM. The BIOS is configurable, when you switch on the machine and after the inventory check is done and your monitor comes alive, you would see a statement like “Press F1 for setup” or “Press DEL for setup”. I mean the key that you press to get into the BIOS configuration is dependent on the BIOS manufacturer and what key he captures to bring up that screen. Try this out and look at the various configuration options available in your computer. WARNING: Do not modify the settings unless you are aware of the impact of the change.


Deprecated: Function ereg_replace() is deprecated in /home/techmasa/public_html/wp-content/plugins/sociable/sociable.php on line 64
Blink this Foundation Stone #2 - BIOS at blinklist.com    Bookmark Foundation Stone #2 - BIOS at blogmarks    Bookmark Foundation Stone #2 - BIOS at del.icio.us    Digg Foundation Stone #2 - BIOS at Digg.com    Fark Foundation Stone #2 - BIOS at Fark.com    Bookmark Foundation Stone #2 - BIOS at Furl.net    Bookmark Foundation Stone #2 - BIOS at NewsVine    Bookmark Foundation Stone #2 - BIOS at reddit.com    Bookmark Foundation Stone #2 - BIOS at Simpy.com    Bookmark Foundation Stone #2 - BIOS at Spurl.net    Bookmark Foundation Stone #2 - BIOS with wists    Bookmark Foundation Stone #2 - BIOS at YahooMyWeb

Comments      Cosmos

Object Thinking - Thinking Objects

The first step to Object thinking would be to think about the objects. From the beginning the key aim in developing a programming language is to make it as humane as possible. And as each programming language was developed, we came closer and closer until we realized that we are missing out a big picture to imitate our lifestyle of interacting with objects. Just think about a moment in your day. Try counting the number of objects you interacted in that moment. OOP is all about creating programs with objects that interact with each other like the way we interact with objects and objects with each other. Let us take a simple example of preparing a coffee. For any problem we have to limit the scope, so here we assume we have the necesary things and environment to prepare coffee.

Step 1: Take a vessel and fill it with a cup of milk
Step 2: Light on a match stick
Step 3: Switch on the gas stove and light it using the fire from step 2
Step 4: Keep the vessel on stove
Step 5: When the milk in the vessel starts to boil switch off the gas stove.
Step 6: Put a spoon of sugar in a cup
Step 7: Put a spoon of coffee powder in the cup
Step 8: Add the boiled milk to the cup
Step 9: Stir the mixture in the cup well with the spoon.

Ofcourse the preparation method and type of coffee could vary depending on the taste and type you are used to. You could also elaborate and keep abstracting the above steps (for example before step 6 you could say take the sugar jar and take a spoon full and so on), but be practical and if you keep abstracting you will lose focus on the problem. The idea here is to think about the objects involved in the above steps and identify its purpose. So lets list a few.

Vessel - a container to hold anything in limited quantity, used to cook
Cup - a container to hold anything in limited quantity, used basicaly to temporarily store and transfer
Match stick - stick that can be ignited to bring a flame.

Ok you could argue with me on the purpose descriptions above, but you are right whatever you describe as the purpose as far as you are clear with what you know as the purpose of that object. Now if you see in the above steps you can also see that there is a chain of reaction that happens between the objects with the outcome, you holding a cup of coffee. So it is not just objects but the interaction between objects and you and objects that’s making this world go around. But more than just understanding object interaction, a critical point is the purpose of the object is well defined and does not work beyond its purpose. For example you cannot bring the gas stove to flame with a vessel or a cup. The second important point is you have to use the objects in the right way specific to the problem you are addressing to make use of it effectively. For example if you try to keep the vessel upside down over the gas stove, the vessel doesn’t care but it does not solve your problem.

The next step to the above exercise is that you can think about object interactions and the sequence. This is one simple exercise that you could keep working on as many times in a day. Try thinking about the sequence of steps and the objects involved and their interaction next time when you sit before your TV and switch to another channel using the remote. You dont need to write it down or sit before your computer to do it, your mind is the notepad and brain is the processor, use them effectively and you are the master.


Deprecated: Function ereg_replace() is deprecated in /home/techmasa/public_html/wp-content/plugins/sociable/sociable.php on line 64
Blink this Object Thinking - Thinking Objects at blinklist.com    Bookmark Object Thinking - Thinking Objects at blogmarks    Bookmark Object Thinking - Thinking Objects at del.icio.us    Digg Object Thinking - Thinking Objects at Digg.com    Fark Object Thinking - Thinking Objects at Fark.com    Bookmark Object Thinking - Thinking Objects at Furl.net    Bookmark Object Thinking - Thinking Objects at NewsVine    Bookmark Object Thinking - Thinking Objects at reddit.com    Bookmark Object Thinking - Thinking Objects at Simpy.com    Bookmark Object Thinking - Thinking Objects at Spurl.net    Bookmark Object Thinking - Thinking Objects with wists    Bookmark Object Thinking - Thinking Objects at YahooMyWeb

Comments      Cosmos

Programming Tip #3 - Keep a watch on browser compatibility

Many a times and it is still the case most of the times, browser compatibility issues are the most troublesome. The basic problem is that we dont constantly keep a watch on the browser compatibility as and when we modify the presentation layer code. It is often at the end of the project or after significant code has been developed do we check the application in different browsers and sit spending lot of time in trying to fix stylesheets and HTML to make the application work consistently across browsers.

So how can we take care of this? While the issue cannot be totally avoided, but the browser/display related requirements should be kept in mind from the beginning of the project. This will help in finding out inconsistencies early and also look at alternatives. The following are the people and what they must do in the project team for making sure that browser/display related requirements is taken into consideration from the beginning.

    1. Business Analyst - is responsible for adding a non functional requirement on browser/display requirements. Basically it should contain the following,
             a. Browsers to be supported
             b. Minimum versions of browsers to be supported.
             c. Minimum resoution to be supported.
     2. UI designer - is responsible for
             a. designing the layout, style, look and feel
             b. generating stylesheets and HTML adhering to the browser/display requirements.
             c. collaborately working with the technical team on rich UI + AJAX requirements and it satisfies the browser/display requirements..
     3. Designers/Developers - are responsible for
             a. making sure the code does not affect the layout, style, look and feel of the application at any point of time.
             b. working with the UI designer in getting the ui design for rich UI + AJAX requirements, that adheres to browser/display requirements.
             c. including browser compatibility tests in the unit test cases.
     4. Testers - are responsible for
         a. including test cases that test browser/display requirements.
         b. Use a tool like Selenium to automate browser compatibility testing.

Here are few grains from the sack on browser compatibilites.

AnyBrowser.com - resources on browser compatibility verification
Browser compatibility chart
Browser Compatibility Tutorial
Style Master CSS tutorial
Websites that dont work well with FireFox
While browser compatibility testing seems to be one of the most ignored area in web app development projects, if attacked from the beginning can save a lot of time in trying to crack your head fixing inconsistencies.


Deprecated: Function ereg_replace() is deprecated in /home/techmasa/public_html/wp-content/plugins/sociable/sociable.php on line 64
Blink this Programming Tip #3 - Keep a watch on browser compatibility at blinklist.com    Bookmark Programming Tip #3 - Keep a watch on browser compatibility at blogmarks    Bookmark Programming Tip #3 - Keep a watch on browser compatibility at del.icio.us    Digg Programming Tip #3 - Keep a watch on browser compatibility at Digg.com    Fark Programming Tip #3 - Keep a watch on browser compatibility at Fark.com    Bookmark Programming Tip #3 - Keep a watch on browser compatibility at Furl.net    Bookmark Programming Tip #3 - Keep a watch on browser compatibility at NewsVine    Bookmark Programming Tip #3 - Keep a watch on browser compatibility at reddit.com    Bookmark Programming Tip #3 - Keep a watch on browser compatibility at Simpy.com    Bookmark Programming Tip #3 - Keep a watch on browser compatibility at Spurl.net    Bookmark Programming Tip #3 - Keep a watch on browser compatibility with wists    Bookmark Programming Tip #3 - Keep a watch on browser compatibility at YahooMyWeb

Comments      Cosmos

· « Previous entries

Creative Commons License  This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.