2008年10月20日星期一

get Last-Modified in jQuery ajax.

This issue bugged me for days. After a deep inspect of jQuery source code, I worked out this code:

$url="../status.php";
$.ajax({
"url":$url,
"type":"GET",
"complete":function(xhr, s){
handleResponse(xhr, s);
}
});

function handleResponse(xhr, status){
$("#result").append("
Headers:
"+xhr.getAllResponseHeaders());
var $dateStr = xhr.getResponseHeader("Date");
alert(xhr.responseText);
alert($dateStr);
var $date = new Date($dateStr);
alert($date);
}

<div id="result"></div>

===================
If you think this is useful, please leave a word, many thanks.

Why unbind of jQuery does not work

I need a javascript function to unbind "onclick" operation for some div elements like this:


Click me


and then click and unbind:
Unbind Click



This code cannot unbind the onclick event, it seems that the unbind could only unbind the events binded by jQuery, not events coded directly in HTML.

I hope you can understand this.



2008年10月18日星期六

double click column to resize table width in word 2007

double click column to resize table width in word 2007

it is easy to resize table width if it is beyound the visition.

Another usage of 7-zip

7-zip can open chm file, and unpack files in it.
That is wonderful, because some old chm file does not work fine in modern system,
7-zip could get what we want instead of bad chm files.

2008年10月9日星期四

I'm tired of splash screens

I am tired of splash screen, they really make me uneasy.

I hope I can find ways to remove them.

Known:
>1. pgAdmin III(static)
>2. Eclipses(Dynamic infomation)
>3. ....

2008年10月8日星期三

How to make sure eclipse code formater does not wrap multi line comment .

Add HTML marks to avoid code formater wrap long comments to ugly
one.
For example:<div>&<br />
/**
* <div> Date format reference:<br />
* Letter Date or Time Component Presentation Examples <br />
* G Era designator Text AD <br />
* y Year Year 1996; 96 <br />
* M Month in year Month July; Jul; 07 <br />
* w Week in year Number 27 <br />
* W Week in month Number 2 <br />
* D Day in year Number 189 <br />
* d Day in month Number 10 <br />
* F Day of week in month Number 2 <br />
* E Day in week Text Tuesday; Tue <br />
* a Am/pm marker Text PM <br />
* H Hour in day (0-23) Number 0 <br />
* k Hour in day (1-24) Number 24 <br />
* K Hour in am/pm (0-11) Number 0 <br />
* h Hour in am/pm (1-12) Number 12 <br />
* m Minute in hour Number 30 <br />
* s Second in minute Number 55 <br />
* S Millisecond Number 978 <br />
* z Time zone General time zone Pacific Standard Time; PST; GMT-08:00
* <br />
* Z Time zone RFC 822 time zone -0800 </div>
*/

2008年10月7日星期二

"You are welcomed" or "you are welcome"?

From:
http://answers.yahoo.com/question/index?qid=20060628170518AAJhSop

Is it correct to say "you are welcomed" or "you are welcome"?
I have said "you are welcomed" my whole life, and decided to switch to "you are welcome" a week ago. But something is bothering me, so I come to you for advice.

Serious answers only.
Answer only if you are at least 90% certain.
==============================================
The two phrases have different meanings.

The proper phrase, "You are welcome" says that the person is welcome to whatever you have given them.

The other phrase, "You are welcomed", which is not generally used, implies that the person is being welcomed to wherever they are, as in "we are welcoming you into this place". Notice that the sentence does not say who is doing the welcoming, only who is receiving the welcome. It's an awkward phrase and should not be used, even when you are truly welcoming someone to a particular place.

So, when someone thanks you, just say "you're welcome" and if you want to welcome them to some place, then say "welcome to my ..."

Fix one RealVNC viewer problem.

I cannot connect to RealVNC server yesterday, the same today.
I did it on another PC. So the problem is in viewer, not in server.

Open regedit, find this:

HKEY_CURRENT_USER\Software\RealVNC\VNCViewer4\KnownHosts

and delete the server and reconnect, the viewer will generate a new secure key,
and then all is OK.