echo "hey, it works" > /dev/null

just enough to be dangerous

Retrieving rows by columns equal to NULL in SQLite


In SQLite you can't retrieve a row by testing the equality of a column with NULL.

This doesn't do what you think.

SELECT * from table WHERE column = NULL;

You need to use IS NULL.

SELECT * from table WHERE column IS NULL;

Happy now.

The lazy web for the rich and famous


Well, at least for the famous. I'm jealous of people like Tim Bray, who can say, "Hey, lazy web, where can I buy a hard disk for the Mac?" or "What kind of storage server would you recommend?" and people come flooding back with a whole lot of advice. The more famous you get the more help you get, which makes perfect sense, but is a perfect pain in the butt for minnow me. My recent tweets for help have yielded not a single response.

Using JQuery with Camping


Camping is great, yeah. JQuery too. Maybe you want to use them together? Here's how.

First, you need to set up a route for your JQuery. I've talked about sending static files with Camping before, so this is just a modification of that. [You can serve static files more sensibly than setting up a route for each type. Maybe one day I'll write about that.]

In your controller:

module MyApp::Controllers class Index < R '/' def get render :index end end class JQuery < R '/resources/jquery.js' def get currentdir = File.expandpath(File.dirname(FILE)) @headers['Content-Type'] = "text/javascript" @headers['X-Sendfile'] = "#{current_dir}/resources/jquery.js" end end end

Now you have to get the JQuery library in your view.
module MyApp::Views def layout html do head do title 'Using JQuery in Camping' end body { self << yield } end end def index script :src => R(JQuery), :type => 'text/javascript' script do ' $(document).ready(function() { alert("Hello world!"); }); ' end end end

The call to the R function creates the URL for the JQuery library. Now you can embed any JQuery yumminess that you want, right there in your view.

Did Lonely Planet err in selling to the BBC?


One of the stated reasons for the Lonely Planet sale to the BBC earlier this year was to expand the "digital" aspect of the business, an area where they had so far failed to leverage their reputation. For digital we really have to read online. After all, the Thorn Tree is great, but it's really just a forum. The recent story about technology issues at the BBC (via) make one question whether it was the right partner for online innovation.

Here's Tony and Maureen Wheeler talking about the sale.

Mzingi 0.2 for Habari


Michael Bishop (aka miklb) over at Blogging Meta has released a new version of the Mzingi theme for Habari. I used Mzingi as a reference when I was porting the WordPress Connections theme to Habari, trying to figure out how Habari themes work. It's a really nice theme. Kudos to Michael for all his great work with Habari.

Google Press Center: Press Release


Google today announced a new strategic initiative to develop electricity from renewable energy sources that will be cheaper than electricity produced from coal. The newly created initiative, known as RE<C, will focus initially on advanced solar thermal power, wind power technologies, enhanced geothermal systems and other potential breakthrough technologies.

I think in the long term we need to move away from the idea of monolithic power stations providing all of our electrical needs. The future will be a system that allows for many inputs to the system. People will complement the electrical out points they have now with in points, so that you can plug in your solar panels, windmills, pet rats on a wheel, or your kids tied to the Hill's Hoist, and feed power back into the grid.

Posts with no category


Now that WordPress comes with tag support, you might have posts that you only want tagged and not categorised. To set that up in the Connections theme, you'll need to set up a category that you don't want displayed (I used 'Uncategorised' and no, I don't live in America, thank you), and edit post.php.

If you enabled tags by following my instructions for enabling tags in Connections, you'll have some code like this:

Posted by under

The call to the function thecategory() outputs a link to the category page for each category under which your post is filed. To output categories conditionally you don't want to output them directly, so you need to use the getthe_category function, which returns an array of category objects. I'll ignore the fact that the function calls should really be plural. Replace the code above with the following code.

Posted by cat_name == 'Uncategorised')) { echo " under"; $category_url = get_option('siteurl') . '/category/'; foreach ($categories as $category) { echo " category_nicename}\">"; echo "{$category->cat_name}"; } } the_tags(' tagged ', ', ', ''); edit_post_link(' (edit)'); ?>

Unless there's only one category and it's the one you don't want to display, you want to output the categories. Basically, you need to manually build what thecategory builds automatically. Again, I'll ignore the terrible category method naming, some cat others category_.

Android criticisms


Tim Bray points to an interesting and detailed criticism of Google's Android. I don't pretend to grok the mobile landscape, but I do know that the mobile user experience sucks, and sucks needlessly. I've never bothered trying to develop anything for mobile platforms because none of it has ever looked remotely developer friendly.