Value of chemicals found in the human body

The images show an original picture and a re-imagining of it using whole images found on Flickr. This has been done before at the pixel level where images are picked for their approximation to the pixel in overall color and brightness. Using a coarser granularity, however, produces a much more interesting image. Chris, my wife and artist, likens the result to the the value of chemicals found in the human body.

Technically, it is also a fantastic use of Hadoop. Hadoop is an implementation of the MapReduce algorithm made famous by its use in Google's software.

Why are natural numbers still used for primary keys?

Most database products have a facility for creating unique numbers. These numbers are commonly used as the primary key of a record. You can often see this exposed as a small integer in the URL of a web page. This posting is not about the risks of exposing primary keys but rather about why natural numbers are still used for primary keys.

The observation I want to make is that 1234 can easily be mistaken for 1324. Suppose I have equal access to both the records associated with 1324 and 1234, what mechanisms prevent or at least hinder me or my agents using of the wrong one?

UPCs numbers are numeric but not natural numbers. Credit card numbers are numeric but not natural numbers. ISBNs numbers are numeric but not natural numbers. Each of these are examples of identifiers exposed as "numbers." These identifiers have useful characteristics. They are self validating so that some transcription errors invalidate the identifier. Some identifiers are self correcting. And in the vast universe of value for, for example, 13 digit numbers only a small fraction of the values are valid ISBNs.

As ever more systems record URLs as references to data we need to be ever more careful about our identifiers. Public identifiers should not be natural numbers. Perhaps any system of identification that does not require ordering by identifier should not use natural numbers. It is time that database products had a facility for creating and using unique identifiers that is as easy to use a sequence table or an automatically incrementing integer. Until then, add a check digit.

ISBNs are not stricly numeric as the check digit might be 10 and this is represented as "X".

RI, go vote today for Barack Obama

My reasons for supporting Barack Obama are my two 8 year old boys. The next president is likely to leave office when they are 16. I want these years for them to see America at its best. I want them to see and experience leadership that rights wrongs. I want them to experience an optimistic America. I want them to participate in an optimistic America. I fully expect the next years to be difficult for this country. I believe that Barack Obama can lead us through this hardship.
bōst-: A self-serving blog posting. ~-ing: The act of publishing a self-serving blog posting.

New Common's working space

Last week I spoke with Robert Leaver and Michelle Gonzalez at their New Commons offices. It was a great conversation and one I hope to continue. Robert's and Michelle's manner and their working space immediately make you relaxed. I am usually confident and comfortable in new situations but the feeling of welcoming there was intense.

Their working space is very well designed. Robert's work creating spaces and places would of course lead you to expect this. Here is my rough [*] floor plan of the space. I particularly liked the open hallway and the offices's French doors onto the meeting space.

[*] Visio's floor planning tool is very easy to use. However, the formality of the final visual hides too well the inaccuracies of dimensions and the mistakenly forgotten or added features.

Marrying the working environment with the working materials

I love this team-space designed by Clive Wilkinson Architects and this personal-space design by Francois Perrin. I am attracted to these carefully designed spaces exposing raw materials because I spend so much time inside software. There is a comfort that comes from marrying the working environment with the working materials.

Good example of labeling

The Virginian Pilot, the local newspaper in Virginia Beach, VA, has a good graphic design department. I have always liked their maps and this Sunday's edition had another fine example detailing the changes on Witchduck Rd. One element of their design program I really like is how points of interest are labeled using a modified balloon -- a simple pin shape with the label text below. All the points of interest clearly labeled and aligned at the edge of the map and the connections acute triangular shape does not interfere with the map's content.

Does anyone have pointers to specific services or tools for cleaning up newspaper scans? It just seems that the page color can be subtracted without touching the printed image.

Give Your Readers Something To Do

"For some content providers, looking at content through the prism of actionable content is also a good way to decide whether it is content worth publishing at all. If your readers can’t do anything with the content – meaning they can't use it - then how useful is it?" Vinny Goldsmith, Give Your Readers Something To Do. The full posting makes other good points too.

Make the "holding page" useful

Building a web site always takes longer than expected. And the size of the web site does not seem to matter. There is an inverse relationship between cost and commitment: A $10,000 job with 100% commitment takes about the same time as a $1,000 job with only 1% commitment. And who can commit to any project 100%. The point of this is that that web site's "holding page" better be useful. An "under construction" sign does not help your client or your client's audience.

For example, the holding page at Social Venture Partners Rhode Island (svpri.org) is a one page web site. It tells you who they are, what they do, what is happening, and who to contact. All this on one page and maintained with an insignificant tool -- a few dozen line PHP script.
Mofuse, from local Pawtucket company Swift Blue, has an interesting tool that makes your web site mobile phone friendly. Here is its take on this blog. I like the idea that this can be done, but would rather see sites consider the information architecture and visual design of their content for mobile users.

