<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Steven Yong's Weblog - computer</title>
    <link>http://blogs.ngiap.com/stevenyong/</link>
    <description>not really ridiculous</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.3.1 - http://www.s9y.org/</generator>
    
    <image>
        <url>http://blogs.ngiap.com/stevenyong/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Steven Yong's Weblog - computer - not really ridiculous</title>
        <link>http://blogs.ngiap.com/stevenyong/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Installing software on Windows no longer easier</title>
    <link>http://blogs.ngiap.com/stevenyong/archives/340-Installing-software-on-Windows-no-longer-easier.html</link>
            <category>computer</category>
    
    <comments>http://blogs.ngiap.com/stevenyong/archives/340-Installing-software-on-Windows-no-longer-easier.html#comments</comments>
    <wfw:comment>http://blogs.ngiap.com/stevenyong/wfwcomment.php?cid=340</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://blogs.ngiap.com/stevenyong/rss.php?version=2.0&amp;type=comments&amp;cid=340</wfw:commentRss>
    

    <author>nospam@example.com (Steven Yong)</author>
    <content:encoded>
    &lt;br /&gt;
Software installation has been the primary obstacle preventing novice users switching from Windows to Linux, until the central repository of software packages introduced in Linux world. Observe following scenario.&lt;br /&gt;&lt;br /&gt;Let say I want to install Zip, IM Client and Firefox on my PC, the steps comparison on Windows XP and Fedora Core 9 are as below:&lt;br /&gt;&lt;br /&gt;On Windows XP:&lt;br /&gt;1) Go to www.zip.com, download zip.exe, double click on the downloaded exe, and click at least one &amp;quot;Next&amp;quot; button.&lt;br /&gt;2) Go to www.im.com, download im.exe, double click on the downloaded exe, and click at least one &amp;quot;Next&amp;quot; button.&lt;br /&gt;3) Go to www.firefox.com, download ff.exe, double click on the downloaded exe, and click at least one &amp;quot;Next&amp;quot; button.&lt;br /&gt;&lt;br /&gt;On Fedora Core 9&lt;br /&gt;1) Open terminal, type &lt;code&gt;su root&lt;/code&gt; followed by root password, type &lt;code&gt;yum -y install zip&lt;/code&gt;.&lt;br /&gt;2) In the same terminal, type &lt;code&gt;yum -y install im&lt;/code&gt;.&lt;br /&gt;3) In the same terminal, type &lt;code&gt;yum -y install firefox&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;Some Windows fans might ask &amp;quot;how am I supposed to know what &amp;quot;yum&amp;quot; command to type?&amp;quot;, the answer is same as asking &amp;quot;How would I know the URL of Zip download page?&amp;quot;.&lt;br /&gt;&lt;br /&gt;When you need to know something, you will know.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Mon, 23 Jun 2008 23:59:00 +0800</pubDate>
    <guid isPermaLink="false">http://blogs.ngiap.com/stevenyong/archives/340-guid.html</guid>
    
</item>
<item>
    <title>Unable to eject USB Storage Device on Windows XP</title>
    <link>http://blogs.ngiap.com/stevenyong/archives/338-Unable-to-eject-USB-Storage-Device-on-Windows-XP.html</link>
            <category>computer</category>
    
    <comments>http://blogs.ngiap.com/stevenyong/archives/338-Unable-to-eject-USB-Storage-Device-on-Windows-XP.html#comments</comments>
    <wfw:comment>http://blogs.ngiap.com/stevenyong/wfwcomment.php?cid=338</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://blogs.ngiap.com/stevenyong/rss.php?version=2.0&amp;type=comments&amp;cid=338</wfw:commentRss>
    

    <author>nospam@example.com (Steven Yong)</author>
    <content:encoded>
    &lt;br /&gt;
Often you would see error message &amp;quot;The device ‘Generic volume’ cannot be stopped right now. Try stopping the device again later&amp;quot; when trying to do a safe removal of USB storage device, but you are pretty sure that no program is currently using it. That&#039;s because there are still open handles with certain files in the USB Storage Device are in use by some processes which cannot be seen at the built-in Windows Task Manager.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://support.microsoft.com/kb/555665&quot;&gt;This Microsoft Support article&lt;/a&gt; explains the cause and offers the solution that requires a separate free utility, &lt;a href=&quot;http://www.microsoft.com/technet/sysinternals/security/processexplorer.mspx&quot;&gt;Process Explorer&lt;/a&gt;. 
    </content:encoded>

    <pubDate>Tue, 10 Jun 2008 23:59:00 +0800</pubDate>
    <guid isPermaLink="false">http://blogs.ngiap.com/stevenyong/archives/338-guid.html</guid>
    
