Thursday, May 20, 2010

FIFA World Cup 2010 theme songs

Enjoy the official FIFA World Cup 2010 theme songs. Just can't wait for the opener. I know I'll miss it once the Cup is over because the next one won't happen for another 4 years.

Tuesday, April 27, 2010

Python 2.5, Google AppEngine and Ubuntu 10.04

One day before Ubuntu 10.04 is released, I just can't wait so I built a live, persistent Ubuntu 10.04 on a USB flash drive.  I recently decided to install Windows 7 on my really, really old laptop which only has 40GB hard-drive, partitioning for a dual-boot of Windows 7 and Ubuntu would not leave too much space left for Windows.  So I wanted to move my entire Google App Engine development environment computer onto a USB flash drive.  I paid $10 for a 4GB Microcenter-brand USB flash drive.  

But I am quickly disappointed to find out that Python 2.5 which is still a requirement for Google App Engine has been permanently removed from Ubuntu 10.04.  So it looks like I would have to take an alternative route which is using Java.  Of course, there are worse things in life than having to develop Java-based Google App Engine applications.  Having said that, I will monitor any news coming out Google I/O 2010, since I have a feeling it's about the right time that App Engine moves to Python 2.6.  Google I/O seems like the right setting for this announcement.

Thursday, April 22, 2010

Hello Vietnam

The singer's name is Pham Quynh Anh who's a Vietnamese-Belgian. I don't have any musical talent but I know when I hear a really great voice, like hers. The song is pretty good too.

Wednesday, April 14, 2010

Ngô Bảo Châu and the Fundamental Lemma

My mother called the other day and asked if I know who Ngô Bảo Châu is.  I didn't know, so while she was on the phone, I found a few links about this Vietnamese man and why he is considered so influential.

His work was listed by Time as one of the Top 10 Scientific Discoveries of 2009.

So I was curious about what exactly this Fundamental Lemma is, so I followed a few links from the wikipedia's articles listed above.  Saying that this stuff is over my head is a huge understatement.  So without even trying to understand what this is, I just wonder if this Fundamental Lemma thing, whatever it is, will play some role in the field of Computer Science, perhaps in the next century?  If that's the case, I'm surely glad I wouldn't be around to learn about it.

Sunday, April 11, 2010

How to build voice-enabled web applications that run on all browsers

I am planning to expand this article by re-writing with more details and will also include one or two samples, but for now, in the interest of time, it just has minimal information. In addition, the plugin itself is still in its infancy. It does what I need it to do for the Voice-enabled Weather and Traffic Report application that I built, but I am also planning and hopefully others would join me to further improve it.

When I say "all browsers", yes, I mean that this also includes IE6. For IE8, IE7 and IE6, somehow, you would have to instruct your users that they would need to install the QuickTime plugin for a seamless user experience. If you figure out to make it work seamlessly with Media Player, please let me know. For Opera, the end users would have to configure their browsers by going to "Settings->Preferences->Network" and uncheck the box labeled "Send Referer information". Out of the box, it seems to work best with FireFox, Safari and Chrome.

First, grab the jQuery Text-to-Speech and jPlayer plugins:

Then in the <head> tag, add the following lines:

Somewhere inside the <body> tag (I put mine right after the opening of the <body> tag), add a couple of divs:

In your JavaScript code, initialize and then call the play() method.:

That's it. This should be enough for anyone to start now. As I mentioned, I am planning to expand this article in the next few days.

About the Voice-enabled Weather and Traffic Report

I want to keep this "About" page as non-technical as possible, since there's no doubt, a majority of visitors who land here are not interested and do not care about the technical details. If you want to find out about the technical details and want to learn about how to voice-enable web applications for almost all web browsers, please reas this post.

The Voice-enabled Weather and Traffic Report is an easy-to-use, easy-to-understand site that does exactly what it says it would do in its title. You would type in a U.S. (and maybe part of Canada) zip code and it would speak to you, literally, about the results for both the weather and traffic for that zip code. Of course, you can still read the results on your monitor screen. If you forget to type in the zip code, it would speak to you, telling that you need to type a valid zip code in the box. If you mistype a zip code, it would speak to you, telling that you entered an invalid zip code.

That's it. It's free to use and it's that easy. There's no other non-technical information that I could tell you. I build this application, oops ... I mean to say this web site by "mashing up" the information from Yahoo's sources and host the site on Google's infrastructure, so the web site should be very accurate and highly-available. Occasionally, if you don't hear anything immediately, you might need to refresh or reload the page once or twice (using the F5 key on your browser, if you're using Windows).

I already mentioned about Yahoo and Google, but there are a couple of other individuals that I want to say "Thanks" to. First, I want to thank Weston Ruter for sharing his discovery about Google Translate. After reading his article, I was inspired and came up with the idea to do this project. Second, I want to thank Antonio Lupetti for his clean and pure CSS form. If you think the web site looks nice and clean, that's because it's thanks to Antonio. If you think otherwise, it's because I tried to customize and messed it up.


Note: For IE and Opera users:

For IE8, IE7 and IE6, you would need to install the QuickTime plugin for a seamless user experience.

For Opera, you would need configure your browsers by going to "Settings->Preferences->Network" and uncheck the box labeled "Send Referer information".

Out of the box, it seems to work best with FireFox, Safari and Chrome.

Wednesday, October 21, 2009

Syntax highlighting your code snippets in Blogger

If you want to add syntax highlighting to code snippets in your blog, Blogger specifically, you are more than likely get the following results back from a Google search. At least that's what I get at the time of this writing.

But I soon realized that the instructions in all of those blog articles, while they must be useful in the past, are now obsolete with the latest SyntaxHighlighter from Alex Gorbachev. So here's how to add syntax highlighting to code snippets in your Blogger:

1. Navigate to Layout->Edit HTML, find the <head> tag. Right after that <head> tag, add the following (I use the Eclipse theme as shown on line 2 and include the scripts for the languages that I will be blogging about. But there are many more other themes and languages supported):

2. Wrap any code that you want to hightlight inside the following <script> tag (this example uses the brush:js for JavaScript, but again, there are brushes for many other languages, standard and non-standard. The ... is where your code snippets should be residing):

3. There are a couple of advantages that I see over using the legacy version 1.5 of the script. One advantage is that there are more than just one theme supported. The other advantage is inside the CDATA, you don't need to escape the < charater. You can just copy and paste anything from your IDE to the area inside the CDATA. However, the Blogger editor might complain by putting up the message: "Your HTML cannot be accepted: Tag is broken: <![CDATA[". I just checked the check box "Stop showing HTML errors for the body of this post" and publish again, and it seems to forgive.

Here's an example in Python:

IMPORTANT: When I saved as draft with the check box "Stop showing HTML errors for the body of this post" checked, and returned to the list of posts, I didn't see my post. So I quickly hit the back button on the browser, and published the post. What this means is while it's nice to be able to copy and paste code snippets directly from the IDE to the Blogger editor without worrying about escaping all the < characters, we might lose the ability to save as drafts.