Saturday, March 08, 2008

2nd Quote of the day, also from SICP

Why can't a day have two quotes?

From the Foreward of "Structure and Interpretation of Computer Programs":

"The source of the exhilaration associated with computer programming is the continual unfolding within the mind and on the computer of mechanisms expressed as programs and the explosion of perception they generate. If art interprets our dreams, the computer executes them in the guise of programs!"

- Alan J. Perlis

Quote of the day, from SICP

"I think that it's extraordinarily important that we in computer science keep fun in computing. When it started out, it was an awful lot of fun. Of course, the paying customers got shafted every now and then, and after a while we began to take their complaints seriously. We began to feel as if we really were responsible for the successful, error-free perfect use of these machines. I don't think we are. I think we're responsible for stretching them, setting them off in new directions, and keeping fun in the house. I hope the field of computer science never loses its sense of fun. Above all, I hope we don't become missionaries. Don't feel as if you're Bible salesmen. The world has too many of those already. What you know about computing other people will learn. Don't feel as if the key to successful computing is only in your hands. What's in your hands, I think and hope, is intelligence: the ability to see the machine as more than when you were first led up to it, that you can make it more.''
Alan J. Perlis (April 1, 1922-February 7, 1990)

Friday, March 07, 2008

The most brilliant paper I have read in a while...

The paper referenced here.


It's about the art form known as mathematics.

Sigh, time to break out my Turtle Geometry book again.

Thursday, March 06, 2008

Not a "Maker"


Not that anyone has asked, but...

I am not a "Maker".

I've alternated between awe and respect in regards to the things I've seen "Makers" make, but I am not one of their clan. Neither am I one of the closely related "Dorkbots".

I don't think I actually "like" to make things. I am driven to make things. It's in my blood.

I don't have a lot of things to show at this time because I tend to obsess. I hate the idea of spending 8 hours a day working on stuff that doesn't interest me, so I tend to get (and stick with) jobs that allow me to obsess. And, that tends to suck away at my CFT.

So, I am less interested in making really cool stuff like you can see here. But I do seem drawn to making (or at least thinking about) stuff that has more tangible impact.

That sounds rather "engineer-y", but I am (at times) equally consumed by art (music, books, drawing and painting). Sometimes I've even been known to do a drawing/painting or two.

Keep an eye on this space and hopefully I will find the CFT to work on something I am passionate about. It may not be earth-shattering, but hopefully it will be interesting, well engineered and full of beauty.

Enough talk... I should be working on something.

Wednesday, February 27, 2008

Life is too short to idle away in a cube...

Not much is getting done in my office cube today. I like my job; I hate my cubicle. (I hate *all* Cubicles).

I've got some serious mental blocks happening right now. I'm not feeling 100% healthy, so that is definitely a contributor.

I'm going home to hang with my son.

Inspiration... Knuth & TeX

My interests are odd (for a computer geek). I don't think I'm retro, but I've learned Ruby, Lua, Erlang, ML, OCaml and a bit of haskell in the the past 7-8 years (yep, I first picked up on Ruby in 2000). I really haven't learned a new language (or done any real programming in the above languages) in the past 4 years.

I'm interested in [La]TeX again. A couple of posts ago I mentioned working on AFT. That could be fun, but (if I had the CFT) I'd rather hack around with TeX. In particular, I am interested in learning MetaPost (look it up). There is a nice $50 LaTeX graphics book that covers MetaPost.

So, I am thinking to myself, wouldn't it be fun to do some hardcore typesetting? (Remember, my interests are odd.)

Fundamentally, I love the idea of TeX (and LaTeX). The end result is very tangible: A (potentially) beautiful typeset document. Maybe make a book out of my kids' artwork or something. TeX (and LaTeX) is a complex enough system that it would be fun just to get lost hacking in it.

Emacs is a large hackable system too, but the end result is some editing tools.

Unix is a large hackable system, but the end result is doing some process/text manipulation.

With TeX, the end result is a piece of paper. A well typeset piece of paper.

Quote for the day

Twenty years from now
you will be more disappointed
by the things that you didn't do
than by the ones you did do.

So throw off the bowlines.
Sail away from the safe harbor.
Catch the trade winds in your sails.

Explore, Dream, Discover

-- Mark Twain

Tuesday, February 26, 2008

AFT Stuff

It's been a couple of years since I've done anything with AFT. I have a few ideas I've wanted to implement for a while, but I am tiring with mucking with the core of AFT and causing distress with any of my (few) users who wonder if they should upgrade. Sometimes a new feature may break old stuff or sometimes I roll in fixes with the new features.

As far as I can tell, AFT users install the version of AFT current to when they discovered it, use it and then resist upgrading (why upgrade when the tool does what you want)?

So, I am going to freeze AFT against any new features and add features by way of AFT add-ons.
These add-ons will be separately download-able and work with the AFT you have installed.

