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
Thursday, January 26, 2012
Monday, January 16, 2012
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
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
Friday, January 13, 2012
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
Wednesday, January 11, 2012
Column aggregation in Oracle
Suppose we have a table (TBL) in Oracle with columns (CATEGORY, ATTR). Consider the following:
We want to convert the table as follows:
This can be done via the SQL below:
select CATEGORY,
xmlagg(xmlelement(c, ATTR || ',')).extract('//text()')
from TBL
group by CATEGORY
| 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
Friday, January 6, 2012
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.
getRemoteUser()
isUserInRole(String role)
Both methods are under javax.servlet.http.HttpServletRequest.
Monday, December 19, 2011
Using ArcGIS JS API v2.5 - v2.8
Some notes on using their API:
Something more about the Javascript files in the API:
- In 2.5, the path is /library/2.5/arcgis (or arcgis_compact)
- In 2.6, the path changed to /library/2.6/jsapi (or jsapicompact), but the manual doesn't changed. So be careful when following the installation manual
- The file in /library/2.6/jsapi/js/esri/jsapi.js will create a Javascript error. You might need to replace the file content with the one in ESRI ArcGIS JS API production site.
Something more about the Javascript files in the API:
- The jsapi.js contains UTF8 characters (‰ - u8240, ¤ - u0164), when ArcGIS JS API "index.jsp" includes this file using <jsp:include>, the UTF8 characters will corrupted. I found two solutions for that
- Modify the jsapi.js, swap those UTF8 characters back to escaped (\u) characters, and save the file back as ANSI format. OR
- Modify the "index.jsp", avoid using <jsp:include>, try to use file reader with encoding specified. For example: FileUtils.readFileToString(new File(filepath_), "UTF8"); (where FileUtils is from org.apache.commons.io package)
Thursday, December 15, 2011
100% Height DIV
The trick is to set body with height:100% in CSS:
<style>
html, body {
margin: 0px;
height: 100%;
}
</style>
Then DIV's CSS height:100% will work !
<style>
html, body {
margin: 0px;
height: 100%;
}
</style>
Then DIV's CSS height:100% will work !
Wednesday, November 30, 2011
Cynefin methods
Cynefin methods, tools, and techniques have been successfully applied in organisations to address areas such as corporate strategy, innovation, culture transformation, weak signal detection, social networking, mergers & acquisitions, knowledge management and ageing workforce. It is useful in capturing tacit knowledge.
Ref: Cynefin framework (http://www.cynefin.net)
Themes for Notepad2
There is a nice color theme called obsidian for Notepad2. But it will hide your cursor after importing it. To fix this, give a color and size to the caret in notepad2.ini. For example:
[Default Text]
...
Caret (Color, size 1-3)=fore:#FFFFFF; size:2;
...
Link to Obsidan for Notepad2
[Default Text]
...
Caret (Color, size 1-3)=fore:#FFFFFF; size:2;
...
Link to Obsidan for Notepad2
Some options for Tomcat 6
Not much options found, but I drop down the useful ones for reference. Note that those options should be assigned to the CATALINA_OPTS. Actually, you may put them in catalina.bat.
- Startup memory size
-Xms256m
- Maximum memory size
-Xmx256m
- Garbage collection path
-Xloggc:/gc.log
- Disable DNS caching
-Dsun.net.inetaddr.ttl=0
- Skip quote escape checking (If you have tag like this <mytags:tag value="<%= "hi!" %>" /> , which is validate in Tomcat 5 before. In Tomcat 6, you may need to turn on the following option to prevent running into error. Ref: http://www.andowson.com/posts/list/346.page)
-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPE=false
- Turn on JMX remote
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9004
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
- Set default Tomcat language / locale to English
-Duser.language=en
Subscribe to:
Posts (Atom)
Upgrade nodejs in conda (from v18 to v26)
If your conda env is nodejs v18, doing a conda install nodejs=26 is likely to create a lot of conflict. Consider remove those conflicting p...
-
When Office2003 couldn't find file SKU011.CAB: regedit -> [HKEY_LOCAL_MACHINE] -> [SOFTWARE] -> [Microsoft] -> [Office] -...
-
The resolution can be changed by editing the BlueStack's registry: HKLM\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0\Height and ...
-
Suppose you got a file in Big5 containing some HKSCS characters (e.g. 深水埗, 赤鱲角, etc). When your environment (Ref: Charset.defaultCharset( ) ...