</item>
<item>
    <title>JDBC pointers</title>
    <link>http://blogs.ngiap.com/stevenyong/archives/336-JDBC-pointers.html</link>
            <category>computer</category>
    
    <comments>http://blogs.ngiap.com/stevenyong/archives/336-JDBC-pointers.html#comments</comments>
    <wfw:comment>http://blogs.ngiap.com/stevenyong/wfwcomment.php?cid=336</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blogs.ngiap.com/stevenyong/rss.php?version=2.0&amp;type=comments&amp;cid=336</wfw:commentRss>
    

    <author>nospam@example.com (Steven Yong)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;a href=&quot;http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/&quot;&gt;JDBC&lt;/a&gt; (Java Database Connectivity) is the core thing to learn in order to understand database connectivity in Java even though you are only using O/R mapping tool like most of us do. While O/R mapping tool might make us more productive and leave out the JDBC detail entirely, it is always good to get yourself familiar with JDBC, which the O/R mapping tools based on top of.&lt;br /&gt;&lt;br /&gt;Article &lt;a href=&quot;http://www.javaworld.com/jw-07-2000/jw-0707-jdbc.html&quot;&gt;JDBC drivers&lt;/a&gt; in the wild over at JavaWorld gives us an insightful explanation of the details of JDBC drivers, and the article written by jeevan, named &lt;a href=&quot;http://java.dzone.com/news/back-2-basics-jdbc-re-visited&quot;&gt;JDBC Revisited&lt;/a&gt; offers the basic concepts of drivers, connection, datasource, statement and resultset.&lt;br /&gt;&lt;br /&gt;Last but not least, keep the API (&lt;a href=&quot;http://java.sun.com/j2se/1.5.0/docs/api/java/sql/package-summary.html&quot;&gt;java.sql&lt;/a&gt; and &lt;a href=&quot;http://java.sun.com/j2se/1.5.0/docs/api/javax/sql/package-summary.html&quot;&gt;javax.sql&lt;/a&gt;) with you.&lt;p /&gt; 
    </content:encoded>

    <pubDate>Sun, 08 Jun 2008 23:59:00 +0800</pubDate>
    <guid isPermaLink="false">http://blogs.ngiap.com/stevenyong/archives/336-guid.html</guid>
    
</item>
<item>
    <title>Change X Server screen resolution</title>
    <link>http://blogs.ngiap.com/stevenyong/archives/335-Change-X-Server-screen-resolution.html</link>
            <category>computer</category>
    
    <comments>http://blogs.ngiap.com/stevenyong/archives/335-Change-X-Server-screen-resolution.html#comments</comments>
    <wfw:comment>http://blogs.ngiap.com/stevenyong/wfwcomment.php?cid=335</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blogs.ngiap.com/stevenyong/rss.php?version=2.0&amp;type=comments&amp;cid=335</wfw:commentRss>
    

    <author>nospam@example.com (Steven Yong)</author>
    <content:encoded>
    &lt;br /&gt;
Changing screen resolution of X Server on Linux hasn&#039;t been easy. It usually requires manual of configuration file &lt;code&gt;/etc/X11/xorg.conf&lt;/code&gt;.&lt;br /&gt;The most easy way I could find is using command &lt;code&gt;dpkg-reconfigure -phigh xserver-xorg&lt;/code&gt;, which requires superuser right. You can do a &lt;code&gt;su root&lt;/code&gt; first or simply &lt;code&gt;sudo dpkg-reconfigure -phigh xserver-xorg&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;The result of this command is actually a modified xorg.conf.&lt;br /&gt;&lt;br /&gt;&lt;font size=&quot;1&quot;&gt;Correction: &lt;code&gt;dpkg&lt;/code&gt; command is only available on Linux distribution that uses &lt;a href=&quot;http://en.wikipedia.org/wiki/Dpkg&quot;&gt;DPKG&lt;/a&gt; package manager, like Ubuntu and Debian. While other popular distributions like Redhat Linux and SUSE Linux use &lt;a href=&quot;http://en.wikipedia.org/wiki/RPM_Package_Manager&quot;&gt;RPM&lt;/a&gt;.&lt;br /&gt;
&lt;/font&gt; 
    </content:encoded>

    <pubDate>Sat, 07 Jun 2008 23:59:00 +0800</pubDate>
    <guid isPermaLink="false">http://blogs.ngiap.com/stevenyong/archives/335-guid.html</guid>
    
