<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for /home/wenlong</title>
	<atom:link href="http://wenlong.wordpress.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://wenlong.wordpress.com</link>
	<description></description>
	<lastBuildDate>Sat, 02 Jan 2010 01:32:21 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Using vim in AWN Terminal by Chuso</title>
		<link>http://wenlong.wordpress.com/2009/02/18/using-vim-in-awn-terminal/#comment-40</link>
		<dc:creator>Chuso</dc:creator>
		<pubDate>Sat, 02 Jan 2010 01:32:21 +0000</pubDate>
		<guid isPermaLink="false">http://wenlong.wordpress.com/?p=175#comment-40</guid>
		<description>Control+C also works.
Look for bug #178784 in AWN launchpad (your blog doesn&#039;t let me post the URL).</description>
		<content:encoded><![CDATA[<p>Control+C also works.<br />
Look for bug #178784 in AWN launchpad (your blog doesn&#8217;t let me post the URL).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Issue with java.sql.Time + GWT + browsers in Linux and Windows. by Lim How Wei</title>
		<link>http://wenlong.wordpress.com/2009/11/04/issue-with-java-sql-time-gwt-browsers-in-linux-and-windows/#comment-38</link>
		<dc:creator>Lim How Wei</dc:creator>
		<pubDate>Wed, 11 Nov 2009 18:02:26 +0000</pubDate>
		<guid isPermaLink="false">http://wenlong.wordpress.com/?p=272#comment-38</guid>
		<description>hmm...  i just wonder if you use datetime, this problem will still occur??? of course if you have a date like 1970-1-1 Windows will still have problem :P</description>
		<content:encoded><![CDATA[<p>hmm&#8230;  i just wonder if you use datetime, this problem will still occur??? of course if you have a date like 1970-1-1 Windows will still have problem <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Issue with java.sql.Time + GWT + browsers in Linux and Windows. by wenlong</title>
		<link>http://wenlong.wordpress.com/2009/11/04/issue-with-java-sql-time-gwt-browsers-in-linux-and-windows/#comment-37</link>
		<dc:creator>wenlong</dc:creator>
		<pubDate>Wed, 11 Nov 2009 13:15:49 +0000</pubDate>
		<guid isPermaLink="false">http://wenlong.wordpress.com/?p=272#comment-37</guid>
		<description>For my case, what I need is only the HH:MM:SS, thus &quot;time&quot; is the correct data type to use.  Timestamp or datetime will include the yyyy-mm-dd, that&#039;s why I didn&#039;t use them.</description>
		<content:encoded><![CDATA[<p>For my case, what I need is only the HH:MM:SS, thus &#8220;time&#8221; is the correct data type to use.  Timestamp or datetime will include the yyyy-mm-dd, that&#8217;s why I didn&#8217;t use them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Issue with java.sql.Time + GWT + browsers in Linux and Windows. by Lim How Wei</title>
		<link>http://wenlong.wordpress.com/2009/11/04/issue-with-java-sql-time-gwt-browsers-in-linux-and-windows/#comment-36</link>
		<dc:creator>Lim How Wei</dc:creator>
		<pubDate>Wed, 11 Nov 2009 09:41:40 +0000</pubDate>
		<guid isPermaLink="false">http://wenlong.wordpress.com/?p=272#comment-36</guid>
		<description>Java Apps follows Epoch and handled the case you mentioned (the timezone switch), and Linux handled @ OS level also. unfortunately, Windows is not handling this.

Javascript engine should follow what OS can give...

so your DB really holding data with very old date?

anyway, in MySQL, Time object is not really a Time teller... should use timestamp or datetime object instead.</description>
		<content:encoded><![CDATA[<p>Java Apps follows Epoch and handled the case you mentioned (the timezone switch), and Linux handled @ OS level also. unfortunately, Windows is not handling this.</p>
<p>Javascript engine should follow what OS can give&#8230;</p>
<p>so your DB really holding data with very old date?</p>
<p>anyway, in MySQL, Time object is not really a Time teller&#8230; should use timestamp or datetime object instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Issue with java.sql.Time + GWT + browsers in Linux and Windows. by wenlong</title>
		<link>http://wenlong.wordpress.com/2009/11/04/issue-with-java-sql-time-gwt-browsers-in-linux-and-windows/#comment-35</link>
		<dc:creator>wenlong</dc:creator>
		<pubDate>Wed, 11 Nov 2009 08:28:28 +0000</pubDate>
		<guid isPermaLink="false">http://wenlong.wordpress.com/?p=272#comment-35</guid>
		<description>I believe your Windows machine will give you +7:30GMT also.

In Windows:
  Java Apps returns +7:30GMT on 1970-Jan-1st
  Javascript (Firefox &amp; IE) returns +8:00GMT on 1970-Jan-1st

In Linux:
  Java Apps returns +7:30GMT on 1970-Jan-1st
  Javascript (Firefox &amp; epiphany) returns +7:30GMT on 1970-Jan-1st</description>
		<content:encoded><![CDATA[<p>I believe your Windows machine will give you +7:30GMT also.</p>
<p>In Windows:<br />
  Java Apps returns +7:30GMT on 1970-Jan-1st<br />
  Javascript (Firefox &amp; IE) returns +8:00GMT on 1970-Jan-1st</p>
<p>In Linux:<br />
  Java Apps returns +7:30GMT on 1970-Jan-1st<br />
  Javascript (Firefox &amp; epiphany) returns +7:30GMT on 1970-Jan-1st</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Issue with java.sql.Time + GWT + browsers in Linux and Windows. by Lim How Wei</title>
		<link>http://wenlong.wordpress.com/2009/11/04/issue-with-java-sql-time-gwt-browsers-in-linux-and-windows/#comment-34</link>
		<dc:creator>Lim How Wei</dc:creator>
		<pubDate>Wed, 11 Nov 2009 03:57:12 +0000</pubDate>
		<guid isPermaLink="false">http://wenlong.wordpress.com/?p=272#comment-34</guid>
		<description>something weird here, your Windows machine seems to have the +7:30GMT, while mine don&#039;t have it...

i believe the javascript engine will just make use of the local machine timezone data... i&#039;m not too sure how Linux Javascript engine can be different between OS since it should be tied up with browser. any readings which you found out the javascript engine between Linux FF and Windows FF are different?</description>
		<content:encoded><![CDATA[<p>something weird here, your Windows machine seems to have the +7:30GMT, while mine don&#8217;t have it&#8230;</p>
<p>i believe the javascript engine will just make use of the local machine timezone data&#8230; i&#8217;m not too sure how Linux Javascript engine can be different between OS since it should be tied up with browser. any readings which you found out the javascript engine between Linux FF and Windows FF are different?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Issue with java.sql.Time + GWT + browsers in Linux and Windows. by wenlong</title>
		<link>http://wenlong.wordpress.com/2009/11/04/issue-with-java-sql-time-gwt-browsers-in-linux-and-windows/#comment-33</link>
		<dc:creator>wenlong</dc:creator>
		<pubDate>Wed, 11 Nov 2009 02:04:32 +0000</pubDate>
		<guid isPermaLink="false">http://wenlong.wordpress.com/?p=272#comment-33</guid>
		<description>Hi Pal,

&lt;ol&gt;
I don&#039;t need to have the timezone object.  What I need is only the time, but java bundle it with timezone.&lt;/ol&gt;

&lt;ol&gt;
Timezone offset for Asia/Kuala_Lumpur is +8:00GMT since 1981 (Dec 31 23:30:00 to be exact).  Before that, it was +7:30GMT, +7:00GMT, etc.  See &lt;a href=&quot;http://en.wikipedia.org/wiki/Malaysian_Standard_Time&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Malaysian_Standard_Time&lt;/a&gt; for a complete list of timezone history for Malaysia.&lt;/ol&gt;
&lt;ol&gt;
Before writing this blog post, I&#039;ve also tested a simple Java program that return the timezone offset for Asia/Kuala_Lumpur on the date 1970-Jan-1st on both Linux and Windows.  Both return me the same result: +7:30GMT.  I believe the tzdata on both OSes are the same or have the same timezone history for Asia/Kuala_Lumpur.&lt;/ol&gt;

The problem I encountered was mainly cause by the Javascript Engine and the design of &lt;code&gt;java.sql.Time&lt;/code&gt; class.  Let me explain it in more detail:

&lt;ul&gt;Javascript engine in Linux understand that, the timezone offset for Asia/Kuala_Lumpur on 1970-Jan-1st is +7:30GMT but in Windows, +8:00GMT is used.  Why and what exactly is causing the difference?  I do not know.&lt;/ul&gt;

&lt;ul&gt;&lt;code&gt;java.sql.Time&lt;/code&gt; is a class to represent a database type called &lt;code&gt;time&lt;/code&gt;.  It basically means, HH:MM:SS without any date info.  Meaning just a time, that&#039;s all.  Instead of creating a new class just for that purpose, Java decide to inherit from &lt;code&gt;java.util.Date&lt;/code&gt;.  The javadoc for &lt;code&gt;java.sql.Time&lt;/code&gt; says clearly that, the date portion of the class should be set to 1970-Jan-1st and should not be accessed.&lt;/ul&gt;

 Thus the following:
&lt;ul&gt;Database value is 00:00:00&lt;/ul&gt;
&lt;ul&gt;&lt;code&gt;java.sql.Time&lt;/code&gt; value is date=1970-Jan-1st, timezone=Asia/Kuala_Lumpur, millisec from epoch=-7.5*60*60*1000 (see bottom on how to calculate this value)&lt;/ul&gt;
&lt;ul&gt;Linux javascript engine translate the value to &quot;-7.5*60*60*1000&quot; + &quot;+7:30GMT&quot; = 00:00:00 (correct)&lt;/ul&gt;
&lt;ul&gt;Windows javascript engine translate the value to &quot;-7.5*60*60*1000&quot; + &quot;+8:00GMT&quot; = 00:30:00 (wrong)&lt;/ul&gt;

Calculation of milisec from Epoch:
In the example above, the &lt;code&gt;java.sql.Time&lt;/code&gt; has the value of 1970-Jan-1st, Asia/Kuala_Lumpur, 00:00:00 local time.  Millisec from Epoch means the time on the same day but with the timzone of Greenwich.  Thus, the above local date time will be translated to
&lt;ul&gt;1969-Dec-31st, Greenwich, 16:30:00 (human term)&lt;/ul&gt;
&lt;ul&gt;1970-Jan-1st, Greenwich, -07:30:00 (computer term)&lt;/ul&gt;
&lt;ul&gt;-7.5*60*60*1000=-27000000 milisec from Epoch (take note of the minus sign)&lt;/ul&gt;

I cannot decide who is at fault here:  The design of the &lt;code&gt;java.sql.Time&lt;/code&gt;? or the Javascript engine?</description>
		<content:encoded><![CDATA[<p>Hi Pal,</p>
<ol>
I don&#8217;t need to have the timezone object.  What I need is only the time, but java bundle it with timezone.</ol>
<ol>
Timezone offset for Asia/Kuala_Lumpur is +8:00GMT since 1981 (Dec 31 23:30:00 to be exact).  Before that, it was +7:30GMT, +7:00GMT, etc.  See <a href="http://en.wikipedia.org/wiki/Malaysian_Standard_Time" rel="nofollow">http://en.wikipedia.org/wiki/Malaysian_Standard_Time</a> for a complete list of timezone history for Malaysia.</ol>
<ol>
Before writing this blog post, I&#8217;ve also tested a simple Java program that return the timezone offset for Asia/Kuala_Lumpur on the date 1970-Jan-1st on both Linux and Windows.  Both return me the same result: +7:30GMT.  I believe the tzdata on both OSes are the same or have the same timezone history for Asia/Kuala_Lumpur.</ol>
<p>The problem I encountered was mainly cause by the Javascript Engine and the design of <code>java.sql.Time</code> class.  Let me explain it in more detail:</p>
<ul>Javascript engine in Linux understand that, the timezone offset for Asia/Kuala_Lumpur on 1970-Jan-1st is +7:30GMT but in Windows, +8:00GMT is used.  Why and what exactly is causing the difference?  I do not know.</ul>
<ul><code>java.sql.Time</code> is a class to represent a database type called <code>time</code>.  It basically means, HH:MM:SS without any date info.  Meaning just a time, that&#8217;s all.  Instead of creating a new class just for that purpose, Java decide to inherit from <code>java.util.Date</code>.  The javadoc for <code>java.sql.Time</code> says clearly that, the date portion of the class should be set to 1970-Jan-1st and should not be accessed.</ul>
<p> Thus the following:</p>
<ul>Database value is 00:00:00</ul>
<ul><code>java.sql.Time</code> value is date=1970-Jan-1st, timezone=Asia/Kuala_Lumpur, millisec from epoch=-7.5*60*60*1000 (see bottom on how to calculate this value)</ul>
<ul>Linux javascript engine translate the value to &#8220;-7.5*60*60*1000&#8243; + &#8220;+7:30GMT&#8221; = 00:00:00 (correct)</ul>
<ul>Windows javascript engine translate the value to &#8220;-7.5*60*60*1000&#8243; + &#8220;+8:00GMT&#8221; = 00:30:00 (wrong)</ul>
<p>Calculation of milisec from Epoch:<br />
In the example above, the <code>java.sql.Time</code> has the value of 1970-Jan-1st, Asia/Kuala_Lumpur, 00:00:00 local time.  Millisec from Epoch means the time on the same day but with the timzone of Greenwich.  Thus, the above local date time will be translated to</p>
<ul>1969-Dec-31st, Greenwich, 16:30:00 (human term)</ul>
<ul>1970-Jan-1st, Greenwich, -07:30:00 (computer term)</ul>
<ul>-7.5*60*60*1000=-27000000 milisec from Epoch (take note of the minus sign)</ul>
<p>I cannot decide who is at fault here:  The design of the <code>java.sql.Time</code>? or the Javascript engine?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Issue with java.sql.Time + GWT + browsers in Linux and Windows. by Lim How Wei</title>
		<link>http://wenlong.wordpress.com/2009/11/04/issue-with-java-sql-time-gwt-browsers-in-linux-and-windows/#comment-32</link>
		<dc:creator>Lim How Wei</dc:creator>
		<pubDate>Tue, 10 Nov 2009 18:59:20 +0000</pubDate>
		<guid isPermaLink="false">http://wenlong.wordpress.com/?p=272#comment-32</guid>
		<description>just my 2cents, but the only difference to me is the different timezone settings on Linux and Windows OS. in Windows, there is no such thing as +7:30GMT, and it&#039;s publicly recognized Malaysia is in +8GMT zone...

the best way for me is to define a custom timezone object, so you may ensure the date is always consistent.

maybe you can try this in Java instead:

Timezone tz = Timezone.getDefault(); // local machine default timezone data
String[] tzs = TimeZone.getAvailableIDs(); // local machine available timezone ids
Timezone tzKL = TimeZone.getTimeZone(&quot;Asia/Kuala_Lumpur&quot;); // local machine timezone data for KL

i guess even for same timezone, Java will give you different answer for different OS.</description>
		<content:encoded><![CDATA[<p>just my 2cents, but the only difference to me is the different timezone settings on Linux and Windows OS. in Windows, there is no such thing as +7:30GMT, and it&#8217;s publicly recognized Malaysia is in +8GMT zone&#8230;</p>
<p>the best way for me is to define a custom timezone object, so you may ensure the date is always consistent.</p>
<p>maybe you can try this in Java instead:</p>
<p>Timezone tz = Timezone.getDefault(); // local machine default timezone data<br />
String[] tzs = TimeZone.getAvailableIDs(); // local machine available timezone ids<br />
Timezone tzKL = TimeZone.getTimeZone(&#8220;Asia/Kuala_Lumpur&#8221;); // local machine timezone data for KL</p>
<p>i guess even for same timezone, Java will give you different answer for different OS.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on scp file name with spaces by Dave Armstrong</title>
		<link>http://wenlong.wordpress.com/2009/02/14/scp-file-name-with-spaces/#comment-31</link>
		<dc:creator>Dave Armstrong</dc:creator>
		<pubDate>Mon, 06 Jul 2009 14:27:45 +0000</pubDate>
		<guid isPermaLink="false">http://wenlong.wordpress.com/?p=173#comment-31</guid>
		<description>I&#039;ve tried a few times in the past but never could figure that one out!

Thanks, Dave</description>
		<content:encoded><![CDATA[<p>I&#8217;ve tried a few times in the past but never could figure that one out!</p>
<p>Thanks, Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Convert Dia diagram to PDF for easy viewing by Frank</title>
		<link>http://wenlong.wordpress.com/2009/04/27/convert-dia-diagram-to-pdf-for-easy-viewing/#comment-29</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Sun, 03 May 2009 15:12:16 +0000</pubDate>
		<guid isPermaLink="false">http://wenlong.wordpress.com/?p=199#comment-29</guid>
		<description>Hey, many thanks for that. Exactly what I was looking for and it worked a treat!
Frank</description>
		<content:encoded><![CDATA[<p>Hey, many thanks for that. Exactly what I was looking for and it worked a treat!<br />
Frank</p>
]]></content:encoded>
	</item>
</channel>
</rss>
