Tuesday, November 06, 2007

Open Source Project Management

Do's and Don't

Use Open Source Judiciously

We all know the benefits of using open source, but what are the pitfalls? If you have been asked to build a professional, production-ready, mission-critical, customer-facing application, you probably don't want to go bleeding edge.

You need to ask yourself if the project is ready for prime-time. Don't be fooled by a glossy, over-hyped project page. Dig deep. Find out
how many people are really using the project. Look at the mailing list archives. Is it active enough? Is is full of unanswered questions? Check out the source from subversion. Review the check-in history. If time permits, read the code.

For short-timeframe, mission-critical projects, I use what I call The Book Test. Any project for which an O'Reilly book has been written has been vetted and tested to my satisfaction. If three or more books on the subject have been written and are available from your local bookstore, you can bet that the technology is ubiquitous. Tried and true open source projects include Linux, Apache web server, Python, PHP, and Ruby. This litmus test will eliminate a majority of the projects you find on source forge, so this shouldn't be your only test. But it's a good place to start.

Saturday, November 03, 2007

Wireless Problems Upgrading Ubuntu to Gutsy

I ran into trouble this week while installing Ubuntu Gutsy on some older hardware for my five year old son Kadin. He'd been using a prism2 based wireless card with success under older releases of Ubuntu for over a year, so I knew that the card was supported. But after completing the fresh install, network manager couldn't find my home network.

Matt Hartley suggested that the problem was with Network Manager in this post, but I followed his recipe, winstalling wicd as a replacement, and it didn't help my situation. Wicd had the same problems detecting my home network.

ifconfig reported two interfaces for my wireless card---wifi0 and wlan0. Some suggested blacklisting hostap_pci (and others) to remove conflicting drivers which might be confusing network manager. The best suggestion I found early on---which didn't work for me at the time---was to install the linux-wlan-ng package. This was the right thing to do (the needed prism2 driver is installed), but unfortunately, this didn't work either. Perhaps some additional configuration was needed?

Since, according to some, the real problem was with Network Manager, and since it was working well for us under Feisty, I decided to pin back those packages using apt.

I added the following to /etc/apt/preferences:

Package: *
Pin: release a=gutsy
Pin-Priority: 700

Package: network-manager
Pin: release a=feisty
Pin-Priority: 800

Package: network-manager-gnome
Pin: release a=feisty
Pin-Priority: 800

Then I duped all of the repository entries in /etc/apt/sources.list and changed each "gutsy" to "feisty" so that apt can find modules in both repositories. Then I ran:

sudo apt-get install network-manager network-manager-gnome

This successfully downgraded and pinned the two Network Manager packages to the versions that are available in Feisty Fawn.

I was really pleased that the downgrade went so smoothly, as I've gotten trapped in dependency hell attempting similar feats in the past. Sadly, though, my problem remained! Perhaps Network Manager was not at fault after all.

linux-wlan-ng seemed to be the right solution for my card, so I decided to build from source from the trunk.

svn co svn://svn.shaftnet.org/linux-wlan-ng/trunk

Then I built and installed it and followed the directions in the README to setup, which included setting values in /etc/wlan/wlan.conf. I added my home network's SSID and changed the following entry:

# for some reason, this value was set to N --- seemed wrong to me

I also added the suggested values to /etc/rc.local (for modprobing the correct driver---prism2_pci in my case).

I remembered seeing wlan0 aliases under /etc/modprobe.d, so I grepped for matches and found this file:

The contents are shown below. The "alias wlan0 prism2_pci" line was commented so I removed the comment.

# Aliases to tell insmod/modprobe which module to use when bringing up the
# wlan0 interface.

# Uncomment the line corresponding to the type of prism2 device you have.
alias wlan0 prism2_pci
#alias wlan0 prism2_usb
#alias wlan0 prism2_cs
#alias wlan0 prism2_plx

# this allows network manager to manipulate the device
options p80211 wlan_wext_write=1

I rebooted and network manager was able to find my home network, as well as a number of my neighbors wireless network. In hindsight, I wonder if, after installing linux-wlan-ng as a package, I had just removed the comment from this file and WLAN_SCAN=Y, my troubles would have washed away? If you are having similar problems, I would try that first before compiling the latest driver from source.

Thursday, November 01, 2007

I posted a question to the Wicket users group a few days ago on how to best deal with frames, in particular how to pass arguments between a tree view in one frame and a list view in another. I didn't get any takers.

I finally determined that there was no good way other than to use plain-old javascript to push values from the tree up to the parent frame, where they are dispersed to the other frames.

I wanted to use LinkTree, but really didn't need most of the features other than the look and feel. I just needed to be able to insert an onclick link that would pass a value to my parent frame.

After a lot of digging I came up with a solution that worked, but seems verbose for the job I'm attempting. My question for the reader is this: Can you propose a more concise solution?

public class CategoryTree extends LinkTree
protected Component newNodeComponent(String id, IModel model)
return new LinkIconPanel(id, model, CategoryTree.this)
private static final long serialVersionUID = 1L;

protected void onNodeLinkClicked(TreeNode node, BaseTree tree, AjaxRequestTarget target)
super.onNodeLinkClicked(node, tree, target);
CategoryTree.this.onNodeLinkClicked(node, tree, target);

protected Component newContentComponent(String componentId, BaseTree tree, IModel model)
Label l = new Label(componentId, model)
private static final long serialVersionUID = 1L;

protected void onComponentTag(ComponentTag tag)
tag.put("onclick", "parent.notifyViews(this.getAttribute('catalogid'))");


DefaultMutableTreeNode n = (DefaultMutableTreeNode)model.getObject();

if (n.getUserObject() instanceof EcCategoryTreeNode)
EcCategoryTreeNode ec = (EcCategoryTreeNode)n.getUserObject();
l.add(new SimpleAttributeModifier("catalogid", "" + ec.getId()));

return l;

public CategoryTree(String s, TreeModel tm)