Changing Locale To Chinese (and all the other languages) On ASUS EeePC.
Recently a friend of mine tried changing the locale on his new ASUS Eee PC to Chinese (PRC). No problem, we thought, we changed the locale to "LANG=en_CN.UTF-8" and everything seemed to work.
However, after changing this the extra features on the touchpad such as the zoom, scrolling etc didn't work anymore.
So eventually we tried the steps given on this site to change the locale instead:
http://www.eeeuser.net/?p=8
Alas, it worked! Kudos to this great blog for posting it up.
Programming solutions, source code, solutions to tech problems and other tech related stuff.
Saturday, July 19, 2008
Wednesday, July 16, 2008
Replacing Brackets in a String (Java)
Trivial issue really but something I always forget...
sNiceString = sNiceString.replaceAll("\\(", "");
or
sNiceString = sNiceString.replaceAll("\\)", "");
You could probably use a purer regular expression too but this does the job.
sNiceString = sNiceString.replaceAll("\\(", "");
or
sNiceString = sNiceString.replaceAll("\\)", "");
You could probably use a purer regular expression too but this does the job.
Monday, July 07, 2008
Redirect and masking with mod_rewrite
I'm not sure if this will work for anyone else in the world except me, since mod_rewrite is such a tricky beast (and apparently powered by voodoo).
I managed to mask the JSP on my site which was something like:
http://www.mysiteblahblah.com/doSomethingGood.jsp?type=reallygood
to
http://www.mysiteblahblah.com/doSomethingGood/ReallyGood.html
Simple! I thought. Mod_rewrite can handle this; before I was hit with:
"You don't have permission to access /doSomethingGood/ on this server"
So I searched around the web here and there and found out that you need to 'enable' mod_proxy. So I did, by uncommenting the line in my httpd.conf:
LoadModule proxy_module modules/mod_proxy.so
I still had the same problem though and looking through my Rewrite Log (which was set to loglevel 3) everything seemed normal and the only meaningful message was "go-ahead with proxy request proxy." So all seemed fine even though it wasn't working.
After another round of searches I just tried my luck and uncommented all other modules that are related to mod_proxy. Lo' and behold, it all began to work:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
Now my virtualhost tag looks something like:
<VirtualHost *>
DocumentRoot "D:\website\webapps\mySiteBlahBlah"
ServerName www.mysiteblahblah.com
# SECTION FOR MOD_REWRITE
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRAC(E|K)
RewriteRule .* - [F]
RewriteRule /doSomethingGood/([A-Z]+).html http://www.mysiteblahblah.com/doSomethingGood.jsp?type=$1 [proxy,QSA]
RewriteLog "D:\Program Files (x86)\Apache Group\Apache2\logs\mod_rewrite.log"
RewriteLogLevel 1
# END OF SECTION FOR MOD_REWRITE
</VirtualHost>
I hope this helps at least someone out there.
Many thanks to all these sites for helping me along:
WebMasterWorld.com
FluidThoughts.com
JSW4.net
Nabble.com
ChinaUnix.net
Apache: mod_rewrite documentation
Apache: mod_proxy documentation
I managed to mask the JSP on my site which was something like:
http://www.mysiteblahblah.com/doSomethingGood.jsp?type=reallygood
to
http://www.mysiteblahblah.com/doSomethingGood/ReallyGood.html
Simple! I thought. Mod_rewrite can handle this; before I was hit with:
"You don't have permission to access /doSomethingGood/ on this server"
So I searched around the web here and there and found out that you need to 'enable' mod_proxy. So I did, by uncommenting the line in my httpd.conf:
LoadModule proxy_module modules/mod_proxy.so
I still had the same problem though and looking through my Rewrite Log (which was set to loglevel 3) everything seemed normal and the only meaningful message was "go-ahead with proxy request proxy." So all seemed fine even though it wasn't working.
After another round of searches I just tried my luck and uncommented all other modules that are related to mod_proxy. Lo' and behold, it all began to work:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
Now my virtualhost tag looks something like:
<VirtualHost *>
DocumentRoot "D:\website\webapps\mySiteBlahBlah"
ServerName www.mysiteblahblah.com
# SECTION FOR MOD_REWRITE
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRAC(E|K)
RewriteRule .* - [F]
RewriteRule /doSomethingGood/([A-Z]+).html http://www.mysiteblahblah.com/doSomethingGood.jsp?type=$1 [proxy,QSA]
RewriteLog "D:\Program Files (x86)\Apache Group\Apache2\logs\mod_rewrite.log"
RewriteLogLevel 1
# END OF SECTION FOR MOD_REWRITE
</VirtualHost>
I hope this helps at least someone out there.
Many thanks to all these sites for helping me along:
WebMasterWorld.com
FluidThoughts.com
JSW4.net
Nabble.com
ChinaUnix.net
Apache: mod_rewrite documentation
Apache: mod_proxy documentation
Subscribe to:
Posts (Atom)