Here are some of the potential AFT add-ons:
  • aft-indexer -- Create an index on an AFT file against words in a separate document, write out a new AFT file that includes AFT markup for an index and run AFT against that.
  • aft-fixtabs -- Take an AFT document and smartly fix any tabstop errors. Output a new AFT document with tabs or N spaces for tabs.
  • aft-ft -- Convert "free text" (somewhat intelligently) to AFT format.
  • aft-simple -- A newer, simpler markup format (influenced by lessons learned) that produce standard AFT output.
The add-ons will be written in Perl or C and conform to AFT's current policy of not requiring any additional Perl modules outside of a standard 5.x distribution.

Tuesday, February 19, 2008

Idea of the week #1: Scramble Box

This would be a small handheld device powered by a AAA battery that has 1 SD slot, two buttons and 1 tri-color LED.

Let's say you've just taken some prize-winning pictures and want to "secure" the SD card from copyright thieves.

You just pop in the SD card, press the "scramble" button and all content on the SD card is encrypted (in place) using AES-256. The LED lights yellow while this is happening and then turns green when done.

(The key was crafted by you and programmed into the device earlier by putting it into a file called "CFG/KEY.CFG" on a blank SD card).

When you want to unscramble the SD, you pop it in and press the "descramble" button. The LED lights yellow while this is happening and then turns green when done.

