Tuesday 29 March 2011

Understanding ASP.NET Dynamic Compilation

When request processes we don’t know, how processes exactly works or compiles, recompilation process and how it will give compilation output. Let’s start with how it will exactly work.
ASP.NET must first parse and compile the code of your Web application into one or more assemblies.When the code is compiled, it is translated into a language-independent and CPU-independent representation called Microsoft Intermediate Language (MSIL). At run time, MSIL runs in the context of the .NET Framework, which translates MSIL into CPU-specific instructions for the processor on the computer running the application.
ASP.NET dynamic compilation enables you to modify your source code without having to explicitly compile your code before you deploy your Web application. If you modify a source file, ASP.NET automatically recompiles the file and updates all linked resources. The IIS server does not have to be restarted for the changes to take effect unless the <process Model> section has been changed.
-          Compiling on First Request
ASP.NET Web pages and code files are compiled dynamically when users first request a resource, such as an ASP.NET page (.aspx file), from a Web site. After pages and code files have been compiled the first time, the compiled resources are cached, so that subsequent requests to the same page are extremely efficient.
ASP.NET supports the dynamic compilation of ASP.NET pages (.aspx files), ASP.NET Web services (.asmx files), ASP.NET HTTP handlers (.ashx files) and ASP.NET application files (Global.asax), as well as other files, such as source code and class files.
-          Recompiling on Change
Any changes to a dynamically compiled file will automatically invalidate the file's cached compiled assembly and trigger recompilation of all affected resources. The next time a request to the code is made, ASP.NET recognizes that the code has changed and recompiles the affected resources of the Web application. This system enables you to quickly develop applications with a minimum of compilation processing overhead.
-          Compilation Dependencies
When the first request is made to an application, ASP.NET compiles files in a specific order. The first items to be compiled are referred to as the top-level items. After the first request, the top-level items are recompiled only if a dependency changes.
Top-level items include the App Global Resources folder, the App Web Resources folder, profile properties, the App Code folder, and the Global.asax file. After the top-level items are compiled, ASP.NET compiles additional items. These items include the App Local Resources folder, individual ASP.NET pages (.aspx files), ASP.NET user controls (.ascx files), ASP.NET HTTP Handlers (.ashx files), and ASP.NET HTTP modules (.asmx files), as well as themes, master pages, and other source files.
-          Compilation Output