An iPod Touch moment

An iPod Touch moment: I have started to "flick" web pages with my mouse. It doesn't work.

Simple & Direct Tools

I have been using sftpdrive to enable me to mount the directories of remote file systems as local drives with Microsoft Windows. I chose this product over others as it does not cache much data about the remote directories and files. Not caching is important because I tend to modify files both via an editor in Microsoft Windows and an editor on the remote system. Without caching there is a noticeable delay in directory navigation. However, this is a small price to pay for having absolute consistency in the content from Windows and from the remote system.

One of the tools I use that mitigates the directory navigation delays is a Java class and package browser I wrote several years ago. The browser is a 300 line perl script that displays an interactive list of packages on the left and an interactive list of classes on the right. The significance of the class view is that it lists all the classes under a given package hierarchy and orders them by class name. For example, the figure shows all (4) classes under the "com.ingenta.oso" packages. Double-clicking a class name opens it in an editor.

The tool is very simple but surprising useful. There is no comparison between it and powerful package and class browsing components in Eclipse and NetBeans. However, these weighty tools sometimes offer too much when all you want is a class file list and quick access to the source.

Google Calendar and Travel Time

A small improvement to Google Calendar would be to allow you to define travel time around an event. For example, the illustration shows that to attend the 6 pm meeting you need to leave by 4:30 as the meeting's location is an hour away and you need to find parking. (The drive home is shorter because you don't need to find parking!)

30G iPod for sale

If you are interested in a very lightly used 5th generation, 30G, white iPod I am selling mine for $165. You can buy it from me or buy it via Amazon.com. SOLD. I have had so much success with Amazon.com Marketplace. I highly recommend it.

ag×a.com

I decided that it would be useful to get the international domain name ag×a.com for Andrew Gilmartin & Associates. (I could not get "ag&a", "ag+a", "ag•a.com", or "ag†a.com" and there is no IDN for "№1".) I used the IDN Conversion Tool to get the ASCII version of the domain name "xn--aga-9ja.com" (this is the Punycode version). With this, I registered the name with GoDaddy. Neither 1and1.com nor Yahoo! support IDN just now. In a day or so I will have the domain forwarded to this blog.

Use the Unicode charts to concoct your own strange international domain name.

Oh, under Windows you need to type ALT-0215 to get the ×.

Model Railways

I attended the Amherst Railway Society Railroad Hobby Show yesterday. I have only gone to this show once before with Geoffrey some ten years ago. And it hasn't changed much. The crowd has gotten grayer but it continues to be a horrifying collection of gimps, geeks and retards. I fitted right in.

I started and ended active model railwaying in the '70s in England. A family friend was an avid railwayer and I caught the bug from him. He was a wonderfully patient and enabling mentor. It is a great hobby for me because of large range of skills it takes to be effective. If you want to model operations you have to design a track layout, rolling stock, and schedules that work together. If you want to model landscapes you have to learn the skills necessary to represent 3D space in miniature. Lots of fine mind and fine motor skills are necessary. I was never at a loss for something to do because on a model railway there is always something to finish or something to start.

For the last year I have been toying with the idea of starting again. When my mentor passed away, now several years ago, he passed along the collection of locomotives and rolling stock he had with him at the end. Every now and then I take them out of the boxes and have a look. Henry, especially, likes to look too. It consists mostly of modern US traction and sock. I am not sure why, near the end, he stopped modeling his beloved Welsh steam railways. So what to do?

There are two kinds of model railwayer or railroader. The first kind likes to create a place in time and so tends to focus more effort on the scenery. You construct buildings with great detail and place them in naturalistic settings. Buildings, people, and trains are aged and weathered. There is litter. This is the kind of modeling I did. The second kind likes to run a railway. They manage a division or, sometimes, the whole railway. Trains move from place to place because there are passengers to carry, live stock to transport, and goods to distribute. There needs to be rules of governance and operations and a timetime to keep. My mentor straddled the two kinds. I have vivid memories of sitting with him at the dinning room table with a blue school notebook, a ruler, and pencile and working out of the distances and timings of station runs. Accompanied by background sounds of locomotives coming from his record player -- an 0-6-0 shunting wagons in the fiddle yard with too much of a head of steam. I also straddle the two. So what to do?

What the show did for me was resolve the question. Do both. I will build an N-gauge layout primarily for operations. N-gauge allows for long runs in a smaller space and long runs are necessary to make the operations work interesting. I will also find a club that has a modular layout that uses a larger gauge -- perhaps On30 gauge -- so that I can create detailed scene. The Narragansett Bay Railway & Navigation Company is a fine example of which.

