[Header Picture]

# Site Updates!

Notice anything different about the site? No? Good.

I spent some time today tweaking a bunch of things about the site. The biggest thing is that I stepped out of the year 2003 and brought my site up to standards. It's now 100% valid XHTML 1.1 Strict. What does this mean for you? Probably nothing.

If you use a non-gecko browser nothing should change. The site still gets served up with plain old text/html mimetypes everywhere. However if you use a Gecko based browser- such as SeaMonkey, Camino, or Firefox- you'll be served application/xhtml+xml goodness. The good part is that rendering will be faster for you lucky people, since it doesn't have to use the TagSoup renderer. The bad part is that if I fuck up and use broken XML in one of my entries you'll get an error page. Such is the price we pay for the bleeding edge, I guess.

(Don't worry, I won't intentionally fuck up.)

Ok, so there is one minor visible change. I've placed anchor links next to each story so you can click them and put that headline at the top of your browser. I really don't have any better legitimate use for that, however. But if you like playing with pointless stuff, click the hash marks to the left of a story title to get the anchor for a story.

posted at: 2006 Jun 24 01:37 UTC | category: tech | (story link)

# Code snippit: Inserting Drupal entries

I recently helped a friend import 9 years worth of content into a Drupal system. The documentation for Drupal sucks, so for the benefit of anyone else needing to do the same thing, here's some valuable information on how to import nodes into a Drupal system.

The SQL below will insert whatever content you need into a standard node. It will create term entries so you can use the standard Drupal category listings. It's also a good base to start from if you're trying to use flexinodes or whatever else you need to use.

You're left on your own for finding free NIDs. There's a sequence you can query and store in a variable, or you can do what I did and generate a list of NIDs that were in use at once time but had been deleted for one reason or another.

This information was figured out through no help of anyone related to Drupal. I found the Drupal documentation to be less than worthless. I also found #drupal-support on Freenode to be completely worthless, as well. The only way I was able to figure out exactly which tables to add entries to was by doing a mysql dump of the db, and searching for existing node ids.

(And don't get me started on their DB. Mysql and a DB with no referential integrity. Would a few REFERENCES statements in their DB schema be such a bad thing?)

Term Definition Term Definition
uid User ID nid Node ID
changed A unix timestamp representing the time you uploaded the entry created A unix timestamp representing the time the entry was created
title The Entry's title body The content for the entry
gid The Group ID for the entry (For permissions) tid The Term (or category) ID for the entry
DELETE FROM history WHERE nid = %(nid)s;
INSERT INTO history
        (uid, nid, timestamp)
VALUES
        (%(uid), %(nid)s, %(changed)s);
INSERT INTO node
        (nid, type, title, uid, status, created, changed, comment, promote,
        moderate, teaser, body, sticky, format)
VALUES
        (%(nid)s, 'blog', '%(title)s', 1, 1, %(created)s, %(changed)s, 2, 0, 0,
        '%(body)s', '%(body)s', 0, 3);
DELETE FROM node_access WHERE nid = %(nid)s;
INSERT INTO node_access
        (nid, gid, realm, grant_view, grant_update, grant_delete)
VALUES
        (%(nid)s, %(gid)s, 'term_access', 1, 0, 0);
DELETE FROM node_comment_statistics WHERE nid = %(nid)s;
INSERT INTO node_comment_statistics
        (nid, last_comment_timestamp, last_comment_name, last_comment_uid,
        comment_count)
VALUES
        (%(nid)s, %(changed)s, NULL, 1, 0);
DELETE FROM term_node WHERE nid = %(nid)s;
INSERT INTO term_node
        (nid, tid)
VALUES  
        (%(nid)s, %(tid)s);

posted at: 2006 Jun 09 01:37 UTC | category: tech | (story link)

# This Week's Moment of Zen

From a post I made to hates-software:

Date: Wed, 31 May 2006 18:28:25 -0700
From: "Aaron J. Grier"
To: hates-software
Subject: Re: sendmail, user catchalls, and other MTA hate

On Wed, May 31, 2006 at 08:11:37AM +0200, Juerd wrote:
> How hateful does your software have to be?

if you can't hate it, is it still software?

posted at: 2006 Jun 01 01:37 UTC | category: tech | (story link)

# Picasa Sucks Ass

So I've been scanning in old negatives from the family "archives" lately. It fits in well at work, since I can spend 2 minutes loading new negatives and let it do its thing for 45 minutes. Forced breaks, and all that.

So I have some 450 scans so far, I need to start organizing, rotating, etc. Since I'm doing this at work on a windows machine, I decide to give Picasa a go. Big mistake.

First, Picasa doesn't actually rotate the images on disk. I don't know where it stores the rotated images, but it's not in the original directory. This means that I spent 30 minutes rotating images for nothing. Joy.

Second, and more hateful, it pops up status messages in the lower-right corner of the screen. Messages you can't get rid of. For example, I exported some 250 pictures from picasa (which, btw, you can only export in jpeg format) and the entire time there was a status message in the lower right corner. Worse, even though they provide a close button, IT DOESN'T FUCKING WORK. It'd go away, and then come back with the next status update.

It's the same story when scanning images in. Every time a new image appears in the directory, Picasa pops up a status message. You can't get it to not do this. HATE.

If this is what Google passes off as desktop software then I pray they never take on Microsoft head to head. They may be search gods, but they have a long way to go before they're usability gods, or even usability novices.

posted at: 2006 May 30 01:37 UTC | category: tech | (story link)

# Web Interfaces, Continuations, and AJAX

This started as a comment to Simon Brocklehursts post on Web Interfaces. When I started on my 4th paragraph I decided that it was better off as a blog post than a long missive on Simon's blog.

So go read his post and then come back here, and pretend that I'm commenting there. Go ahead, I'll wait. :)

