Sunday, November 23, 2008

Is my computer 64-bit support?

Well, one thing is when we're talking about 64bits system, actually we are talking about 2 separate things: 64-bit hardware support and 64-bit OS support.

In my understanding, if you can see 4GB or more memory in your system profile, then you have a 64-bit computer. (Whatever OS you use, there should be some system utils can help you to monitor the system status in runtime, e.g., system monitor for mac/u*x/, task manager for Windowz, etc.)

You may not really feel how 64-bit benefits you. But at least it's compatible with most of your current applications so you don't need to pay extra money to get the 64-bit edition for them.

Want to know more about 64-bit? Take a few minutes to read the following links:
- What kind of performance increase can I expect in going from 32-bit to 64-bit Stata?
- First Look: Leopard first looks: 64-bit support
- Is Leopard truly 64-bit?

Saturday, November 22, 2008

JDK 6 for Mac doesn't have Console support?

I just downloaded and installed JDK6 form here (http://support.apple.com/kb/HT1856). But look like there isn't the lib java.io.Console since the code "import java.io.Console;" will cause a compiler error, "cannot find symbol". That's strange.

Tested on a Linux box and it's good. So I suppose this "Java for Mac OS X 10.5 Update 1 adds support for Java SE 6" (This update provides Java SE 6 version 1.6.0_05.) is not a full version. If it's tailored, how could it comply with the license? Maybe I missed something here...

Wednesday, November 05, 2008

HTTP Protocol: Method OPTIONS?

Well, the method OPTIONS defined in HTTP RFC[1] is required to be implemented for all web servers. [2]

But when I test it with my local apache server and the bckids.info server, something looks interesting...

1. Trying http/1.0 shows the methods allowed together with error 501.

calvin:~ cxl$ telnet localhost 80
Trying ::1...
Connected to localhost.
Escape character is '^]'.
options * http/1.0

HTTP/1.1 501 Method Not Implemented
Date: Wed, 05 Nov 2008 22:26:33 GMT
Server: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7l DAV/2 PHP/5.2.6
Allow: GET,HEAD,POST,OPTIONS,TRACE
Content-Length: 209
Connection: close
Content-Type: text/html; charset=iso-8859-1


2. Trying http/1.1 shows error 400: Bad Request.

calvin:~ cxl$ telnet localhost 80
Trying ::1...
Connected to localhost.
Escape character is '^]'.
options * http/1.1

HTTP/1.1 400 Bad Request
Date: Wed, 05 Nov 2008 22:26:06 GMT
Server: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7l DAV/2 PHP/5.2.6
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1


[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.1
[2] http://en.wikipedia.org/wiki/HTTP

Wednesday, October 15, 2008

VMWare Server upgrading issue

I upgraded my VMWare Server from 1.x to 2.x recently. Something strange happened since then.

At first beginning, everything looks fine. After a few days, the windows service "VMWare Host Agent" couldn't start up automatically when the host machine boots up, although it's set to start "Automatic". I managed to solve the problem by configuring the "Log On" option in windows service manager, select "This account" and put in user name and password of the administrator manually.

It worked for a few days, and then I got an error for any VM when connecting with "VMWare Infrastructure WebAccess" through a browser window. The error message is "Unable to connect to the MKS: Login (username/password) incorrect.".

So after a few days confusing, I reconfigured the windows service to change the "Log On" method back to use system account. But again, the service won't start up automatically.

What's the problem here? Not a clue on vmware support forum, and they don't allow me to login to ask question either! :(

Tuesday, July 22, 2008

How to develop addons for rtl locales

The topic was initiated from url: http://www.babelzilla.org/content/view/316/. But the approach provided below doesn't work at all.

function getDirection() {
var myLocalBundleService = Components.classes ["@mozilla.org/intl/stringbundle;1"].getService(Components.interfaces.nsIStringBundleService);
var myLocalStrings = myLocalBundleService.createBundle("chrome://global/locale/global.dtd");
return myLocalStrings.GetStringFromName("locale.dir");
}



Good thing is that we can still read the direction property from document.dir and preference bidi.direction. The definition of bidi.direction can be found in source code:
// ------------------
964 // Text Direction
965 // ------------------
966 // 1 = directionLTRBidi *
967 // 2 = directionRTLBidi
968 pref("bidi.direction", 1);
Both of them are r/o, but here we just need to read the information.

Friday, July 04, 2008

Logitech QuickCam service blocks Firefox build...

Although it's a known issue in bugzilla I was still really surprised. After reading the log I can see the "rebase" dll caused the problem.

Removing the service and keeping the driver, QuickCam still works and Firefox started building. That's funny...

This is the most helpful:
David Humphrey 2008-02-15 06:49:02 PDT
From the mingw FAQ (http://www.mingw.org/MinGWiki/index.php/FAQ):

Why does make often crash creating a sh.exe.stackdump file when I try to
compile my source code?
If you experience random crashes with make as well as with the msysinfo command
(i.e., repeating the command often allows to compile the source code
successfully), the issue might be caused by the Logitech QuickCam software.
Here is provided a solution to this issue:

* type the command services.msc from a command prompt (you will need
administrator privileges to do this), then find the "Logitech Process Monitor"
service, and change the "Startup type" from "Auto" to "Manual". Do the same
with the "LVSrvLauncher" service.
* type the command regedit from the command prompt (you will need
administrator privileges to do this), then find the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run. Among the
other REG_SZ keys, there should be three of them related to the Logitech
QuickCam, namely: "LogitechCommunicationsManager", "LogitechQuickCamRibbon",
"LVCOMSX". Make a backup of the registry, then remove them.
* reboot your PC

In this way the Logitech QuickCam daemon won't be available anymore.
Nonetheless, the camera will keep working just ok with 3rd party software
(e.g., Skype). If you want a less drastic solution, just kill the lvprcsrv.exe
process whenever you want to use MSYS by typing at the command prompt: pskill
-t lvprcsrv.exe (you will need PsTools and administrator privileges to do
this). However, as soon as you will plug in the USB cable of your Logitech
QuickCam, the daemon will be restarted, while with the first procedure it
won't.

Friday, April 04, 2008

How come western people to be so rude?

Got a comment from technical support this morning. Someone said:

Additional Comments:
Fuckin' Shit, This Is SO Not Workin', And Besides The Fuckin' Crap It's A Hell Of Annoyin'
Should Make It Better Assholes.
If You Are Gonna Make Something Make It The Right Way.

I always think western people are not as polite as they claim for themselves. This is a sample. How could they export their "civilization" to other country like this?

What a shame!

Friday, March 28, 2008

Leopard AddressBook: new encoding for vCard

I have an application which can export "My Card" in addressbook to a vCard (.vcf) file and then import it to another application. For Leopard, this approach stopped working.

The applescript for exporting looks like:
After digging some details, I realized that the reason is that in Leopard, the output file is no longer a UTF-8 encoding file. It's UTF-16BE! So the file looks like:


Dump it in hex mode, found the magic is the first word:
FE FF

OK, now ignore in the importing application and everything is fine.

Friday, January 11, 2008

Run VNC service on Ubuntu

This command will be able to run a user specific vnc service on a ubuntu machine.

"Xvnc :5 -query localhost -geometry 1024x768 -depth 16 -once -securitytypes none -fp /usr/share/fonts/X11/misc -DisconnectClients=0 -NeverShared -extension XFIXES"

And when choose "Disconnect" from the vnc client, the server will shutdown itself.

Thursday, January 10, 2008

Firefox has lot of issues on Mac.

Recently when developing an addon for firefox 2/3, noticed that the preference window overlay ruins the default preferences window. It grows the height of the window and some times may cut screen elements in the bottom of the dialog.

Just aware the reason today, I missed an attribute "helpURI" for the "prefpane" element. Add this line, and the "help" button will show up in left bottom corner. Then everything is fine.

Since it looks like an irrelevant attribute to me, still think it's a bug of firefox. Filed on bugzilla.
Just set attributes 'class' and 'image' for a menuitem, the menu will become vivid immediately.
















Sample:
var mi=document.createElement('menuitem');
mi.setAttribute('class', 'menuitem-iconic');
mi.setAttribute('image','chrome://

But it may be affected by themes that you applied. See snapshot below.