New Blog Title, New Logo
As you already saw, I changed the title for this blog from “Robby Chen Personal Blog” to “Ubuntu Web Coder “as well as the logo.
One reason for changing the blog title is because I’m going to stick to Ubuntu, specifically Lucid Lynx (10.04.1), since I depend on some PPAs to get the updates. Maverick Meerkat (10.10) just doesn’t work for me. I will wait until Natty Narwhal (11.04) is out and see. If this still won’t work for me, I will stay with 10.04.1 and wait for the next release… Anyway, you get the idea.
As most of you who read this blog in the past know, I used to write code in Netbeans until I discovered the hidden potential of gedit for being such a good IDE. That’s why I abandoned Netbeans and replaced with gedit in the new logo. And I renamed blog title specifically to “coder” because I would like to try writing the code in each post from now on.
Besides the gedit logo in the new logo, I have also included two groups of logos, GNU/Linux and PHP. The GNU/Linux logos include Linux penguin, Chrome OS, Android, and Open Source. The PHP logos include PHP, CakePHP, and WordPress. I also included just released HTML5 logo created by W3C. I regularly use these tools and talked and will continue to talk about them in this blog. That’s why I included them in the logo.
What do you think about the new logo, blog title, and background color?
US Government uses FOSS
This page lists few of the companies/governments that use FOSS. One of which is the US Department of Defense. According t0 its profile, the reason for using FOSS is to defend software freedom. It reminds me that President Obama wanted to use open source software in the White House during the 2008 election.
An Easy and Cool GIMP Effect
Today I learned a cool GIMP trick through tutorialegimp. I think it is a Spanish blog. For some reason, the video was not available anymore after I watched the video tutorial once. Fortunately, I remembered all the steps to create this effect because it is very easy if you know GIMP well.
Here are the steps to create the effects (I will use one of the Star Craft 2 wallpapers, you can use any image):