</item>
<item>
    <title>Checking out source code using CVS and SVN command</title>
    <link>http://blogs.ngiap.com/stevenyong/archives/333-Checking-out-source-code-using-CVS-and-SVN-command.html</link>
            <category>computer</category>
    
    <comments>http://blogs.ngiap.com/stevenyong/archives/333-Checking-out-source-code-using-CVS-and-SVN-command.html#comments</comments>
    <wfw:comment>http://blogs.ngiap.com/stevenyong/wfwcomment.php?cid=333</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blogs.ngiap.com/stevenyong/rss.php?version=2.0&amp;type=comments&amp;cid=333</wfw:commentRss>
    

    <author>nospam@example.com (Steven Yong)</author>
    <content:encoded>
    &lt;br /&gt;
CVS and Subversion are two of the most popular source code control utilities, thousands of open source projects are using these two software to host their source code. Therefore, it is always worth remembering some useful commands such as checking out and updating source modules.&lt;br /&gt;&lt;br /&gt;For CVS:&lt;br /&gt;&lt;br /&gt;To check out: &lt;code&gt;cvs -d&amp;lt;CVS Root&amp;gt; login&lt;/code&gt; followed by &lt;code&gt;cvs -d&amp;lt;CVS Root&amp;gt; -P &amp;lt;Module Name&amp;gt;&lt;/code&gt;&lt;br /&gt;Example, check out source code of Mozilla&lt;br /&gt;- &lt;code&gt;cvs -d:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot login&lt;/code&gt; &lt;br /&gt;- Enter password when prompted&lt;br /&gt;- &lt;code&gt;cvs -d:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -P mozilla&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;To update latest code: &lt;code&gt;cvs update&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;For SVN:&lt;br /&gt;&lt;br /&gt;To check out: &lt;code&gt;svn co &amp;lt;SVN Path&amp;gt;&lt;/code&gt;&lt;br /&gt;Example, check out source code of Apache Tomcat Server&lt;br /&gt;&lt;code&gt;svn co http://svn.apache.org/repos/asf/tomcat/trunk&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;To update latest code: &lt;code&gt;svn update&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;When in need, it will come in handy.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Sat, 31 May 2008 08:08:00 +0800</pubDate>
    <guid isPermaLink="false">http://blogs.ngiap.com/stevenyong/archives/333-guid.html</guid>
    
</item>
<item>
    <title>Three ways to display user-friendly label from Java Enum</title>
    <link>http://blogs.ngiap.com/stevenyong/archives/331-Three-ways-to-display-user-friendly-label-from-Java-Enum.html</link>
            <category>computer</category>
    
    <comments>http://blogs.ngiap.com/stevenyong/archives/331-Three-ways-to-display-user-friendly-label-from-Java-Enum.html#comments</comments>
    <wfw:comment>http://blogs.ngiap.com/stevenyong/wfwcomment.php?cid=331</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blogs.ngiap.com/stevenyong/rss.php?version=2.0&amp;type=comments&amp;cid=331</wfw:commentRss>
    

    <author>nospam@example.com (Steven Yong)</author>
    <content:encoded>
    &lt;br /&gt;
