MY mENU


Sunday, 8 April 2012

Rework System Restore


The amount of space Windows uses for restore points is a little more complicated than a single percentage value. The Registry includes its own setting for the maximum disk space given to System Restore, and Windows uses whichever amount is larger: the percentage you specify via the System Properties dialog box, or the Registry's maximum value. Any disk space you free up via System Properties won't instantly be used by System Restore; it will be available until a new restore point requires more space than the amount allotted via the percentage value. The percentage and max values tell Windows only when to stop making new restore points. 


To lock in your System Restore allocation, open the Registry Editor and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\SystemRestore.  Select the SystemRestore icon in the left pane to see several icons appear in the right pane. Do not experiment with just any of these icons! While you an safely change the value of some of them, Microsoft warns that others should not be altered under any circumstances. Fortunately, you can safely edit the values for the DiskPercent and DSMax icons, which control System Restore's disk-space allotments. To change the maximum amount of disk space System Restore will use (providing it's larger than the percentage value), double-click the DSMax icon. In the Edit DWORD Value dialog box, click Decimal so you can see the specified number of megabytes in the 'Value data' box (the default on most systems is '400'). Change this to the desired amount, and click OK.


While you're there, you can also safely edit the DSMin value, which specifies the minimum space System Restore needs to work at all. Normally, if free space on your Windows drive gets too low, System Restore shuts down and makes no restore points until you have at least 200MB of free space. Setting this value determines the amount of disk space at which System Restore will wake up and attempt to start saving restore points again. However, just because System Restore will try to do so, it won't necessarily succeed if the available space is too small. Unfortunately, we know of no method to determine how much space a single restore point will require, so setting this amount too low could render the feature useless. Still, you can fit a lot of system files in 100MB of disk space.


To change this value, double-click the DSMin icon, click Decimal, and enter your desired amount of free disk space (in megabytes) in the 'Value data' box. Click OK .

What is load factor?


 Load factor determines the point at which the capacity of HashTable or HashMap will be automatically doubled.

Saturday, 7 April 2012

JSP Implicit Objects


JSP container provides a list of instantiated objects for you to access different kind of data in a web application. Those objects are called implicit object because it is automatically available to access. These are some main implicit objects in JSP which you use most:

  • request object
  • response object
  • session object
  • out object
  • pageContext object
  • application object
  • config object
  • page object
  • excpetion object

The request object

Each time a client requests a JSP page, the JSP engine creates a new object to represents that request called request object.  The request object is an instance of classjavax.servlet.http.HttpServletRequest. The request object contains all information about the current HTTP request and the clients.  Be noted that request object only available in a scope of the current request. It is re-created each time new request is made.
By using methods of the request object you can access almost information such as HTTP header, query string, cookies...

The response object

JSP also creates the response object which is an instance of classjavax.servlet.http.HttpServletResponse.  The response object represents the response to the client. By using this object you can add new cookies, change MIME content type of the page. In addition, the response object also contains sufficient information on the HTTP to be able to return HTTP status codes or make the page redirect to the other page.

The session object

The session object is used to track information of a particular client between multiple requests. the session object is avaible in the server so it can helps you to overcome the stateless of HTTP protocol. You can use session object to store a arbitrary information between client requests. The session object is an instance of classjavax.servlet.http.HttpSession.

The out object

The output stream is exposed to the JSP through the out object. the out object is an instance of class javax.servlet.jsp.JspWriter. The out object may refer to an output stream or a filtered stream... You can use the out object methods to send the data into the output stream such as println method. Then JSP take care the rest.

The pageContext object

The pageContext object represent the entire JSP page. You can use the pageContext objectto get page attributes of a page. the pageContext object is an instance of classjavax.servlet.jsp.pagecontext.

The application object

The application object is a representation of JSP page through its life cycle. The application object is created when a JSP page is initialized and removed when the JSP page is removed by jspDestroy() method or JSP page is recompiled. As its name imply, the information of the application object is accessible to any object used within the JSP page.

The config object

The config object allows you to access the initialization parameters for the Servlet and JSP engine. The config object is an instance of the class javax.servlet.ServletConfig.

The page object

The page object is an instance of a JSP page. By using the page object, you can call any method of the page's servlet.

The exception object

The exception object contains the exception which is thrown from the previous JSP page. You can use the exception object to generate friendly error message based on erorr condition to the end-user.