Monthly Archive for June, 2007

Help Me: Per-Post Uploads in Firefox on Linux

WordPress has the ability to upload files directly on the add/edit post/page form, which is really handy.  However, I can't get it to work with FireFox on Linux (2.0.0.2 and CentOS 4, respectively); the section of the form just doesn't show up.  The IFRAME that houses it is in the page, but it's zero-height for some reason.

Uploading works happily with FireFox on Windows (multiple machines), as well as with Mozilla SeaMonkey on Linux (the very same CentOS 4 box).  If anyone out there has seen this and knows of a solution, I'd love to hear it.

Between Posts Plugin for WordPress

I wrote a little WordPress plugin for managing content between posts on listing pages.  Since those listings are time based, the "between" space is governed by the date range between the posts above and below it.  The actual impetus for it was to inject a history of my bike rides into my blog, without them being actual entries (and therefore included in feeds).  If you scroll down a bit, you can see an example.

The files are available for download, should you wish to use them.   Since there isn't a native hook for "between posts", I had to create my own.  Consequently, installation is more than just drop in the plugin and activate.  Inside 'between-post-registry.php' there is an example of the code that needs to be added to your display template(s) with The Loop that renders entries.  Once that's set up, you can add as many other between post plugins as you want, and they'll all be executed for each "between".  Included are two examples: a very simple test that just outputs the date range, and the bike ride plugin I'm currently using.  The latter has a database dependency and is really only there as a more complex example, not as something directly useful.

If anyone's interested in the bicycle database schema, I'd be happy to share, just leave a comment.

The Woes of Flex

I've been working on a big Flex project for a while now, and boy is it a pain. I have to give Adobe credit for making straightforward quite simple (linked DataGrids with drag'n'drop selection is a snap), but once you get past the basics of the framework, it gets cumbersome quickly. Flex 3 (now that it's public - though still beta) promises to alleviate a number of the nagging problems, but from what I've experienced over the past few months, HTML-based UIs are faster to develop, are easier to maintain, and enormously easier to control the presentation of.

In particular, styling a Flex app is a joke. CSS stands for Cascading StyleSheets, but Flex has no cascade. You can't do contextual selectors. You can't have multiple class selectors on an element. And you can't even use existing CSS tooling, because all the style names are different (e.g. fontFamily instead of font-family). Very frustrating.

Flash does provide some nice things, like automated history management, and very straightforward use of view stacks (to use the Flex term). Not having to think about plumbing those is definitely nice, as they're cumbersome to get right. But by the time I got to wishing that AxisRenderer actually had a decent API for extending it's behaviour (instead of a pile of private helper methods), or DataGrid supported 'colspan' (which it does in Flex 3 via AdvancedDataGrid), etc., the benefits are a bit overshadowed. And that's even before considering the fact that a huge amount of base plumbing for HTML-based apps is available from various toolkits (just as it is for Flex).

Hopefully we can get things squared away to use Flex 3 for the project, as that'll ease a lot of headaches. Because I don't know how much more suffering I can take.

Riding My Bike

No, not my motorcycle, an actual bicycle. With the move last month, I'm now just shy of 10 miles from the office, which is a far more reasonable bicycle commute than the 20+ I was before. Not to say that 20 miles is an incredibly long ride, but more than I'd want to do for a one-way commute. 10 is a lot more reasonable.

My dad graciously donated his old touring bike to the cause, and boy and I out of shape. I've never been a particularly strong person, but I've always been able to exert to my limits and sustain it. Not anymore. Covering the 10 miles is no big deal, but the number of times I have to remind myself to take it easy is annoying. But that'll come down as I get back into it. Fortunately it's cooled down for the past couple weeks after. We'll see how it goes when it gets hot again.

So far, no real muscle aches or anything, which is nice. Definitely can tell I've been working, but I'm still able to bound up the stairs without issue. Sitting at my desk all day has led to some stiffness, but it's not too bad. Need to start doing a better job of stretching and such after riding to help the muscles "clean up".

Most exciting news of all is that I'm getting a new bike next week. Dad's is a solid bike, but after riding it a while, I wanted to change a few things to suit me better. After talking to the guy at the bike shop, it wasn't going to be significantly more to just get a new one compared with upgrading. And while newer isn't always better, getting a fresh set of everything will certainly reduce the amount of maintenance and upkeep required for a while.

With me an my penchant for info porn, I've been logging all kinds of relevant data about rides. Expect to see pretty visual displays of that data with the next "whenever I feel like it" or so. Might even have to break out CFCHART with the public consumption requirement, rather than my usual SVG charts.

CF8 Bug Fixed

I have to give some props to the Adobe CF team.  Yesterday I reported a bug in CF8 via the Adobe bug report/feature request form.  In a nutshell:

There is a change in behaviour between CF6/7 and CF8 with CFQUERY's NAME attribute.  The earlier versions allow the empty string to be passed, but CF8 didn't (it raises an exception).  The documentation (for all versions) states that the value must begin with a letter and that the attribute is required.  Clearly the latter statement is false.  The former could be interpreted to imply that the empty string is invalid, depending on whether you consider the empty string to have a beginning character.  My complaint wasn't with the docs however, just the break in backwards compatibility.

Within a few minutes of submission I'd received a emails from Tim Buntel and Damon Cooper to get clarifications and example code.  Today, via the forum thread they requested I start, Tom Jordahl said the bug will be fixed.  So bravo for the remarkable responsiveness; I have to admit I wasn't really expecting a fix in the CF8 series, let alone almost immediately.

i wanna go wii, part three (FuzzyDates)

After a couple hours of packaging, I really need to go wii, so I threw one more little bit of code at Ben’s CFUNITED/Wii contest. This time it's a fuzzy date library with two UDFs: fuzzyDateFormat, and fuzzyTimespanFormat.  They do about what you'd expect (thing GMail's timestamp formatting or Trac's age formatting), and I use them all over the place in various apps.  Their functionality seems trivial or even undesirable (intentionally NOT formatting dates consistently?!?), but they lend a certain "softness" to often terse software that inexplicably goes a long way towards easing users' minds.  The submitted build is available here, as well as on Ben’s site (post-contest).

i wanna go wii, part two (SchemaTool)

I've been using a little schema management tool for a while now, and thought I'd release it into the wild.  And I just submitted it to Ben's CFUNITED/Wii contest. The submitted build is available here, as well as on Ben's site (post-contest).

In a nutshell, the tool provides a home for storing all your schema migrations in a reusable and managed location.  Then it takes care of updating any schema it gets deployed against automatically.  This keeps your schema definition in code, so you're assured that your DB changes are always released at exactly the same time your code is released.  If you've got a lot of environments (home, work, laptop, production, etc.), it can save a lot of time, because the database is just always right.

i wanna go wii, part one (TransactionAdvice)

I relicensed my ColdSpring AOP transaction advice under the ASL and just submitted it to Ben's CFUNITED/Wii contest. The submitted build (with no significant changes aside from licensing) is available here, as well as on Ben's site (post-contest).