The device holds onto the "key" in flash memory. You can use a different key anytime by placing CFG/KEY.CFG on either the enrypted or yet-to-be-encrypted SD card. At the end of encryption/decryption the CFG/KEY.CFG is securely deleted (don't want to store keys in the clear, now do we?). If the CFG/KEY.CFG is supplied on a blank SD card, the flashed key is changed.

This is less secure (if someone steals your Scramble Box AND your encrypted SD cards then they can decrypt the cards so as long as they were encrypted with the currently flashed key). However, this at least allows encryption/decryption to occur without creating the key file
(so you can go directly from camera to Scramble Box).

Now, photos are probably not the best use case here. A better, although less dramatic, example would be to put a bunch of "important" documents on the SD card and run it through the Scrambler.

However, since we are just using a fairly standard AES-256 technique (CBC w/ CTS), you could always do the encryption/decryption on a PC (with the right software).

In this case, the Scramble Box can be used for batch encryption/decryption.

Oh, and for usability, the key is a simple password/passphrase that is run through a hash function, so you don't have to memorize a 32 bit key ;-)

Lambda the Ultimate links to some of my old ideas

These links are mainly here for my own bookmarking purposes, but they expound ideas I can't seem to let go of:


In the second link, Luke Gorrie ported his "untar" program from scheme shell to bash. I tried to make it more beautiful (or perhaps just more obfuscated). Here is his ported script, and here is my rewrite.

Wednesday, February 13, 2008

The End of the Analog Television Era: Sad...

The end of an era is coming. On Feb 17, 2009 analog television broadcast is supposed to come to an end. The US government has mandated that all over the air broadcasts will be digital. They are giving away coupons for free converters for analog TVs. After March 1, 2009 all newly manufactured TVs must be digital.

Since 1941, the analog broadcast standard has pretty much remained the same. The same signal broadcast then can be received now. For over the air broadcasts, the era of NTSC will end after a 68 year run.

Children in a post 2009 world will never know about "snowy" pictures. With poorly received digital, you get frame drops, stutters and pixelation.

The days of hacking analog TV signals are also gone. This is not quite as dramatic as the (eventual?) loss of analog AM/FM radio, where with just a crystal and a few parts any kid can tune in a grainy signal and thrill to the discovery of turning inaudible radio signals into sound!

I haven't figured out yet what the plan will be regarding "emergency broadcasting". When the next flood or tornado hits what do folk who didn't get the "free voucher" upgrade (or are just too far away to get a decent signal) do? In the middle of swampy Lousiana, or in a remote farmhouse in Kansas you may be able to currently get a grainy noisy signal warning you of disaster. Come 2009, how well will the same tower broadcast digital? Will you be able to make out the news when the digital stalls and drops?

None of this affects us cable/satellite users. But, I want to tune in when the moment comes and we witness the silence of the analog signal. I wonder how many uninformed people will take the silence to mean an invasion from space or Armageddon?

Monday, February 11, 2008

Cutting Code in a Coffee House

I need to remind myself that its all about creative problem solving. The Web and internet is all just a facade. Software is all about a manifestation of concepts. It's a tool for creative thinking. If you can web-enable it then you are trendy.

While doing embedded development, I am limited by what can be physically rendered. I can only get things smaller up to a point. I can only do what physics deem possible (for today at least). I can be creative, but I can't fly.

Current thinking in Web technology threaten to clip my wings too. I left IT development for the embedded world because I felt bogged down by XML, HTML and the Web programming juggernauts (Java, Javascript, Ruby, etc).

The effort of putting things on the Web didn't seem all that sexy anymore.

The effort of building complicated backend servers was no longer appealing.

Building embedded thingies gives me some immediate satisfaction. People use the stuff I build. I can measure the impact. It's real. It is physical. It has a form.

But, I kinda miss pure software. Coding in coffee houses is fun. Developing something useful while sipping on coffee and eating sweet breads (doughnuts, danishes, pie, oh my) is heaven. I just need an idea.

At times, when I got wrapped up in just hacking for the sake of hacking (e.g. getting awk/ksh/bash to do things they really weren't meant to do), I didn't feel like I was contributing much. Hey, I was a member of the language-of-the-week club (Erlang, Haskell, ML, etc)!

In reality, the languages I am the most productive in has been (in no particular order): C, Tcl, Awk and Perl. I've built production systems in Tcl/C and have written my only contribution to open source in Perl (see AFT). So, why do I insist on learning new languages? Why can't I just cut code in what I know best?

I need to take the time to visit a coffee house. Just me, my laptop and some ideas.

Pure Software vs Embedded Hybrid

Visions of purchasing the Asus EEE has grabbed me lately. It would probably be useless for embedded development, but if I imagine myself somewhere on an island (or in a mountain cabin) hacking away at my latest ideas. There wouldn't be much embedded work done there.

At the minimum, embedded work would take a PC, some sort of JTAG interface and a target board (and maybe a power supply). To do embedded I am chained to my house (or the lab/cube at work). With a nice portable, I could be sitting in a coffee shop or in an airport terminal, jamming to tunes while I hack away.

This is a different kind of development, though. As much as the embedded devices I hack during the day will impact people (I design pagers, satellite based trackers, etc), writing pure software (that either runs on a server or someone's PC) has the potential to impact far more people (and hopefully for good, not evil!).

Thursday, February 07, 2008

(Simple) Single Wire Protocols

My current favorite MCU is the MSP430. In particular, I like the ones that stretch the longest lifetime out of small batteries (like a CR2032 coin cell). Unfortunately, there aren't a lot of "communication" options for such a low power design (think: how do we get logged data out of a tiny low power processor?). RS-232 is too heavy, SPI/I2C is too complex, Bluetooth and other RF is too expensive (money and power-wise).

How about a simple single wire protocol?

Dallas/Maxim has such a protocol (called One-Wire) that is very interesting, but its very proprietary (you can't legally create a slave -- they reserve the right to be the sole provider of slaves that are compliant to the protocol). Among other things, this protocol supports multiple slaves and can even be used to power them. You just need a single wire (normally pulled up) and a common ground. The single wire is used for *all* communication (bi-directional).

I'm looking at doing something similiar to this, but greatly simplified: Only one slave supported.

(Random) Copious Free Ideas

A few random ideas for someone's Copious Free Time: (All of these projects involve very low power circuits -- the idea is that these things will run a long, long time without changing batteries).

Cold Bot

Augment a Roomba (or iRobot Create) with a temperature sensing parasite that navigates the Roomba to the coldest spot(s) in a room. If the temperature sensor was mounted on a small probe/arm, then you could pin point insulation leaks. The parasite also controls the power to the roomba thereby extending runtime by shutting the roomba off when the coldest spot has been reached.

For extra credit, make it a warm bot, place a gold fish bowl on top and let it take the fish to the warmest part of the room ;-)


Temperature Throwies



Tape a MSP430F2012 to a coin cell battery and use the internal temperature sensor to log temperature data to its internal flash. Make a bunch of them and place them in parts of the room or house that you are interested in monitoring for temperature trends. Create a single wire interface (data) to transfer data to a collector. The collector has two probes (ground and data) that you touch against the sensor in order to transfer logged data (along with an associated sensor ID).

Plot collected data on a PC.

Mom, my little sisters are messing with my stuff!

Couple a tilt sensor (accelerometer) with an MSP (or AVR) to make a small alarm. Use a piezo buzzer and coin cell battery. Make it small enough not to be easily noticed. Put on top of (or inside of) the item you want to monitor. If someone moves the item, the piezo screams.... for a long time.

Alternatively: Remove buzzer and use a watch crystal to build a fairly accurate RTC. Silently log the time the item was jostled. Collect this info later with single wire interface.

Tuesday, December 11, 2007

Never power down

Low power consumption computing is an interest of mine. While we have things plugged into AC that never really go off, they still consume a fairly high amount of power.

No, I'm talking about devices that never truly cut off. Or, at least, some portion of a device that never cuts off. How about a pico power AVR or MSP430 that runs off of a small coin cell battery for months/years. Running while quietly collecting data or waiting for a command from you to turn on it's host (we are still talking about parasitic computing here).

What useful things can we do actively under 1mA, while periodically sleeping at under 10uA?

Friday, November 23, 2007

... or is this more appropriate?



Someone at work (thanks, Rob K.) pointed out how maybe my "Biotrophic Parasitic Computing" idea is similar to the relationship between Remy and Linguini in the movie Ratatouille.

Does that sound more pleasant?

Wednesday, November 14, 2007

Biotrophic parasitism as a computing strategy

Biotrophic parasitism is a form of symbiosis between a parasite and it's host. The parasitic organism doesn't destroy it's host, but co-exists with it.

This presents an interesting strategy for embedded computing, or more precisely, the augmentation of existing embedded computing devices. This has, lately, become a consuming interest of mine. But, before I dive into that, here is something a bit more lurid.

This was the basis for my original line of thought: Parasitic fungi that control the behavior of the host. Unfortunately, this is not symbiotic, as the host is ultimately consumed or destroyed. I don't seek to replicate that type of relationship in my embedded augmentation experiments. But, outside of the grisly demise, it's pretty close to what I am talking about.

Consider this: You want to modify the behavior of your Roomba. You attach a microcontroller that feeds off of the Roomba's power and augments the Roomba's behavior through the "Open" serial interace. That microcontroller can be said to be parasitic. If the microcontroller is small enough (e.g. consumes little power from the host) and is well behaved (e.g. won't cause the Roomba to ignore it's cliff sensors), then it is a Biotrophic Parasite.

There are some microcontrollers (and of greater interest: microcontroller boards) that are well suited to biotrophic parasitism. For example: the Lilypad and this (3 for $10) board from TI, that can be programmed by this $20 development board.

Interestingly, I've been doing something along the lines of parasitic computing at my day job.

As I play with my iRobot Create (and forthcoming Roomba), I hope to exploit this technique further.

I like to call it Biotrophic Parasitic Computing.

Wednesday, May 23, 2007

Crypto for Everyone: Scripting and truly transparent systems

The idea of writing tools using standard unix scripting facilities (e.g. sh, awk, sed) may seem like a exercise for idle minds, but it has certain qualities that may make it beneficial to the end user at large.

That benefit is transparency.

For example, consider a simple blowfish encrypt/decrypt application. There are dozens of implementations in C, Perl, Tcl, Python, Ruby, etc. But, each comes with a certain amount of baggage. For Perl, Tcl et al, you have to make sure you have the right version of the interpreter installed as well as the right libraries. With C and C++ you have to make sure you have the compiler on hand with the correct libraries (unless you are willing to install an opaque binary).

However, a blowfish application that is written using always available OS facilities (under the assumption that your OS comes loaded with standard GNU utilities) is both portable and transparent. A blowfish implemented in gawk and bash/sh is very transparent. The user can see what is going on and even make modifications. Beyond that, adopting the "unix way" could make the usage of such an application transparent: it operates as a typical unix filter command where you can use pipes (and redirection).

This is an interesting idea (to me at least). Download blowfish.sh and you have an encrypt/decrypt solution (assuming you have gawk installed). Now, just use it. Pipe to it. Put it in /usr/local/bin (or some other convenient path) and use it as often as you would "cat" or "ls". It's not terribly fast, nor is it terribly efficient, but you can see what it does and can change it, play with it and make it do what you want it to.

This is all part of a copious free time deep thinking effort I've been up to. I am trying to figure out how to offer the simplest tools (simple in terms of installation, configuration and modification) to environments that lack such tools. It seems that everytime I (we?) think of an easy (usually GUI based) way of doing things, such as encryption, I (we?) get caught up in trying to provide the most sophisticated solution. Either that solution is never completed or simply doesn't "take".

Sure, blowfish.sh has vulnerabilities (mostly regarding typing passwords on command lines and buffering decrypted output), but for most users who do not do encryption, this offers some level of protection.

Now, you could argue that most "users" don't know how to use the unix shell or simply don't use unix (MS Windows is used by most of the computing world). But, you could wrap blowfish.sh in a BAT file or simply add a little more scripting to automatically encrypt samba mounted directories from a unix box (see my last post). This too sounds unsafe, but it is much safer than keeping your currently unencrypted list of credit cards, bank account numbers and passwords sitting around on a laptop drive.

Tuesday, May 22, 2007

Never underestimate the power of a small unix + lots of shell scripts

I've been wondering how to solve some home "IT" problems. You know, things like backup, password management, picture management, encryption of financial documents, etc.

I wonder what the combination of FreeBSD, bash (or ksh93!), gawk and samba would do for me.

Well...

If I could samba mount all of the primary Windoze harddisks (kitchen, guest room, etc), I could write a few scripts to do all of the dirty work. There is quite a bit of power and flexibility in having a smallish unix server controlling all of the MS beasts.

This would solve so many problems...