Hear hear! I've long explained to people that I use vi because it's easy to use, although not easy to learn. The pain I went through to learn vi has been repaid thousands of times over in how easy to use it is ONCE you've learned it. This statement inevitably causes confusion among those who don't know vi, and I find myself spending 10,000 words to explain this to them. Now I can just point them to Simon's post.

I find myself using AJAX at work to enable the kinds of rich GUI interfaces Simon writes about. The easily understood example is an imitation of OSX live searching. Present the user a table and a search field, and as the user types the table is filtered in real time. It's a simple thing, but my users love it.

A better example is the HR/Resume system I'm working on for work. To add or change an employee's entry and/or resume, you use the same page, which is a form page for entry. You can either use the drop-down to select an employee, or start typing a name into the name field. As soon as a unique match is found (based on their username) the form automatically fills in based on what's in the database. This is similar to the Access application I'll be replacing with this. Now, I'm not holding Access up as a paragon of good design, but at least for our company and clients the interface is known and is easier to use (as opposed to learn) than your average web application, despite how it makes programmers cringe.

I then use Javascript to keep track of which fields have changed, and submit only that information which has changed. This increases the responsiveness of the application, as the user doesn't have to submit large amounts of data via the ADSL connection they're likely using. I'd never use this in an application for the Internet, but when I can specify that only certain browsers are supported this sort of thing is possible.

So far I only have one user actually using the system (Our HR person) but she likes it so far, and is typical of an average user. She's the same user that had trouble figuring out our 3rd party timecard system, so I figure I've done something right.

AJAX as I'm using it doesn't break bookmarkability, and doesn't break the back button, it simply adds the rich GUI elements that make my webapps easier to use. IMHO, this is the future of webapps, somewhere between the extremely simple apps Tim advocates and the Rich AJAX apps others advocate.

I also have to point out a flaw in Tim Bray's parenthetical comment on Simon's post. Tim Says:

but Simon, a good browser should pre-fill forms for you and get it right almost all the time; Safari does

Tim is taking a narrow view here. Safari's autofill gets it right most of the time, but that's only a subset of when web apps are used. It ignores the common case of webapps used inside of companies. For example, you wouldn't want your web browser to autofill a bugzilla form. In fact, I can think of very few webapps outside the Internet where you actually want your browser to autofill.

posted at: 2006 May 21 01:37 UTC | category: tech | (story link)

# Commands output from the VWCDPIC

Ok, this is not something that you probably care about, but I'm putting it here for convienence and in the hope that someone else will find it useful someday. This is the protocol that the vwcdpic uses to control remote devices such as your carputer. It's only useful if you're writing your own interface.

VWCDPIC2.7d	# Power Applied
RING
MDISABLE
MENABLE
MENABLE

LIST1		# 1
MINQUIRY

LIST2		# 2
MINQUIRY

LIST3		# 3
MINQUIRY

LIST4		# 4
MINQUIRY

LIST5		# 5
MINQUIRY

LIST6		# 6
MINQUIRY

RANDOM		# MIX (Toggles MIX display)

NEXT		# SEEK UP

PREVIOUS	# SEEK DOWN

NXT_LIST	# Hold SEEK UP
MENABLE		# Sent after release

PRV_LIST	# Hold SEEK DOWN
MENABLE		# Sent after release

PLAY		# Pres in on tuning knob (Toggles SCAN display)
 

posted at: 2006 Apr 19 01:37 UTC | category: tech | (story link)

# So tell me, should I test my circuit before applying power?

Apparently not. I mean, that's only $10 in components and an hour of my time down the drain.

[Fried Circuit Board]

I'm starting to see the wisdom of living with seperate components rather than something you can hide in the case of your carputer.

posted at: 2006 Apr 19 01:37 UTC | category: tech | (story link)

# Not as much of a failure as I thought

Well, I'm not as much of a failure as I thought. After a gentle "Use the right firmware, dummy" message from Ed, my vwcdpic works now. Awesome.

Next step: Build the compact version and write some control software for my carputer. Oh shit, this means I need to actually work on my carputer now.

posted at: 2006 Apr 18 01:37 UTC | category: tech | (story link)

# I'm a failure as a geek

So it seems that my hardware hacking skills aren't up to snuff like I thought they were. First I can't get my TNC-X to work after building it, now I can't get something as simple as the vwcdpic working.

It should be pretty simple. Build this adaptor, flash your hoodmicro with this code, and then plug it into the changer cable in the trunk. When I do this, all I get is "No CD." Hopefully I can get some help with this on the k9spud forum.

posted at: 2006 Apr 18 01:37 UTC | category: tech | (story link)

# Beautiful Soup: Turning tag soup into structured data

So a friend of mine has been trying to get her various writings collected into the same place. She has a LJ, a couple personal sites, and now a drupal site.

One of her personal sites has journal like entries going back to 1997. She'd like them to be imported into her drupal site. Unfortunately they are in hand-written HTML. Fortunately they're all pretty well formatted.

Beautiful Soup to the rescue! Using this I was able to screenscrape her site and pull out all the syntactic goodness I needed to get entry dates, titles and text. I have it working great now for 2006. Now I just have to massage it until the rest of the years work, which shouldn't be too hard.

YAY FOR TOOLS THAT MAKE SCREENSCRAPING EASY AND FUN!

posted at: 2006 Apr 14 01:37 UTC | category: tech | (story link)

<--  Page 3 of 4  -->


Copyright © 2006-2008 Zach White