- Use the Crop Tool to crop out the black borders around the image (Use Ctrl+mouse wheel to zoom in to precisely crop to the edge of the image)
- Duplicate the layer and select Image -> Canvas Size to enlarge the width of the canvas to 200%
- Use Move Tool and zoom in to move the duplicated layer to the empty part of the canvas which is to the right, make sure to fill the canvas
- Select Layer -> Transform -> Flip Horizontally to connect between left copy and right copy of the image
- Right-click the first layer and select Merge Down to merge the layers together
- Again duplicate the layer and select Image -> Canvas Size to enlarge the height of the canvas to 200%
- Again use Move Tool and zoom in to move the duplicated layer to the empty part of the canvas which this time is to the bottom, make sure to fill the remaining canvas
- Select Layer -> Transform -> Flip Vertically to connect between top copy and bottom copy of the image
- Right-click the first layer and select Merge Down to merge the layers together
- Duplicate the layer again and this time select either Layer -> Transform -> Rotate 90 degree clockwise or counter-clockwise
- Change Layer Mode to Darken Only for the first layer and Merge Down
- Duplicate the layer once more and use Rotate Tool to rotate the layer either to 45 degree or -45 degree
- Change Layer Mode to Darken Only for the first layer once more and Merge Down
- If you want, you can also duplicate the layer and rotate the layer to the opposite 45 degree and repeat step 13
- You also can lighten the image by selecting Colors -> Levels if you want to bright the image
Below is the completed effect:
More About CA272 (Pro Website Development) Final Project
Since I mentioned the CA272 final project a little in the last post, I think it’s best to talk more about this topic.
I took CA272 class in the Spring of 2009. It is known as Professional Website Development. Actually to me, this is not a professional class. Instead, it is a very basic class: it doesn’t include sever-side script languages nor JavaScript, just basic HTML4. At that time however, I didn’t know jQuery and PHP until the very end of the semester.
As you can see through the source code of the Final Project page, all of the AJAX and JavaScript functions were created by myself. Because I discovered jQuery during the last week of final project submission, I hurriedly added some animated transitions to the pages using jQuery without the deep understanding of jQuery. Therefore, the animation looks a little incomplete.
The presentation below explains the most of features on the site:
Note that because I don’t have my own website at the time, I copied all the final project files to a free hosting. Therefore, the URL at the end of the video is not valid anymore, use http://robbychen.com/ca272/final/ instead.
Variable Rules – C vs PHP
Here is my first post about C programming language which I decided to learn this summer. Today I compare the variable declaration rules between C and PHP. The main difference between C and PHP’s variable declaration process is that C’s variable name must be declared at the beginning of the code as well as its type, whereas PHP creates variables on the fly without indicating variable type. In C, variable name must be declared uniquely within the current code, except the same name can be declared inside the functions. This is different from PHP. Thanks to its dynamic variable type, a variable name can be used as a number and a string depending what’s the value inside the variable. The variable naming rules for C is the same as PHP. It also doesn’t allow to place digits first of the variable name. I also learned that the length of a variable name in C should not be longer than 31 characters. I never heard of this rule in PHP. However, I never used more than 10 characters for the PHP variable names. I will try to apply my 10-character policy to C once I have a real C programming project. I’m looking forward to programming with C and play around with some open source code when I understand C programming language a little more.
Create own VR Server with OpenSim
OpenSim is an open source VR (Virtual Reality) server that is similar to Second Life, but the land is hosted on your own computer rather than hosted on the Second Life server. This means that there is no more expensive monthly fee to pay to maintain the SL land. However, if your ISP doesn’t allow you to host your own server on the Internet such as Verizon like me, OpenSim is almost useless except for the testing and education purposes.
I’m running the server with CombineContiguousRegions turned on and setup of 3 X 3 mega-regions. The initial setup was quick and easy with no installation. Before starting up the server, however, you need to first install some components:
sudo apt-get install nant mono-gmcs libmono-microsoft8.0-cil libmono-system-runtime2.0-cil libgdiplus libmono-i18n2.0-cil libmono-oracle2.0-cil
After OpenSim was set up, you have to use either Second Life viewer or other open source viewers to connect to the server. I’m using Imprudence latest beta because I just discovered today that Imprudence has the option on the login screen to add the VR server yourself and the localhost server is already set up in the latest build. When you login to the server first time, the default avatar is female. You can easily change the gender by adding a new shape directly in the inventory. In the beta build, Imprudence would crash if make a new outfit inside the appearance window. The default land is only one small island or many if you setup as a mega-region like me. You can manually edit the land by raise or lower the terrain, or you can export the hightmap of the land to an image file described here and edit it in GIMP. One thing to note is that you first need to logon using a veiwer in order to import the hightmap successfully, otherwise you won’t be able to logon to the server after the import. Here is my land after the modification in GIMP:
3 by 3 mega-regions connected as one big island
Click the image to enlarge
Notice the red arrow in the image. This screenshot is taken 859 feet above the ground. It means that this island is very big. It seems that by enabling the CombineContiguousRegions option, all of the regions’ region names become the first region name according to Regions.ini file.
Overall, OpenSim can be used as an alternate Second Life server unless your ISP doesn’t allow hosting your own server. It is also a good testing and education environment to test and learn the basics of 3D creation and animation.
Starting to learn C Programming Language
I have decided to learn a new programming language during this summer break. I chose C because I have already learned the basics of C++. The C++ programming language is the object oriented version of C after all. Another reason I chose to learn C because the source code for many of the open source projects that I’ve read are written in C language. It seems that the language is very popular in open source community along with C++ and Java. I’m starting with VTC C Programming video tutorials. This is the first video tutorials that I came across when I was searching for C programming language tutorials online. Therefore I downloaded it and am beginning to watch and learn C language. I will post any tips that inspired by the tutorials as I learn instead of post what I learned from the tutorials.
Here are the ISO images of this video tutorial series if you are a copylefter or don’t care about the copyright:
http://www.downtr.net/162643-vtc-c-coding-video-tutorial.html
Create a DSN-less database connection using ColdFusion 8
For a long time, I had been searching around online to find a solution to switch to MySQL database for my ColdFusion school server from Microsoft Access database. Since I have no control over the ColdFusion Administration settings, I can’t change the DSN connection.
Recently I have been finishing my remaining undone projects. I use Railo open source CF server and MySQL under Ubuntu to do the assignments for the class. The SQL code I was writing is a bunch of aggregate functions:
SELECT Â b.BookId, Â Â Â b.BookTitle, Â s.SalePrice, Â Â Â Â Â Â COUNT(s.SalePrice) AS bcount, Â Â Â Â Â Â SUM(sd.TotalSale) AS ts, Â Â Â Â Â Â SUM(sd.Quantity) AS qt FROM tblBooks AS b, Â Â Â tblSales AS s, Â Â Â Â tblSalesDetail AS sd WHERE b.BookId=s.BookId AND s.SaleId=sd.SaleId AND s.SalePrice IS NOT NULL GROUP BY b.BookTitle ORDER BY #variables.ob# #URL.s#;
When I was testing these code on the localhost which is MySQL-powered, the page was rendered fine without any errors. However, once I uploaded to the school server which is powered by MS Access, the errors began to appear. Noticeably, I can’t use the name such as b.BookId, b.BookTitle, s.SalePrice without using aggregate functions. It struggled me a bit because the final is due tomorrow.
I then remembered my unsolved solution for connecting MySQL database dynamically through CF code because most of the DSN-less code online only works in CF 5. Once again I began to searching for the solution to release my struggle to the MS Access. Finally, I found a CF custom tag to do just that. It is called query, similar to cfquery. Since it’s a custom tag, the use of it is cf_query. This tag is primary used to connect to the MS SQL server by its author. Fortunately he has given a code snippet to dump out the available JDBC drivers on the server.
After I tested this code, I was surprised to see that my school server supports lots of databases that I don’t know about. I chose the MySQL one and copied its JDBC URL to the CF test page. I noticed that I was unable to connect to my own MySQL server on this web server since my hosting provider doesn’t allow remote connection to MySQL. Therefore I googled for “free mysql hosting” and found a website called FreeSQL.org that specifically for hosting free MySQL databases. I connect to this newly created database by using the cf_query code:
<cf_query jdbcURL="jdbc:mysql://www.freesql.org/ColdFusion" username="username" password="password" qName="qGetData">
Note that ColdFusion is the database name. Within the cf_query beginning and ending tag, I wrote the SQL statements to import the data since the phpMyAdmin link does not work on FreeSQL.org. After that, I replaced the above cf_query code with cfquery in the project that I struggled with.
You can download the above code here along with the custom tag and the original code from its author. The project page that I was struggled with can be found here.
My hatred of Microsoft and Adobe as a GNU/Linux user and a web developer
I had used Dreamweaver, Flash, Fireworks, and other Adobe products long before Adobe acquired Macromedia. At that time, I didn’t know the existence of GNU/Linux and open source communities. I didn’t even decide on my career as a web developer yet. Thanks to Microsoft’s announcement of Windows Vista, I decided to look for other Operating Systems beyond Windows that are able to run on the older hardware eternally (by the way, I didn’t know other OSes besides Windows back then), meaning that the future version of OS will still be able to work on old hardware. I found GNU/Linux, specifically Ubuntu.
After one year of switching back and forth between GNU/Linux and Windows, I finally made the decision to stick to GNU/Linux. However, I still would test the browser compatibility in IE through VirtualBox. And here comes my hatred of MSIE. During the course of my web development, I’ve read numerous articles about how Microsoft doesn’t follow the W3C standards for their Internet Explorer to make web developers suffer from browser incompatibility issue. I had enough struggle for the Internet Explorer, I decided to use some jQuery to encourage those who view my website to ditch their Internet Explorer.
I have become to hate Adobe since the day I switched to the Eclipse and NetBeans IDE to develop my projects. After Adobe announced that Flash Builder and ColdFusion Builder are based on the Eclipse, I was excited to know that Adobe finally makes their development tools available on all of the major OSes. It disappointed me when I went to download the beta version of these two builders, it only offers Windows and Mac versions, no GNU/Linux version anywhere. Since Eclipse uses its own EPL license instead of GPL license to govern the use of Eclipse, Adobe can make modification to its code and sell it as their own products. This doesn’t mean that Adobe can discriminate against GNU/Linux users from using their products since Adobe uses Linux on their Adobe.com website.
As an opposite effect, these hatreds actually make me become more involved with open source technologies, such as HTML 5 and Ogg theora. I use open source ColdFusion engine Railo to develop ColdFusion websites as well. I think that ActionScript will be replaced by jQuery and other JavaScript frameworks and FLV will be replaced by either H264 or Ogg Theora depending on which side will win the online video wars.
My First Experience with UNR (Ubuntu Netbook Remix)
As yesterday’s release of Ubuntu 10.04 Lucid Lynx, I thought I would gave Ubuntu Netbook Remix 10.04 a try since I was going to reinstall Ubuntu on my netbook anyway. I downloaded UNR ISO image and created an USB installer through UNetBootIn. After I booted into the new Ubuntu live USB, I immediately clicked the installer to install onto the netbook. Surprisingly, the installer will minimize itself when installing after I entered required information. I found the windows selector at the top panel once I knew the installer is working. I clicked the installer icon to restore its window and found out that the interface is very compact compare to the desktop version of Ubuntu. The title bar for each window is near the windows selector.
After the installation was finished and rebooted, I first set up my GMail account through Evolution. The setup process was smooth without entering the details of IMAP gmail server. I then opened Firefox and installed Configuration Mania extension to change the way Firefox functions. The main reason I first installed this extension is because it helps me to configure the Firefox to select all when clicked on the address bar and to enable other useful features more easily. I noticed that Gwibber was not in the Favorite list. Because this app is one of the applications that I use most often, I added Gwibber into the Favorite easily from Internet list.
This is my first time use UNR. I usually had installed Ubuntu desktop edition onto my netbook. But because of this new version is the long term support release, I think that it’s more stable and more easier to use with the UNR LTS. In the end, I’ve already familiar with the UNR interface once I started to using it perhaps because I like its compact UI.
