2011年3月15日 星期二

強迫IE用IE7的相容性檢視模式

寫個class繼承javax.servlet.Filter,在doFilter裡撰寫以下程式:

public void doFilter(ServletRequest aRequest, ServletResponse aResponse, FilterChain aChain)
        throws IOException, ServletException {
    //強迫IE用IE7的相容性檢視模式
    ((HttpServletResponse) aResponse).setHeader("X-UA-Compatible", "IE=EmulateIE7");
    aChain.doFilter(aRequest, aResponse);
}

2010年11月25日 星期四

如何關掉Toad的呱呱聲

View –> Toad Options –> StartUp –> uncheck the option “Play Toad wave file”

2010年10月17日 星期日

用CSS改變滑鼠指標

<span style="cursor:hand">手形</span>
<span style="cursor:crosshair">十字</span>
<span style="cursor:text" >文字游標</span>
<span style="cursor:wait" >等待</span>
<span style="cursor:default" >預設</span>
<span style="cursor:help" >問號</span>
<span style="cursor:e-resize" >左右箭頭</span>
<span style="cursor:s-resize" >上下箭頭</span>
<span style="cursor:auto" >系統自動給出效果</span>

2010年5月18日 星期二

Programmatic hot deploy with Jetty

  1. Create the server:
    Server jetty = new Server();

     

  2. Create a handlerCollection with a ContextHandlerCollection in it:
    HandlerCollection hc = new HandlerCollection ();
    ContextHandlerCollection contextHandlerCollection = new ContextHandlerCollection();
    hc.setHandlers(new Handler[]{contextHandlerCollection});
    jetty.setHandler(hc);

     

  3. Start the server:
    server.start();

     

  4. Hot deploy your web application:
    WebAppContext warWebappContext = new WebAppContext();
    //configure it ...
    contextHandlerCollection.addHandler(warWebappContext);
    warWebappContext.start();

     

  5. Hot undeploy your application:
    //get the WebAppContext to undeploy...
    WebAppContext toUndeploy = getWebAppContextToUndeploy();
    //stop it
    toUndeploy.stop();
    //and remove it from the handler collection
    contextHandlerCollection.removeHandler(toUndeploy);

    In a nutshell, the trick is to use a HandlerCollection for your WebAppContextHandler.
    source: http://www.bonitasoft.org/blog/tutorial/programmatic-hot-deploy-with-jetty/

2010年3月23日 星期二

Gigaspaces Notes

JVM fine-tune

http://www.gigaspaces.com/wiki/display/XAP7/Tuning+Java+Virtual+Machines

GigaSpaces fine-tune

http://www.gigaspaces.com/wiki/display/XAP7/Tuning+GigaSpaces+Performance

Windows network fine-tune

http://www.gigaspaces.com/wiki/display/XAP7/Tuning+Infrastructure

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"KeepAliveInterval"="1000"
"KeepAliveTime"="1000"

Rapid loading to address the CSV file loading performance.

http://www.gigaspaces.com/wiki/display/SBP/Rapid+Data+Load

First of all, please let your team to read http://www.gigaspaces.com/wiki/display/XAP7/Polling+Container . For your case, please read "Concurrent Consumers" session to configuration it work with more threads and it will increase the performance.

And also, the below links are useful since you are talking about GuangZhou business today:

Eucaplyptus

http://open.eucalyptus.com

Nati's blog are related to cloud computing

http://natishalom.typepad.com/nati_shaloms_blog/2010/01/the-missing-piece-in-the-virtualization-stack-part-1.html

http://natishalom.typepad.com/

Webinar - On Demand Middleware Services for the Enterprise - Coming Up in 2010

http://www.gigaspaces.com/resource/video

Please follow Nati's blog, from there you will learn more basic concepts of cloud computing not only GigaSpaces.

1. How to get the number of web request.

instance.getStatistics().getWebRequests().getTotal();

    instance is a jetty PU.

2. http://www.gigaspaces.com/wiki/display/XAP7/Administration+and+Monitoring+API

    To get the memory statistics ( Virtual machine and physical machine)

And also you can use this sample(Petclinic) codes:

http://www.openspaces.org/display/DAE/Project+Downloads

2009年11月6日 星期五

Change user profile path in windows xp

Changing the ProfileImagePath value in the registry
ProfileImagePath registry value
The ProfileList registry key contains some sub-keys, which are nothing but the list of User Account Security Identifiers (SID). Each of the SID represents an Account. The key is located here:

HKEY_LOCAL_MACHINE \ SOFTWARE\ Microsoft\ Windows NT \ CurrentVersion \ ProfileList