weblog.masukomi.org

mah-soo-koh-me

 

Sharing a public Git repo over HTTP [flow chart] March 11, 2008

Filed under: Uncategorized — masukomi @ 10:07 am
Configuring a public HTTP Git repository

There is also an SVG version of this flow, which is more readable (but poor IE folks will have issues). Notes: This is a simplest possible configuration. Be sure to check out the docs for git-remote to see how to, optionally, designate specific  local or remote branches. Many of the initial commands could be performed locally and then just uploaded to the server. This particular sequence guarantees that all the connection pieces are in place and working correctly. 

Much thanks to Tim Toolman for getting this info into two easy to follow posts: Sharing git repositories via OS X’s built-in web sharing and  Setting up a new remote git repository. However, this doesn’t feel elegant to me. If anyone can come up with a simpler / more elegant way to do this please add a comment. 

This image is copyright 2008 Very Useful Books, Inc. and is distributed under the GPL v2. It was created with OmniGraffle 4. If anyone wants the original, just holler.

 
 

New Blog Engine and Feed Urls March 9, 2008

Filed under: Uncategorized — masukomi @ 12:16 pm

Death to slow apps!

I killed Mephisto. Screw Rails’s inability to perform on shared hosts, and screw using a system that no-one has updated in any real way in years.

I was going to  go back to my homebrew system but rip out the bits that the spammers loved so well, then I said “screw it”. I have no interest in maintaining blog software. I’ve got too many projects on my plate as it is.  WordPress is damn good, has lots of cool widgets, and Askimet does a great job of filtering out blog spam. The fact that Mephisto used WordPress’s Askimet was the one thing I really liked about it.

So, new feed urls all around:
RSS 2: http://weblog.masukomi.org/?feed=rss2
RSS .92: http://weblog.masukomi.org/?feed=rss
Atom: http://weblog.masukomi.org/?feed=atom

If anyone reading this is also thinking of abandoning Mephisto I’ve got a teeny little script that’ll generate a LiveJournal XML export file from Mephisto (was the easiest thing to do) which WordPress (and other apps too, I’m sure) will import.

 
 

The most useful Monkeypatch ever March 8, 2008

Filed under: Uncategorized — masukomi @ 9:50 pm

In Java we all dread the dreaded NullPointerException of dread.
In Ruby nil is a class and we can do something about it.
Monkeypatching core classes is of course a Bad Thing(tm) but this particular one should* break nothing since we’re adding a self contained method to a class that doesn’t alter the functioning of any of the other methods on the class. Furthermore we’re adding something that simply makes sense, so when you call it sensible things happen. Now, as with most innovative thoughts, it isn’t. According to _why it’s been brought up by far more knowledgeable Ruby geeks than I: Jim Mernard, Dave Thomas, and Dan Fitzpatrick have all argued for this. Others have argued against. The others all work for The Man and are just trying to put you down.

Behold, the glory of nil.empty?

class NillClass
  def empty?
    return true
  end
end

Oooh ahh… Bow before its glory! Bow I say!
Do you not see? NilClass is the void. It is nothingness incarnate. You may debate if it is really false, since how can nothing be true or false, but it is most assuredly empty, for how could nothingness ever contain something? Now you never need to @#$% check if a thing exists or not before checking if it’s empty.

More lately people including _why have been arguing for nil.blank? This is, of course, craziness. While I encourage such insanity in _why (it’s what makes him great) it is impossible. Nothing can not be blank, for it has no form, no surface, and only things can be blank. Nothing is neither blank, nor non-blank.** Rails has, of course, incorporated nil.blank? because they’d monkeypatch their grandmothers if they could figure out how. Personally, while I love this particular monkeypatch I don’t think any core classes should ever be monkeyatched in a distributed library or app, but YOUR app, that other apps don’t use as a foundation…. monkeypatch whatever-the-hell you want, just be sure to document it well.


