Monthly Archive for June, 2007

Joe Says "Codpiece"

Joe Rinehart says that the codpiece is coming back. A huge proponent of genital decoration/protection, he managed to create a custom codpiece from his CFUNITED nametag. Truly an ingenious man. Next year we expect to see him sporting an authentic period 'piece.

Calling all Gaget (Specifically GPS) Geeks

I'm trying to find a GPS unit for myself, and am struggling. I figured since my blog has a fairly technical audience of varied backgrounds, there's probably a bunch of people out there reading who might offer some insight. Here are the specifics of what I'm looking for, in decreasing order of import:

  • detailed 4-space (lat, long, alt, time) logging. Ideally configurable down to the once-per-second level.
  • storage on removable media (like an SD card)
  • quick-acquisition and accurate chip
  • ability to do mapping/driving directions/POIs (standard "GPS unit" stuff)
  • internal, rechargeable battery
  • be a cell phone
  • motorcycle mountable for power and stability (requires left-handed buttons, and only useful if it does mapping/directions/POIs)
  • run JME (ideally with access to the GPS chip's serial port and removable media). This would theoretically alleviate the need for built-in logging, as I could write my own.
  • car mountable for power at least, and probably stability

As you can tell, I'm not really looking for something mainstream. I'm looking for something that'll give me huge amounts of data about my whereabouts, specifically when I'm on my bicycle or motorcycle. I've found a handful of units that would probably do what I want, but the specs are very vague, so it's hard to tell for sure.

If anyone has any ideas, thoughts, or comments, I'm all ears….

Another Flex Weirdness/Gotcha

Another little gotcha to watch out for with Flex.  If you have an ArrayCollection of Objects that are backing a DataGrid, you can add/remove objects from the ArrayCollection and the DataGrid will update.  However, updating properties on the objects doesn't seem to update the DataGrid until you force a redraw via some other means (e.g. resorting the rows).  In my particular case, the Objects in question were non-dynamic instances of a custom class that are [Bindable] at the class level.

This was unexpected to me, but on further reflection seemed quite explicable (though not necessarily reasonable).  It seems that individual DataGrid cells ought to be bound to the property they're fronting, rather than only the rows being bound to the Objects.  But with the way the internals of DataGrid work, the property selection is dynamic (using [] notation), which is unbindable directly.  You can avoid it with a bindable function, of course, but it seems DataGrid (at least in Flex 2.0.1) doesn't do that.

I'll probably dig into this some more (since I really don't want to have a zillion executeBindings() calls all over the app).  If anyone has any insight into this behaviour, I'd be quite interested to hear it.

List/ComboBox Row Backgrounds in Flex

All the listy components in Flex (List, Datagrid, Tree, etc.) have a protected method called drawRowBackground which is in charge of drawing the background for a given row. You typically use it to color a given row based on some facet of the data the row represents (e.g. red background for rows with a negative bank balance).

With DataGrid, it's easy to use, just subclass DataGrid and override the method, parameterized so you can pass in a function to compute the color for each row based on the row index/data/original color/etc. With List (and since ComboBox uses a List, ComboBox too), it's a bit nastier.

For some reason, List will only call drawRowBackground if the 'alternatingItemColors' style is set for the List. So if you want to color your List rows, you have to supply that style, which you'll likely immediately be overriding.

With ComboBox, you use a ClassFactory for the dropdownFactory to instruct it to use your custom List implementation (that will do row coloring). In this case, however, it's not the List instance that needs the 'alternatingItemColors' style, but the ComboBox. The ComboBox passes all it's style attributes to the List that backs the dropdown when it's created.

Just for reference, here is my subclass of List to allow row coloring. The one for DataGrid is identical, except for the name and the class it's extending:

package views {
  import mx.controls.List;
  import mx.collections.IList;
  import flash.display.Sprite;

  public class RowColoringList extends List {

    [Bindable]
    public var rowColoringFunction:Function;

    protected override function drawRowBackground(s:Sprite, rowIndex:int, y:Number, height:Number, color:uint, dataIndex:int):void {
      if (rowColoringFunction != null && IList(dataProvider).length > dataIndex) {
        color = rowColoringFunction(IList(dataProvider).getItemAt(dataIndex), dataIndex, color);
      }
      super.drawRowBackground(s, rowIndex, y, height, color, dataIndex);
    }

  }
}

My New Bike

Got my new bike yesterday and rode it to work this morning.  Whee!  Definitely needs some tuning (seat height, handlebar placement, dérailleur tension, etc.), but it's quite nice.  Integrated shifting alone is huge.  I'll get a pic some time and post it, but for now, it's all for me.  ;)

Las Vegas WTF

Saw this on The Daily WTF / Worse Than Failure: Crashing Las Vegas.  Good ol' Windows.

i'm gonna go wii

News came back last night, my schema management tool won the Wii and CFUNITED ticket in the Open Source CF contest. After holding my wii in for the past few weeks, it'll be nice to finally let it out.

MovableType goes Free / Open Source

MovableType has gone back to having a free version for personal use.  They're also going open source.  That's good news, as I really liked it back in the olden days.  WordPress has proven to be functional, but the architecture leaves something to be desired, and the full-runtime nature is good for authors but bad for developers.  As I'm starting to add new functionality to my site (and the various others I host), I've been wishing for some platform independence, and MT might provide that.

For those of you not familiar with it's internals, you write templates in MT's own language that are used to write files to disk.  Those files can be static (*.html/*.xml), or dynamic (*.cfm/*.php/*.jsp).  This affords remarkable flexibility in developing MT-based applications, as you can have a two-pass structure for page rendering.  You also get caching of your blog-based content, as all the transformation/linking/looping over the blog content happens at template render time, not at runtime.

I can't say I'm enthused about Perl (which would be necessary for developing admin plugins), but most of my interests lie on the outside, so we'll see if that's a showstopper.  Not that I'm enthused about PHP today.  ;)

Interesting @task Edition Breakdown

The operational support team where I work uses a product called @task for trouble tickets, and I'm currently build some Subversion/Trac integration pieces so that we can keep everything in sync between us (the developers) and them.  I saw they have a SOAP interface for the product, but made an interesting discovery: it's only available as part of the Enterprise edition of the software.  That's not totally irrational on it's own, but what I found a bit strange is that both Professional and Enterprise editions expose an EJB (yeah, Enterprise Java Beans) interface.  It doesn't matter a whole lot, and I honestly prefer an SSB EJB interface over a SOAP one, since I'm building the client in Java anyway (with Spring, of course), but I thought it was interesting.

Dumbass Alert

Please ignore my previous post about per-post uploads not working on Firefox. As I was lying in bed, bemoaning my plight to Heather, I realized exactly what the problem was. Adblock. I had a filter defined for "*ad.php*", which just happens to match "upload.php". Changed it to match "*[^o]ad.php*" and it works like a charm. Much happier now. ; )