As an addendum to yesterday’s little writeup on data-driven design, here’s another little (perl) trick I’m particularly fond of, that relies on storing perl code as a hash element. The cool thing about this approach is that you can actually have a configuration file written in, say, XML, that can then reference procedures which are actually defined in the configuration along with the rest of the parameters — allowing you to abstract it away from the core application 100%.
Latest Entries »
One of the main paradigms I’m interested in working with when writing new bits of code is the concept of ‘data driven’ logic. On the surface this seems simple enough, but for the uninitiated the premise is that one should be able to dictate the logic of a routine via the input data, while doing little (if any) actual coding.
For instance, I recently ran into a situation where I needed to manage a series of input and output files, moving them from point A to point B. Most of the time we just need to rename the files en-route, but occasionally other manipulation might be required such as encrypting/decrypting the files, filtering subsets of data out, or performing other tasks.
I don’t want to tip my hand too soon, but there’s a few things about WordPress that I find myself writing code for that, really, I shouldn’t have to write code for. Especially since the foundations of making things “just work” are all already in WP, and in most cases, have been around for quite awhile!
I broke down and ordered an Arduino (ok, the Freeduino SB, specifically) from HVW Tech. Piece of advice – to save on the $5 handling fee “on orders under $30″ — add an L293D motor driver for to your order for $3.95. You know you’re gonna need one anyway… ;)
So, I ordered a PICAXE 28X1 board from Advanced Micro Circuits (aka World Educational Services), and it arrived yesterday. It’s a bit smaller than I expected (which isn’t a bad thing at all!), but it was also sans-interface cable, which was a bit of a let down (the cable is, however, en route!). Either way, it’s a compact microcontroller package with a decent feature set, so I’m looking forward to playing with it. Fits inside an altoids tin, sans-batteries, and I suspect with a proper LiIon pack, it’d probably fit in the tin with batteries. We’ll see… :)
It was up against the Freeduino SB (produced by Solarbotics / HVWTech, a derivative of the Arduino Deicimila board), which probably would have been my choice had I done some more research up front. The Freeduino SB is a bit cheaper, mostly due to the fact that it ships as a semi-kit where only the SMT components are pre-soldered, and the rest of the assembly is up to the purchaser, but the trade-off was that the PICAXE was built with the capability to add a motor driver by simply socketing an L293 into a slot on the PICAXE board — the Arduino would require an external circuit. What I didn’t know, was that Adafruit sells a motor driver “shield” for the Arduino for just under $20.
