set oShell = WScript.CreateObject("WScript.Shell")
call oShell.AppActivate(<Window's Title>)
Friday, November 18, 2011
Tuesday, November 15, 2011
Copy files from tsclient
For example:
xcopy \\TSCLIENT\F\$Update\ *.* "C:\Documents and Settings\%USERNAME%\My Documents\" /s /v /f
xcopy \\TSCLIENT\F\$Update\ *.* "C:\Documents and Settings\%USERNAME%\My Documents\" /s /v /f
Enable/Disable network interface via command line
c:\> netsh interface set interface "INTERFACE_NAME" enable
OR
c:\> netsh interface set interface "INTERFACE_NAME"disable
OR
c:\> netsh interface set interface "INTERFACE_NAME"disable
Thursday, November 3, 2011
Debug mode in Eclipse and Tomcat
For Tomcat:
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
catalina.bat jpda start
For Eclipse:
Set Connection Port (8000) and Connection Host (localhost) in "Run > Debug Configurations"
Configuration Type: "Remote Java Application"
Set connection port to "8000"
Set connection host to "localhost"
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
catalina.bat jpda start
For Eclipse:
Set Connection Port (8000) and Connection Host (localhost) in "Run > Debug Configurations"
Configuration Type: "Remote Java Application"
Set connection port to "8000"
Set connection host to "localhost"
Thursday, October 27, 2011
Download Eclipse Plugins in Zip at GitHub
This can be done via:
Ref: https://github.com/eclipse-color-theme/eclipse-color-theme.github.com/issues/1
https://github.com/eclipse-color-theme/eclipse-color-theme.github.com/zipball/master Ref: https://github.com/eclipse-color-theme/eclipse-color-theme.github.com/issues/1
Thursday, July 7, 2011
Firefox plugins
Some Firefox plugins recommended:
Firebug
Greasemonkey
Hide Caption Titlebar Plus
Hide Navigation Bar
HttpFox
ImagePref (not from mozilla site)
MM3-ProxySwitch
No Color
Stylish
User Agent Switcher
Web Developer
Firebug
Greasemonkey
Hide Caption Titlebar Plus
Hide Navigation Bar
HttpFox
ImagePref (not from mozilla site)
MM3-ProxySwitch
No Color
Stylish
User Agent Switcher
Web Developer
Thursday, June 2, 2011
Search Engine Optimization Technique
For SEO, there are few things to note.
More information:
- Meaningful title
"Production name | Description" - Use of meta tag
META DESCRIPTION, META KEYWORD - Use of canonical link
http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html - Use of SiteMap
http://code.google.com/p/googlessitemapgenerator/
http://www.sitemaps.org/protocol.php - Use alt text
More information:
- http://static.googleusercontent.com/external_content/untrusted_dlcp/www.google.com/zh-TW//webmasters/docs/search-engine-optimization-starter-guide.pdf
- http://www.seomoz.org/beginners-guide-to-seo
Sunday, March 27, 2011
Reading and saving UTF8 text file in Java
To read and save text file in Java, we need to add the "UTF-8" parameter in the Stream Reader.
File file = new File("1.txt");
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
String text = reader.readLine();
String s1="\u6df1\u6c34\u57d7";
String s2="深水埗";
OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream("2.txt"),"UTF-8");
out.write(text+s1+s2);
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
Friday, December 3, 2010
Capture standard output (stdout) in console command running at VBS
We can use WScript.Shell.Exec( ) and WScript.Shell.StdOut.ReadLine( ) to perform the task:
Set objShell = WScript.CreateObject("WScript.Shell")
Set objExecObject = objShell.Exec("cmd /c dir")
strText=""
Do While Not objExecObject.StdOut.AtEndOfStream
strText = strText & objExecObject.StdOut.ReadLine() & chr(13)
Loop
Wscript.Echo strText
Monday, October 11, 2010
Using X-Forward-For Header
Say if you have a web server on top of your application server, you can use "x-Forward-For" HTTP header in the application server to get the real IP of the client.
Note: Remote host only returns the IP of the web server instead.
Note: Remote host only returns the IP of the web server instead.
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( ) ...