Sunday, February 28, 2010
Yeah, I use Google Wave to 'sign off' on informal agreements
Thursday, February 25, 2010
It sucks to visualize public data
A while back, I made a graph overlaying the senate party majority with the national debt. While correlation isn't sufficient for causation, I did learn a lot about the shape of the national debt as well as assertions between political party and national debt is not as clear cut as political commenters and pundits would like you to believe.
However, the entire experience of producing the graphs in those blog post left me dumbfounded with how tedious it was just to see the shape of the data.
As a programmer, I can figure out how to find and graph the data, however painfully. But it's completely inaccessible to regular everyday person that uses the internet. There's a lot of pubic data out there, but people aren't able to access it easily. If it doesn't show up on google's search, that's where they stop.
This is why I'm working on Graphbug--making public data more easily accessible through visualizations. Some questions are best answered visually.
Saturday, February 20, 2010
What to listen for from technology scrooges
Consider today's online world. The Usenet, a worldwide bulletin board, allows anyone to post messages across the nation. Your word gets out, leapfrogging editors and publishers. Every voice can be heard cheaply and instantly. The result? Every voice is heard. The cacophany more closely resembles citizens band radio, complete with handles, harrasment, and anonymous threats. When most everyone shouts, few listen.
I saw this short opinion piece from 1995, and it's related to the technology myopia I wrote about recently, even amongst the technologically well-versed.
Once again, it's easy for us to say Mr. Stoll here is a fool. But that's not what we should glean from this. We now know that even if every voice can be heard cheaply, that data can be easily accessed in text form, and someone will come up with an algorithm to organize it all. Not only that, there's more than one algorithm. Some, like Pagerank is all in a computer. Others, like Digg, Reddit, and HN, are computer-human hybrids that require a bit of social engineering. So while Mr. Stoll correctly identified the problem, he let that stop him there. It was beyond his imagination if, much less how, that problem would be solved.
The same goes when any technology pundit talks about the current new crop of technologies. He might just not have the background to know whether it's possible at all, or he might just not have the imagination. You need both to see clearly.
That's not to say you should ignore everything these pundits say. Instead, listen carefully. The hard part of product development is making something people want. What pundits have done is the hard part of identifying the problem. It's up to you to figure out how to prove them wrong.
Friday, February 19, 2010
I take it back. Haml's got some vinegar for a reason.
I take it back.
I gave HAML a second shot, and I rather like it. The conversion was pretty easy, and having emac's haml-mode saved a lot of indentation headaches--even moving blocks left and right in indentation.
How come I liked it better the second time around? The first time I saw it, it was written by someone that ignored convention and just powered through nesting HAML div elements 10 to 12 levels deep in one file. You know what? You're doing it wrong.
Writing HAML from scratch this time, and reading Haml Sucks for Content, I've found that HAML is designed with intentional weaknesses to make you stay clean and clear. Indentation too far in an HTML document? Chances are, there are repeating elements. Refactor it out to a partial, and you get to start at column zero again. Have the urge to make multi-line ruby statements? Refactor it out to a helper. You'll live longer that way.
By making some things intentionally hard to do--giving them some syntactic vinegar, you'd hope that your users end up Doing the Right Thing™. But then again, some people just are immune to having code indent 10 to 12 levels deep, or name their variables 'ii' and 'jj' when they're not programming in Fortran.
Saturday, February 13, 2010
Who would pay for a message sent to nobody in particular?
Consider books. I still buy and read all of my books in the form of compressed wood pulp. There are newfangled e-book readers, but I don't want one. Why? Because the only places I read are 1) In the bathtub, and 2) Lying in bed. Taking a computer into the bathtub is generally not a good idea, and holding a Kindle above my head for 3 hours is awkward compared to lying a (3-D) book on the bed beside me with one page bent up so I can read it.
via briancarper.net
It's something I hear often about new technologies--"Why would I want to do that?" I hear it on flamebait blog posts. I hear it in person during meetups. When I hear something like this, I'm reminded of quotes about technologies that we take for granted as being obvious now.
Let's start with the radio. Back before radio as we know it now (as radio stations), when people said 'radio' in the 1920's, they meant the wireless transmission of messages over the air. They considered it as a communication medium to relay news, like the sinking of the Titanic. Because of that, people use to pay directly to send messages. No one was using it as a way to broadcast music like the way we know it now--the concept of a radio station. And hence, there was no sense of imagination that advertisers would pay ads alongside music broadcasts. And when David Sarnoff was pioneering the idea, what was the reaction by his potential investors?
By 1916, along with Armstrong and de Forest, [David Sarnoff] was using his newfound fame to push the idea of commercial radio, something he called the "wireless music box," although this idea was before its time. Even as late as 1920, one potential investor wrote him to say, "The wireless music box has no imaginable commercial value. Who would pay for a message sent to nobody in particular?" Even the Marconi Company, his employer, rejected the idea of radio as anything but a communications medium. So he went to work for the Radio Corporation of America [RCA] in 1920.
-- Radio Pioneers enter story of the wire on David Sarnoff's associates in response to his urgings for investment in radio. [emphasis mine]
"While theoretically and technically television may be feasible, commercially and financially I consider it an impossibility, a development of which we need waste little time dreaming."
-- Wikiquotes -- Lee DeForest, American radio pioneer and inventor of the vacuum tube,
No wireless. Less space than a nomad. Lame.
via Slashdot
Wednesday, February 10, 2010
Google Buzz seems more like Friendfeed than Twitter
Monday, February 08, 2010
Linking data in XML and HATEOAS
There are three pages in a UI. The first page has a link to go to the second page. The second page has a link to go to the previous page as well as the third page. The third has a link to the second page and another link to the first page.
A client starts from the first page, and then through the link on that page, goes to the second page. The fact that this page has one link to the first page and another to the third page implies that the current state of the application (i.e. the interactions) is that "the client is viewing the second page". That is what it means by hypermedia as the engine of application state. It does not necessarily mean serializing application state, such as "<page>2</page>" into representations. Friday, February 05, 2010
If you forked technomancy's emacs-starter-kit, upgrade nXhtml
Tuesday, February 02, 2010
I want to use SASS, but not HAML.
The title of the post is more-or-less a verbatim quote from a coworker, as well as from an unrelated colleague of mine from a previous job. I was asked that question and, to be honest, I was a little thrown both times. I didn’t actually know why I use HAML. I guess I’d never really considered it much after I started doing everything with it. It just seemed better and more fun.
Oddly enough, I want to do Sass, but not Haml. Html isn't too hard to begin with, and I guess it's never bugged me.
What I do dislike about Haml is the indentation on a larger piece of code. When I want to shift elements around, suddenly, I'm not sure which level of indentation to put it, let alone make sure all the sub-levels are indented correctly as well. haml-mode in emacs didn't seem to help much.
This means either two things:
- web markup should be more shallow and I'm doing it wrong. Perhaps with rails helpers and partials I can compress it more to keep myself DRY.
- The very Nature of web markup is a deeply nested tree, and haml's indentation's not a right fit for it. This seems more likely, though again, it depends on the design of the page. If a page is designed to be with heterogenously abundant page elements, then this is true.
I've yet to decide on either. Perhaps I'll give Haml another shot.
CSS, on the other hand, has a fairly shallow structure. In fact, it doesn't have nested structures at all, and you have to re-declare parent tags. This lends itself to really long files that I can't keep track of. I've often wished for color variables too. SASS indentation is good here because it gives you a way to group your css together in a more compact way with hierarchy.
Hence, HTML is too deep for whitespace indentation, and hence in my opinion, not a good fit for HAML. And CSS is too shallow, and hence perfect for SASS.
So it's not that I don't want to learn HAML because it's something-new, but because it doesn't seem to fit a need I have for the markup I'm working with. SASS, on the other hand, solves a pain problem I've had with CSS.
Friday, January 29, 2010
How to add paths to your emacs shell
Actually this is probably because start-process can't find your git
executable. Try doing something like this in your Emacs configuration
(adjust the path if needed):
(setenv "PATH" (concat (getenv "PATH") ":/usr/local/git/bin"))
(setq exec-path (append exec-path '("/usr/local/git/bin")))
If you're trying to use magit in emacs, and you can't figure out why it's not recognizing your git repos, it's probably because it can't find git. And it can't find git, because it's not in the path.
Just set the path, as it's show above, and add your own directory, wherever git is being held. If you're on a mac, you can add /opt/local/bin for the rest of your utilities.
Erlang mode on Emacs
Although there are a few other editors for Erlang, I prefer to use Emacs for Erlang and its the only major reason I use Emacs for. Erlang now has an eclipse plugin too, called Erlide.
Erlang comes with the emacs mode as part of its standard distribution, so you only need to customize your emacs settings to use the erlang mode. Once you have Emacs installed (I have Carbon Emacs on my Mac OSX), create a .emacs file in your home directory (or use the one that you already have).
$ vi ~/.emacsThen insert the following lines of Lisp code into your .emacs file.
;Erlang Mode (setq load-path (cons "/usr/local/lib/erlang/lib/tools-2.6.1/emacs" load-path)) (setq erlang-root-dir "/usr/local/lib/erlang") (setq exec-path (cons "/usr/local/lib/erlang/bin" exec-path)) (require 'erlang-start)/usr/local/lib is where my Erlang is installed, and /usr/local/lib/erlang/lib/tools-2.6.1/emacs is the location where erlang.el and erlang-start.el files are, which actually define and initialize the Emacs Erlang-mode.
Update the path and version of the tools in the above code as per your installation, and enjoy the amazing features - including the Erlang shell right from Emacs.
Just something to remind me.
Thursday, January 28, 2010
A REST service description language not a good idea
Tuesday, January 26, 2010
A simple guessing game in Erlang
Lorem ipsum for images in French Maid
French Maid is just a small little javascript wrapper library that injects common behaviors into web pages using unobtrusive javascript, based on jQuery. All you ever need to do is set the attributes of html to standard html5 or microformats, and it'll give you some behavior that makes sense. I started this because while working in Sinatra and Django, there wasn't built in javascript behaviors for templates like in Rails. Turns out that was a good thing, but a bit annoying, so I wrote something to help me out.
Lorem ipsum for images is the only non-standard in there right now. When you're laying out a page, put:
And you'll get an image placeholder 200 px wide by 100 px height. There's only a few options:
This is pretty useful for having placeholder icons. I usually spend lots of time picking icons when I'm laying out a page, when I really shouldn't be.
I haven't yet made a homepage for French Maid. Figured I would when it's more mature, but hey, if you're not embarrassed when you release something, it's too late, right? So while I haven't gotten around to implementing all the microformat and html5 specifications, it's been useful so far, especially for standard pattern AJAX calls. The screenshot is from the test/example/documentation page in the project. You need Sinatra gem to run it. Then just fire up the server by running the test file, then navigate to localhost:4567 and start clicking around.
Have fun, and if you find it useful, lemme know. It'll be motivation to get a homepage up for it.
Monday, January 25, 2010
Getting a kid started with programming
I had a couple choices for him, due to some requirements:
- Something easy to install or didn't have lots of things to install
- Something with a all-in-one gaming library
- Something with some sort of community around it. 4) It'd be nice if there was a book for it.
So with those there, there was:
Ruby and HacketyHack. http://hacketyhack.heroku.com/ It also has a app framework called shoes that you can use to build both games and apps. However, since _why left, all this requires a lot of hand hold to set up.
Lua and Love. http://love2d.org/ Lua is an easy language to pick up as it's pretty minimal, and love's 2D engine is pretty fantastic. I've used it before and it's pretty easy to get started with, and plenty of examples, as well as a vibrant community.
Python and Pygame. http://www.pygame.org/news.html Pygame has all of the above, and for me, the final winner, since there was a book that walks the kid along from basic text games to the graphics part. http://inventwithpython.com/
Just in case there are those of you out there that are looking for things to help out your little programmer. Are there others you'd recommend?
Wednesday, January 13, 2010
Some of the best people are the ones you never hear about
“The superior doctor prevents sickness; The mediocre doctor attends to impending sickness; The inferior doctor treats actual sickness;” - Chinese Proverb
The bumps on the road to javascript
Sunday, January 03, 2010
The hard part about unit testing
Joe Armstrong (Erlang) once said "The problem with object-oriented languages is they’ve got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle."
Thursday, December 31, 2009
Bubbles and triangles
Lately, I've been looking at more information visualizations, and it's not been said enough that simple geometry is often ignored.
Often times, I'll see visualizations like this, where bubbles are employed to visually compare different records. It seems likely that people judge and compare difference in size by area. However, the artist/designer makes the mistake of mapping the data to the radius instead. This doesn't work for circles because of your old 4th grade math, stating that A = pi * r^2, where the area doesn't increase linearly as a proportion of the radius.
For the record, it's done correctly here in the visualization above, as far as I can tell.

Here, the designer decided to use triangles. If he mapped the data to the height of the triangles, that's fine, because for triangles, A = 0.5 * b * h, and hence area varies in linear proportion to height.
However, looking at Hungary, the red triangle doesn't seem quite a quarter of the black triangle.
Beyond that, for these two examples, I really see no reason to use circles or triangles. People are able to judge spatial difference much more easily, as opposed to size. It would have been far more effective to use bar charts and rectangles instead of shapes like triangles and circles. In my opinion, you only use that if the spatial x and y axis are already being used to convey other information already.