Let&#039;s say we have an enumerated type Result:&lt;br /&gt;&lt;pre&gt;enum Result { Pass, Fail }&lt;/pre&gt;&lt;br /&gt;When we do a print of either type, like:&lt;code&gt;System.out.println(Result.Pass)&lt;/code&gt; we get a word &amp;quot;Pass&amp;quot; which is not so user-friendly. &lt;br /&gt;There are many ways to add a label to each enumeration and here are three common ones:&lt;br /&gt;&lt;pre&gt;enum Result {&lt;br /&gt;    Pass, Fail;&lt;br /&gt;&lt;br /&gt;    String getLabel() { &lt;br /&gt;        switch(this) {&lt;br /&gt;            case Pass : return &amp;quot;You are passed&amp;quot;;&lt;br /&gt;            case Fail : return &amp;quot;You are failed&amp;quot;;&lt;br /&gt;        }&lt;br /&gt;        throw new AssertionError(&amp;quot;Unknown result: &amp;quot; + this);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;pre&gt;enum Result {&lt;br /&gt;    Pass(&amp;quot;You are passed&amp;quot;), Fail(&amp;quot;You are failed&amp;quot;);&lt;br /&gt;    &lt;br /&gt;    Result(String s) { label = s; }&lt;br /&gt;    &lt;br /&gt;    String label;&lt;br /&gt;    &lt;br /&gt;    String getLabel() { return label; }&lt;br /&gt;}&lt;/pre&gt;&lt;pre&gt;enum Result {&lt;br /&gt;    Pass { String getLabel() { return &amp;quot;You are passed&amp;quot;; }},&lt;br /&gt;    Fail { String getLabel() { return &amp;quot;You are failed&amp;quot;; }};&lt;br /&gt;&lt;br /&gt;    abstract String getLabel();&lt;br /&gt;}&lt;/pre&gt;All of them print &amp;quot;You are passed&amp;quot; when displaying &lt;code&gt;Result.Pass.getLabel()&lt;/code&gt;. I believe the first approach is relatively slower since it needs to do checking, although it is cleaner at the type definition. Second approach make use of constructor but an instance variable has to be introduced, it&#039;s also not so extensible since it would end up with a few constructors when more aliases are required. I prefer the last approach as it looks more flexible.  
    </content:encoded>

    <pubDate>Fri, 23 May 2008 17:37:57 +0800</pubDate>
    <guid isPermaLink="false">http://blogs.ngiap.com/stevenyong/archives/331-guid.html</guid>
    
</item>
<item>
    <title>Find Java tools in an easy way</title>
    <link>http://blogs.ngiap.com/stevenyong/archives/329-Find-Java-tools-in-an-easy-way.html</link>
            <category>computer</category>
    
    <comments>http://blogs.ngiap.com/stevenyong/archives/329-Find-Java-tools-in-an-easy-way.html#comments</comments>
    <wfw:comment>http://blogs.ngiap.com/stevenyong/wfwcomment.php?cid=329</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blogs.ngiap.com/stevenyong/rss.php?version=2.0&amp;type=comments&amp;cid=329</wfw:commentRss>
    

    <author>nospam@example.com (Steven Yong)</author>
    <content:encoded>
    So now we can browse for popular Java tools and libraries at this very good one-stop directory, &lt;a href=&quot;http://javatoolbox.com/&quot;&gt;JavaToolbox.com&lt;/a&gt;. According to the site owner, the idea comes from .NET tools website &lt;a href=&quot;http://sharptoolbox.com/&quot;&gt;SharpToolbox&lt;/a&gt;.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Wed, 09 Apr 2008 09:27:27 +0800</pubDate>
    <guid isPermaLink="false">http://blogs.ngiap.com/stevenyong/archives/329-guid.html</guid>
    
</item>
<item>
    <title>Interview with Adam Bien</title>
    <link>http://blogs.ngiap.com/stevenyong/archives/328-Interview-with-Adam-Bien.html</link>
            <category>computer</category>
    
    <comments>http://blogs.ngiap.com/stevenyong/archives/328-Interview-with-Adam-Bien.html#comments</comments>
    <wfw:comment>http://blogs.ngiap.com/stevenyong/wfwcomment.php?cid=328</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blogs.ngiap.com/stevenyong/rss.php?version=2.0&amp;type=comments&amp;cid=328</wfw:commentRss>
    

    <author>nospam@example.com (Steven Yong)</author>
    <content:encoded>
    &lt;br /&gt;
Some of you already know, I like sharing interviews of Java Champion. This time, it is &lt;a href=&quot;http://java.sun.com/developer/technicalArticles/Interviews/community/bien_qa.html&quot;&gt;Adam Bien on Java EE&lt;/a&gt; programming.&lt;br /&gt;&lt;br /&gt;I like his advices on API Javadoc:&lt;blockquote&gt;- Don&#039;t allow default Javadoc comments generated by the IDE.&lt;br /&gt;- Sometimes &amp;quot;No doc is the best doc&amp;quot; -- try to minimize the amount of documentation and describe only the key concepts.&lt;/blockquote&gt;&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Thu, 03 Apr 2008 09:53:40 +0800</pubDate>
    <guid isPermaLink="false">http://blogs.ngiap.com/stevenyong/archives/328-guid.html</guid>
    
</item>
<item>
    <title>Default initialization of object variable</title>
    <link>http://blogs.ngiap.com/stevenyong/archives/318-Default-initialization-of-object-variable.html</link>
            <category>computer</category>
    
    <comments>http://blogs.ngiap.com/stevenyong/archives/318-Default-initialization-of-object-variable.html#comments</comments>
    <wfw:comment>http://blogs.ngiap.com/stevenyong/wfwcomment.php?cid=318</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://blogs.ngiap.com/stevenyong/rss.php?version=2.0&amp;type=comments&amp;cid=318</wfw:commentRss>
    

    <author>nospam@example.com (Steven Yong)</author>
    <content:encoded>
    &lt;br /&gt;
