I’ve been using the great CCK module on a bunch of projects (including this blog, for my bikelog). It’s really cool in that it lets you construct custom content types within the Drupal admin interface, without having to touch any PHP code. It’s like having your own personal microformat manager – it could handle things like compound content on a web page (and generate the editing form so you just fill in the blanks – abstract, body, url for more info, email contact, etc…) and I think it could even handle something like a simplified LOM for a “learning object repository”.
One thing I wanted to do on my bikelog was to automatically calculate average speed. I have fields for “duration” and “distance” so entering a value for “average speed” is redundant. Better to just derive the value from the known values already entered.
Which is where the really cool Computed Field module comes in. It’s a contributed module for CCK, and lets you do all kinds of funky things by writing PHP code to perform operations to generate the value of a field. These operations can include calculations on the other fields, or even more complicated things like, I suppose, performing a lookup on wikipedia or something…
After adding the Computed Field module, I just edited my “bikeride” CCK content type to add a new “computed” field called “average speed”. It’s got a “computed code” value, which is executed whenever a value needs to be derived. I just used this:
$node_field[0]['value'] = ($node->field_distance[0]['value'] / $node->field_duration[0]['value']) * 60;
I gave it a data type of “float”, a length of “10,2″ and a default value of 0. I told the module to store the value in the database, so I can use the computed field with Views.module as well (in this case, it performs the computation on edit, and stores the result in a field just as any other CCK field would do). I also flagged the field as being sortable, in case that helped Views.module at all.
The end result is a tiny bit of work entering a simple PHP calculation, and then the module takes over the monotonous and redundant calculation work. All I do is enter the base data, and it can derive the rest from that.
I’d imagine this type of derived field could be really useful in an event manager – looking up the number of registrations and updating an “available seats” field, for instance. Or, in a store or inventory system to calculate prices and stock counts. It’s a really cool addition, and although the setup interface (manually entering PHP code) isn’t something you’d unleash on a noob, it’s simple enough to set up and forget about.
I got tagged, so here goes…
- Music that changed my life
- Beatles' Red and Blue albums. The first vinyl I owned. Still have them somewhere.
- The Police: Synchronicity. First cassette I ever owned. Who is Miss Gradenko, anyway?
- Music I can listen to on repeat – this comes from my iTunes most-played playlist
- The Police: Synchronicity (still!)
- The Tragically Hip – Day For Night
- Black Eyed Peas – Elephunk
- Smashing Pumpkins – Melon Collie and the Infinite Sadness
- Moby – Play
- Bob Marley & The Wailers – Legend
- Nirvana – In Utero
- Weezer – Green Album
- Battlestar Galactica soundtrack (seriously – it's really good)
- Billy Talent
- An album I'd take to a deserted island – album? really? I'd have to take my iPod, fully loaded with CBC Radio 3 .
- Music that makes me smile
- Bedouin Soundclash
- Bob Marley & The Wailers
- Mel Blanc – D.O.G. Spells Dog
- Pointer Sisters – Pinball Number Count (Songs from the Street). 123 FOUR FIVE 678 NINE TEN. ELEVEN TWELVE.
- Music that makes me cry
- cry? really? music doesn't make me cry. next track.
- Music that I wish had been made
- not sure. what an obscure question. what kind of tree would I be?
- Music that I wish hadn't been made
- Hanson. Mmmmblech.
- NKOTB. Baby Jebus cried.
- Music I'm currently into
- New Pornographers
- Broken Social Scene
- Bedouin Soundclash
- The White Stripes
- Weezer
- Wynton Marsalis
- Miles Davis
- Music I've been meaning to explore
- More Canadian indy bands (getting more of this, thanks to CBC Radio 3)
- More non-touristy Caribbean music
- Tag
- Joshua Archer
- Paul Pival
- Stephen Downes
- Sami Khan
- Brian Lamb
I wasn't going to tag anyone, but screw banality – it's summer.
I've been using an OmniOutliner document to track tasks and hopefully prevent things from slipping through the cracks. It works quite well, especially when combined with kGTD to help prioritize and filter tasks as they start to pile up, but it's limited to a file on one computer. So, I can't easily add stuff from my Powerbook at home. And I can't access it when I'm not sitting in front of my G5. Sure, I can sync the file, and export it to the web, and print it, and sync it to my iPod, and to iCal, etc… but that's a pain, and not bulletproof.
I was doing some Googling for other "getting things done" packages, and found a reference to Tracks. It's a Ruby on Rails app that provides the streamlined context/project interface on top of a plain to-do list. So, I threw a copy of it on my Dreamhost server (it's got all of these bells and whistles just sitting idle, which would be a shame). It Just Worked™. I had to refer to the Dreamhost wiki to see how to best set up a Rails app to be served by Apache, but that was pretty darned easy.
The hardest part of the whole install was figuring htf to create an account – open the "signup" url, and you're good to go.
Performance is a bit lacking, but the entire network is feeling slowish today. It's not fatally slow, anyway. I've added in most of my current projects, and it's already helped me to see at a glance what's the most important set of tasks to be working on.
And it's the first non-Drupal tool I've installed in a while, which is a welcome change
Tracks – Getting Things Done in Rails
Update: Bonus. Now I’ve got multiple RSS feeds to keep me up to date on upcoming important tasks and deadlines…
King’s in SF for WWDC2006, and just posted a quick note about the shirt/bag combo. Looks like a really sweet black T-Shirt with “veni. vidi. codi” on the front. Very cool.
King also linked to someone’s sneakypic of the banner on the second floor of Moscone West – someone must have neglected to cover it up with black fabric.
If I’m reading it properly (through a window girder), it says “Introducing Vista 2.0″ with a closeup of the MacOSX 10.5 install DVD. That sounds like one hell of a warning shot. Wonder what’s going to be announced tomorrow…
I basically talked my way out of going to WWDC this year. Between my rather hectic travel schedule in 2005, and wanting to stay close to home this year, and wanting to better share the limited travel resources of the Teaching & Learning Centre. I didn’t think I’d really miss it this year, but damn. I’m jealous. This is going to be one hell of a show.
And, to top it off, Monday’s a holiday here, so I’ll be occupied in the yard building an arbor, rather than glued to the various news feeds coming out of Moscone West. Stupid holidays!
I tried to take some time yesterday to distill the patent into plain english. Michael Feldstein did a much better job than I did, which should make it really easy to find relevant and defensible bits of prior art. Of course, the fun part will be finding prior art that hasn’t been purchased by Blackboard…
I’ve been biting my tongue on this whole Blackboard-patents-the-LMS brouhaha that’s going around. I did add my 2 cents to the Wikipedia VLE Prior Art page, with a link to one of the two LMSes I’ve been involved in building before Blackboard applied for this patent.
What follows is a largely stream-of-consciousness rant about some of the issues involved.
I find it completely unfathomable that such a basic and well established classification of software could be summarily handed to a single company. I’m planning on taking some time to actually read the patent, to see if it’s as general as everyone says, or is it really (hopefully) a vaguely worded description of their particular implementation. A cursory glance at it suggests that they’ve managed to throw in utilities ranging from online storage of user data, to storing files on a server…
However, the greater problem isn’t this particular case, but rather the more general issue of software patents as a whole. These intentionally vaguely worded litigation factories only benefit one group of people – shareholders in the patent holding company.
Here’s what’s driving the whole patent engine – public companies are held legally responsible to maximize profit for their shareholders. To the extent that if they fail to generate profit (or acceptably sufficient profit) they can be sued by shareholders. The board of directors is liable. Which drives public companies to squeeze every possible gram of cash out of any possible revenue stream. If they failed to get the patent for a product, and someone else managed to get it – and then came after the company – shareholders would be pissed. So, software patents are conceptually an arms race. Companies are filing patent applications for anything they can think of in order to both protect themselves from others doing the same thing, and to maximize profit by handing the patent to their lawyers and owning a market segment as a result.
But – the patent office should be acting as a filter, preventing these blatant patent grabs as being invalid before getting rubber-stamped. If the patent office can’t properly vet applications, the office should be closed as ineffective or worse.
If Blackboard wants to recoup some karma, they should sign the patent(s) over to an impartial body, ensuring that the patent is used only as a first strike protection to prevent evildoers from obtaining said patent and obliterating an entire marketplace.
So… Who’s the best candidate to be handed the patent? IMS? IEEE? Creative Commons? UN?