Monday, December 17, 2007
Guide To Maximize Laptop Battery Life
Conditioning a new battery pack Before you use a battery pack for the first time, there is a "conditioning" process that you should follow:
1 Insert the new battery without turning the computer on.
2 Connect the AC adapter and fully charge the battery.
3 Disconnect the AC adapter.
4 Turn on the computer and operate using battery power.
5 Fully deplete the battery until the battery-low warning appears.
6 Reconnect the AC adapter and fully charge the battery again.
Follow these steps again until the battery has been charged and discharged three times. Use this conditioning process for all new batteries, or if a battery hasn't been used for a long time. If the computer is to be stored for more
than two weeks, you are advised to remove the battery pack from the unit.
Warning: Do not expose battery packs to temperatures below 0°C
(32°F) or above 45°C (113°F). Extreme temperatures may adversely
affect the battery pack.
By following the battery conditioning process you condition your battery to accept the maximum possible charge. Failure to follow this procedure will prevent you from obtaining the maximum battery charge, and will also shorten the effective lifespan of the battery. In addition, the useful lifespan of the battery is adversely affected by the following usage patterns:
• Using the computer on constant AC power with the battery
inserted. If you want to use constant AC power, you are advised to
remove the battery pack after it is fully charged.
• Not discharging and recharging the battery to its extremes, as
described above.
• Frequent use; the more you use the battery, the faster it will reach
the end of its effective life. A standard computer battery has a life
span of about 300 charges.
Optimising battery life
Optimizing battery life helps you get the most out of battery
operation, prolonging the charge/recharge cycle and improving
recharging efficiency. You are advised to follow the suggestions set
out below:
• Purchase an extra battery pack.
• Use AC power whenever possible, reserving battery for on-the-go
use.
• Eject a PC Card if it is not being used, as it will continue to draw
power (for selected model).
• Store the battery pack in a cool, dry place. The recommended
temperature is 10°C (50°F) to 30°C (86°F). Higher temperatures
cause the battery to self-discharge faster.
• Excessive recharging decreases the battery life.
• Look after your AC adapter and battery.
Thursday, December 13, 2007
Widget Server Spring Framework Integration
As Java lightweight framework, Spring is widely used in Java world. it is because Spring is simple, light, and easy to integrate with other frameworks. Widget Server Framework, as one of Xml Gui Implementation with Java, gives us a great solution, that is when we make an application, we can use it as a standalone, Thin Client ,and web based app without changing the code.
The main idea when we want to integrate this two frameworks (using Widget Server at Presentation Layer and Spring at Bussines Layer) is we have to make Widget Server call Spring Application Context/Bean Factory(i.e file applicationContext.xml) when Widget Server Servlet is initialized by Servlet Container.
First thing we should do is creating Widget Server mandatory directory in spring project directory
for example at Spring "DistroSystem" Project i have war/ and src/ directory
DistroSystem
|—-src
|
|—war–
|
|–WEB-INF
|
|—lib
|
|—classes
Widget Server Mandatory directory is
|
|–*.xml
|—start
| |
| |–src
|
|–WEB-INF
|
|—lib
|
|—classes
Next, move Widget Server's “start” directory to Spring's “war” directory, After that move all file (not directory just file) under to “war” directory. Move all Widget Server library under “lib” to Spring's “lib”. For Widget Server "src" directory, move all its content to spring's “src” directory.
After that directory structure must like this:
DistroSystem
|
|—-src
| |
| |–Wiser Java Source
| |–Old Bussines and/
| or persistence Java source
|—war–
|
|–start
|
|–WEB-INF
|
|—lib
| |–Spring And Wiser library
| dependency
|
|—classes
Step 2 is modifying piccolo.jar, theWiser library dependency. Extract piccolo.jar . Remove all piccolo's xml parsers package(folder javax). and compress piccolo again. So in this new piccolo.jar only exist "com" and "META-INF" folder. After this you can write your web.xml.
Step 3 is developing your presentation layer and Listener code. In order to make Listener code get bean from Spring, We must make parent listener for all listeners which we want it to call Spring bean code. Here is my code
package Listeners;
import de.ug2t.unifiedGui.service.UnBasicServlet;
import de.ug2t.kernel.KeRegisteredObject;
import javax.servlet.*;
import javax.servlet.http.*;
import org.springframework.web.context.*;
import org.springframework.web.context.support.*;
public abstract class BasicListener{
private WebApplicationContext wac ;
public BasicListener()
{
ServletConfig sg=
(ServletConfig)KeRegisteredObject.pcmf_getGlobalObjByName
(UnBasicServlet.SERVLET_CONFIG);
ServletContext sc =sg.getServletContext();
wac = WebApplicationContextUtils.getWebApplicationContext(sc);
}
public WebApplicationContext getWebApplicationContext()
{
return wac;
}
}
This is one of my Widget Server listener code which use Spring's Bean
package Listeners;
import de.ug2t.kernel.*;
import de.ug2t.unifiedGui.*;
import de.ug2t.unifiedGui.interfaces.*;
import de.ug2t.unifiedGui.loader.*;
import java.util.*;
import DistroSystem.Stock.DAO.*;
import DistroSystem.Stock.Logic.*;
import DistroSystem.*;
import org.springframework.web.context.*;
public class BarangGetAll_li extends BasicListener implements IUnGuiEventListener
{
private BukuManager buku_man;
public void pcmf_execListener(UnComponent xParam) throws Exception
{
WebApplicationContext wac = getWebApplicationContext();
buku_man=(BukuManager)wac.getBean("bukuManager");
// get all relevant widgets from the registry
IUnTable l_table = (IUnTable) KeRegisteredObject.pcmf_getObjByName("atable");
UnTableLoader l_load = (UnTableLoader) KeRegisteredObject.pcmf_getObjByName("tableLoader");
List list = buku_man.getAll();
// insert row
((BukuTableModel) l_load.pcmf_getModel()).setBuku(list);
l_table.pcmf_repaint();
return;
}
}
When we want to get beans's Spring we just must extend BasicListener class. To get a bean first call super method getWebApplicationContext(), this method will return "WebApplicationContext" object. With this object you can get all beans from Spring's Application Context