Commenter &lt;a href=&quot;http://blogs.ngiap.com/stevenyong/archives/317-Calculate-video-file-size.html#c11401&quot;&gt;~*~&lt;strong&gt;yUeN fEi*~&lt;/strong&gt;~&lt;/a&gt; said that the post about calculating video file size is too simple because it is something that has been taught to her in her school time. What is obvious is that we are from different colleges because I never learn that in school.&lt;br /&gt;&lt;br /&gt;Okay, since she said like that, perhaps today I have to write something that has not been explained in school before.&lt;br /&gt;&lt;br /&gt;It is about stack and heap memory. Consider following class definition:&lt;br /&gt;&lt;pre&gt;class A&lt;br /&gt;{&lt;br /&gt;   int m_iA;&lt;br /&gt;   boolean m_boolB;&lt;br /&gt;   string m_sC;&lt;br /&gt;}&lt;/pre&gt;Note that the class is defined in language-independent way.&lt;br /&gt;&lt;br /&gt;We all know that whenever an object of class &lt;code&gt;A&lt;/code&gt; is being instantiated, member variable &lt;code&gt;m_iA&lt;/code&gt; will be initialized to 0, &lt;code&gt;m_boolB&lt;/code&gt; will be  false and &lt;code&gt;m_sC&lt;/code&gt; will be null. Yes, we all know that, even since school time, but why is it like that?&lt;br /&gt;&lt;br /&gt;Every process of computer program has its own memory space called stack and a shared memory space called heap. Stack is useful for function parameter passing as well as caller address returning, and the data in the stack memory is being pushed and popped by the Stack Pointer in the CPU. All the values of local variables of any function are stored in stack memory, the size and type of the variable has to be known at compile time and that is the reason why we will get error if we forget to initialize local variable before use.&lt;br /&gt;&lt;br /&gt;On the other hand, heap memory is used to store objects which the size is not known until runtime. Heap memory normally shared by processes, and data in the heap always initialized to zero.&lt;br /&gt;&lt;br /&gt;Armed with these basic knowledge, we would know what&#039;s going to happen when we instantiate an object of class &lt;code&gt;A&lt;/code&gt;:&lt;br /&gt;&lt;pre&gt;A a =  new A();&lt;/pre&gt;&lt;br /&gt;The value of variable a, which is an object reference, which should be very close to a memory address, will be put into the stack. While the actual object that a is referencing to will be stored in the heap. We just learned that heap memory always initialized to zero, unsurprisingly &lt;code&gt;m_iA&lt;/code&gt; will be 0, &lt;code&gt;m_boolB&lt;/code&gt; will also be zero, I&#039;m sure our school has taught us that for boolean value, 0 means false and everything else represents true, so now we know why &lt;code&gt;m_boolB&lt;/code&gt; is false by default. The value of &lt;code&gt;m_sC&lt;/code&gt; will be zero as well, and when we say an object reference is 0, it means that it is a null reference. Our school taught us that, right?&lt;br /&gt;&lt;br /&gt;Back to the video file size calculation, we do know that 1 kilobyte is 1024 bytes, but why? Since it is kilo, the unit that we all familiar with, why not 1000 bytes instead? Hopefully ~*~&lt;strong&gt;yUeN fEi*~&lt;/strong&gt;~ could share the secret she&#039;s learnt from college, otherwise I will see if I can make it the topic of my coming post.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Mon, 14 Jan 2008 10:57:57 +0800</pubDate>
    <guid isPermaLink="false">http://blogs.ngiap.com/stevenyong/archives/318-guid.html</guid>
    