When your code is compiled, the resulting assemblies are cached in a folder on the server. This folder requires appropriate permissions so that your code compiles and runs correctly. You can configure both the compilation folder location and the permissions under which your code compiles and operates.
Following example which shows steps of compilation in easy way
  1. Machine boots.
  2. Request for MyPage.aspx comes in (first time).
  3. MyPage.aspx compiles to an assembly* (we'll call it MyPage.dll* ).
  4. The portions of MyPage.dll that are needed for execution are JITed* to memory.*
  5. Page execution completes. The JITed code stays in memory.
  6. A new request for MyPage.aspx comes in. The page hasn't changed. The JITed code that is still in memory runs.
  7. The source for MyPage.aspx changes.
  8. A new request for MyPage.aspx comes in. MyPage.aspx compiles to an assembly, JITs, and executes. The JITed code stays in memory.
  9. A new request for MyPage.aspx comes in. The page hasn't changed. The JITed code that is still in memory runs.
  10. IIS is stopped and started.
  11. A new request for MyPage.aspx comes in. The page hasn't changed. Because IIS was stopped and started, the JITed code is no longer in memory. The existing MyPage.dll JITs and executes. This new JITed code stays in memory.

How IIS Process ASP.Net Request

Microsoft Active Server Pages, also known as ASP, since its first release in late 1996 provided web developers with a rich and complex framework for building web applications. As years passed its infrastructure evolved and improved so much that what is now known as ASP.NET is no longer something which resembles its predecessor. ASP.NET is a framework for building web applications, that is, applications that run over the web, where the client-server paradigm is represented mostly by a browser forwarding requests for resources of different kinds to a web server.
The interaction between client and server is very simple. Communications over the web occur via HTTP (Hyper Text Transfer Protocol), an application level protocol which relies on TCP and IP to transmit data between two nodes connected to the heterogeneous network known as World Wide Web.

What is Web Server?

When we want to host the application on a centralized location and wanted to access from many locations. Web server is responsible for handle all the requests that are coming from clients, process them and provide the responses.


What is IIS ?

IIS (Internet Information Server) is one of the most powerful web servers from Microsoft that is used to host your ASP.NET Web application. IIS has it’s own ASP.NET Process Engine  to handle the ASP.NET request. So, when a request comes from client to server, IIS takes that request and  process it and send response back to clients.

Request Processing :

Now let’s have a look how web server & IIS do things internally. Before we move ahead, we have to know about two main concepts
1.    Worker Process
2.   Application Pool
Worker Process:  Worker Process (w3wp.exe) runs the ASP.Net application in IIS. This process is responsible to manage all the request and response that are coming from client system.  All the ASP.Net functionality runs under the scope of worker process.  When a request comes to the server from a client worker process is responsible to generate the request and response. In a single word we can say worker process is the heart of ASP.NET Web Application which runs on IIS.

Application Pool: Application pool is the container of worker process.  Application pools is used to separate sets of IIS worker processes that share the same configuration.  Application pools enables a better security, reliability, and availability for any web application.  The worker process serves as the process boundary that separates each application pool so that when one worker process or application is having an issue or recycles, other applications or worker processes are not affected. This makes sure that a particular web application doesn’t not impact other web application as they are configured into different application pools.
Application Pool with multiple worker process is called “Web Garden”.
Now let’s have look how IIS process the request when a new request comes up from client.
If we look into the IIS 6.0 Architecture, we can divided them into Two Layer
1.    Kernel Mode
2.    User Mode
Now, Kernel mode is introduced with IIS 6.0, which contains the HTTP.SYS.  So whenever a request comes from Client to Server, it will hit HTTP.SYS First.

Now, HTTP.SYS is Responsible for pass the request to particular Application pool. Whenever we creates a new Application Pool, the ID of the Application Pool is being generated and it’s registered with the HTTP.SYS. So whenever HTTP.SYS Receives the request from any web application, it checks for the Application Pool and based on the application pool it send the request. 
So, this was the first steps of IIS Request Processing.
Till now, Client Requested for some information and request came to the Kernel level of IIS means at HTTP.SYS. HTTP.SYS has been identified the name of the application pool where to send. Now, let’s see how this request moves from HTTP.SYS to Application Pool. 

In User Level of IIS, we have Web Admin Services (WAS) which takes the request from HTTP.SYS and pass it to the respective application pool.
When Application pool receive the request, it simply pass the request to worker process (w3wp.exe) . The worker process “w3wp.exe” looks up the URL of the request in order to load the correct ISAPI extension. ISAPI extensions are the IIS way to handle requests for different resources. Once ASP.NET is installed, it installs its own ISAPI extension (aspnet_isapi.dll) and adds the mapping into IIS.  

When Worker process loads the aspnet_isapi.dll, it start an HTTPR untime, which is the entry point of an application. HTTPR untime is a class which calls the Process Request method to start Processing.
When this methods called, a new instance of HTTP Context is been created.  Which is accessible using HTTP Context? Current Properties. This object still remains alive during life time of object request.  Using Http Context. Current we can access some other objects like Request, Response, Session etc.
After that Http Runtime load an Http Application object with the help of  Http Application Factory class.. Each and every request should pass through the corresponding HTTP Module to reach to HTTP Handler, this list of module are configured by the HTTP Application.
Now, the concept comes called “HTTP Pipeline”. It is called a pipeline because it contains a set of Http Modules (For Both Web. config and Machine. config level) that intercept the request on its way to the Http Handler. HTTP Modules are classes that have access to the incoming request. We can also create our own HTTP Module if we need to handle anything during upcoming request and response.
All the request now passes from  http Module to  respective HTTP Handler then method and the ASP.NET Page life cycle starts.  This ends the IIS Request processing and start the ASP.NET Page Lifecycle.
The short overview of IIS Request how the request get processed in backend. 
When client request for some information from a web server, request first reaches to HTTP.SYS of IIS. HTTP.SYS then sends the request to respective Application Pool. Application Pool then forward the request to worker process to load the ISAPI Extension which will create an HTTP Runtime Object to Process the request via HTTP Module and HTTP Handler. After that the ASP.NET Page Life Cycle events start.

Monday 28 March 2011

Touch Screens

Now a day’s having a touch screen device like mobile, tablet PC, desktop, laptop etc, is usual thing. In simple words we can say, touch screen device is a combo of ease and style. But how many people know about biology of touch screen? So let’s see how touch screen works.....
The touch screen recognizes the location of the contact and responds according to the software program it contains. Interaction is made directly with a standalone computer or through a display connected to a larger network. There are three basic components to a touch screen system. The monitor can be an integrative monitor with a touch sensor built in or a touch sensor panel can be added, which sits over the monitor screen and detects movement on the screen. The second component is a controller card that translates the touch from the screen to computer language and sends it to the third component, a software driver that allows the screen and computer to work together.

How do touch screens work?
Touch screens are activated by the insertion or removal of the fingertip or by pressing the controls, active areas or targets with a mouth stick, head stick, or other similar device (stylus). Some touch screens support stylus input and others do not. The difference is in the device's touch sensor technology, of which there are several common types:
Resistive touch screens are pressure sensitive, so they can be operated with any input device, including a gloved hand or stylus. However, resistive screens can be easily damaged by sharp objects and they offer only 75% clarity, which may create additional problems for people with low vision.

Capacitive touch screens offer higher clarity and are more durable, but they do not respond to gloved hands or most styluses (the pointing device must be grounded).


Sunday 20 March 2011

Android Mania


Few months ago, I decided to buy a new  mobile. So as we normally do, I went for opinions , since then I am listening to the word ‘Android’.
I would say, Android mania all over. Get a mobile with Android Operation system and you will know what it is. Android delivers a complete set of software for mobile devices: an operating system, middleware and key mobile applications. (Middleware is sometimes called plumbing as it connects two applications and passes data between them).
Google usually refers to the Android OS as a software stack. Software stack means set of software subsystems or components needed to deliver a fully functional solution.
 Each layer of the stack groups together several programs that support specific operating system functions. Android is a Linux based open source operating system which has JAVA library.
There is a general thought that Google owns Android. But not just Google, there is Open Handset Alliance, a group of 65 technology and mobile companies including mobile operators, semiconductor companies, handset manufacturers; software companies commercialization companies who own Android.
The wonderful thing experienced on such Android mobiles is Android Apps.
 Generally   women spent lot of time in market, but if you are a techie person ,here is a market for you in your hand. This is the online software store developed  for Android devices. An application program called "Market" is preinstalled on most Android devices and allows users to browse. Android market- you will spend lot of time in surfing apps and using them. Find beautiful widgets , games etc. There are over 1,50,000 number of applications available in the  and many yet to come.
Android presents  open market place to the third party Android Application developers for instant publishing and feedback.

So Practically, there is no limit on the kind and number of Apps you can see on Android. Its creativity multiplied by huge array of developers. Interesting Idea, isn’t it?

Best thing is you can develop an App too. It’s not difficult. What you need is an Idea and some development skills. Some Indian small firms have already joined the party and earning there Millions.
Hope to see your application in Market soon.

Cloud Computing

Suppose  in a  software company some ‘XYZ’ employee’s  particular responsibility include, making sure that all of the company’s  employees have the right hardware and software ,which is required to get their job done.
 Buying just computers for everyone isn't enough -- but have to purchase software or software licenses to give employees the tools they need. Whenever there is  a new joinee, company needs to buy more software or make sure current software license allows another user, this becomes a tedious job.
Now here is something which can make change in the scenario.
Rather than installing a suite of software for each computer, just load one application. That application would allow users to log into a Web-based service which hosts all the programs the user would need for his or her job. Remote machines owned by another company would run everything , from e-mail to word processing and complex data analysis programs. This is cloud computing and it could change the entire computer industry.
In a cloud computing system, there's a significant workload shift. Local computers no longer have to do all the heavy lifting when it comes to running applications. The network of computers that make up the cloud handles them instead. Important thing to mention is, hardware and software demands on the user's side decrease. The only thing the user's computer needs to be able to run is the cloud computing system's interface software, which can be as simple as a Web browser, and the cloud's network takes care of the rest.
You've had some experience with cloud computing ,as we generally have an e-mail account on Gmail,Yahoo or Hotmail. So  Instead of running an e-mail program on your computer, we log in to e-mail account. The software and storage for your account doesn't exist on your computer -- it's on the service's computer cloud.
So in Short, the companies don't have to buy a set of software or software licenses for every employee. Instead, the company could pay a metered fee to a cloud computing company. In future ,IT needs will be reduced ,if  companies switch to using streamlined computer systems.

A Superstar from Silicon Valley


Silicon Valley has earned a reputation as a platform for folks who like to play with Ideas. Who are willing to change the world with their vision. And yes, turnaround their fortunes as they do so.In this blog, lets meet a guy who needs no introduction.
He is Adopted. Pretty normal guy. Founded Apple in 1976 with Friend Steve Wozniak. Got booted from his own company in 1985. Yes, Steve Jobs. Earlier Newton was famous because of his apple related invention (gravitational force etc.).

Our Steve Jobs invented another Apple. His journey started when he was born to a young unwed college graduate student. And he was put up for adoption. His mother wanted him to be a graduate and so he was adopted by a couple.
Its a different story that he dropped out. He never graduated from college. This is something that many of us would want to happen with us and still become a great hit in the profession that we choose. That’s why he is the idol of billions of young minds today.
He was spending his parent’s money first unknowingly and then knowingly after realizing that the classes didn’t interest him. So he decided to quit and feels it was one of his best decisions. Like a typical Hindi film actor, Steve had a hard life but he kept following his curiosity and intuition. Genius folks have their own way.
 He found his interest in calligraphy. He learned about serif and san serif. After 10 yrs he developed MAC (Macintosh) computer that had this beautiful typography application. He gave his thoughts a practical form. He started Apple in his parent’s garage when he was 20.After 10 yrs when the company was in full bloom, he got fired from his own company. He was publicly out.
He thought of running away from valley but then he decided to start over again. He then started another Animation company named “Pixar”. Yes, the same company which gave us greatest animation movies in history of Hollywood. All was good. Later he was called back into Apple when the company was not doing good and he turned it around, how?
His iPod shook the whole music industry and later he continued with his intuitive and innovative products. Today Apple has Cult fan following. Credit is all Steve’s.
His way of making decisions is something like this - "If you live each day as if it was your last, someday you'll most certainly be right.
He was diagnosed with cancer in 2004. He had maximum 6 months to get his affairs in order and say goodbye. But luck was by his side once again. He had surgery and he is fine now. The Man surely followed what he preached.
Time is limited so don’t waste it in living someone else's life. 'You have got to find what you love'.
So, time for a quick check. ..Do you love what you do?

Wednesday 16 March 2011

Just Open up windows and start connecting people…

It was electrifying news for techno freaks like me when I heard Nokia, the biggest global handset manufacturer and Microsoft, operating system industry recently had a multi-million dollar deal and their collaboration for mobile development. This deal is a big threat for lot of industries. Microsoft is an earliest investor in a field of mobile operating system development. Microsoft promoted windows operating system with many partners like HTC and Motorola. Google’s Android is a main competitor of Microsoft’s windows mobile operating system.
Now Nokia is ready to carry forward the legacy of Microsoft windows phones and it’s a great new for millions of cell phone addicts. Nokia will not be just contributing in hardware support but they are offering their resources to improve their business and to capture market segments. According to reports Nokia is paying royalty fee for every license it uses. This deal is nothing but a huge win for Microsoft.
Windows7 mobile operating system has great operating interface which is slick, intuitive and redefined when I compared it with previous versions of windows mobile operating systems.Windows7 system has some amazing features like portrait as well as landscape QWERTY support, Internet Explorer which is user friendly, Microsoft’s Zune service for better digital online media, great social integration and good support for Appstore. Beside that Nokia has world’s best map service and is included in the windows7 mobile operating system. I find Nokia maps are as good as Google maps. At startups, screen tells you the updates on what is going on, what will be happening next and what you have missed. Windows7 mobile system has lot of better features like hardware choice, business productivity, search and maps communication, web browsing etc. Microsoft finally gave up their old Windows operating system and launched amazing and fresh windows7 operating system.
Now start connecting people from your tiny pocket with the help of windows.

Too Much Technology Has Destroyed Our Ability To Sleep


Technology is a boon to mankind within its own limits. As rightly said “Technology is so much fun but we can drown in our technology. The fog of information can drive out health and hygiene”. To talk more about technology Mobiles works on radio waves and little part of this radio emission gets absorbed by the human head. It is a scientifically proven fact that radio waves have vital effects on human brain. Currently in India more than 1/3 population has mobile phones and network is expanding rapidly. As mentioned by Nicolas Deleon people don’t get enough sleep overall. The condition in Indian metro cities is even worse; people hardly get time to sleep. Most of the younger generation is already addicted to computers and internet social networking sites. Survey proves that people spent approximately 2-3 hours sitting in front of the computer before bedtime.
“To achieve the impossible dream, try going to sleep.”It is very necessary to sleep for at least 6to 8 hours a day. Addicted to technology …are you? If yes then why not use same technology to get some quality sleep why not use soft music, massage chairs or some light effects.

Have a good sleep…

Blog link:
http://www.crunchgear.com/2011/03/07/study-too-much-technology-has-destroyed-our-ability-to-sleep/

Sixth Sense Technology

Can you just imagine the whole technology is dancing on your four fingers, now just open up your eyes and feel this amazing techno dance practically with the help of Sixth Sense Technology? This Dream came true by effort of genius Indian Scientist Mr.Pranav Mistri in the year 2009.
Sixth Sense technology interprets our finger moments and arrangements into gestures which provide interaction instructions for the actual application interface.
If you think there is correct definition for future then it’s the Sixth Sense technology. In future Sixth Sense technology will help mankind to produce unimaginable gadgets which will be utilized to drive the world to the highest limit of excellence. It is a revolution that will facilitate society by improving standards in fields such as industrial growth, communication, automobile, research and technology etc. The thought creeping in my mind is why not use this technology as a way of effective communication for deaf, blind & that’s an immense challenge where we could give them second chance to live life naturally.

It will also prevent wastage of human efforts, resources.
Imagine yourself traveling and you want to take a note of something, generally what you would do is grab a pen and paper to take down information. This simple operation would consume several minutes. Now imagine yourself with Sixth Sense technology, what you would do is just focus the camera on your palm which would be your temporary display, place device microphone on your palm and then just move your fingers for drawing letters just like using stylus on your touch screen. The microphone which is connected to device captures the friction generated by your finger and sensor in the device captures position of your finger, accordingly the device would display and save the input data. Well technology! How great and helpful can it be!

In last two decades technology emerged drastically and will keep doing so with our imagination and this gives me a feeling of “Having started with nothing and still having most of it”.