*I say “should break nothing” but there is, of course, being stupid and using the unexpected, and slow, thrown exception to change the flow instead of checking for nil.
** Yes, the antonym for blank is “full”, but if you ask me, that makes no sense.


P.S. It’s a really good thing that Java isn’t monkeypatchable because if it was java.util.Calendar would be monkepatched a new and incompatible way in every single library out there because we all hate its @#$% guts. Use Joda Time instead.
 
 

Using Toonlet for quickie cartoon strips.

Filed under: Uncategorized — masukomi @ 5:11 pm
I’d just like to take a moment to plug Toonlet.com. It’s not perfect, but…

I’ve toyed with the idea of doing little comic strips (as you’ve seen lately) for… hell years now. But never wanted to deal with the work. It was Toonlet.com that finally got me off my ass to do it. Now, I’m not actually using Toonlet.com to generate them, but that’s not the point. The point is that they make it easy and fun to put together your own strip with unique characters. You create a character by bringing up an “art pack” which is a collection of heads, bodies, arms, eyes, etc., and combining them to create characters that you save for later use. This is very cool and allows for a ton of possible combinations, but honestly, I just don’t like the drawing style of their initial art packs. It’s too high-school notebook looking. Fortunately, that’s all about to change because they’ve just made it possible for anyone to add a new art pack. Everyone gets to use the various components in a pack that you upload, but that’s ok, because it’s unlikely that they’ll use them in the same combinations that you will.
Playing around with Toonlet is what made me realize that it really didn’t require that much effort to put together a strip. I’m doing it all from scratch with Inkscape but after doing so I have found that I get a little kick out of seeing my strip on a page. Enough that I’ll spend the time to make whatever new poses, facial expressions, etc. for new strips. Of course, because I’m using Inkscape it means I’ll have a library of things that I can recombine later to save time making new strips. Just like Toonlet (and ever other vector art comic strip you’ve ever seen).

There are a handful of things that suck about Toonlet, and unfortunately they’re pretty big:
1) While you have great control over your characters, can save sets of them in various moods, and outfits, you’ve got absolutely zero control of placement and the size of the character is relative to the amount of text. This results in almost unrecognizably small characters when you have a lot of text in a panel.
2) You can only have one character in a panel. This means that two characters can never talk to each other in the same panel.
3) No preview mode.
4) While you can create a set of moods for a character if you ever want to ad a new mood to the set you can’t just bring up and change an existing one of yours. You have to remember and recreate the exact combination of all the other elements that went into making that character and then hope you got it right because there’s no delete character either.
5) It doesn’t work in Safari. Creative types have been enamored with Apple for years. To not support the primary browser on the operating system that creative types tend to prefer is mind-boggling to me.
And now you see why I decided to do it from scratch.

I considered, very briefly, using Stripgenerator but they’ve got the opposite problems. You’ve got total control over what’s in a panel, you can even use painfully crude collections of shapes to “draw” new things, but you can’t save anything for re-use later. There’s no way to create a new character that you could re-use without having to redraw it from scratch every time, and the users are insane. The people behind StripGenerator were/are considering adding the ability for people to draw (with a mouse / tablet) and a lot of users were actually arguing against adding it. Saying that it would destroy the look of things. Why would you ever want to force your strip to look like everyone else’s or limit yourself to drawing by pasting and rotating 1/4 arcs and squares and such?

I think The guys over at Toonlet have their priorities straight. Make it as easy as possible to let people make comic strips then add features that will give users more choice and control. They’re working on the issue of only one character per panel. Personally I think they should browse over to Stripgenerator and steal ideas from the strip creation UI. Right now it’s SO easy to create a strip at Toonlet that people comment on other strips by making comment strips. It’s amazing.

To give you an idea, here is a Toonletized version of this post’s main points (Mac users should check out the note afterwards):


an example of a toonlet strip