</item>
<item>
    <title>Calculate video file size</title>
    <link>http://blogs.ngiap.com/stevenyong/archives/317-Calculate-video-file-size.html</link>
            <category>computer</category>
    
    <comments>http://blogs.ngiap.com/stevenyong/archives/317-Calculate-video-file-size.html#comments</comments>
    <wfw:comment>http://blogs.ngiap.com/stevenyong/wfwcomment.php?cid=317</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://blogs.ngiap.com/stevenyong/rss.php?version=2.0&amp;type=comments&amp;cid=317</wfw:commentRss>
    

    <author>nospam@example.com (Steven Yong)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;p&gt;Here are the basic steps of calculating file size of a video:&lt;/p&gt;&lt;br /&gt;First, we have to know the dimension of the video, in other words, the height and width of the video, in pixel, let&#039;s take a video that has the width of 320 pixel and the height of 240 pixel:&lt;pre&gt;&lt;code&gt;320 x 240 = 76,800 pixels&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Next, mulitply the total pixels with the color depth, assume we have a 24-bit (3 bytes) color depth:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;76,800 x 3 = 230,400 bytes&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Say the video is playing at 15 frame per second (fps):&lt;/p&gt;&lt;pre&gt;&lt;code&gt;230,400 x 15 = 3,456,000 bytes&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;and playing for about 30 seconds:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;3,456,000 x 30 = 103,680,000 bytes (or 103.68 MB)&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Of course, video plays with sound, the video uses 16-bit stereo CD-quality sound, which has 44.1 kHz of sampling rate*:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;44,100 x 2 bytes (16-bit) x 2 bytes (stereo) x 30 seconds = 5,292,000 bytes (or 5.292 MB)&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Finally we got the total file size of the video:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;103.68 + 5.292 = 108.97 MB&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note that the size of the video images is calculated separately from the size of the video sound.&lt;/p&gt;&lt;p /&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;font size=&quot;1&quot;&gt;*1 - The FM frequency that familiar to us uses only 11.025 kHz of sampling rate&lt;/font&gt;&lt;br /&gt;&lt;font size=&quot;1&quot;&gt;*2 - Mono sound uses only 1 bytes per sampling&lt;/font&gt;&lt;br /&gt;
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 30 Dec 2007 17:24:38 +0800</pubDate>
    <guid isPermaLink="false">http://blogs.ngiap.com/stevenyong/archives/317-guid.html</guid>
    
</item>
<item>
    <title>Brief explanation on how to access function</title>
    <link>http://blogs.ngiap.com/stevenyong/archives/316-Brief-explanation-on-how-to-access-function.html</link>
            <category>computer</category>
    
    <comments>http://blogs.ngiap.com/stevenyong/archives/316-Brief-explanation-on-how-to-access-function.html#comments</comments>
    <wfw:comment>http://blogs.ngiap.com/stevenyong/wfwcomment.php?cid=316</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blogs.ngiap.com/stevenyong/rss.php?version=2.0&amp;type=comments&amp;cid=316</wfw:commentRss>
    

    <author>nospam@example.com (Steven Yong)</author>
    <content:encoded>
    Alan&#039;s given us a brief, good and easy-to-understand &lt;a href=&quot;http://blogs.msdn.com/vcblog/archive/2007/12/17/how-a-program-accesses-functions.aspx&quot;&gt;explanation&lt;/a&gt; on how program accesses function in library.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Tue, 18 Dec 2007 14:08:19 +0800</pubDate>
    <guid isPermaLink="false">http://blogs.ngiap.com/stevenyong/archives/316-guid.html</guid>
    
</item>
<item>
    <title>New Java EE 5 Implementation - Geronimo</title>
    <link>http://blogs.ngiap.com/stevenyong/archives/309-New-Java-EE-5-Implementation-Geronimo.html</link>
            <category>computer</category>
    
    <comments>http://blogs.ngiap.com/stevenyong/archives/309-New-Java-EE-5-Implementation-Geronimo.html#comments</comments>
    <wfw:comment>http://blogs.ngiap.com/stevenyong/wfwcomment.php?cid=309</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blogs.ngiap.com/stevenyong/rss.php?version=2.0&amp;type=comments&amp;cid=309</wfw:commentRss>
    

    <author>nospam@example.com (Steven Yong)</author>
    <content:encoded>
    Another new open source Java EE 5 certified implementation is out, &lt;a href=&quot;http://geronimo.apache.org/&quot;&gt;Apache Geronimo 2.0.1&lt;/a&gt;. To see a full list of compatible implementations, &lt;a href=&quot;http://java.sun.com/javaee/overview/compatibility.jsp&quot;&gt;go here&lt;/a&gt;.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Wed, 29 Aug 2007 09:42:15 +0800</pubDate>
    <guid isPermaLink="false">http://blogs.ngiap.com/stevenyong/archives/309-guid.html</guid>
    
