In the Process of Switching to Blip.tv (Updated)
Update (09/05/2010): All the videos on this blog has been transferred to blip.tv and switched to the blip.tv embedded Flash player. Please view my previous posts for the videos or visit the show archive for all of my videos uploaded on blip.tv
I don’t know why I don’t like YouTube. Perhaps it doesn’t have enough feature for me? Anyway, I’m transferring the videos I made so far to Blip.tv since I have an old account there. I hadn’t uploaded any videos since 2009. The latest video was the final project for my basic ColdFusion course in college. As you can see on my show archive page, about all of the videos are created for my classes at school. Some of the videos are also on my CA 272 final project page.
Once the transfer process is completed, I will replace all the videos on this blog to the new video player. For the sneak peek of the performance of blip.tv, please watch the following video which was made in Windows because I didn’t switch to GNU/Linux yet:
Note that this is a HD video, which means that it requires fast Internet download speed to view smoothly or you can download the video using DownloadHelper for Firefox.
Played Around with Drupal, Upcoming Site Update, and more …
I hadn’t write any blog post since last Thursday. The reason is because I had been playing around with Drupal. Drupal is a Content Management System that is similar to WordPress, in my experience, because it can install additional plugins as modules, custom themes, and add pages. However, Drupal has few other features that need to be configured externally if using WordPress, such as the ability to optimize the performance of the site by enabling compression. Perhaps I used WordPress for long time and don’t know how to use Drupal yet, I have not discovered any usefulness of Drupal over WordPress yet. I will continue to learn more about Drupal and improve my Drupal site at diary.robbychen.com. As you can see through the URL, I originally planed to start another diary blog using a CMS app and change the daily post schedule for this blog to irregular post schedule just like my Tumblr-based blog. I decided first to try Drupal because I tried Joomla before and I can’t seem to use it. I think I will try other CMS if Drupal also won’t work for me.
I also plan to update my main site robbychen.com beginning tomorrow since the spring semester is over. I decided to make this site as a portfolio site that include all the programming works that I have done in the past instead of a tutorial site because this domain name is based on my name and it doesn’t suited for a tutorial website or a commercial website. The current layout on the site is based on a commercial website. I will try to create my own site layout and I have decided to apply the color theme of the site based on the new Ubuntu Radiance theme.
The ColdFusion to PHP project that I was promised back in January is not possible anymore because I couldn’t find the CA 278 files and can’t convert to PHP without these files. However, I’m organizing the CA 288 class files which is advanced ColdFusion programming. I will rewrote them with PHP as soon as the maintenance of these files is completed.
Delete part of the URL string using removeChars with ColdFusion
While I was doing the final project for my ColdFusion class today, I got one problem which the URL query keeps adding up when I was using CGI.QUERY_STRING. For example, the query string becomes “projectid=5&clear=yes” when I just added the “&clear=yes” to the end of the CGI.QUERY_STRING variable. After the page have been refreshed, the query would become “projectid=5&clear=yes&clear=yes”. This became a problem to me because not only the URL query was not right, but the result of the page was also not right.
After numerous trail of using cfif, I remembered that I could use a build-in ColdFusion function to remove the last part of URL query and store it to a variable to use it later. The name of the function is removeChars. It needs three parameters, a string, the position number of where to begin removing characters, and the position number of where to end the removing of characters. For example, I used the following statement to remove the “&clear=yes” characters at the end of the CGI.QUERY_STRING variable and stores it to a new variable called variables.QUERY_STRING:
<cfset variables.QUERY_STRING = removeChars("#CGI.QUERY_STRING#",12,11)>
Of course I would add a cfif statement to avoid continue removing the characters if there is no “clear=yes” exists in the string:
<cfif CGI.QUERY_STRING CONTAINS "Clear=yes">
<cfset variables.QUERY_STRING = removeChars("#CGI.QUERY_STRING#",12,11)>
<cfset variables.clear = "#CGI.QUERY_STRING#">
<cfelse>
<cfset variables.QUERY_STRING = "#CGI.QUERY_STRING#">
<cfset variables.clear = "#CGI.QUERY_STRING#&Clear=yes">
</cfif>
<a href="?#variables.QUERY_STRING#" title="Continue Shopping">Continue Shopping</a><br />
<a href="?#variables.clear#" title="Clear Cart">Clear Cart</a>
You can see result of the above code here along with my final project.
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 Open Policy Decistion
This morning when I read all of the GNU/Linux news from my email inbox delivered via Google Alerts, I decided to have my own open policy. Although my career is web development, I can contribute my server-side script code such as ColdFusion and PHP through Github and Google Code Project. Other server-side scripting languages such as Perl and Java is out of the topics of this blog because I’m only beginning to learn the basics of Perl and soon I will learn JSP as well as other languages, except Microsoft-owned ASP and ASP.NET. My hosting provider doesn’t support these two languages anyway. In fact, it also does not support ColdFusion. The reasons that I’m studying and using ColdFusion is that first because this language is required for my major. Second reason is that this language is identical to PHP. Thus it ‘s easier to learn this language together with PHP. In fact, the RPX demo page that I created is inspired by curl function in PHP.
In addition to open up more of my code, I have also decided to use, learn and contribue to other open source projects, including WordPress and PHP, as well as VLC and other projects whether they are related to the web or not.
One of my current goals is to wait and see if there is any good Android-based device in the near future that meet my requirements. Although I have a jailbreaked iPod Touch, I felt that it still is not very openness to me. My requirements of the device are following:
- Its price needs to blow $200 dollars
- It needs to have a camera
- It needs to have access to Android Market Place
- I definitely do not want the phone ability
- The GPS feature is in my wish list, but not really a requirement
I hope that there is going to be a suitable device for me before I begin to attend University of Maryland this Fall so I could experienment with some mobile programming knowledge.
Simple login form using existing Google or Yahoo account
I spent all of this morning write a demostration ColdFusion page for integrating with RPX API to allow users to use their existing Google or Yahoo accounts to sign in to my website. By using this API, I could get basic user information such as their names and gender. Actually, I only could get their names through their Google accounts, in addition to their gender if they signed in through their Yahoo accounts. I could get more of user information if I upgrade my RPX account. The ColdFusion page is a basic demo that shows a login link to the RPX login AJAX popup. Once the user logged in, he/she will see their names as well as some related information of their provider. In addition to Google and Yahoo, there is also an OpenID login option. Unfortunately, I cannot test OpenID because I don’t know how to implement my own OpenID since Google is also use OpenID implementation.
You can view the demostration page at the following URL:
http://160.253.0.40/Students/Students/0111/OpenIDapi.cfm
Here is the download URL for the source code of this page:
http://ca288-final-spring-2010-mc.googlecode.com/files/OpenIDapi.cfm
CFWheels, an Open Source Framework for ColdFusion
CFWheels is a ColdFusion framework inspired by Ruby on Rails. It has a very thorough get started tutorial to get you started with using CFWheels on its website. The URL format of the framework is pretty much like CodeIgniter PHP framework, example.com/index.php/news, except it’s index.cfm instead of index.php. Since it’s open source, I’m able to see its source code.
CFWheels uses CF Components, which is ColdFusion method of Object Oriented Programming (OOP). I’m happened to be learning UDF (User Defined Functions) and Custom Tags for ColdFusion in college. Therefore it’s a perfect opportunity to learn the ColdFusion Component which is the next step of UDF and Custom Tags.
There are also many useful documents and tutorials on the CFWheels website. It has 10 episodes of video tutorials and offers online version and PDF version of its Reference Guide and Wheels API documents. Overall, it’s easy to get started to using this framework. However, I’m still struggled with completely using ColdFusion on GNU/Linux.
Use Samba to Transfer Files between Fedora and Windows XP
Samba is a GNU/Linux network service that provides file sharing between GNU/Linux and Windows. One week ago, I switched my netbook from Ubuntu back to Windows XP thanks to the Google Earth plugin. I need to use Google Earth API for my ColdFusion class and it needs Google Earth plugin to test the API code. However, the Google Earth plugin doesn’t have a Linux version yet despite the popularity of Google Chrome and Google Earth on GNU/Linux. I initially thought that Google Earth plugin could work on virtualized Windows XP through VirtualBox. It failed to display the data due to the low performance of VirtualBox graphics card.
Anyway, to use Samba, you need to first install it by entering the command below to the terminal:
sudo yum install samba samba-client samba-common samba-swat
After the installation, I followed a helpful tutorial on linuxhomenetworking.com to complete the Samba setup. It provided me step-by-step instructions to setup the Samba server using SWAT web interface.
I use Asus Eee PC 1005HA, which means that it has Windows XP Home Edition. The instructions for this tutorial on how to connect Samba server with Windows XP Home confused me. I was never able to connect to the server based on it. Fortunately, I found a post on linuxforums.org that discusses about the same issue. According to the discussion, the firewall must be disabled to allow Samba to accept the connection. This inspired me to enable the Samba and Samba Client ports in Firewall setting without completely disable the Firewall. This prevents any unnecessary security issues. Windows XP successfully connected to the Samba server without any problem.
I have not yet tested with transferring files from Windows XP back to Fedora directly on Fedora, but I think it’s the same technique. Some of the Samba server security concerns would rise if Samba is used on a non-password protected network. According to the article on linuxhomenetworking.com, you need to setup a local HTTPS Certificate for the Samba server if you have any security concerns. I don’t need the certification because I only use the sever on the home network and the network is password-protected.
Become a better Web Developer
Nowadays, it is easier to become a web developer, at least I think so.
As a web developer for almost five years, I have experienced HTML, CSS, JavaScript, PHP, Python, and ColdFusion. However, for the first three years of my web developer career, I only knew Client-Side scripting languages. Later, as I entered college, I have learned about PHP and ColdFusion Server-Side scripting languages. I have also learned Python and Ruby about one year ago after I got this first domain.
I think the web development is easier because almost all of the tutorials related to the web development topic are freely available on the Internet. I remember when I first started to learn PHP about two year ago, I learned basic PHP syntax from w3schools.
According to an article from meiert blog, web developers need to read the specs for HTML and CSS, continuously prictice their web development skills, and find the best tutorials around the web in order to become a better web developer.
I read the early draft for the HTML 5 long time ago. It’s a 300-page document. At that time, I thought it is too time consuming to read the whole document, so I scanned over them. As the result, I didn’t learn anything about HTML 5. Until now, I only have a little understanding on HTML 5 specification. Thanks for the abundance of the web development tutorials online, I’ve found HTML 5 doctors and other HTML 5 related tutorials on other websites.