P.S. In case you’re considering using Inkscape on the Mac, I’d recommend not. While it is rock-solid under Linux something about running X11 apps under OS X means it’ll crash if you do things like accidentally click too fast or, well, it seems any rapid sequence of operations involving the mouse will kill it. I’m downloading a demo of LineForm now which looks very promising and is only $80. If it has good export capabilities I’ll probably buy it because I prefer using OS X for anything that isn’t code. VectorDesigner is probably the most affordable commercial Vector graphics software for the Mac but unfortunately it will only export bitmaps, so there’s no way for you, or anyone else, to leverage any of your vector based creations in any other app. I refuse to use software that will lock me in and never let me change to something else as my needs change so this is a deal-breaker for me.
 
 

Importing an existing codebase into Git (a flowchart)

Filed under: Uncategorized — masukomi @ 11:27 am

importing a codebase into Git flow chart


A simple flow chart showing the steps you should take to add an existing codebase to Git. This assumes you don’t have revision history that you wish to migrate from another version control system.

Some notes about the flow:

  • When adding file paths you can use wildcards like “git add /path/to/images/*.jpg”
  • This is one of the few times when you’d want to use “git rm –cached ” to un-add a changes in the index. After the first commit the recommended way to un-add changes to the index (staging area) is to “git reset HEAD “.
  • Note that the only file that is edited during this process is .gitignore When you call “git add” you are adding the current content of a file to Git to the index. If you change a file after you add it Git won’t commit the additional changes (unless you add them too). So, it’s a good idea to run “git add .gitignore” just before you commit in order to make sure Git has the most recent version of it.
  • You’d only, obviously, “add” files you wanted. “git add .” (note the dot) tells Git to add everything in, and below, the current directory.


This image is copyright 2008 Very Useful Books, Inc. and distributed under the GPL v2. It was created With OmniGraffle 4. If anyone wants the original, just holler.

[Update] P.S. It’s just a matter of time before someone tries to use this as evidence that Git is complex or hard to use, but before you do, please do an equivalent flow chart for your version control system that includes ignore files, adding selected files, adding all files, removing accidental adds, and everything else. You’ll find your chart is just as “complex”. The shortest path here is only 4 commands and that includes setting up the new repository to check the code into, and an optional sanity check of what’s going to be committed.

 
 

I really ought to be writing.

Filed under: Uncategorized — masukomi @ 2:40 am

Yes, I really have that hat. I knitted it. It’s supposed a tea-cosy hat like Hermione knitted for the House Elves. Unsurprisingly, it looses something in the translation to black-and-white-cartoon.

Yes, more details will follow about the new co. as soon as the site is up, but yes, I will be publishing other people’s work, and yes, I’ll be focusing on books for geeks initially. What I can tell you about Very Useful Books is that I’m looking to publish a line of concise, but very useful books. Yeah, I know, that doesn’t help you much. But hey, if you’ve got a good idea for a programming book that no-one else seems to have bothered to write. Get on it. If I don’t publish it there are other companies that will probably jump at the opportunity.

A lot of people think you need to horde writing ideas lest some other writer steal them, but the truth is that there’s no difficulty in thinking of something to write about. The difficulty is in actually writing it. Or, more accurately, the difficulty is in continuing to actually write it. I think if you ask any non-fiction author you’ll find that after the first few chapters it’s actually work. Enjoyable, fulfilling, and constructive work, but work none-the-less. The trick, as the NaNoWriMo folks know, is to just keep writing. Don’t stop. You need to try and write something for your book every single night. Even if it’s just a page. I advise eschewing any major editing until the end. Editing just slows you down and makes you feel like you’re not getting anywhere.

The downside, I’ve found, to writing books about software is that you can’t just stop and say “that’s enough.” At least, you can’t if you’ve still left a third of the thing undocumented. You have to write about it all. Maybe not cover every single little detail but you can’t just skip over a feature set because you’re tired of writing about the subject. On the other hand, it means you have to explore all those corners of the app/language/library that you wouldn’t have normally looked in, which means you become even more proficient in it by writing about it.

The Git book is actually making decent progress. I’m pretty much done with the section on managing files, and have a start on the section on managing local repos, but I’ve not taken my own advice and pretty much blew-off writing this week to play Project Gotham Racing 4. It’s a really good game but I’d only recommend it if you have an HD screen. It was “meh” on my standard-def. After the upgrade, it rocked.





P.S. Yes, as soon as I post this, I’m going back to working on the book.

P.P.S. Is the comic a little too small? I can’t decide. I think I’m pushing the lower size boundary, but anything bigger doesn’t fit this site layout (which really needs to go).

 
 

Review of Edward Tufte’s Presenting Data and Information course March 7, 2008

Filed under: Uncategorized — masukomi @ 12:12 am

First, let me set the stage. I’ve been reading stumbling across interesting data information articles by Edward Tufte for years now, have been interested in getting his books for a while now, and was excited when my manager offered to send me to his one day course, and am quite grateful to have had the opportunity to go. So, I definitely went into this with good expectations.

30 Seconds summary:
The first two thirds were not bad. The second two thirds sucked. The type of people who would appreciate this course the most are ones akin to the woman in front of me who wore red velvet pants, a scarf that probably cost $60 and from the Museum of Fine arts, dangly earrings of semi-precious stones, and, were you to talk to her, would be sure to let you know that she’s “an artist.” She loved it. You, on the other hand, should buy his books and skip the course.

Details:
The first two hours were pretty informative, and essentially all of my notes that didn’t involve expletives came from that portion of the talk. But, there were two quotes (taken completely out of context here) that pretty much summed up his course
“…I prefer text.” and “Well this is all very interesting but…”

After the first intermission Edward made sure to let everyone know about his wonderful four hundred year old books by by Euclid and Gallileo which he held aloft, and flipped the pages of with his oily ungloved hands, thus guaranteeing they will not survive the next four hundred years as they have the last. He even made sure to carry it down a couple of aisles and show it to the people on the end, whilst frustrating and / or boring the other 95% of the audience.

After lunch he talked about visual interfaces which was comprised almost entirely of him telling you how cool his iPhone was. According to Mr. Tufte the only major thing that Apple got wrong with the iPhone was using icons on the main interface instead of text. Just imagine how many more items you could fit on that screen if it used text instead of icons! Oh the joy of having to read through text lists to find the fucking calendar app instead of just poking a fingertip sized picture of a calendar. Gallileo was so cool. Did you see this section of my book by Gallileo? To be fair he pointed out some valid ways they could improve the weather and stock apps.

Much time was spent making fun of PowerPoint, “bullet grunts”, and “chartoonists”. A grand total of zero minutes were spent discussing the pros or cons of any standard graphing technique: bar graphs, line graphs, area graphs, pie charts, scatter plots, etc.. Zero minutes were spent discussing what graphing techniques were best suited for what kinds of data (unless you count the 3 minutes spent on vertical scaling of graphs). Did you see the picture of Gallileo? There aren’t many pictures of him but I have an etching of him in my 400 year old book right here.

In between jabs at PowerPoint he discussed his technique for speeding up time in meetings, which is to start out with a “massive data dump” (giving the participants stuff to read before you talk), and then to ask if there are any questions. He guarantees this will make your meetings at least 30% faster. I guarantee that if you ever try that with a potential customer you won’t make the sale. He repeatedly used this technique on the audience by saying “now turn to page x in my book titled y” and waiting silently until everyone in the audience had read the whole page. Oh have you seen my book by Euclid?

He repeatedly advised people to clarify confusing data by adding more detail. While there are a handful of situations where this may actually be good advice it’s incredibly bad advice to give to an audience without clarifying when, why, and how to do so, which, of course, he never did. I will note that I found at least one good example of this technique while flipping through his books. The iPhone is so cool, but AT&T’s Edge network is the reason it isn’t cooler.

Edward also seems to be laboring under the mistaken impression that people actually want to understand all of the details of all the data you’re presenting to them. It is my experience, and many concur with me, that most people want to be shown the high-level “bullet grunts” of whatever data you have so that they can have a clue what the hell they’re looking at. Only then do they actually want nitty-gritty details, and usually they want the details on just a subset of the information. Aren’t Gallileo’s etchings of these sun-spots wonderfully detailed?

Documentation. All(?) graphs need documentation. The names of everyone who contributed to them should be present in big bold letters just like Gallileo did in this really old book. He even put his picture in it. Isn’t Gallileo cool? Also, descriptions: lots of descriptions, and annotations, and annotated descriptions, It’s fine if it the text required to describe the graph requires the same, or more, space than the graph itself. One of the techniques that he mentioned multiple times for making data more approachable was using annotations, which is great if your data isn’t going to change the next time the person looks at it (any stats on constantly changing things), but doesn’t seem to grasp how incredibly difficult it is to write software that can intelligently find a point to annotate that is either interesting or indicates some causality, never-mind trying to write software that will generate useful text about it. As an example, check out the Google Trends for “git”. Only one of the annotated points has any causal effect on the data that’s being graphed (the one about Git software being released).

Resolution. He makes a really big deal about resolution. He applies it to media (screens, paper, etc.), as well as the resolution of information in a graph. He makes a lot of valid points about resolution, then talks about how some typographers designed their fonts at a resolution of two thousand grid lines per inch, and how his “Sparklines” have “two significant digits of resolution”. But he utterly fails to grasp that there is a point at which adding resolution is useless. In print his Sparklines may very well be precise to within a hundredth of an inch, but no fucking reader can tell the difference. Imagine a typical ruler with precision down to a sixteenth of an inch. Now put ten times as many tick marks in each inch and you’re roughly at one half the resolution of print on good paper. Even at half the resolution of print you’re still going to have a really hard time telling the difference between 23/160ths of an inch and 21/160ths. But, after telling you how amazingly high the data resolution is in his Sparklines he proceeds to tell you it’s not enough and that he’s started work on displaying information in “High-def” Which bewilders the mind when you consider that you’re very lucky if your “High Def” screen is one third of the resolution of paper. Have you seen the resolution in this etching of Gallileo’s sun-spots? By giving the iPhone a higher resolution screen they more than doubled the amount of information they could fit on it relative to a normal phone! If only Gallileo had of had an iPhone…

Throughout the presentation I arrived at the following conclusions (potentially wrong) about Edward Tufte.
  • He has great distain for software developers.
  • He has no clue about the problems involved in displaying dynamic data.
  • He has no clue about how to run a presentation.
  • He has no clue why software works the way it does and berates it for not working the way he thinks it should.

BUT It didn’t all suck. As I said there were a number of good points in the first two hours, and all attendees got a box with all four of his books in it. You will need these if you attend the course because a third of the time he’s referring to pages in them like a typical college professor, and the other two thirds of the time you’ll need them to entertain yourself while he tells you about his four hundred year old books and his iPhone. I’ve read a few articles that went into one of them and I’ve skimmed through the rest and I do think they’re actually worth the cover price. He makes a lot of good points in the books and has a lot of good examples, although I don’t think that all of his suggestions actually play out in the real world.


Notes from the course (in case anyone cares):
  • Focus on causality when presenting information.
  • Data visualizations should be content driven not method driven.
  • Strive to invoke content responses / questions in your users.
  • Data should tell a story
  • Provide a context for the data.
  • Annotations: choose a point, explain it, then tie tangentially related facts to that explanation (not sure I agree with that last part)
  • Try and make the “smallest effective difference” when trying to emphasize some point.
  • Order data by the most important aspect, not alphabetically.
  • Find a way to connect your data to your users on a personal level (for example when dealing with data on neighborhood fires plot it on a satellite image of the town so that your users can find their house and thus connect to it personally).
  • Try to eliminate legends. You don’t want your users to have to look up details of your graph. It should all be integrated. For example if you’ve got a line graphing Bananna sales put “Bananna” on the line.
  • Keep related items adjacent in space.
  • It’s easiest to see variations in a slope when it is roughly at a 45 degree angle.
  • Make comparisons.
  • Attempt to overcome recency bias.

Also, some paraphrased questions to ask when consuming presentations:
  1. What’s their story?
  2. Can I believe them?
  3. What is the “domain specification” of this presentation.
  4. What do I want to see? Is that what I was shown?

Some questions to answer when presenting information:
  1. What is the problem I’m addressing?
  2. Who is it relevant to, and why?
  3. What is the solution I am presenting?

Mr. Tufte, if you’re reading this, I appreciate and respect the work you have done, but you need some serious lessons on how to give a course. I’d recommend spending some of the millions people have given you for these courses on some private lessons with Tony Robbins. Whether or not you agree with what he has to say it’s hard to deny that that man knows how to convey lots of useful techniques to his audience in a way that is both memorable and entertaining.

P.S. Gallileo did, in fact, rock. However, if I wanted to see a historically significant book I’d go to the museum or the library (Boston happens to have a kick-ass library with regular, and free, exhibitions). The iPhone also rocks, and is a triumph of interface design, but if I wanted to see a video of someone using it I would go to Apple.com.

 
 

[Rant] @#$% Rails March 6, 2008

Filed under: Uncategorized — masukomi @ 1:04 am
rails vs seaside comic
Rails:
I was all happy to get a chance to code something in Rails at work. Just a throw-away prototype, and then it came time to deploy it. God I hate you Rails. You’re a freaking clit-tease. You’re all “come on baby…don’t you want to be productive? Think of how fast you and I can built your hot app…” The next morning, when it comes time to deploy, you hear laughter fading down the hallway from some 500lb lady with strangely oozing bits who looked much more attractive when you were drinking the good shit last night. You clean yourself vigorously, get the thing deployed after much frustration (and never well on a shared server), and then find out that it’s runs slower than frozen dog shit if you don’t give it injections of fast-cgi, mongrel, and any other uppers you have lying around.

After fighting with it for hours, giving up on Mongrel working (yes i’ve gotten it working many times before), and having to hack the Rails source to make it boot even Webrick, I realized that for a simplistic app I could have written it in just as much time in Smalltalk with Seaside, and had it deployed in about 5 minutes. Smalltalk I say! I’m not dissing Smalltalk, but it’s not like the world is jumping up and down to make Smalltalk deployment easy. Rails on the other hand has thousands upon thousands of people trying to get it running, many for businesses, and each needs to go jiggery-poking it with pound, or Nginx, or mod_proxy, or fast-cgi, or anything they can fucking think of just to make it usable. Even then it’s laughable the amount of hardware you have to throw at it for a site like Twitter.

So, yeah. Rails can bite my shiny white ass. I’m incredibly grateful that they revolutionized the web development landscape but their intolerance towards anything the core Rails devs. don’t happen to need (legacy databases anyone?), the blinders they’re wearing when it comes to scaleability, and the bullshit you have to go through to get it deployed result in me giving it the finger. I still don’t think Java’s a fun language but one thing you can say about it is that deploying Java webapps is freaking easy, hell, distributing them isn’t even that hard. Even the ThoughtWorks guys decided it’d be much easier for their customers to deploy Mingle (a Rails app) under the JVM with JRuby, and that’s just sad.

P.S. Who the fuck thought it would be a good idea to replace the really nice photos on the Mongrel web site with a drawing of a drowning dog ?! “Yes please! I wanna install the drowning dog software!” OMFG people!

P.P.S For those who keep not getting it: Rails != Ruby. Ruby rocks, even if it is slow.

P.P.P.S. Yes, I realize something was @#$% in my ruby+gems+whateverthefuck installation and that it’s not specifically Rails fault, but it’s a pain in the ass to deploy for production even when all the stars are aligned.