Archive for January, 2008

Is the prius hard to drive?

Sunday, January 20th, 2008

New York Times had an article on The Risk of Innovation: Will Anyone Embrace It?. Overall, I think the article made some excellent points on how people embrace or resist innovations. It is a great read for people who try to sell new technology solutions to the general public.

However, I think the primary example used in the article was all wrong: The article talks about how the controls in Toyota Prius are un-intuitive (e.g., tap twice to start the car), and customers embrace the inconvenience anyway since Prius represents the kind of “green” innovation people want to be part of. Well, as a Prius owner, I can tell you that the “un-conventional” control is exactly what prompted me to buy a Prius. If I want conventional controls, I would have bought a Camery Hybrid or a Civic Hybrid — neither of those hybrids are sold nearly as hot as the Prius. Why?

The Prius has a rather large price premium over a comparable Corolla. Even with gas price at $3 per gallon, it still makes little economic sense to buy a Prius over a Corolla. The Prius is a “statement car” or a “fashion car”. People buy it for the same reason they pay extra for a low end luxury car. It is hence essential for Toyota to distinguish the Prius from the Corolla — to make people feel that they are driving a totally different car, not only in gas milage but also in “look and feel.” I think the “feel” of an “futuristic” car is what made a lot people forking over the extra cash.

The “usability barrier” here accelerates the adoption of innovation rather than impeding it. I think this is lesson we could also learn in designing a consumer mobile application. :)

Austin TX is the #3 best city for jobs in America

Sunday, January 13th, 2008

Forbes.com ranked Austin TX the #3 best city for jobs in America for 2008. Of course, we all know that. It is kinda a tough for tech employers though — we have been trying to fill several Java / web positions for months. Almost every developer I know in town is gainfully employed.

Picture 27.png

In fact, according to the article, Texas in general is the best place to look for a job in 2008:

The Lone Star State shines brilliantly in a list of the best places to work in the U.S. when some economists peer into their crystal balls for 2008.

Austin, Fort Worth, Houston and San Antonio all rank high on the latest forecast data from Moody’s Economy.com. McAllen, Texas, is expected to have the highest job growth rate, as its leisure and hospitality, educational and health services and commercial construction jobs flourish.

Here is the detailed statistics for Austin. I noticed that Austin’s ranking is probably dragged down by its lower median income — that is very misleading since we have one of the nation’s largest public universities in town, and the students make very little income while they are still counted in the median. For people in the software field, Austin probably pays 10% less than San Francisco in raw salary but the cost of living is much much lower.

Picture 26.png

Let your readers subscribe to your RSS via SMS

Wednesday, January 9th, 2008

As a blog reader, one thing I’d love to do is to subscribe to my favorite blogs via SMS. And by “subscribing”, I do not mean simply getting an SMS alert telling me to “check it out on your PC”. I want the full post to be delivered to my phone — so that I can read it while I am driving (kidding!).

Well, thanks to the good folks at textmarks and mowser, I just did exactly that for my own wordpress blog (See how it works). As promised, I am releasing my little wordpress plugin here. Here is what you need to do to mobilize your blog:

1. Sign up for a free keyword at textmarks. This is the keyword people will text in to subscribe to your blog.

2. Request for a free API key from textmarks. This key is needed to broadcast SMS messages.

3. Get my plugin here, unzip it and drop the textmarks_alerts.php file in your wp-content/plugins directory, and then activate the plugin from your wordpress admin console.

4. Go to the Options –> Textmarks Options tab, and fill in your account and keyword information from textmarks. You will also need to fill in the root URL of your wordpress blog. You can choose to use Google or Moswer to adapt your blog pages for mobile screen viewing. Choose “none” if you already have Andy Moore’s wordpress mobile plugin installed. See more explanation on the plugin options page.

Picture 24.png

That’s it folks! Your readers can simply subscribe your blog by texting in your keyword to short number 41411. The subscribers will get a mobile web link for every new post from now on!

Okay, if all those sound too complicated but you still want to use the plugin. Send me $100 and I will take care of everything for ya. ;)

cheers
Michael

PS. The scripts uses Binny V A’s free PHP load() function (from bin-co.com) to make make network connections. It is gets around the sometimes blocked file_get_content() call. Thanks Binny!

Develop compelling iphone applications with JSF + Facelets + Seam

Tuesday, January 8th, 2008

I recently had the pleasure to write an iphone application using JSF + Facelets + Seam. It is mostly a smooth experience but there are also some gotchas I'd like to share with the Seam community.

