Thursday, December 28, 2006

New Year's resolutions, GameCube

I'm currently in Pennsylvania with my in-laws over the holidays, so I've been pretty much off the grid. We've had a grand time visiting, exchanging presents, eating too much good food, and building a potato cannon. Seeing as 2007 is fast approaching, it's time to start thinking of resolutions. From exercising more, eating fewer snacks, or remembering to call your mother on her birthday, we all think of various ways we can improve our lives, by starting good habits or ending bad ones. I took some time off this afternoon and compiled a few suggested resolutions that will assist you in your pursuit of free software. Check out the entry at Free Software Magazine entitled Free software New Year's resolutions.

As the Nintendo Wii is still a bit difficult to get a hold of and there's a persistent rumor about it dropping to $200 and having DVD playback in early 2007, I decided to purchase a used Nintendo GameCube for the time being. I know there's a homebrew scene, there's a Linux distribution available, and I've heard of people hacking IDE drives onto the thing. Oh, and there's a fairly large number of excellent games for the GameCube that are pretty cheap right now, so I should be able to finally play The Legend of Zelda: The Wind Waker, Cubivore, Killer7, Donkey Konga and a few other titles that have been recommended to me. I'll write more about the GameCube mod scene when I can do some more research.

My wife and I wish you and yours the very best in the years to come!

Friday, December 22, 2006

Wii-diculous

Demonstration

One of my friends is a manager at a local movie theater, which uses a digital projector to show advertisements between features. After seeing the It Burns When I Wii video, we figured we could one-up it with the equivalent of a 344" television screen. We wanted to use my friend's Nintendo Wii in the theater, but we didn't want to have to deal with yards of cabling. Inspired by doctabu's design, I built my own wireless sensor bar for less than $20. Doctabu left out something important; a resistor, which is needed to limit the current to the LEDs.