</item>
<item>
    <title>PHP 4 supoprt will end soon</title>
    <link>http://blogs.ngiap.com/stevenyong/archives/305-PHP-4-supoprt-will-end-soon.html</link>
            <category>computer</category>
    
    <comments>http://blogs.ngiap.com/stevenyong/archives/305-PHP-4-supoprt-will-end-soon.html#comments</comments>
    <wfw:comment>http://blogs.ngiap.com/stevenyong/wfwcomment.php?cid=305</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blogs.ngiap.com/stevenyong/rss.php?version=2.0&amp;type=comments&amp;cid=305</wfw:commentRss>
    

    <author>nospam@example.com (Steven Yong)</author>
    <content:encoded>
    &lt;br /&gt;
The &lt;a href=&quot;http://www.php.net&quot;&gt;PHP development team&lt;/a&gt; &lt;a href=&quot;http://developers.slashdot.org/article.pl?sid=07/07/14/0646216&amp;from=rss&quot;&gt;will stop supporting PHP version 4&lt;/a&gt; in the end of year 2007, although critical security fixes will be still issued on a case-by-case basis until 8/8/2008. In other words, the websites like this blog, which are relying on PHP 4 should consider migrating to version 5 as soon as possible (&lt;a href=&quot;http://php.net/manual/en/migration5.php&quot;&gt;here is the migration guide&lt;/a&gt;.)&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Mon, 16 Jul 2007 09:36:45 +0800</pubDate>
    <guid isPermaLink="false">http://blogs.ngiap.com/stevenyong/archives/305-guid.html</guid>
    