Okay, first things first, what is an "iphone application", you ask? The iphone SDK has not been released yet! Well, I am referring to a web application that simulates iphone's native look-and-feel via JavaScript and special Safari markups. In particular, I am using the iui library. It works great on an iphone (or even in a desktop browser -- try the official iui demo here)!

So, what are the issues using the iui library with JSF + Facelets + Seam?

The first and biggest issue is that iui and Safari expects the page to be in text/html while Facelets + Seam renders text/xhtml. For some obscure reason (a bug in Safari as Firefox does not display the same issue), this really messes up the navigation. To fix that, you can put the page content inside a pair of <f:view> tags to set the content type properly. Your page will look something like this:

XML:
  1. <html xmlns="http://www.w3.org/1999/xhtml"
  2.       xmlns:s="http://jboss.com/products/seam/taglib"
  3.       xmlns:h="http://java.sun.com/jsf/html"
  4.       xmlns:f="http://java.sun.com/jsf/core"
  5.       xmlns:ui="http://java.sun.com/jsf/facelets">
  6. <f:view contentType="text/html">
  7.    
  8.     <head>
  9.         <title>Your Title</title>
  10.         <meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
  11.         <link href="iui/iui.css" rel="stylesheet" type="text/css"/>
  12.         <script type="application/x-javascript" src="iui/iui.js"></script>
  13.     </head>
  14.  
  15.     <body>
  16.         <!-- ul and div elements as required by iui -->
  17.     </body>
  18.  
  19. </f:view>
  20. </html>

Notice that the viewport meta data is very useful in iphone development. By default, iphone displays the "thumbnail view" of most web pages when the page is loaded. The words on the page are unreadable in the thumbnail mode. The user is expected to zoom in to read via finger gestures. That works for most large web pages designed for deskto browsers. But you do not want this if your site is optimized for the iphone -- you want the site to display as it is from start up. The viewport element allows you to specify the zooming behavior for this page.

The second issue is that when iui loads pages, it tries to load page fragments via Ajax to provide nice page transition visual effects, as well as nice navigation buttons. To do that some of your dynamic web pages must be provided without the <html> or <body> tags. The facelets <ui:composition> is ideal for this. Here is how one of my pages look like

XML:
  1. <ui:composition xmlns="http://www.w3.org/1999/xhtml"
  2.                 xmlns:ui="http://java.sun.com/jsf/facelets"
  3.                 xmlns:h="http://java.sun.com/jsf/html"
  4.                 xmlns:f="http://java.sun.com/jsf/core"
  5.                 xmlns:s="http://jboss.com/products/seam/taglib">
  6.    
  7.     <ul id="#{siteSearchAction.tag}" title="#{siteSearchAction.tag}">
  8.         <ui:repeat value="#{siteSearchAction.sitesByTag}" var="site">
  9.             <li><a href="view.html?siteId=#{site.id}" target="_self">#{site.name}</a></li>
  10.         </ui:repeat>
  11.     </ul>
  12.  
  13. </ui:composition>

When the user clicks a link to this page, the dynamically generated <ul> list will be rendered according to iui stylesheet, with all the bells and whistles of the "wait" animation and "sliding door" page transition in effect.

Anyway, aside from those two issues, developing for the iphone is really a breeze. What is the application I am writing? Well, you will know in a few days! Subscribe to this blog via SMS! :)

Subscribe to this blog via SMS!

Friday, January 4th, 2008

My little holiday project was to write a very simple wordpress plugin that allows people to get SMS notifications, along with "mobile web links", whenever a wordpress blog is updated. I just tried it on my own blog and it worked like a charm:

1. You can subscribe to my blog feed by entering your phone number below. Or, you can text in word yuan to short number 41411 to subscribe.

2. When I post a new blog entry, you will get a SMS message on your phone with a link to the post, which you can open directly on your phone's web browser (if you have a mobile data plan, as all iphone users, all blackberry users, and many smartphone users do)

That is it! Have fun guys! In the next post (probably on Monday), I will release the wordpress plugin and explain how to use it. Stay tuned! (Actually, subscribe now so that you do not miss my next post! ;))

Here is how the service works on a real phone:

1. Get a SMS link when the blog is updated

Screenshot0092.jpg

2. Open the link in the SMS

Screenshot0093.jpg Screenshot0094.jpg

3. See the page in action on the phone!

Screenshot0095.jpg Screenshot0096.jpg

Courtesy to Textmarks for providing the SMS services (including the short number 41411), and Mowser for providing transcoding services to re-format my blog pages for better display on small phone screens.

PS. This service only works on US phone numbers. Sorry guys, but if you find an equivalent to textmarks in Europe or Asia, please please let me know! Thanks.