You had me at "Hello"

I have been been thinking about and exploring Groovy for the last few weeks. I have been looking (forever it seems) to something like the Rails web framework built on Java. There is much to like about Ruby but in the end it is just another imperative, object-oriented language with poor performance, bad threading, libraries "built on a learning curve" [*], and non-existent internationalization. Rails, however, is much more interesting than Ruby. The two parts of Rails that I most like are (1) the "convention over configuration" approach to associating components and attributing behaviors to them and (2) the integrated support for a version's development phases and migrations between versions. These are great boosts to productivity.

However, I am committed to Java for the foreseeable future for most commercial work that I do. (I also work in Perl and PHP but these languages are mostly used for integration projects.) Java offers a wealth of best of breed components of which most are open-source and use the generous LGPL or BSD licenses.

So I was excited to find out about Grails and, as mentioned in an earlier post, after reading Getting Started with Grails I found that it satisfied my need for a Rails work-alike based on Java. My concern was that it was written in Groovy and not directly in Java. And so, I spent the better part of three weeks working my way through Groovy in Action.

Groovy in Action covers the language in detail, its idioms, and its use in several problem domains -- XML, relational databases, GUIs, web application, etc. I am very impressed with Groovy. I was not expecting to be. It is another imperative, object-oriented language with reasonable performance, great threading, best of breed libraries, and end-to-end internationalization. The "You had me at "Hello"" moment came a third of why through the book when the author explores using "builders" to construct XML documents. The code is

def builder = new groovy.xml.MarkupBuilder()
build.number {
   description 'Square and factors of 10..15'
   for ( i in 10..15 ) {
      number( value: i, square: i*i ) {
         for ( j in 2..<i ) {
            if ( i % j == 0 ) {
               factor( value: j )
}  }  }  }  }

which outputs

<numbers>
  <description>Square and factors of 10..15</description>
  <number value='10' square='100'>
    <factor value='2' />
    <factor value='5' />
  </number>
  <number value='11' square='121' />
  <number value='12' square='144'>
    <factor value='2' />
    <factor value='3' />
    <factor value='4' />
    <factor value='6' />
  </number>
  <number value='13' square='169' />
  <number value='14' square='196'>
    <factor value='2' />
    <factor value='7' />
  </number>
  <number value='15' square='225'>
    <factor value='3' />
    <factor value='5' />
  </number>
</numbers>

This is a compact and maintainable solution to the XML document creation problem.

The use of builders to construct complex hierarchical structures be they XML documents or Swing GUI interfaces is a very powerful facility. This shows the strength of Groovy's meta programming and its support for closures.

Next week I plan to take a few days off and build a web application with Grails and Groovy. Wish me luck.

[*] I love this phrase. So much of what is open-source is written by people either learning the language, learning the domain, or learning the patterns. The older the language or the library and the greater the likelihood that what you have in hand has had several generations of revision and revisers and is the best that it can be. SmallTalk's libraries are the epitome of this. Most new languages and libraries (Groovy included) are written by folks while they are "on the learning curve." The result is often baroque, idiosyncratic, flaky near the edge cases, etc. ¶ With that said, one of my employability facets is that I build on the learning curve all the time! ¶ I have no idea where I first heard the phrase "building on the learning curve." If you know to whom I can attribute it to please contact me.

Looking for a better web browsing history

I browse the web a lot. I see too much stuff for bookmarking either via client bookmarks or service bookmarks like del.icio.us and Yahoo! and so I need something else. What I have been thinking about is an augmented history. The history is a chronalogical list of sites visted. Each visit can be augmented with tags, notes, page captures (HTML+CSS+JS), and page image captures (PNG image). All of this is browsable and searchable. Does anyone know if there is such a beast? I am willing to use a FireFox extension, a local (desktop) proxy server, or a remote proxy server.

Update: A key notion I did not mention above is that I don't want to "catalog" the site during browsing but do so at some time later in the day. While browsing might not seem like a flow activity it is. Interruptions should be limited. Bookmarking is a secondary activity, at best, but it requires that I keep the activity in mind while browsing and take action at unstructured times.

Dartmouth Comprehensive's 1979 graduating class.

Dartmouth Comprehensive class of 1979I'm the one bottom row third from the right.

Forcing MySQL to use an index

Again, MySQL does stuff I don't expect. For example, the statement select * from T has very poor performance. While, the statement select * from T order by PK, where PK is the primary key, has very good performance. Since I don't care about record order both of these statements are effectively the same. MySQL's explain command says that the first statement does not use an index while the second does. Why on earth would an optimizer not use an index for the first statement? The upshot is that my DML is now scattered with extraneous order by clauses. Sigh.