</item>
<item>
    <title>Viewing Solaris system configuration</title>
    <link>http://blogs.ngiap.com/stevenyong/archives/304-Viewing-Solaris-system-configuration.html</link>
            <category>computer</category>
    
    <comments>http://blogs.ngiap.com/stevenyong/archives/304-Viewing-Solaris-system-configuration.html#comments</comments>
    <wfw:comment>http://blogs.ngiap.com/stevenyong/wfwcomment.php?cid=304</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://blogs.ngiap.com/stevenyong/rss.php?version=2.0&amp;type=comments&amp;cid=304</wfw:commentRss>
    

    <author>nospam@example.com (Steven Yong)</author>
    <content:encoded>
    We can issue this command &lt;code&gt;/usr/platform/sun4u/sbin/prtdiag&lt;/code&gt; and get output similar to this:&lt;blockquote&gt;&lt;pre&gt;&lt;font size=&quot;2&quot;&gt;&lt;code&gt;System Configuration: Sun Microsystems  sun4u Sun Blade 100 (UltraSPARC-IIe)&lt;br /&gt;System clock frequency: 84 MHZ&lt;br /&gt;Memory size: 2GB&lt;br /&gt;&lt;br /&gt;=============================== CPUs ===============================&lt;br /&gt;               E$          CPU     CPU       Temperature&lt;br /&gt;CPU  Freq      Size        Impl.   Mask     Die    Ambient&lt;br /&gt;---  --------  ----------  ------  ----  --------  --------&lt;br /&gt; 0    502 MHz  256KB       US-IIe   1.4     80 C      35 C&lt;br /&gt;&lt;br /&gt;============================ IO Devices ============================&lt;br /&gt;     Bus   Freq&lt;br /&gt;Brd  Type  MHz   Slot        Name                          Model&lt;br /&gt;---  ----  ----  ----------  ------------------------  --------------&lt;br /&gt; 0   pci    33            7  isa/dma-isadma (dma)&lt;br /&gt; 0   pci    33            7  isa/serial-su16550 (serial)&lt;br /&gt; 0   pci    33            7  isa/serial-su16550 (serial)&lt;br /&gt; 0   pci    33            8  sound-pci10b9,5451.10b9.5451+&lt;br /&gt; 0   pci    33           12  network-pci108e,1101.1 (netw+ SUNW,pci-eri&lt;br /&gt; 0   pci    33           12  firewire-pci108e,1102.1001 (+&lt;br /&gt; 0   pci    33           12  usb-pci108e,1103.1 (usb)&lt;br /&gt; 0   pci    33           13  ide-pci10b9,5229.c3 (ide)&lt;br /&gt; 0   pci    33           19  SUNW,m64B (display)           ATY,RageXL&lt;br /&gt;&lt;br /&gt;======================= Memory Configuration =======================&lt;br /&gt;Segment Table:&lt;br /&gt;-----------------------------------------------------------------------&lt;br /&gt;Base Address       Size       Interleave Factor  Contains&lt;br /&gt;-----------------------------------------------------------------------&lt;br /&gt;0x0                512MB             1           DIMM0&lt;br /&gt;0x20000000         512MB             1           DIMM1&lt;br /&gt;0x40000000         512MB             1           DIMM2&lt;br /&gt;0x60000000         512MB             1           DIMM3&lt;br /&gt;&lt;br /&gt;=========================== usb Devices ==========================&lt;br /&gt;&lt;br /&gt;Name          Port#&lt;br /&gt;------------  -----&lt;br /&gt;hub             2&lt;br /&gt;&lt;br /&gt;========================== hub#2 Devices ==========================&lt;br /&gt;&lt;br /&gt;Name          Port#&lt;br /&gt;------------  -----&lt;br /&gt;keyboard        1&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/blockquote&gt; 
    </content:encoded>

    <pubDate>Wed, 04 Jul 2007 10:33:31 +0800</pubDate>
    <guid isPermaLink="false">http://blogs.ngiap.com/stevenyong/archives/304-guid.html</guid>
    
</item>
<item>
    <title>Getting StringIndexOutOfBoundsException when the bound hasn't exceeded</title>
    <link>http://blogs.ngiap.com/stevenyong/archives/303-Getting-StringIndexOutOfBoundsException-when-the-bound-hasnt-exceeded.html</link>
            <category>computer</category>
    
    <comments>http://blogs.ngiap.com/stevenyong/archives/303-Getting-StringIndexOutOfBoundsException-when-the-bound-hasnt-exceeded.html#comments</comments>
    <wfw:comment>http://blogs.ngiap.com/stevenyong/wfwcomment.php?cid=303</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://blogs.ngiap.com/stevenyong/rss.php?version=2.0&amp;type=comments&amp;cid=303</wfw:commentRss>
    

    <author>nospam@example.com (Steven Yong)</author>
    <content:encoded>
    &lt;br /&gt;
A coworker of mine got puzzled with the &lt;a href=&quot;http://java.sun.com/j2se/1.5.0/docs/api/java/lang/StringIndexOutOfBoundsException.html&quot;&gt;&lt;code&gt;StringIndexOutOfBoundsException&lt;/code&gt;&lt;/a&gt; yesterday morning while she was trying to write string to the &lt;code&gt;BufferedWriter&lt;/code&gt;. She claimed that the total length of the text she wanted to write was just only 255 characters of the entire buffer and it wasn&#039;t going to exceed the length of the buffer itself. Something like this:&lt;br /&gt;&lt;br /&gt;buffer length: 1000 characters&lt;br /&gt;the length of string she wanted to write: 255 characters&lt;br /&gt;&lt;br /&gt;and the original code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;write(buffer, 700, 955);&lt;/pre&gt;&lt;br /&gt;&amp;quot;See? 955 is not yet reaching the length of the buffer, which is 1000, why am I getting that exception?&amp;quot;&lt;br /&gt;&lt;br /&gt;Perhaps she get too used to the &lt;a href=&quot;http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#substring(int,%20int)&quot;&gt;&lt;code&gt;String.substring&lt;/code&gt;&lt;/a&gt; API:&lt;blockquote&gt;public String substring(int beginIndex, int endIndex)&lt;br /&gt;&lt;br /&gt;Parameters:&lt;br /&gt;    beginIndex - the beginning index, inclusive.&lt;br /&gt;    endIndex - the ending index, exclusive.&lt;/blockquote&gt;After reading through the &lt;a href=&quot;http://java.sun.com/j2se/1.5.0/docs/api/java/io/BufferedWriter.html#write(char[],%20int,%20int)&quot;&gt;&lt;code&gt;BufferedWriter.write&lt;/code&gt;&lt;/a&gt; API with her:&lt;blockquote&gt;public void write(char[] cbuf, int off, int len) throws IOException&lt;br /&gt;&lt;br /&gt;Parameters:&lt;br /&gt;    cbuf - A character array&lt;br /&gt;    off - Offset from which to start reading characters&lt;br /&gt;    len - Number of characters to write&lt;/blockquote&gt;We started looking at each other embarrassingly, the original code was actually trying to write 955 characters from the offset 700, rather than write until reaching character 955. The correct one should be:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;write(buffer, 700, 255);&lt;/pre&gt;&lt;br /&gt;Just another example of not reading documentation before coding.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Wed, 20 Jun 2007 10:39:19 +0800</pubDate>
    <guid isPermaLink="false">http://blogs.ngiap.com/stevenyong/archives/303-guid.html</guid>
    
</item>

</channel>
</rss>