Posts

Showing posts from January, 2012

Spatial Reference of HK

The spatial reference of Hong Kong could be found at :  http://spatialreference.org/ref/epsg/2326/ There is a link "Proj4" in that page which provides the Proj4js definitions for converting EPSG:2326 (HK1980 Grid) projection to other projection using the Proj4js library: +proj=tmerc +lat_0=22.31213333333334 +lon_0=114.1785555555556 +k=1 +x_0=836694.05 +y_0=819069.8 +ellps=intl +towgs84=-162.619,-276.959,-161.764,0.067753,-2.24365,-1.15883,-1.09425 +units=m +no_defs

Command line to get installed software / windows updates information

One can use wmic command to get the list of product installed in Windows:  c:\> wmic product You can also specify which data fields you want to retrieve, e.g.:  c:\> wmic product get caption We can also use wmic command to get the list of windows updates made on the machine:  c:\> wmic qfe list

Solving disk offline issue in Windows

You may experienced a message "The disk is offline because it has a signature collision with another disk that is online" / "磁碟簽章發生衝突" in Windows. The case for myself is switching two RAID-1 drives back to non-RAID devices, where the two drives will become identical and cause the collision problem. The following is the solution to turn on the offline disk: c:\>diskpart c:\>list disk (you may see your offline disk is in the list) c:\>select disk 1 c:\>offline disk c:\>online disk Reference:  http://beddingmall.blogspot.com/2011/01/blog-post_04.html

Delete Acronis Failed Task

Just tried their solution, it works: Run Schedmgr.exe and issue the following command: task zap Delete the content of the following folders: Windows XP, Windows 2000/2003 (32/64 bit) - \Documents and Settings\All Users\Application Data\Acronis\BackupAndRecovery\MMS\Policies\ - \Documents and Settings\All Users\Application Data\Acronis\BackupAndRecovery\MMS\TasksStorage\ - \Documents and Settings\All Users\Application Data\Acronis\BackupAndRecovery\MMS\PolicyStatistics Windows Vista, Windows 7, Windows Server 2008 (32/64 bit) - \ProgramData\Acronis\BackupAndRecovery\MMS\Policies\ - \ProgramData\Acronis\BackupAndRecovery\MMS\TasksStorage\ - \ProgramData\Acronis\BackupAndRecovery\MMS\PolicyStatistics Recreate the tasks Ref:  http://forum.acronis.com/forum/10652

Column aggregation in Oracle

Suppose we have a table (TBL) in Oracle with columns (CATEGORY, ATTR). Consider the following: CATEGORY ATTR 1 A 1 B 1 C 2 D 2 E 2 F 3 X 3 Y 3 Z We want to convert the table as follows: CATEGORY ATTR 1 A,B,C 2 D,E,F 3 X,Y,Z This can be done via the SQL below: select CATEGORY,         xmlagg(xmlelement(c, ATTR || ',')).extract('//text()')  from TBL  group by CATEGORY

Determine user in Tomcat

To determine user authentication info in Tomcat, we can use the following: getRemoteUser() isUserInRole(String role) Both methods are under javax.servlet.http.HttpServletRequest.