Parts - what's essential:

  • 4 x Infrared 5MM LEDs (Radio Shack # 2760143)
  • 1 x 15 ohm 1/2 watt resistor (Radio Shack # 2711102)
  • 1 x Battery Holder for 4 AAA (Radio Shack # 2700413)
  • 4 x AAA battery
  • Small gauge electrical wire (at least 7 1/2")

Parts - what I recommended:

  • 2 x Project Enclosure (3"x2"x1") (Radio Shack # 2701801)
    • Housing for your device.
  • 1/4" drill bit
    • Drill holes in the housing for the LEDs and wire.
  • 1 x Package of 5 LED Snap-Holders (Radio Shack # 2760079)
    • Keeps the LEDs in place.
  • 1 x SPST Submini Toggle Switch (Radio Shack # 2750612)
    • Turn it on and off.
  • Four small cable ties
    • Place on either sides of the wire where it goes through the hole and trim. Keeps the wires from pulling out.

My design consists of two IR emitters connected by a single piece of wire in a series circuit. I left the battery holder on the outside to make it easier to change the batteries.

When you build your own and you're finished soldering it together, put the batteries in, take it in a dark room and flip the switch. The LEDs will have a very faint, flickering red glow. Infrared is beyond the range human sight, but there's a little bleed-through into the visual frequencies. Some cameras with will be able to pick it up as a greenish glow. To use the emitters, turn the device on and place it on a level surface with about 6-7 inches between the two inner LEDs.

Implementation

I built the wireless sensor bar, brought it over to the theater and tested it on a regular television. Fortunately, it worked! After the patrons left, we hooked the Wii up to the data projector and house sound, put in Wii Sports, and brought the controllers and the wireless sensor bar downstairs. We set the emitters on the backs of two chairs and stood a few rows back. The wireless range of the controllers was great enough to work! We suffered no technical glitches from the distance; we could even play up on stage, craning our necks up at the gigantic image, immersing ourselves in the game.

In conclusion, there's more than one way one can Wii, and sometimes, size does matter.

Edit - Thank you, Make Blog, Digg, Engadget, menéame, ElOtroLado.net, Kotaku, Kottke.org, QJ.net, Gizmodo, and GameTrailers.com for hosting a high resolution version!

Edit 2 - Over 500,000 views on YouTube and almost 800,000 views on a bootleg version on break.com!

Thursday, December 21, 2006

Backing up your system, finding balance

My new entry, Backing up your system with free software is up at FreeSoftwareMagazine.com. Originally titled I ain't afraid of Norton Ghost (I'm learning to be more graceful about editorial changes), it describes some free tools and techniques one can use to back up and make an image of their workstation.

I still feel like I'm still fumbling around a bit there. While a weekly writing deadline has been very good for me, I don't think I've quite found the right groove yet at FSM.

Part of the difficultly has stemmed from the definition of "free". I originally thought free meant not having to pay for it, and classified closed-source freeware, no-nag shareware and open source software as free. Their definition is a bit more strict; if it's not open source, it's not truly free. It's a challenge to shift your perspective in that manner, but it's manageable.

My other stumbling block is finding the right equation for success; what's popular? I can't predict what will be hit yet, even looking at other people's work. Sometimes, an entry that I think is substandard will generate tens of thousands of hits, and another that I thought was stellar only gets a few hundred.

Obviously, there's no black and white solution; it's a matter of being in the right place at the right time with the right message.

With this particular definition of free, it's easy to slip into the anti-corporate role, railing against Microsoft or other large companies... extremists are obnoxious, and that's not my style. I feel more moderate; it's okay to find balance, and while I lean in a particular direction, I don't want to go off the deep end. I don't think Steve Ballmer is the devil.

However, I do like the 37signals approach, which is to pick an enemy and make something better than what they're doing. Hence, my title, "I ain't afraid of Norton Ghost" - I intentionally picked a popular commercial package and made it a target, and my weapons were free and open source software. Such a violent analogy and a confrontational tactic, yet that's a proven method of success.

In the end, the entry title was changed but the structure remained the same, and I got an above-average number of hits. So it goes.

I'm putting the finishing touches on my first article for Free Software Magazine... if accepted, it'll be in Issue 16. I haven't forgotten about the home server security, but real life and some other priorities have taken precedence. Also, I've got something big and fun planned in the next day or so...

Saturday, December 16, 2006

Zend Certification and a drink recipe

As of Friday, December 15th, I earned the title of Zend Certified Engineer. As best as I can remember, the exam concentrated primarily on precedence, casting, array manipulation, and file operations.

To get an idea of what the test process was like, take an 8oz tumbler, add a few ice cubes, fill it with 2oz vodka, 2oz Rose's Lime Juice, and 2oz of Triple Sec. Stir gently, then jam the whole glass into your left eye. Okay, so it wasn't that bad; while stressful, it's manageable... and coincidentally, is a recipe for a Kamikaze.

Certification tests are one of those necessary evils that one must suffer through in the pursuit of professional development. I feel my strengths lie in concepts and structure, and my greatest weakness is the ability to memorize and regurgitate. This is advantageous when doing systems analysis, but it doesn't help when taking a standardized exam specifically designed to test your knowledge by requiring the selection and differentiation between a series of extremely similar solutions.

I'm aware that just because you're good at taking a certification exam doesn't mean you're a good programmer. I do feel that the training that led up to the certification helped me as a programmer as it delved into some of the more obscure aspects of the language. In addition, networking with my classmates was invaluable. I'm glad I went through that process, and I'm equally glad that it's over.

So, what's my next goal? Zend PHP 5? Solaris 10? We'll see...

I'm going to let the dust settle a bit with the fast approaching holidays, and I've got a couple big projects coming up in early 2007; writing a PHP tool to analyze survey results stored in MySQL, writing a working prototype of a job description database in Ruby on Rails, and working with the rest of my department to upgrade the web server, including transitioning from PHP4 to PHP5. That's in addition to my regular writing duties for FreeSoftwareMagazine.com and whatever scraps of a social life I can squeeze out... but first, time to celebrate and relax with my wife.

Thursday, December 14, 2006

KompoZer - Unofficial Bugfix Stopgap for Nvu

My latest entry at Free Software Magazine, KompoZer - Unofficial Bugfix Stopgap for Nvu is now up. Nvu, the free cross-platform WYSIWYG HTML editor reached its acclaimed final 1.0 release in June of 2005. Official development then ceased to allow work on its successor, Mozilla Composer 2.0, leaving users with no bugfixes and patches. The post discusses the history and controversy of KompoZer, the unofficial community stopgap release of Nvu.

I'm really enjoying my week in Manhattan. The Zend PHP Certification boot camp is progressing smoothly, in spite of a delay in getting the official books (we had print outs of the PDF instead, so I had to transcribe all my notes once the books arrived). It's a small class in a small room; only four students and a teacher. However, this kind of setting is well suited for this kind of material and allows more individualized training. I'm fairly confident that I'll be prepared for the exam on Friday.

I've been to the IFC Center twice, the first time on Sunday to see David Lynch's Inland Empire, then last night to see the premiere a new print and revival of El Topo, the "first" NYC midnight movie. Inland Empire was everything that a David Lynch movie could be; emotional, surreal, and building a complex character and structure only to completely break it down without any compassion for the viewer. I liked it, but it was difficult to follow and felt more like an in-joke than a story.

Before Inland Empire, an advertisement for El Topo stated that the 7:20p show would have a special guest, so I bought an advance ticket. As it was John Lennon and Yoko Ono's favorite movie, I guessed that Yoko Ono would be there to say a few words since Lennon was busy elsewhere. The night of the show, they announced that she was supposed to be there, but due to unforeseen circumstances she was unable to attend. Instead, they played a section of Imagine and read a letter from her saying that she wished she could be there and gave her love to the audience. The newly restored print was absolutely beautiful, and I really enjoyed the movie, even more than Inland Empire.

This morning, the New York Post reported that Yoko was the victim of a $2 million extortion scheme from her chauffeur, complete with death threats, videos and photos. I suppose that's a legitimate excuse for not being at the premiere.

After El Topo, I went to Benny's Burritos in the Village, only a few blocks away. I remembered their Mojitos from previous trips and asked for one, only to be politely told that they didn't make them anymore. I ordered a margarita instead, then was pleasantly surprised when the waiter brought over a Mojito, saying the bartender did have the supplies after all. My jerk chicken on a curry tortilla was tasty and what I needed. While Benny's isn't haute cuisine, it is a nice place to get a good meal for a reasonable price with personable service.

Late that night when I was exiting the subway station, I happened to look up. The top Empire State Building was piercing the low-lying cloud cover, reflecting and diffusing its holiday red and green lights in an ethereal mist. I like this city, and I wish I could spend more time here.

Thursday, December 7, 2006

Serendipity

This is extremely frustrating and unfortunate. I finished writing my entry at around the same time that this other one was posted, and the Gina's currently has over 1000 diggs. At least I know it was a good idea, and Gina's article was well written and a slightly different perspective on the same issue. Congratulations!

Wednesday, December 6, 2006

Visualize Your Disk Usage, Console Hacking

I've posted a new entry titled Visualize Your Disk Usage at Free Software Magazine. Ever wonder about what's been eating up your free space in Windows? Two free utilities that graphically represent disk utilization are analyzed and compared.

Continuing the discussion about subjugating game consoles... Over the last week, hackers have had a field day with the Wii. The WiiMote can be used in Windows using GlovePIE (see this HowTo for the script) and on OSX with DarwiinRemote. There's a video demo of the Wii-Mote controlling Half-Life 2 in Windows. If you're interested in Wii (well, Gamecube) home brew and emulators, check out wraggster's tutorial on how to exploit the GC Action Replay for just that.

PlayStation 3 Linux has also gotten some notice as it's pretty easy to just create an image of a Blu-ray disc, including movies and games. Inevitable and not particularly shocking, but some people just get the wrong idea and think that Linux is a piracy enabler. A tool is a tool; it's up to the user to decide whether or not to use it for good.

I've been teaching myself Ruby on Rails at work. It's turning out to be a great way of making CRUD (Create, Retrieve, Update, and Delete) based applications quickly and easily. I ran through part one of the classic Rolling with Ruby on Rails tutorial, turned around and in less than an hour created a prototype application that would have taken me at least a day to get to the same point in PHP. I do like how it pretty much forces you to use the Model-View-Controller (MVC) design pattern, separating business from presentation. Much to learn and even more to do before it's even close to production ready...

Speaking of PHP, I'm traveling to New York City on December 10th for a week-long Zend PHP Certification Boot Camp. While I've been using PHP and developing applications for a couple years now, it'll be nice to have some formalized training and certification. In my free time, when I'm not studying or visiting friends, I'm planning on watching David Lynch's Inland Empire and maybe even catch Avenue Q, the subversive Sesame Street parody.

I'm currently writing a follow-up for to the How to Configure an $80 File Server in 45 Minutes entry. I'll discuss how to take steps to protect, audit and secure your server. Imagine the relief you'll feel when you eliminate the script kiddie dictionary attacks from your auth.log!

Thursday, November 30, 2006

Why hack your game console?

My first blog entry at FreeSoftwareMagazine.com, Why hack your game console, has been posted. It's a topical overview of why and how game consoles can be utilized and extended using home brew software and Linux. Check it out!

Monday, November 20, 2006

Getting Your Cell Phone Under Control Using BitPim

I had some issues with managing my cell phone.  I had dozens of work contacts that I wanted to import instead of using the keypad to manually enter them.  Also, I had dozens of pictures that I had taken with my phone's camera that I wanted to easily organize and transfer without being charged.  After some research, I found the Mobile Action USB Data Suite - a USB cable, drivers, and syncing software for around $20.  However, I felt the included software was too bloated and limiting.  I installed only the drivers and turned to Google, where I found BitPim.

To quote BitPim.org...

is a program that allows you to view and manipulate data on many CDMA phones from LG, Samsung, Sanyo and other manufacturers. This includes the PhoneBook, Calendar, WallPapers, RingTones (functionality varies by phone) and the Filesystem for most Qualcomm CDMA chipset based phones.

Contacts

The ability to import contacts was what initially brought me to BitPim.  I synchronized the existing contacts from the phone, converted a Excel spreadsheet of contacts into a CSV, and used BitPim's import function.  After some categorizing and tweaking, I transferred the new list with my phone.  I checked, and everything was there as I wanted!  I saved myself from some very tedious data entry.  BitPim's import also supports a variety of different sources for contacts and calendars, including Outlook, Google Calendar, iCalendar, and more.

Images

I wanted to organize the images I had taken with the phone's camera.  Under Media, you can see thumbnails or a detailed list of the images.  I renamed the images and even added some from my computer to use as wallpaper, which BitPim resized automatically.  A quick sync, and now my images were under control.

When importing or exporting, the pictures taken with the camera were under "Wallpaper", even though they're listed under Media - images in the tree view.  Also, if you rename or upload an image, make sure it has the proper file extension (eg .JPG) - my LG-VX5200 will reset when it tries to display an image without the extension.

Ring Tones and Sounds

Many people have custom ring tones... why can't I?  However, I'm cheap and I like to do things myself.  I edit a short sound clip, saved it as a .WAV file, and dragged it into the ringers panel.  BitPim automatically converted the file to MP3 upon import.  One sync later, and I now have a four bar section of "The Gonk" as my ringtone.

Other Functions

The Memo and Todo functionality worked without issue.  Data entry using a computer's keyboard is much faster than using a phone's keypad, which saves time and frustration.  I did not use the Calendar function because we use Meeting Maker, a proprietary format that is notoriously inflexible and nigh-impossible to export.

Conclusion

I feel that BitPim is an excellent, mature program for managing cell phones; it has the functionality and versatility that I needed without the bloat.  The emphasis in this program seems to be function over form; the graphics and layout are bland and cluttered, but it works beautifully.  Best of all, it's open source and free (GPL).  To see if your phone is supported, check their matrix of supported phones and features.

Sunday, November 19, 2006

Waiting for the Wii

It's almost 5am, and I've been waiting in line at the Best Buy in Carousel Center in Syracuse, NY to get one of the approximately 120 Nintendo Wii's at launch. Someone who identified himself as a former Best Buy employee has been writing place numbers on people's hands in an effort to prevent line cutting. I talked to the guy who was #2; he was here at 7pm. I got there at about 11:30pm, and I'm #71.

The Circuit City downstairs has 38 units, and there's a much smaller line. I guess people just didn't think of it. I visited the Cicero Wal-Mart at 10:30pm, and they had already given out their Wii vouchers to the people who had been in line. Some people have mentioned that the Wal-Mart sales people were getting increasingly testy and rude to potential customers, and apparently all the Wal-Marts in the area were completely sold out of their Wii consoles before midnight even hit.

Most people in line in the hallway closest to the Best Buy are sleeping. The crowd is mostly 20 somethings, but there are some exceptions; a business man in his 50's, a man with his 12 year old son, and a few older women playing Scrabble.

People have laptops, consoles, TVs, and boom boxes. As the night wore on, the energy level has dropped. Smashbrothers tournaments have started, people have Nintendo DS systems playing head to head... the atmosphere is very friendly. The only rumors are about launch numbers nation wide, not about how one store really has a smaller number or anything negative like that.

Someone already has a Wii from another store and is letting people play a round or two. People queue up politely, play a round, and hand it to the next in line. Very cordial. Nobody has gotten angry, violent, or unruly the entire night.

I've been asking people if they're here for business or pleasure. Interestingly enough, most people are here to buy and play this system, and after playing a round of Wii Sports (boxing), I can see why. It's a hell of a lot of fun.

Update - 9:45am, I walked out of Best Buy with a Wii and The Legend of Zelda: Twilight Princess.

Update #2 - great xkcd comic on the subject of console lines.

Saturday, November 18, 2006

How to Configure an $80 File Server in 45 Minutes

I use a modded Xbox and Xbox Media Center for playing media files across the network on my television and sound system.  I also download large files, such as Linux ISOs, via BitTorrent.  However, leaving my primary computer on all the time seemed like a waste of energy.  I wanted a cheap, small headless machine that I could use as a Samba server and BitTorrent client so I could leave my workstation off when I wasn't using it.

I was in luck; HCDI Trading had a great "Fall Extravaganza" deal - a Dell OptiPlex GX150 Desktop for $47.91 (around $30 s/h).  The specs:

  • Desktop Form Factor (it fits on a shelf in a media center)
  • Intel Celeron 700 MHz
  • 128MB RAM
  • 10GB HD
  • CD-Rom

Not cutting edge, but perfect for what I needed and priced very reasonably.  Instead of using X11 and remote clients, I felt that web interfaces would be optimal out of simplicity.  If I configured the server as a LAMP (Linux, Apache, MySQL, and PHP), then I could use web GUIs for configuration, administration, and file transfers.

Out of the popular Linux distributions, I'm most familiar with Gentoo and Ubuntu.  Gentoo didn't seem appropriate; it would take hours and hours to get everything set up, configured and updated (even from a Stage 3 install), and any performance gain from the optimization would be negligible.  Ubuntu has a history of reliability and ease of set up, so I used the Edgy Eft release as the basis my server.

The Applications

  • Remote Console - OpenSSH
    • The free version of the SSH connectivity tools.  Use it for secure access to the console.
  • Web Server - Apache
    • It's free, fast, well supported and documented
  • Network Fileshare - Samba
    • Creates file shares that can be easily accessed from Windows.  Notoriously obnoxious to configure by hand, the Samba Web Administration Tool (SWAT) simplifies the process immensely.
  • Database - MySQL
    • The popular free database server.  While I can use a command line to administrate MySQL, I prefer using phpMyAdmin.
  • P2P Client - BitTorrent

Directions

  1. Download and burn the Ubuntu Server 6.10 i386 install CD.
  2. Install Ubuntu Server
    1. When asked about Software Installation, choose LAMP.
    2. When the installation is finished, take out the CD (I flip it over and leave it in the drive for the next time I need it) and reboot.
  3. Logon as the regular user that you created during setup.
  4. Give root a password.
    sudo passwd root
  5. We're going to modify the file sources list to allow us access to all the required files.  Uncomment the edgy universe, edgy-security main restricted, edgy-security universe, edgy multiverse, edgy-backports main restricted universe multiverse, and edgy-commercial main.  In addition, Ubuntu leaves the install CD as one of the file sources after installation, so you'll need to remove the CD from the source list.  Comment out the CD from the list and save.
    sudo nano -w /etc/apt/sources.list
  6. Update apt-get to use the new sources.
    sudo apt-get update
  7. Install OpenSSH server
    sudo apt-get install openssh-server
  8. Turn off the computer.
    sudo shutdown -h now
  9. Disconnect the monitor, keyboard, and set the computer wherever it's going to lurk for the next couple years.
  10. Turn on the computer and wait about a minute for it to boot.
  11. Using your preferred SSH client, connect to the machine.  I prefer PuTTY for Windows.
  12. Install Samba and SWAT.
    sudo apt-get install samba smbfs swat xinetd
  13. Create a Samba user.
    sudo smbpasswd -a username
  14. Add SWAT to the xinet configuration and save.
    sudo nano -w /etc/xinetd.d/swat
    # description: SAMBA SWAT
    service swat
    {
    disable = no
    socket_type = stream
    protocol = tcp
    #should use a more limited user here
    user = root
    wait = no
    server = /usr/sbin/swat
    }
  15. Reload Xinetd with the new configuration.
    sudo dpkg-reconfigure xinetd
  16. Verify that SWAT is up and running.  If you don't get any response, start Googling.
    sudo netstat -tap | grep swat
  17. Make the shared directory for TorrentFlux.
    sudo mkdir /share
    sudo mkdir /share/incoming
    sudo chmod 777 /share/incoming/
  18. Create the Samba share.  Using a web browser, go to http://hostname:901/shares
    1. path /share/incoming
    2. valid users - username
    3. read only - no
    4. Commit Changes
  19. Install phpMyAdmin
    sudo apt-get install phpmyadmin
  20. Connect to phpMyadmin using a web browser - http://hostname/phpmyadmin
    1. Secure MySQL / phpMyAdmin
      1. login: root (no pass)
      2. Privileges
        1. Add a password to both root accounts
      1. Create a database for TorrentFlux
        1. Databases - Create New - torrentflux
  21. Install TorrentFlux
    sudo apt-get install torrentflux
    1. Ignore the libphp-adodb message.
    2. Configure database for torrentflux with dbconfig-common? - yes
    3. Password - blank (generates random)
    4. Restart Apache? - Yes
  22. Configure TorrentFlux using a web browser - http://hostname/torrentflux/
    1. Username / Password - root / root
    2. Configuration
      1. Path - /share/incoming/
      2. Save
    3. Click My Profile
      1. Update your password
    4. Create a user account
      1. Admin - New User
  23. Remove the Apache default documents from web root.
    sudo rm -Rf /var/www/apache2-default/
  24. Create a basic web launchpad for easy access your services.
  25. sudo nano -w /var/www/index.php

    <?php $hostname = $_SERVER['HTTP_HOST']; ?>
    <ul>
    <li><a href="http://<?php echo $hostname; ?>/torrentflux">Torrent Flux</a></li>
    <li><a href="http://<?php echo $hostname; ?>/phpmyadmin">phpMyAdmin</a></li>
    <li><a href="http://<?php echo $hostname; ?>:901/">SWAT</a></li>
    </ul>

Post Mortem

Overall, the installation and configuration took me about 45 minutes to go from zero to a fully functional system.  The Xbox can see the share, and I've got a new playground for web development.  I would suggest cleaning up and securing that home page a bit; research .htaccess files to lock it down.

I put my file server in my media center underneath my router, and it takes up about the same space as a VCR.  For $80, I feel that I've made an excellent investment.

Update - 11.19.2006 - I've been Dugg! Thank you all for your comments, compliments, corrections, criticisms, and suggestions!

Friday, November 17, 2006

The Dojo Javascript Toolkit - Powerful, but Unfinished

Javascript toolkits are collections of tools that provide easy interfaces to both basic and advanced functionality that allow developers to concentrate on the business functionality of their application.  However, some are more polished than others; I'll tell you about a recent experience with Dojo, an increasingly popular toolkit.

I had written a simple PHP application to graph web server statistics, such as HTTP daemons and MySQL connections.  The application utilized JpGraph to generate graphs from tabular data.   The first page provided documentation and the interface to select the services to graph and the date/time range, and the second parsed and displayed the requested information.  For the date and time picker, I used for loops and an array to generate options for the drop-down lists.  It was ugly, but due to the low volume of use, it was enough.

However, as our organization started having more web server performance related issues, we increasingly relied on the tool, and the kludgy user interface became painfully obvious.  Wouldn't it be easier to select a date on a calendar rather than scrolling through an option list?  Can we have all the information and options available on one page, yet have an uncluttered interface?  While it was just a private utility, it needed improvement.

Enter Dojo 0.4, the modular Open Source Javascript toolkit.  A number of useful Widgets in its arsenal included a date picker, time picker, tool tips, and tabbed content.  It seemed like an ideal tool for overhauling the GUI without spending undue amounts of time tweaking, and I had easily utilized the collapsible TitlePane widget in another application.

However, the lack of good documentation quickly became an issue; a number of features or techniques mentioned in the incomplete API didn't work out of the box.

The date and time picker provided to be the hardest to deal with.  The method of retrieving the selected date and the selected time were different and incorrectly documented (DatePicker), if at all (TimePicker).  In addition, there was no documentation on how to ID the individiual widgets for retrieval.

Google searches for documentation found developer discussion threads such as, "Who broke the time picker?" but providing no working examples that worked with a form submission.  I found an email exchange between a user and a developer about another widget that provided the key on how apply an ID, and a third discussion revealed how to actually retrieve the value so it could be POSTed.

Finally, I turned to the source code.  According to a code comment, the published mechanism for getting the DatePicker value was deprecated, and the function for TimePicker was completely different than the DatePicker.

Armed with the information from a variety of hard-to-find sources, I finally got it to function... after wasting several hours researching, experimenting, and adjusting.  Fortunately, the tool tips and tabbed content were much easier to implement than the date/time pickers.

The end result was highly polished, easy to use and beautiful.  I felt drained by the experience; a released toolkit shouldn't be this hard to use.  Using the beta (or alpha?) release as a justification for bad documentation is not an acceptable excuse; if you want to help others, you need to take the time to make sure they can use it.

Moroha is the Japanese word for "double-edged," and it sums up my experience with Dojo; it's powerful, but careful how you handle it.

Code:

To set up the two widgets, use the following HTML:

<div dojoType="DropDownDatePicker" widgetId="wid_from_date"></div>
<div dojoType="TimePicker" widgetId="wid_from_time"></div>

Somewhere within the form, you'll need a hidden value for POSTing.

<input type="hidden" name="from" value="">

And finally, the submit button. I used the Dojo widget.

<button dojoType="Button" onclick='submitform()'>Submit</button>

The javascript (sans validation):

function submitform(form) {
var datepicker_from = dojo.widget.byId("wid_from_date");
var timepicker_from = dojo.widget.byId("wid_from_time");
document.forms[0].elements["from"].value = datepicker_from.getValue() + " "
+ timepicker_from.selectedTime['hour'] + ":"
+ timepicker_from.selectedTime['minute'] + " "
+ timepicker_from.selectedTime['amPm'];
document.myform.submit()
}

The result can be parsed with the PHP strtotime function.

$start = strtotime($_POST['from']);

Thursday, November 9, 2006

Should I Drink the Flavor Aid?

After coming back from an expo, you're ecstatic. You saw a demonstration of a great new product; a Ruby on Rails podcasting system with a Section 508 compliant AJAX interface with built-in automatic transcription. Everyone else is doing it, it's got all the right buzzwords, and it's free! This will expand your organization's horizons and make you look like a technological genius. However, you need to take a moment to reflect on some key points before even thinking about installing your shiny new toy.

Justification

Why do you need it? Is this just to get in on what's hot, or does it serve a legitimate purpose and serve your client's best interests? Just because you can do something doesn't mean you should.

Is it really the best solution? Do some research on what other similar products are available; there may be better options that serve your needs.

Can everyone within your organization use it, or is your pet project? When you're part of a group, you need to consider the needs of others, not just yourself.

If others may be using it, how hard will it be to train them? You need to consider the lowest common denominator; it may be easy for you to use, but it may be much more difficult or impossible for others to use.

Do they even want to use it? There's nothing wrong with asking a few questions; you may find out that there's a better solution available that you hadn't considered or were even aware of. Change can be very scary and difficult for some individuals to handle; take that into account when proposing a new solution.

Maintenance and Support

How easily does it integrate with your existing system? Think of a square peg in a round hole. A hammer would get it in, but it would take a lot of work and would damage both the peg and the hole. While there may be no direct monetary cost for the software license, every minute you spend configuring, rewriting, tinkering, and fixing is a time cost.

Is it an officially released, mature product, or is it still in beta? If it's a mission critical application, then you don't want to use an incomplete or untested product.

How buggy is it? If the tool gets the job done, but only does it 3 times out of 10, then it's not not an effective tool.

Is the product the result of the work of a group, or an individual? This adds to the fragility of a product; if the sole developer is hit by a bus, then the project is also dead.

What kind of support is available? Sometimes, all you get is a 20 line text file in broken English. Other times, a complete Wiki and active forum or IRC communities can supplement the existing documentation.

Is the product still being actively developed? If there's a missing feature, who will add it? If you report a bug, who will fix it? It may have been great four years ago, but if nobody is working on it anymore, then you should seek other solutions.

Can anyone else in your organization maintain the new application, or are you the only one who knows how to keep it up to date? Once again, consider the hit-by-a-bus scenario. This isn't necessary a deal breaker if you keep good internal documentation.

Conclusion

Recently, I came back from a conference excited about Ruby on Rails, a free web application framework. I watched a manager (not a programmer!) create a feature complete forms-based front end to a database in about 20 minutes, and I was sold. I did the research, asked the questions, and it really does look like the best solution for some specific applications that we need to develop. Sometimes, the hot solution is popular for a reason. Just remember, while a great new product may excite you so much that you just about wet your knickers, take a deep breath, step back, and think it through.

Historical Note

In the 1978, approximately 913 followers of Jim Jones drank cyanide-laced grape Flavor Aid in a mass cult suicide.