<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Robby Chen Personal Blog</title>
	<atom:link href="http://blog.robbychen.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.robbychen.com</link>
	<description>robbychen.com Site Updates, Web Development Tricks and GNU/Linux Tips</description>
	<lastBuildDate>Fri, 03 Sep 2010 05:16:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Remove Part of File Names using PHP</title>
		<link>http://blog.robbychen.com/2010/09/02/remove-part-of-file-names-using-php/</link>
		<comments>http://blog.robbychen.com/2010/09/02/remove-part-of-file-names-using-php/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 01:42:57 +0000</pubDate>
		<dc:creator>Robby Chen</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[David's Batch Processor]]></category>
		<category><![CDATA[GIMP]]></category>
		<category><![CDATA[ICAF]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu Studio]]></category>

		<guid isPermaLink="false">http://blog.robbychen.com/?p=1196</guid>
		<description><![CDATA[Since David&#8217;s Batch Processor was pre-installed in GIMP on Ubuntu Studio, I used it extensively in the ICAF Gallery project today. My goal for these images is to resize their thumbnail version to 10KB or smaller and retain the original &#8230; <a href="http://blog.robbychen.com/2010/09/02/remove-part-of-file-names-using-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Since <a href="http://members.ozemail.com.au/~hodsond/dbp.html">David&#8217;s Batch Processor</a> was pre-installed in GIMP on Ubuntu Studio, I used it extensively in the <a href="http://blog.robbychen.com/2010/07/30/my-latest-project/">ICAF Gallery</a> project today. My goal for these images is to resize their thumbnail version to 10KB or smaller and retain the original size for the enlarged version. Because most of these images are in different resolution, I randomly selected the scale value in the Batch Processor to resize the images. Then I had to manually view the file size of each image to see whether or not an image has to be resized again. After the differentiation, I moved the images that need to be resized once more to a new sub-directory and started the above process one more time. I would repeat these steps again and again until all the thumbnail version of the images are under 10KB.</p>
<p>During the early use of the Batch Processor, I missed a very important feature that is to save the newly processed images to a different folders. This resulted my decision to write this Batch File Name Remover script. The source code for this script is very easy to understand. It&#8217;s just some PHP functions plus two Linux commands: <em>ls </em>and <em>mv</em>. I always place a postfix after the file name of processed thumbnails: &#8220;-thumb&#8221;. Because of that, I need to remove this postfix whenever I repeated the above resize steps. The <em>ls </em>command is used to list the file name that contains the specified characters into an array. The <em>mv </em>command is used to remove the specified characters from the file name using PHP <em>explode </em>function. I used PHP instead of native Linux Bash script because PHP is easier than Bash for me <img src='http://blog.robbychen.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . The source code for this script is <a href="http://blog.robbychen.com/Linux/fileNameRemover.tar.gz">available here</a>.</p>
<p>Below is the Batch File Name Remover in action:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/mwL80Rjwol0?fs=1&amp;hl=en_US&amp;hd=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="640" height="385" src="http://www.youtube.com/v/mwL80Rjwol0?fs=1&amp;hl=en_US&amp;hd=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.robbychen.com/2010/08/24/changing-back-to-the-original-schedule-and-first-video-post/" rel="bookmark" class="crp_title">Changing Back to the Original Schedule and First Video Post (Updated)</a></li><li><a href="http://blog.robbychen.com/2010/03/19/an-inspirational-talk-by-linus-torvalds/" rel="bookmark" class="crp_title">An inspirational Talk by Linus Torvalds</a></li><li><a href="http://blog.robbychen.com/2010/09/01/transitioning-to-ubuntu-studio/" rel="bookmark" class="crp_title">Transitioning to Ubuntu Studio</a></li><li><a href="http://blog.robbychen.com/2010/07/30/my-latest-project/" rel="bookmark" class="crp_title">My Latest Project</a></li><li><a href="http://blog.robbychen.com/2010/05/29/created-a-new-logo/" rel="bookmark" class="crp_title">Created a new logo</a></li><li><a href="http://blog.robbychen.com/2010/06/18/linux-shell-programming-basics/" rel="bookmark" class="crp_title">Linux Shell Programming Basics</a></li><li><a href="http://blog.robbychen.com/2010/04/19/backup-mysql-database-without-phpmyadmin/" rel="bookmark" class="crp_title">Backup MySQL Database without PHPMyAdmin</a></li><li><a href="http://blog.robbychen.com/2010/03/29/create-a-wallpaper-slideshow-on-ubuntu/" rel="bookmark" class="crp_title">Create a Wallpaper Slideshow on Ubuntu (Updated)</a></li><li><a href="http://blog.robbychen.com/2010/05/15/use-str_replace-to-easier-delete-characters-in-a-string-with-php/" rel="bookmark" class="crp_title">Use str_replace to Easier Delete Characters in a String with PHP</a></li><li><a href="http://blog.robbychen.com/2010/05/12/manage-files-using-php-on-linux-server/" rel="bookmark" class="crp_title">Manage files using PHP on Linux Server</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.robbychen.com/2010/09/02/remove-part-of-file-names-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transitioning to Ubuntu Studio</title>
		<link>http://blog.robbychen.com/2010/09/01/transitioning-to-ubuntu-studio/</link>
		<comments>http://blog.robbychen.com/2010/09/01/transitioning-to-ubuntu-studio/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 13:14:47 +0000</pubDate>
		<dc:creator>Robby Chen</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Audio Production]]></category>
		<category><![CDATA[Linux MultiMedia Studio]]></category>
		<category><![CDATA[LMMS]]></category>
		<category><![CDATA[NetworkManager]]></category>
		<category><![CDATA[StopMotion]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Ubuntu Studio]]></category>
		<category><![CDATA[Video Production]]></category>

		<guid isPermaLink="false">http://blog.robbychen.com/?p=1181</guid>
		<description><![CDATA[Yesterday I switched to Ubuntu Studio 10.04 mainly because I love the audio production tools available in the distro. The first time I tried to install Ubuntu Studio from the original DVD was a failure. That&#8217;s probably because this distro &#8230; <a href="http://blog.robbychen.com/2010/09/01/transitioning-to-ubuntu-studio/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="file:///tmp/moz-screenshot.png" alt="" /><a href="http://blog.robbychen.com/wp-content/uploads/2010/09/Ubuntu_Studio.png"><img class="alignleft size-full wp-image-1190" title="Ubuntu Studio" src="http://blog.robbychen.com/wp-content/uploads/2010/09/Ubuntu_Studio-e1283349562538.png" alt="Ubuntu Studio Logo" width="247" height="71" /></a>Yesterday I switched to Ubuntu Studio 10.04 mainly because I love the audio production tools available in the distro. The first time I tried to install Ubuntu Studio from the original DVD was a failure. That&#8217;s probably because this distro is usually for multimedia workstation, therefore it doesn&#8217;t install NetworkManager by default. As the result, I didn&#8217;t get very far with this original distribution because of the wifi struggle.</p>
<p>Instead, I reinstalled Ubuntu 10.04 and upgraded to Ubuntu Studio by following <a href="https://help.ubuntu.com/community/Ubuntu%20Studio%20Upgrade%20from%20Ubuntu">this Ubuntu Documentation article</a>. Here is the video preview of the Application menu in the Original Ubuntu Studio:</p>
<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/PzVkq1wtZlg?fs=1&amp;hl=en_US&amp;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/PzVkq1wtZlg?fs=1&amp;hl=en_US&amp;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
<p>Note that I installed the distro inside VirtualBox using original DVD ISO image in the above video to show the different default interface between Ubuntu and Ubuntu Studio. The version of Ubuntu Studio upgraded from the original Ubuntu installation is very different, notably the NetworkManager.</p>
<p>I&#8217;m currently in the process of transitioning to this new Ubuntu environment. I have many tasks to complete like deciding which applications to reinstall and restore their configurations from my backed up home directory, etc. Once I finished all these tasks (probably today), I will start to learn about the tools available in Ubuntu Studio like <a href="http://lmms.sourceforge.net/">LMMS</a> and <a href="http://stopmotion.bjoernen.com/">StopMotion</a>. Look forward to the upcoming posts about these tools.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.robbychen.com/2010/08/24/changing-back-to-the-original-schedule-and-first-video-post/" rel="bookmark" class="crp_title">Changing Back to the Original Schedule and First Video Post (Updated)</a></li><li><a href="http://blog.robbychen.com/2010/09/02/remove-part-of-file-names-using-php/" rel="bookmark" class="crp_title">Remove Part of File Names using PHP</a></li><li><a href="http://blog.robbychen.com/2010/03/19/an-inspirational-talk-by-linus-torvalds/" rel="bookmark" class="crp_title">An inspirational Talk by Linus Torvalds</a></li><li><a href="http://blog.robbychen.com/2010/03/26/the-meaning-of-the-ubuntu-version-number/" rel="bookmark" class="crp_title">The meaning of the Ubuntu Version Number</a></li><li><a href="http://blog.robbychen.com/2010/03/20/began-long-term-usage-of-kde/" rel="bookmark" class="crp_title">Began Long-Term Usage of KDE</a></li><li><a href="http://blog.robbychen.com/2010/04/29/my-experience-with-upgrading-from-ubuntu-karmic-to-lucid/" rel="bookmark" class="crp_title">My Experience with upgrading from Ubuntu Karmic to Lucid</a></li><li><a href="http://blog.robbychen.com/2010/04/06/5-gnulinux-audio-editors-that-i-havent-tried/" rel="bookmark" class="crp_title">5 GNU/Linux Audio Editors that I haven&#8217;t tried</a></li><li><a href="http://blog.robbychen.com/2010/05/29/created-a-new-logo/" rel="bookmark" class="crp_title">Created a new logo</a></li><li><a href="http://blog.robbychen.com/2010/04/03/enhance-creativity-using-mypaint/" rel="bookmark" class="crp_title">Enhance Creativity using MyPaint</a></li><li><a href="http://blog.robbychen.com/2010/04/30/my-first-experience-with-unr-ubuntu-netbook-remix/" rel="bookmark" class="crp_title">My First Experience with UNR (Ubuntu Netbook Remix)</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.robbychen.com/2010/09/01/transitioning-to-ubuntu-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing Back to the Original Schedule and First Video Post (Updated)</title>
		<link>http://blog.robbychen.com/2010/08/24/changing-back-to-the-original-schedule-and-first-video-post/</link>
		<comments>http://blog.robbychen.com/2010/08/24/changing-back-to-the-original-schedule-and-first-video-post/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 23:48:08 +0000</pubDate>
		<dc:creator>Robby Chen</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[slideshow]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[wallpaper]]></category>

		<guid isPermaLink="false">http://blog.robbychen.com/?p=1158</guid>
		<description><![CDATA[Update (08/25/2010): The video quality has been improved thanks to OpenShot. Note that to watch the original HD quality, you must switch to 720p or 1080p. I also fixed the PHP script to exclude the XML file inside the background.xml &#8230; <a href="http://blog.robbychen.com/2010/08/24/changing-back-to-the-original-schedule-and-first-video-post/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Update (08/25/2010): The video quality has been improved thanks to OpenShot. Note that to watch the original HD quality, you must switch to 720p or 1080p. I also fixed the PHP script to exclude the XML file inside the background.xml file so that the slideshow can run smoothly without an empty image.</strong></p>
<p>After weeks of consideration, I finally decided to change back to my original post schedule of one post per day. <a href="http://blog.robbychen.com/2010/06/29/c-comment-and-changing-of-posting-schedule/">Two posts each day</a> simply doesn&#8217;t work for me.</p>
<p>I also plan to make a video version of the post along with each post. Here is my first video showing how to <a href="http://blog.robbychen.com/2010/03/29/create-a-wallpaper-slideshow-on-ubuntu/">create a wallpaper slideshow in Ubuntu</a>, one of the popular posts I wrote back to March of this year:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/XF9FjXcw2mk?fs=1&amp;hl=en_US" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="640" height="385" src="http://www.youtube.com/v/XF9FjXcw2mk?fs=1&amp;hl=en_US" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>The steps in the video are different from the post. I recorded this video this afternoon. Just before that, I wrote a PHP script that can generate background.xml file for me.  You can download the PHP script here:<br />
<a href="http://blog.robbychen.com/Ubuntu/slideshow.tar.gz">http://blog.robbychen.com/Ubuntu/slideshow.tar.gz</a></p>
<p>To use this script, you must first change the permission of the folder where the images are to 777. You may change it back to original permission after that for security reason.</p>
<p>If you have any problem running this script, please leave a comment below.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.robbychen.com/2010/09/02/remove-part-of-file-names-using-php/" rel="bookmark" class="crp_title">Remove Part of File Names using PHP</a></li><li><a href="http://blog.robbychen.com/2010/03/19/an-inspirational-talk-by-linus-torvalds/" rel="bookmark" class="crp_title">An inspirational Talk by Linus Torvalds</a></li><li><a href="http://blog.robbychen.com/2010/09/01/transitioning-to-ubuntu-studio/" rel="bookmark" class="crp_title">Transitioning to Ubuntu Studio</a></li><li><a href="http://blog.robbychen.com/2010/03/29/create-a-wallpaper-slideshow-on-ubuntu/" rel="bookmark" class="crp_title">Create a Wallpaper Slideshow on Ubuntu (Updated)</a></li><li><a href="http://blog.robbychen.com/2010/06/29/c-comment-and-changing-of-posting-schedule/" rel="bookmark" class="crp_title">C Comment and Changing of Posting Schedule</a></li><li><a href="http://blog.robbychen.com/2010/05/27/played-around-with-drupal-upcoming-site-update-and-more/" rel="bookmark" class="crp_title">Played Around with Drupal, Upcoming Site Update, and more &#8230;</a></li><li><a href="http://blog.robbychen.com/2010/07/30/my-latest-project/" rel="bookmark" class="crp_title">My Latest Project</a></li><li><a href="http://blog.robbychen.com/2010/04/19/backup-mysql-database-without-phpmyadmin/" rel="bookmark" class="crp_title">Backup MySQL Database without PHPMyAdmin</a></li><li><a href="http://blog.robbychen.com/2010/03/20/began-long-term-usage-of-kde/" rel="bookmark" class="crp_title">Began Long-Term Usage of KDE</a></li><li><a href="http://blog.robbychen.com/2010/03/25/brother-scanner-driver-installation-in-ubuntu/" rel="bookmark" class="crp_title">Brother Scanner Driver Installation in Ubuntu 9.10 (Updated)</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.robbychen.com/2010/08/24/changing-back-to-the-original-schedule-and-first-video-post/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>C Increment and Decrement Operators</title>
		<link>http://blog.robbychen.com/2010/08/07/c-increment-and-decrement-operators/</link>
		<comments>http://blog.robbychen.com/2010/08/07/c-increment-and-decrement-operators/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 03:34:53 +0000</pubDate>
		<dc:creator>Robby Chen</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[C programming language]]></category>
		<category><![CDATA[decrement operator]]></category>
		<category><![CDATA[increment operator]]></category>
		<category><![CDATA[short-hand operators]]></category>

		<guid isPermaLink="false">http://blog.robbychen.com/?p=1143</guid>
		<description><![CDATA[Programs coded with short-hand operators can run several milliseconds faster. Same as increment and decrement operators. They are &#8212; (minus minus) and ++ (plus plus). The following example shows the usage of these two operators: x = y + z++; &#8230; <a href="http://blog.robbychen.com/2010/08/07/c-increment-and-decrement-operators/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.robbychen.com/wp-content/uploads/2010/08/CplusMinus.png"><img class="alignleft size-full wp-image-1149" title="CplusMinus" src="http://blog.robbychen.com/wp-content/uploads/2010/08/CplusMinus.png" alt="C Plus Plus Minus Minus" width="86" height="47" /></a>Programs coded with short-hand operators can run several milliseconds faster. Same as increment and decrement operators. They are &#8212; (minus minus) and ++ (plus plus). The following example shows the usage of these two operators:</p>
<pre>x = y + z++; // z is incremented by one after x was calculated
x = y + --z; // Decrement z by one first, then calculate x</pre>
<p>In the above example, if y = 2 and z = 4:</p>
<p>x = 2 + 4++ =&gt; x = 6 <em>(z has become 5, x doesn&#8217;t change since it&#8217;s already calculated)</em><br />
x = 2 + &#8211;4 =&gt; x = 2 + 3 =&gt; x = 5 <em>(z first decremented to 3, and then calculates x)</em></p>
<p>As you can see, the position of the operator is very important.</p>
<p>Here is the sample code for these operators:</p>
<pre>/*
 * inDecrement.c
 *
 * Program to illustrate the use of the increment
 * and decrement operators
 *
 * by Mark Virtue, 2001.
 *
*/

#include &lt;stdio.h&gt;

main() {
 int x, y, z = 1;

 y = 5;
 x = 6;

 puts(""); // Prints out a new line
 printf("Before: x = %d, y = %d, z = %d\n", x, y, z);

 z = x++ + ++y; // First y is incremented to 6, and then z gets calculated to 12. Lastly, x is incremented to 7

 puts("");
 puts("z = x++ + ++y");
 printf("After: x = %d, y = %d, z = %d\n", x, y, z);

 puts("");
 printf("Before: x = %d, y = %d, z = %d\n", x, y, z);

 z = x++ - --y; // Same format as above

 puts("");
 puts("z = x++ - --y");
 printf("After: x = %d, y = %d, z = %d\n", x, y, z);

 fflush(stdin);
 getchar();
}</pre>
<p>And here is the output for the above code:</p>
<p style="text-align: left;">
<div id="attachment_1146" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.robbychen.com/wp-content/uploads/2010/08/inDecrement.png"><img class="size-medium wp-image-1146 " title="Increment and Decrement operators in C" src="http://blog.robbychen.com/wp-content/uploads/2010/08/inDecrement-300x84.png" alt="C Increment and Decrement Operators" width="300" height="84" /></a><p class="wp-caption-text">Output for the above sample code. Click the image to enlarge.</p></div>
<p>If you have any question regarding the increment and decrement operators, leave a comment below.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.robbychen.com/2010/07/26/c-advanced-operators/" rel="bookmark" class="crp_title">C Advanced Operators</a></li><li><a href="http://blog.robbychen.com/2010/07/08/c-advanced-relational-operators/" rel="bookmark" class="crp_title">C Advanced Relational Operators</a></li><li><a href="http://blog.robbychen.com/2010/06/21/c-arithmetic-operators/" rel="bookmark" class="crp_title">C Arithmetic Operators</a></li><li><a href="http://blog.robbychen.com/2010/07/07/c-relational-operators/" rel="bookmark" class="crp_title">C Relational Operators</a></li><li><a href="http://blog.robbychen.com/2010/07/18/more-c-strings-input-and-output-functions/" rel="bookmark" class="crp_title">More C Strings Input and Output Functions</a></li><li><a href="http://blog.robbychen.com/2010/04/19/backup-mysql-database-without-phpmyadmin/" rel="bookmark" class="crp_title">Backup MySQL Database without PHPMyAdmin</a></li><li><a href="http://blog.robbychen.com/2010/07/24/c-string-and-character-functions-samples/" rel="bookmark" class="crp_title">C String and Character Functions Samples</a></li><li><a href="http://blog.robbychen.com/2010/03/31/first-draft-of-ideas-for-the-new-website-topic/" rel="bookmark" class="crp_title">First Draft of Ideas for the New Website Topic</a></li><li><a href="http://blog.robbychen.com/2010/07/12/c-for-loop/" rel="bookmark" class="crp_title">C for Loop</a></li><li><a href="http://blog.robbychen.com/2010/02/20/discovered-a-bug-in-the-web-application/" rel="bookmark" class="crp_title">Discovered a Bug in the Web Application</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.robbychen.com/2010/08/07/c-increment-and-decrement-operators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running Sims 3 under PlayOnLinux in Ubuntu Linux</title>
		<link>http://blog.robbychen.com/2010/08/06/running-sims-3-under-playonlinux-in-ubuntu-linux/</link>
		<comments>http://blog.robbychen.com/2010/08/06/running-sims-3-under-playonlinux-in-ubuntu-linux/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 15:35:05 +0000</pubDate>
		<dc:creator>Robby Chen</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PlayOnLinux]]></category>
		<category><![CDATA[The Sims 3]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Wine]]></category>

		<guid isPermaLink="false">http://blog.robbychen.com/?p=1129</guid>
		<description><![CDATA[Back when I was using Windows Vista years ago, I played The Sims 3 and other games for several hours. Once I switched to GNU/Linux, I got rid of these games when I failed to run them under Wine. However, &#8230; <a href="http://blog.robbychen.com/2010/08/06/running-sims-3-under-playonlinux-in-ubuntu-linux/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.robbychen.com/wp-content/uploads/2010/08/sims3.png"><img class="size-full wp-image-1133 alignright" title="The Sims 3" src="http://blog.robbychen.com/wp-content/uploads/2010/08/sims3.png" alt="The Sims 3 running on GNU/Linux" width="93" height="117" /></a>Back when I was using Windows Vista years ago, I played <a href="http://www.thesims3.com/">The Sims 3</a> and other games for several hours. Once I switched to GNU/Linux, I got rid of these games when I failed to run them under <a href="http://www.winehq.org/">Wine</a>. However, for some reasons, I found a folder which stores The Sims 3 ISO file while cleaning and organize the hard drives today that I downloaded from a website that I don&#8217;t remember anymore. I searched over on the Wine database and found that the game and its expansion packs are in the gold state which I assume that it works very well on the GNU/Linux platform.</p>
<p>After searching around in the Ubuntu repositories, I discovered <a href="http://www.playonlinux.com/en/">PlayOnLinux</a> which is the front-end of Wine. I installed it and found out that there are almost all the Windows software and games that are pre-configured by PlayOnLinux. One thing that I discovered when I was running The Sims 3 under PlayOnLinux is that the sound would go out about one minute after running the game. The following is the solution that I came up with the help of <a href="http://www.playonlinux.com/en/topic-2661-Ubuntu_Jaunty_Sims_3_Sound.html">this PlayOnLinux forum thread</a>:</p>
<ol>
<li>Open the terminal and type <strong>playonlinux</strong> to run the GUI which you can add to the GNOME Menu manually with this command. Read <a href="http://www.ubuntugeek.com/howto-add-entries-in-gnome-menu.html">this article</a> on detailed instructions on how to do this.</li>
<li>Install the game by clicking the Install button on the toolbar and follow the instruction.</li>
<li>Run the game you installed. If it doesn&#8217;t have any <strong>sound</strong> problem, enjoy the program. Otherwise, go on to the next step.</li>
<li>Follow the instruction on the first post of <a href="http://www.playonlinux.com/en/topic-2661-Ubuntu_Jaunty_Sims_3_Sound.html">this thread</a> under the <strong>FIX</strong> section.</li>
<li>Instead of using last step on that thread, create a launcher on the desktop with the following information:<br />
<strong>Type:</strong> Application<br />
<strong>Name: </strong>The program name that you installed in step 2. In my case is <em>Sims 3</em>.<br />
<strong>Command: </strong>padsp playonlinux &#8211;run &#8220;The Sims 3&#8243;<br />
<em>(Replace The Sims 3 with the program name that you want to run, note that this name must exactly the same with the name listed in the PlayOnLinux main window, otherwise it will fail to run)<br />
</em><strong>Comment: </strong>Optional. You can add your own description.</li>
<li>You can add an unique icon by clicking the button on the left and select a JPG image.</li>
<li>Click the launcher that you created and enjoy the game.</li>
<li>You can also add this launcher to the GNOME menu by following the instruction from the link I provided in step 1.</li>
</ol>
<p>If you have any problem for the above steps, leave a comment below and I will try to help as quick as possible. <strong>Note that I will not answer comments other than sound problem, especially the CD-related issue for the legal concern of my hosting provider.</strong></p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.robbychen.com/2010/03/25/brother-scanner-driver-installation-in-ubuntu/" rel="bookmark" class="crp_title">Brother Scanner Driver Installation in Ubuntu 9.10 (Updated)</a></li><li><a href="http://blog.robbychen.com/2010/01/15/experimenting-with-second-life/" rel="bookmark" class="crp_title">Experimenting with Second Life</a></li><li><a href="http://blog.robbychen.com/2010/03/21/kubuntu-is-better-than-fedora-after-all/" rel="bookmark" class="crp_title">Kubuntu is better than Fedora after all</a></li><li><a href="http://blog.robbychen.com/2010/03/29/create-a-wallpaper-slideshow-on-ubuntu/" rel="bookmark" class="crp_title">Create a Wallpaper Slideshow on Ubuntu (Updated)</a></li><li><a href="http://blog.robbychen.com/2010/03/30/organize-desktop-with-expo-compiz-plugin/" rel="bookmark" class="crp_title">Organize desktop with Expo Compiz Plugin</a></li><li><a href="http://blog.robbychen.com/2010/03/31/first-draft-of-ideas-for-the-new-website-topic/" rel="bookmark" class="crp_title">First Draft of Ideas for the New Website Topic</a></li><li><a href="http://blog.robbychen.com/2010/04/03/enhance-creativity-using-mypaint/" rel="bookmark" class="crp_title">Enhance Creativity using MyPaint</a></li><li><a href="http://blog.robbychen.com/2010/03/09/mozilla-prism-running-on-my-gnulinux-system/" rel="bookmark" class="crp_title">Mozilla Prism Running on my GNU/Linux System</a></li><li><a href="http://blog.robbychen.com/2010/05/29/created-a-new-logo/" rel="bookmark" class="crp_title">Created a new logo</a></li><li><a href="http://blog.robbychen.com/2010/03/05/thoughts-about-switching-to-gnulinux-for-new-users/" rel="bookmark" class="crp_title">Thoughts About Switching to GNU/Linux for New Users (Updated)</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.robbychen.com/2010/08/06/running-sims-3-under-playonlinux-in-ubuntu-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Latest Project</title>
		<link>http://blog.robbychen.com/2010/07/30/my-latest-project/</link>
		<comments>http://blog.robbychen.com/2010/07/30/my-latest-project/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 02:55:12 +0000</pubDate>
		<dc:creator>Robby Chen</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[C programming language]]></category>
		<category><![CDATA[for loop]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[ICAF]]></category>
		<category><![CDATA[International Child Art Foundation]]></category>
		<category><![CDATA[JqPageFlow]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.robbychen.com/?p=1118</guid>
		<description><![CDATA[I have been volunteering at ICAF (International Child Art Foundation) since April of this year. When I first started off, I was assigned to be a video editor to edit pre-recorded videos for some international festivals. The reason why I &#8230; <a href="http://blog.robbychen.com/2010/07/30/my-latest-project/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have been volunteering at <a href="http://icaf.org/">ICAF</a> (International Child Art Foundation) since April of this year. When I first started off, I was assigned to be a video editor to edit pre-recorded videos for some international festivals. The reason why I selected this position is probably because I put the video editing skill on my resume <img src='http://blog.robbychen.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I used <a href="http://www.kdenlive.org/">Kdenlive</a> and <a href="http://www.openshotvideo.com/">Openshot</a> interchangeably to edit these videos. Sometimes I also used <a href="http://audacity.sourceforge.net/">Audacity</a> to sync between left and right channel of the videos.</p>
<p>After three months of video editing, I was just beginning to love to edit videos. However, I assigned to redesign the <a href="http://icaf.org/gallery/">gallery</a> page on the ICAF website two weeks ago. This is my second  web development challenge. My first challenge, as you can see on my <a href="http://icap.robbychen.com/">website</a>, was to build the first website for another non-profit organization. Although that project was abandoned long time ago because the interruption of school work, I learned the existence of server-side scripting at the time and wrote the first PHP application, the <a href="http://www.robbychen.com/?page=about#contact">contact form</a> on my website. This time I need to place thousands of children&#8217;s artworks and some other pictures to the gallery page in an organized layout.</p>
<p>I know that I have to use pagination for this project. It&#8217;s my first time to create pagination pages using PHP. The original design shown below was using <a href="http://plugins.jquery.com/project/jqpageflow">JqPageFlow</a> jQuery plugin to implement the pagination as the user scroll down the page.</p>
<div id="attachment_1124" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.robbychen.com/wp-content/uploads/2010/07/Gallery.png"><img class="size-medium wp-image-1124" title="Gallery" src="http://blog.robbychen.com/wp-content/uploads/2010/07/Gallery-300x187.png" alt="ICAF Gallery Original Desgin" width="300" height="187" /></a><p class="wp-caption-text">ICAF Gallery page original design</p></div>
<p>After some more research, I thought that the infinite scrolling is not good for bookmarking since the manager specifically pointed out that he wants to have a back button for each page. Therefore I revised the design to use the traditional pagination method similar to Google:</p>
<div id="attachment_1125" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.robbychen.com/wp-content/uploads/2010/07/Gallery1.png"><img class="size-medium wp-image-1125" title="Gallery" src="http://blog.robbychen.com/wp-content/uploads/2010/07/Gallery1-300x187.png" alt="ICAF revised gallery layout" width="300" height="187" /></a><p class="wp-caption-text">Revised ICAF Gallery page layout</p></div>
<p>Based on the above design, I wrote a <a href="http://icaf.robbychen.com/Gallery/test/">test page</a> to test my pagination code. This page is still under development. I will integrate the code into the <a href="http://icaf.robbychen.com">original page</a> once I completed the testing stage. You can download the <a href="http://www.robbychen.com/icaf/Gallery/test/ICAF_Gallery_test.tar">source code for this page here</a> (I didn&#8217;t include the image files since these images are over 1.5 GB). Note that I used <a href="http://php.net/manual/en/function.exec.php">exec</a> PHP function to execute &#8216;ls&#8217; Linux command to output the image file names to an array rather than use a loop or a database table to process file names. This page also contains a script to split different parts of the file name since these names followed a specific pattern: &#8220;country-firstNam_lastName-age-thumb.png&#8221; as well as some knowledge I got from the <a href="http://blog.robbychen.com/2010/07/15/c-special-loops/">C for loop</a> tutorial. Also note that this is the test code, meaning that I haven&#8217;t added extensive comments to the code yet.</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1163px; width: 1px; height: 1px; overflow: hidden;">http://php.net/manual/en/function.exec.phphttp://php.net/manual/en/function.exec.php</div>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.robbychen.com/2010/04/19/backup-mysql-database-without-phpmyadmin/" rel="bookmark" class="crp_title">Backup MySQL Database without PHPMyAdmin</a></li><li><a href="http://blog.robbychen.com/2010/08/07/c-increment-and-decrement-operators/" rel="bookmark" class="crp_title">C Increment and Decrement Operators</a></li><li><a href="http://blog.robbychen.com/2010/09/02/remove-part-of-file-names-using-php/" rel="bookmark" class="crp_title">Remove Part of File Names using PHP</a></li><li><a href="http://blog.robbychen.com/2010/06/11/pass-a-value-to-multiple-php-variables/" rel="bookmark" class="crp_title">Pass a Value to Multiple PHP Variables</a></li><li><a href="http://blog.robbychen.com/2010/04/07/yahoo-design-pattern-library/" rel="bookmark" class="crp_title">Yahoo Design Pattern Library</a></li><li><a href="http://blog.robbychen.com/2010/02/17/computer-concepts-assignment-aid-web-app-released/" rel="bookmark" class="crp_title">Computer Concepts Assignment Aid Web App released</a></li><li><a href="http://blog.robbychen.com/2010/05/29/created-a-new-logo/" rel="bookmark" class="crp_title">Created a new logo</a></li><li><a href="http://blog.robbychen.com/2010/02/20/discovered-a-bug-in-the-web-application/" rel="bookmark" class="crp_title">Discovered a Bug in the Web Application</a></li><li><a href="http://blog.robbychen.com/2010/05/02/playing-around-with-php-url-extraction/" rel="bookmark" class="crp_title">Playing Around with PHP URL Extraction</a></li><li><a href="http://blog.robbychen.com/2010/05/27/played-around-with-drupal-upcoming-site-update-and-more/" rel="bookmark" class="crp_title">Played Around with Drupal, Upcoming Site Update, and more &#8230;</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.robbychen.com/2010/07/30/my-latest-project/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>C Advanced Operators</title>
		<link>http://blog.robbychen.com/2010/07/26/c-advanced-operators/</link>
		<comments>http://blog.robbychen.com/2010/07/26/c-advanced-operators/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 03:26:41 +0000</pubDate>
		<dc:creator>Robby Chen</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[arithmetic assignment operators]]></category>
		<category><![CDATA[assignment operators]]></category>
		<category><![CDATA[C advanced operators]]></category>

		<guid isPermaLink="false">http://blog.robbychen.com/?p=1110</guid>
		<description><![CDATA[There are some advanced operators in C. First set of these operators is the Assignment Operators. Here are five operators presented in the arithmetic assignment operators: += (Plus Equals) -= (Minus Equals) *= (Multiply Equals) /= (Divide by Equals) %= &#8230; <a href="http://blog.robbychen.com/2010/07/26/c-advanced-operators/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are some advanced operators in C. First set of these operators is the Assignment Operators. Here are five operators presented in the arithmetic assignment operators:</p>
<ul>
<li>+= (Plus Equals)</li>
<li>-= (Minus Equals)</li>
<li>*= (Multiply Equals)</li>
<li>/= (Divide by Equals)</li>
<li>%= (Modular Equals)</li>
</ul>
<p>For example, x += y &#8211; 3 is the same as x = x + y &#8211; 3.</p>
<p>Other assignment operators that are not commonly used are:</p>
<ul>
<li>&amp;&amp;= (And Equals)</li>
<li>||= (Or Equals)</li>
<li>&amp;= (Bitwise And Equals)</li>
<li>|= (Bitwise Or Equals)</li>
<li>^= (Bitwise Not Equals)</li>
<li>&gt;&gt;= (Bitwise Shift Right Equals)</li>
<li>&lt;&lt;= (Bitwise Shift Left Equals)</li>
</ul>
<p>Here is the sample code for the arithmetic assignment operators:</p>
<pre>/*
 *
 * assignment.c
 *
 * Program to demonstrate the use of assignment operators
 *
 * by Mark Virtue, 2001.
 *
 */

#include &lt;stdio.h&gt;

main() {
 int x, y;

 y = 3;
 x = 100;
 x /= y - 1;    // It's the same as x = x / (y - 1), therefore it can substitute to x = 100 / (3 - 1).

 printf("x = %d\n", x);    // The answer is x = 50.

 fflush(stdin);
 getchar();
}</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.robbychen.com/2010/07/07/c-relational-operators/" rel="bookmark" class="crp_title">C Relational Operators</a></li><li><a href="http://blog.robbychen.com/2010/07/08/c-advanced-relational-operators/" rel="bookmark" class="crp_title">C Advanced Relational Operators</a></li><li><a href="http://blog.robbychen.com/2010/06/21/c-arithmetic-operators/" rel="bookmark" class="crp_title">C Arithmetic Operators</a></li><li><a href="http://blog.robbychen.com/2010/08/07/c-increment-and-decrement-operators/" rel="bookmark" class="crp_title">C Increment and Decrement Operators</a></li><li><a href="http://blog.robbychen.com/2010/07/11/c-while-loop/" rel="bookmark" class="crp_title">C while Loop</a></li><li><a href="http://blog.robbychen.com/2010/07/17/c-arrays/" rel="bookmark" class="crp_title">C Arrays</a></li><li><a href="http://blog.robbychen.com/2010/07/15/c-special-loops/" rel="bookmark" class="crp_title">C Special Loops</a></li><li><a href="http://blog.robbychen.com/2010/07/08/c-goto-statement/" rel="bookmark" class="crp_title">C goto Statement</a></li><li><a href="http://blog.robbychen.com/2010/07/13/c-do-while-loop/" rel="bookmark" class="crp_title">C do&#8230;while Loop</a></li><li><a href="http://blog.robbychen.com/2010/07/01/more-about-printf-and-scanf-part-2/" rel="bookmark" class="crp_title">More About printf and scanf (Part 2)</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.robbychen.com/2010/07/26/c-advanced-operators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C String and Character Functions Samples</title>
		<link>http://blog.robbychen.com/2010/07/24/c-string-and-character-functions-samples/</link>
		<comments>http://blog.robbychen.com/2010/07/24/c-string-and-character-functions-samples/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 03:53:01 +0000</pubDate>
		<dc:creator>Robby Chen</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[ASCII]]></category>
		<category><![CDATA[C programming language]]></category>
		<category><![CDATA[character]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://blog.robbychen.com/?p=1104</guid>
		<description><![CDATA[Here are the exercises I did for the string and character functions: /* * * exercise1.c * * Allow user to input a string from the keyboard and * display the ASCII value for each character * * by Robby &#8230; <a href="http://blog.robbychen.com/2010/07/24/c-string-and-character-functions-samples/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here are the exercises I did for the string and character functions:</p>
<pre>/*
 *
 * exercise1.c
 *
 * Allow user to input a string from the keyboard and
 * display the <a href="http://www.asciitable.com/">ASCII</a> value for each character
 *
 * by Robby Chen, 2010
 *
 */

#include &lt;stdio.h&gt;

main() {
 char string[51];
 int character;

 puts(""); // Prints a new line
 fputs("Please enter a string (less than 50 characters, including spaces): ", stdout); // Does not add the new line at the end
 fgets(string, 51, stdin);
 puts("");
 puts("Character ASCII Value");
 puts("-------------------------");

 for (character = 0; string[character] != '\0'; character++) {
  if (string[character] == '\n') { // prints the new line character and its ASCII code
   printf("    \\n%12d\n", string[character]);
  }
  else { // prints individual letters of the string and their ASCII codes
   printf("%5c %12d\n", string[character], string[character]);
  }
  puts("-------------------------");
 }

 puts("");
 fflush(stdin);
}
</pre>
<p>Note that the above code contains ASCII-related technique. You can read more about ASCII characters set <a href="http://www.asciitable.com/">here</a> if you haven&#8217;t already done so above.</p>
<pre>/*
 *
 * exercise2.c
 *
 * Allow users to enter their names from the keyboard
 * and output the names with upper case on the first letter
 * and lower case on the other letters of each word
 *
 * by Robby Chen, 2010.
 *
 */

#include &lt;stdio.h&gt;
#include &lt;ctype.h&gt;

main() {
 char name[51];
 int letter;

 fputs("Please enter your name: ", stdout);
 fgets(name, 51, stdin);

 fputs("Hello, ", stdout);

 for (letter = 0; name[letter] != '\0'; letter++) {
  if (letter == 0 || isspace(name[letter - 1])) {
   name[letter] = toupper(name[letter]);
   printf("%c", name[letter]);
  }
  else {
   name[letter] = tolower(name[letter]);
   printf("%c", name[letter]);
  }
 }

 fflush(stdin);
}</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.robbychen.com/2010/07/18/more-c-strings-input-and-output-functions/" rel="bookmark" class="crp_title">More C Strings Input and Output Functions</a></li><li><a href="http://blog.robbychen.com/2010/06/20/c-string/" rel="bookmark" class="crp_title">C string</a></li><li><a href="http://blog.robbychen.com/2010/07/23/c-character-functions/" rel="bookmark" class="crp_title">C Character Functions</a></li><li><a href="http://blog.robbychen.com/2010/07/01/more-about-printf-and-scanf-part-2/" rel="bookmark" class="crp_title">More About printf and scanf (Part 2)</a></li><li><a href="http://blog.robbychen.com/2010/07/01/more-about-printf-and-scanf-part-1/" rel="bookmark" class="crp_title">More About printf and scanf (Part 1)</a></li><li><a href="http://blog.robbychen.com/2010/07/17/c-arrays/" rel="bookmark" class="crp_title">C Arrays</a></li><li><a href="http://blog.robbychen.com/2010/07/02/c-string-functions/" rel="bookmark" class="crp_title">C string functions</a></li><li><a href="http://blog.robbychen.com/2010/07/07/c-relational-operators/" rel="bookmark" class="crp_title">C Relational Operators</a></li><li><a href="http://blog.robbychen.com/2010/06/12/c-scanf-function/" rel="bookmark" class="crp_title">C scanf Function</a></li><li><a href="http://blog.robbychen.com/2010/07/09/a-simple-c-program-to-store-a-cd-information/" rel="bookmark" class="crp_title">A Simple C Program to Store a CD Information</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.robbychen.com/2010/07/24/c-string-and-character-functions-samples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C Character Functions</title>
		<link>http://blog.robbychen.com/2010/07/23/c-character-functions/</link>
		<comments>http://blog.robbychen.com/2010/07/23/c-character-functions/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 03:22:17 +0000</pubDate>
		<dc:creator>Robby Chen</dc:creator>
				<category><![CDATA[Computer Programming]]></category>
		<category><![CDATA[C Character Functions]]></category>
		<category><![CDATA[C characters]]></category>
		<category><![CDATA[C programming language]]></category>
		<category><![CDATA[character conversion]]></category>
		<category><![CDATA[isdigit]]></category>
		<category><![CDATA[islower]]></category>
		<category><![CDATA[isspace]]></category>
		<category><![CDATA[isupper]]></category>
		<category><![CDATA[standard C library]]></category>
		<category><![CDATA[tolower]]></category>
		<category><![CDATA[toupper]]></category>

		<guid isPermaLink="false">http://blog.robbychen.com/?p=1097</guid>
		<description><![CDATA[There are several types of character functions in the standard C library. One type of character functions is character classification functions. They are isuppper, islower, isdigit, isspace, and other boolean functions. For example, if (isupper(ch)) determines whether ch is upper &#8230; <a href="http://blog.robbychen.com/2010/07/23/c-character-functions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are several types of character functions in the standard C library. One type of character functions is character classification functions. They are isuppper, islower, isdigit, isspace, and other boolean functions. For example, <em>if (isupper(ch))</em> determines whether ch is upper case or not.</p>
<p>Another type of character functions is character conversion functions. They are toupper, tolower, and others. For example, <em>ch = toupper(ch)</em> converts ch to upper case whether the original is lower case or upper case.</p>
<p>Here is the same code for the character functions:</p>
<pre>/*
 *
 * ctype.c
 *
 * Program to show examples of the use of isupper, toupper, etc.
 *
 * by Mark Virtue, 2001.
 *
 */

#include &lt;stdio.h&gt;
#include &lt;ctype.h&gt;

main() {
 char ch;

 printf("Please type in a character (enter q to quite): ");
 scanf("%c", &amp;ch);

 while (ch != 'q') {
  if (isupper(ch)) {
   printf("This is an uppercase character\n");
   ch = tolower(ch);
   printf("Lowercase equivalent is '%c'\n", ch);
  }
  else if (islower(ch))
   printf("This is an lowercase character\n");
  else if (isdigit(ch))
   printf("This is an digit\n");
  else if (isspace(ch))
   printf("This is an space-type char\n");
  else
   printf("This is an unknown char\n");

  printf("Please type a character (enter q to quite): ");
  while (getchar() != '\n' &amp;&amp; getchar() != EOF) {}
  scanf("%c", &amp;ch);
 }

 fflush(stdin);
}</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.robbychen.com/2010/07/24/c-string-and-character-functions-samples/" rel="bookmark" class="crp_title">C String and Character Functions Samples</a></li><li><a href="http://blog.robbychen.com/2010/07/01/more-about-printf-and-scanf-part-2/" rel="bookmark" class="crp_title">More About printf and scanf (Part 2)</a></li><li><a href="http://blog.robbychen.com/2010/06/20/c-string/" rel="bookmark" class="crp_title">C string</a></li><li><a href="http://blog.robbychen.com/2010/07/09/a-simple-c-program-to-store-a-cd-information/" rel="bookmark" class="crp_title">A Simple C Program to Store a CD Information</a></li><li><a href="http://blog.robbychen.com/2010/07/17/c-arrays/" rel="bookmark" class="crp_title">C Arrays</a></li><li><a href="http://blog.robbychen.com/2010/07/06/c-switch-statement/" rel="bookmark" class="crp_title">C Switch Statement</a></li><li><a href="http://blog.robbychen.com/2010/07/02/c-string-functions/" rel="bookmark" class="crp_title">C string functions</a></li><li><a href="http://blog.robbychen.com/2010/07/11/c-while-loop/" rel="bookmark" class="crp_title">C while Loop</a></li><li><a href="http://blog.robbychen.com/2010/07/13/c-do-while-loop/" rel="bookmark" class="crp_title">C do&#8230;while Loop</a></li><li><a href="http://blog.robbychen.com/2010/07/01/more-about-printf-and-scanf-part-1/" rel="bookmark" class="crp_title">More About printf and scanf (Part 1)</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.robbychen.com/2010/07/23/c-character-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Play Around with Google Nexus One</title>
		<link>http://blog.robbychen.com/2010/07/19/play-around-with-google-nexus-one/</link>
		<comments>http://blog.robbychen.com/2010/07/19/play-around-with-google-nexus-one/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 02:40:23 +0000</pubDate>
		<dc:creator>Robby Chen</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Android Market]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[iPod Touch]]></category>
		<category><![CDATA[Nexus One]]></category>
		<category><![CDATA[OpenStreetMap]]></category>
		<category><![CDATA[RockPlayer]]></category>
		<category><![CDATA[SIM]]></category>

		<guid isPermaLink="false">http://blog.robbychen.com/?p=1088</guid>
		<description><![CDATA[I received my Nexus One today which I ordered from Google on Saturday. The FedEx delivery of the device was earlier than I expected. They delivered my order 10 AM in the morning, nearly 5 hours earlier than the estimated &#8230; <a href="http://blog.robbychen.com/2010/07/19/play-around-with-google-nexus-one/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I received my Nexus One today which <a href="http://blog.robbychen.com/2010/07/17/finally-ordered-nexus-one/">I ordered from Google</a> on Saturday. The FedEx delivery of the device was earlier than I expected. They delivered my order 10 AM in the morning, nearly 5 hours earlier than the estimated time of 3 PM.</p>
<p>After I <a href="http://www.youtube.com/watch?v=WScN1pThgoY">set up</a> the phone, I decided to move the SIM card from my old T-Mobile based cell phone to Nexus One. It only adds basic call functionality to the device since I own the pre-paid SIM card.</p>
<p>GPS on the Nexus One doesn&#8217;t require Internet connection. However, the maps must be cached on the device in order to use the full GPS function. Turn-by-turn direction also needs to be cached from the Internet. I have not found any GPS app that supports offline viewing of entire US map that supports different zoom levels from Android Market. Maybe I will create one for myself using <a href="http://wiki.openstreetmap.org/wiki/Main_Page">OpenStreetMap</a> once I learn the Android SDK <img src='http://blog.robbychen.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  But first I must finish learning C.</p>
<p>The 5MP camera works very well. Below is a test photo that I took in the bathroom.</p>
<p style="text-align: center;"><a href="http://blog.robbychen.com/wp-content/uploads/2010/07/wpid-IMG_20100719_212319.jpg"><img class="aligncenter" style="display: block;" src="http://blog.robbychen.com/wp-content/uploads/2010/07/wpid-IMG_20100719_212319.jpg" alt="image" width="180" height="240" /></a><strong>This photo was taken in front of mirror<br />
Click the image to enlarge</strong></p>
<p>As you can see, the picture is very smooth without flashlight. I have not tested the flashlight and video recorder yet, but I think it won&#8217;t be very bad. One thing I noticed when playing around with camera is that the zoom level is not great. For the most time, I got pixelated pictures with the max zoom level. However, the problem isn&#8217;t visible on the device until I see the pictures on the PC.</p>
<p>Since I have no idea which audio/video formats does Android support, I copied one mp4 and one avi videos to the root of the memory. The gallery only showed the mp4 video. After browsing through Android Market, I downloaded and tried the ad version of RockPlayer. This player supports DivX, AVI, MKV, and Real formats. I watched some avi videos using this app and they all worked fine.</p>
<p>I transferred all the stuffs from iPod Touch and cell phone to Nexus One. From now on, I only need to carry one device in my pocket instead of two devices. I will see how long will Google Nexus One last in my pocket because my pockets usually get water when it&#8217;s raining whether I wear different cloths <img src='http://blog.robbychen.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.robbychen.com/2010/07/17/finally-ordered-nexus-one/" rel="bookmark" class="crp_title">Finally Ordered Nexus One (Updated)</a></li><li><a href="http://blog.robbychen.com/2010/02/02/gnulinux-is-slow-to-compete-against-apple/" rel="bookmark" class="crp_title">GNU/Linux is Slow to Compete Against Mac Mobile (Updated)</a></li><li><a href="http://blog.robbychen.com/2010/04/27/my-open-policy-decision/" rel="bookmark" class="crp_title">My Open Policy Decistion</a></li><li><a href="http://blog.robbychen.com/2010/04/01/touch-book-is-the-gnulinux-version-of-ipad/" rel="bookmark" class="crp_title">Touch Book is the GNU/Linux version of iPad (Updated)</a></li><li><a href="http://blog.robbychen.com/2010/02/24/rainbows-jquery-plug-in-makes-text-gradient/" rel="bookmark" class="crp_title">Rainbows jQuery Plug-in Makes Text Gradient</a></li><li><a href="http://blog.robbychen.com/2010/04/19/backup-mysql-database-without-phpmyadmin/" rel="bookmark" class="crp_title">Backup MySQL Database without PHPMyAdmin</a></li><li><a href="http://blog.robbychen.com/2010/02/20/discovered-a-bug-in-the-web-application/" rel="bookmark" class="crp_title">Discovered a Bug in the Web Application</a></li><li><a href="http://blog.robbychen.com/2010/07/30/my-latest-project/" rel="bookmark" class="crp_title">My Latest Project</a></li><li><a href="http://blog.robbychen.com/2010/05/29/created-a-new-logo/" rel="bookmark" class="crp_title">Created a new logo</a></li><li><a href="http://blog.robbychen.com/2010/03/31/first-draft-of-ideas-for-the-new-website-topic/" rel="bookmark" class="crp_title">First Draft of Ideas for the New Website Topic</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.robbychen.com/2010/07/19/play-around-with-google-nexus-one/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
