• ClassLoader cl = ClassLoader.getSystemClassLoader();

    URL[] urls = ((URLClassLoader)cl).getURLs();

    for(URL url: urls){
    System.out.println(url.getFile());
    }

  • Types of web services
    Big web services – SOAP based web services, xml only
    Restful supports xml and json

    Different types of web service generation
    axis2 uses wsdl2java to generate code
    cxf supports jax-ws and jax-rs ( restful web service), it uses annotation and wsimport

    wsimport from java itself of jax-ws 2.0

    jax-rpc and jax-ws
    jax-ws is the replacement for jax-rpc

  • Reading Dan Brown’s deception point

  • 一生守候 - 马季自传
    直到世界尽头 - 林丹

  •  

    Book to read

    书名 Tyrants
    副标题 History’s 100 Most Evil Despots & Dictators

  • The government’s slew of further tightening measures will have a major impact on the public housing market, said analysts.

    The policies which took effect on Saturday include an additional buyer’s stamp duty (ABSD) on permanent residents (PRs) buying their first residential property and on Singaporeans purchasing their second residential property, as well as tighter eligibility for loans to buy HDB flats and requirements for owner-occupation by PR buyers.

    The news comes hot on the heels of HDB’s flash estimates which revealed that resale flat prices grew by 2.5 percent in the last quarter of 2012, their fastest pace for the year.

    “It is evident that the latest cooling measures is to moderate the housing prices and instill greater prudence in financing HDB flat,” said Mohamed Ismail, Chief Executive of PropNex Realty.

    He noted that the revised ABSD will impact the PR segment most. “PRs will now have to raise an additional five percent cash outlay to pay for the ABSD in their purchase of the first resale flat.”

    According to Ismail, as PRs make up about 20 percent of the HDB resale market, demand for such units are likely to ease in the coming months.

    Moreover, PRs who could only borrow from financial institutions for the purchase of resale HDB flats are now going to be restricted by the Mortgage Servicing Ratios (MSRs) for loans.

    Ismail believes this will greatly reduce the quantum that they can borrow as the ratio is now being reduced to 30 percent of the borrower’s gross monthly income (originally 40 percent of the borrower’s gross monthly income).

    PRs will also be barred from subletting and must sell their flat within six months of purchasing a private residential property. Currently, PRs own 49,190 out of the one million HDB flats and the 2,142 PR rented flats form about five percent of all approved flats for sublet.

    “Overall the new cooling measures will result in lowering the COVs (cash-over-valuations) as buyers will have to contend with lower MSR for all Singapore citizens and Singapore PRs and the new seven percent ABSD for PRs. The COVs for bigger flats (i.e. 5-room and Executive flat category) will witness a sharper drop by 30 percent immediately. The current median COV for 5-room and Executive flats have been around S$40,000 to S$50,000. This lower COV may encourage some first-timers to enter the resale market.”

    “Overall, median resale prices of HDB this year will substantially slow down from the hay days of double digit growth in 2010 and 2011 and six percent growth in 2012. This year, we expect HDB prices to remain flat and at best attaining only a one to two percent growth in keeping pace with the economic growth,” Ismail added.

  • ####inistall
    yum install httpd
    ####control
    /etc/init.d/httpd start/stop/restart/status
    ####config
    vi /etc/httpd/conf/httpd.conf

  • First of all, JVM memory
    for 32 bit OS, JVM max is 4GB of RAM.

    Java Heap
    java heap is a continuous memory region where all the Objects data will be stored.

    Java Heap parameters:
    -Xmx : max heap size (ex: -Xmx1024)
    -Xms : min heap size. Having -Xms = 1.8GB (32bit) can be bad, because you don’t let memory for anything else.
    -Xmn : the size of the heap for the young generation
    Young generation represents all the objects which have a short life of time. Young generation objects are in a specific location into the heap, where the garbage collector will pass often. All new objects are created into the young generation region (called “eden”). When an object survive is still “alive” after more than 2-3 gc cleaning, then it will be swap has an “old generation” : they are “survivor” .
    Good size is 33%
    -XX:NewRatio : the same as Wmn, but using a % (dynamic fs static -Xmn option). -XX:NewRatio=3 means that the ratio between the old and young generation is 1:3
    -XX:NewSize – Size of the young generation at JVM init. Calculated automatically if you specify -XX:NewRatio
    -XX:MaxNewSize – The largest size the young generation can grow to (unlimited if this value is not specified at command line)
    -XX:SurvivorRatio : “old generation” called tenured generation, ratio, in %. For example, -XX:SurvivorRatio=6 sets the ratio between each survivor space and eden to be 1:6 (eden is where new objects are created)
    -XX:MinHeapFreeRatio: default is 40%. JVM will allocate memory to always have as minimum 40% of free memory. When -Xmx = -Xms, it’s useless.
    -XX:MaxHeapFreeRatio: default is 70%. The same as Min, to avoid unecessary memory allocation.

    For weblogic setup:
    1. Open the domain environment sh file:

            
    \user_projects\domains\base_domain\bin\setDomainEnv.sh
    

    2. Locate the following remark, inside the sh file: (‘Search’ -> “#REM IF USER_MEM_ARGS”)

    #REM IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values

    3. Directly after this remark, add the following line:

    USER_MEM_ARGS=-Xms256m -Xmx1024m -XX:CompileThreshold=8000 -XX:PermSize=128m -   XX:MaxPermSize=512m
    

    4. The portion of the file you have edited looks like this:

    #REM IF USER_MEM_ARGS the environment variable is set, use it to override ALL MEM_ARGS values
    
            USER_MEM_ARGS=-Xms256m -Xmx1024m -XX:CompileThreshold=8000 -XX:PermSize=128m -XX:MaxPermSize=512m
    
            if NOT “%USER_MEM_ARGS%”==”" (
    
            MEM_ARGS=%USER_MEM_ARGS
    
            )
    

    Additional:
    -Xrs Reduces use of operating-system by the java VM, Disables signal handling in the JVM.
    Setting -Xrs prevents the Java™ run time environment from handling any internally or externally generated signals such as SIGSEGV and SIGABRT. Any signals raised are handled by the default operating system handlers. Disabling signal handling in the JVM reduces performance by approximately 2-4%, depending on the application.

    Useful info:
    http://www.petefreitag.com/articles/gctuning/
    http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html

  • Magnolia CMS is open-source content management system, while Oracle UCM is not open-source.

    Magnolia follows JCR ( java content repository ) standard, therefore, it prevents vendor-lock in.

    Oracle UCM sits on Oracle Weblogic, it benefits from powerful application server weblogic, such as clustering support comes easily.