
mDistribute - License films to mobile industry
Posted on: 2/23/2010 by Gautam Labels: cool stuff, mobiles, reviews
Laptop Storage - Is SSD the future?
Posted on: 2/08/2010 by Gautam Labels: articles, techy stuffMVC Design Pattern: An Introduction
Posted on: 1/30/2010 by Gautam Labels: articles, information, mvc, web development The MVC Paradigm
So what does this have to so with programming? For one, most programs are centred on data and display. A majority of the software we use accesses some kind of data and displays something on screen. The data need not be something we would concern ourselves with, but it is there. To use the MVC paradigm, we separate the functionality of our application into three parts, the model, the view and the controller. The model is the data store of the application, the view / views are what decide how data is displayed, and the controller is what handles interaction and response. It is not as simple a job as it sounds, it can often be quite counter-intuitive, and sometimes might not even be the best thing to do.
The model
The model is the repository of data for the entire application. Any information that the program works with is part of the model. By decoupling this from the other parts of the program we ensure that the program will continue working as expected even if we decide to change the way we store or access data. For example, if you develop a simple application for handling contacts, and address book. You initially start off using text files while developing the application. However, you may later decide to store it as an XML file or a VCF file, or even a full fledged database. For this, all you would need to do is add the requisite functions to handle those formats to your model. Since the rest of the application works off the model, it doesn’t matter how the model is getting the data, as long as it’s getting it. So you could even add functionality to store the data online, and all you would need to change is the model. It merely provides a standard fixed way of accessing its data, and modifying it.
The View
The view is part of the application that displays data. Buttons, lists, combo boxes, etc. make up the view. It retrieves data from the model and displays it to the user; however, it does not make any changes to the data itself. Therefore, in a way, it has read-only access to the data. An application need not have only one view. On the other hand, having multiple views easily is one of the strong points of using MVC architecture. Taking our previous example of an address book application, we could create as many views for it as we want. To add or edit contacts, you could provide multiple views such as a wizard view or a simple form view. The view is not dependent on the control; however, it needs to be aware of the model to display the data in it.
The Controller
The controller represents the main logic of your program. It is like the brain which manages the other elements of the MVC program. It accesses and modifies the data of the model in response to the user’s interactions with the view. It is again not concerned with what the view looks like. It is an action-reaction system, where certain interactions with the view will result in modifications in the model, or changes in the view. As in the address book example, the controller would then views such as a wizard view or a simple form view. The view is not dependent on the control; however, it needs to be aware of the model to display the data in it.
An Example
Here is simple explanation of how things go in a simple MVC program. We take the example of a simple program, which has a textbox and a button. When you click on the button, the content of the textbox is capitalised. Here, let’s enumerate the role of the model, the view and the controller.
- The model stores the contents of the textbox, and provides a way of accessing and modifying it. It also registers an event when this data is change.
- The view creates the visual part of the application, the button and the textbox, and the window in which they reside. It also registers an event when the button is clicked.
- The controller responds to any events generated by the view (or elsewhere), and modify the contents of the model.
So when the user clicks on the button, it responds to that event, and capitalises the text box content stored in the model. The same view can be used for a program which would encrypt and decrypt the contents of the text box, and the same controller can be used in a word processing program for providing capitalization as a function. Some kind of mechanism for updating the view in response to changes in the model should also be in place and this is where a framework comes in. Although it is possible to make it entirely yourself, why not let the framework do the grunt work for you?
Video tutorial/review of the Apple iPad
Posted on: 1/30/2010 by Gautam Labels: apple, cool gadgets, reviews
Here is a cool video about the new tablet from Apple - iPad. This video gives you a overall review of the product as well as it can also be considered as a video tutorial for using the device.
I just loved watching it. It describes all the features of the device.
Folks, I have nothing else to write here. Just watch the video...
The video is not allowed to be embedded. The embed code is not available.
But, don't worry....
You can watch it on YouTube, here is the link...
http://www.youtube.com/watch?v=Wj9nYPl5l8U
Internet Explorer 8: Tips and Tricks
Posted on: 1/29/2010 by Gautam Labels: internet, tips and tricks, windowsRearranging the toolbars
The toolbar is locked in IE8. Right-click on the IE8 toolbar area and uncheck “Lock the Toolbars”. By doing this, you can move the Command bar and Favorites bar around with the mouse. You can also move the Favorites button down to the Tabs level and separate it from the Favorites bar. You can rearrange items on your Favorites bar by dragging items from one spot on the Favorites bar to another. You can also create folders and organize your favorite links, web slices and feeds. To create folders, right-click an existing item on the favorites bar and then click New Folder. You can then drag items from the Favorites bar into that folder. To remove old links, right-click the item on the Favourites bar, and then click Delete.
Change the position of Stop and Refresh
You can change the position of the Stop and Refresh button from after the Address bar to before it. To do this, right-click on the toolbar area and go to Customize. Next check “Show Stop and Refresh Buttons before Address Bar” and you will have changed the position of those buttons.
Wider search bar
For those of you who want a little more space for your Search bar, or little less space for that matter, you can adjust the length of the Search bar in IE8. For this you just put your mouse in the area between the search bar and the address bar and adjust it accordingly.
Adding links
There are three ways to add a link to the Favorites bar in IE8: you can either drag the web page icon from the Address bar directly to the Favorites bar. Alternatively, you can drag a link located on the web page to the Favorites bar, or lastly you could just click the Add to Favourites button and then click on Add to Favorites Bar.
Subscribing and previewing web slices
Web slices is an interesting new feature added to IE8. It keeps you updated not with an entire web site, but a particular section or part of a web page. For example, once you subscribe to a web slice such as an auction price, you will be able to see the updated content and this appears as a link on the Favorites bar. When the Web slice is updated, the link on the Favorites bar will appear in bold. You can then click the link to see the updated content. When a Web slice is available, the color of the Web slice icon will change on the Command bar. The Web slice icon will also appear on the content that you can add to the Favourites bar. To subscribe to a Web slice and add it to the Favorites bar, you can either click the Web slice button on the Command bar or click the Web slice icon on the page. Your subscribed Web slice will appear on the left side of the Favorites bar. When there is an update on one of your subscribed web slices, that link will be highlighted on the Favorites bar. You can also preview the Web slice that you have added to the Favorites bar without leaving the web site you are currently viewing. Just click on the Web slice link on the Favorites bar to bring up a rich preview of the web page, which you can then click to navigate to that site if you want.
Compatibility view
Not all web sites on the internet have evolved to be compatible with IE8 and so Microsoft has introduced the Compatibility View option with its browser. This will allow you to view the web site as if you were viewing it on the previous version, i.e. IE7, so that no major changes need to be made on the web site’s front. This option is located next to the address bar, right before the stop and refresh buttons. This feature, once clicked, will only work on the site you have used it with and not other sites that you will visit in the future. IE8 also allows you to maintain a list of the web sites that you want to use with the compatibility view options. For this, go to Tools > Compatibility View Settings from the menu bar. This settings window will allow you to add or remove web sites to be viewed without all the IE8 features. There is an option that you can check “Include updated website lists from Microsoft” which will get an updated compatibility list from Microsoft itself. For those who don’t want any changes to be viewed at all, you can opt to view all the web sites in Compatibility View by putting a check next to “Display all websites in Compatibility View”.
Accelerators
Everyday browsing tasks like translating a word or a line, mapping an address and other such tasks are normally done by opening a new web site for each one separately. IE8 has an interesting new feature to perform all these tasks on the spot, making browsing more efficient. When you highlight some text on the web site you are currently viewing a small icon appears — the Accelerators icon. Either click that icon or simply right-click to get a list of options that you can perform for your selection. By default, you can add that text to your Windows Live Blog, email with Windows Live, Map with Live Search, Search with Google and even Translate with Live Search, and other such daily tasks. Some of them don’t even need you to visit another web site. For example, a definition of the highlighted word will be displayed in a small box when you just mouse over one of the accelerator options. You can download and add more accelerators from www.ieaddons.com.
Caret browsing
An alternative to using a mouse to select text and navigate around within a web page, you can use the navigation keys on the keyboard — Home, End, Page Up, Page Down and the arrow keys. This feature in IE8 is called caret browsing. To use this feature, you just need to hit the [F7] key. On activating caret browsing, click once on any text on the web site you are currently viewing. You will see a cursor that you can now navigate with freely.
