Wednesday, August 18, 2010

Distribution of Scrabble word scores

If you take each word in /usr/share/dict/words (OSX 10.5) that is 7 letters or fewer and can be created with the standard set of Scrabble letters, and calculate its simple value in Scrabble, then the histogram of the data looks like this.


1 | 10
2 | 52
3 | 240
4 | 753
5 | 1541
6 | 3061
7 | 4744
8 | 6220
9 | 7462
10 | 7043
11 | 6439
12 | 5276
13 | 4061
14 | 2959
15 | 2078
16 | 1713
17 | 979
18 | 714
19 | 414
20 | 255
21 | 171
22 | 90
23 | 47
24 | 32
25 | 22
26 | 5
27 | 6
28 | 3
29 | 1

The most valuable word? "jackbox".

Tuesday, August 17, 2010

Marking ALL mail in gmail as read

To mark all Google mail as read without having to page through lots of old messages

1. In the search box, type "is:unread", no quotes
2. In the dropdown that looks like a checkbox (yes, it does) select "All"
3. A link will magically appear that says "Select all conversations that match this search". When clicked, it selects all the messages that are not shown as well as the ones that are shown.
4. Finally, select "Mark All as Read" from wherever it is for you and wait a few minutes.

(via http://www.woodwardweb.com/technology/marking_all_mai.html)

It turns out that the search doesn't select messages in your Drafts folder.

~Matt

Monday, August 16, 2010

A fine and confusing error message from Java


public String myFirstMethod() {
String result = "Hello world";
return result;;
}


A straightforward piece of code that rudely produces a compile-time error "unreachable statement at line 3". "What's so unreachable about that line?" you might ask. Those experienced in the way of Java compilers simply smile and point out the double semi-colon. Accordingly to the compiler, there is an (empty) Java statement between the two semi-colons and it is never reached because the methods always returns before it reaches it.

If I had written writing that error messages, I might have made it say "double semi-colon on line 3".

Thursday, August 12, 2010

What price is a company's reputation worth? Answer: $4600

A reputation once broken may possibly be repaired, but the world will always keep their eyes on the spot where the crack was.
- Joseph Hall

I've been lucky for the last four years as a consultant to not have any major problems with getting paid. So the story of the first client to behave really badly is worth telling.

Back in January 2010 I contracted with an organisation to do $12,000 worth of consulting work for them over the next few months. After two months I sent an intermediate invoice for $9,600 for the work completed so far. Around then the organisation decided due to a strategy change that they no longer wanted the work that I was doing. So they simply went quiet on me and wouldn't acknowledge any email or phone calls. I didn't know what was going on, just got a bit annoyed at the late payment and lack of communication.

Last week I dropped by their offices to sort this out. I received a rather chilly reception and was offered $5,000 as a final payment. Fed up with the five month delay and their lack of communication, I took the offer.

So I lost $4,600, and they lost all my trust and respect. When future clients ask me about that particular organisation's products, I'll probably say "tech is ok, but terrible business practices". Would I work for the same organization again? I'm a pragmatist so probably yes, but with 50% payment or more up-front.

Companies spend thousands of dollars on trade shows and advertising then throw the resulting gains away by treating another business badly. Crazy.

Friday, July 2, 2010

How irritated customers obey a power law



There are over 4000 open issues about JIRA that people have voted for. The most popular vote has 592 votes but most issues have zero votes. I found a suprisingly good line to fit the data with a correlation coefficient 0.9882, if Excel is to be believed. I'm not sure that I actually believe in predicting what people vote for, but I guess this is one way of measuring your progress is how the coefficients of the predictor change over time. The flatter the line, the better job you are doing of evenly spreading out customers' irritation with your product.

As of July 2010, the coefficient of irriration for JIRA is -0.65.

Thursday, July 1, 2010

ASCII art in log files and showing my age



What is that? Well, let me tell you. It's supposed to be some ASCII art that my new-fangled JIRA bug tracker spits out into its log file at start up. It's supposed to serve some useful purpose. It fails (fails, I tell you) because when you view ASCII art that is longer than 80 characters in a terminal (this is a log file, remember) that text art just wraps around and resembles line noise. Yes, line noise like they used to have in the last century.

What's that? You think ASCII art is cool? Well so do I, in it's place. Which isn't my darn log files. What am I going to do about it? I'll tell you, I'll show 'em! Now get off my lawn.

Friday, June 25, 2010

My wife as a sea star




Vacation Bible School ended today with the inimitable Banana Slug String Band. Katherine was their guest Sea Star. It opened up a whole new echinodermic side of her character to me. She certainly was moving around.

Tuesday, June 22, 2010

Drawing a line in the sand

Joel Spolsky writing on his latest project concludes with

"Area 51 is not for everyone. If you don’t know what it’s for, or why it’s going to work, or you can’t figure it out, it’s not, actually for you."


Snark programmer, snark!

Thursday, June 17, 2010

GNU license complexity

The compatibility table at the GNU License FAQ makes my head swim. If this were for the different versions of an application, it would be taken out and shot.

Friday, June 4, 2010

I'll not spoil the punchline

Too true.



From Geek and Poke

Thursday, April 29, 2010

One Bug, Multiple Branches



I enjoyed presenting and discussing some new ideas about how to use JIRA to track bugs in different branches along with their associated builds. This was all at the April San Francisco Atlassian User Group last night, kindly hosted by Atlassian.

My idea is to create a new issue type named "Build" and then create a new build issue for every build. Ordinary bugs in JIRA can then have regular JIRA links named "Present in Build" and "Absent from Build" connecting them to the specific builds in which they are found or fixed. The interesting part is that if you link the Build issues to other Build issues, you get a tree of related builds such as the diagram above that you can then use to deduce which bugs are present in any given release, and also which releases a given bug is likely to be in. Useful information that is rarely available in current issue trackers.

My presentation is available via Google Docs. Feedback welcome, as are beta testers for the ideas in JIRA.

Verification code for Empire Avenue: EAVB_KMCAYMVSLW

Monday, April 26, 2010

Software Engineering and Academia

Bertrand Meyer has an excellent article about why academic computer science has a smaller impact than other academic disciplines do in their respective fields. As he puts it, "academic research has had its part, honorable but limited."

"Researchers in experimental physics or mechanical engineering employ technicians: often highly qualified personnel who help researchers set up the experiments and process results. In software engineering the equivalent would be programmers, software engineers, testers, technical writers; in the environments that I have seen, getting financing for such positions from a research agency is impossible."

"The only software we can produce, if we limit ourselves to official guidelines, is demo software. ... many of us work around the restrictions ... by spending considerable time away from research on programming and maintenance tasks that would be far more effectively handled by specialized personnel. The question indeed is efficiency."

For me, that's what a software toolsmith does.

Thursday, April 8, 2010

How to change your OSX terminal color for ssh sessions

Sometimes I have lots of terminal windows open for ssh sessions to multiple machines. It can all be a bit confusing even if I use the remote machine name in the shell prompt. So I got terminal colorization working for me with help from here and here.
There is a default color for all screens that are using ssh and you can also customize the colors for different remote machines. When you end the ssh session, the terminal returns to black on white.

This is for OS X because it uses the osascript command to change the colors but the rest of the shell script should be just fine for Unix.


$ cat /usr/local/bin/ssh
#!/bin/sh

# Color the OSX Terminal app according the hostname used in ssh
# Assumes you log in with a simple "ssh myuserid@remotehost"
# Place in a directory such as /usr/local/bin that is before the real ssh location

# The value of whatever was after the @ in the command
HOSTNAME=`echo $@ | sed s/.*@//`

set_bg () {
osascript -e "tell application \"Terminal\" to set background color of window 1 to $1"
}

set_text () {
osascript -e "tell application \"Terminal\" to set normal text color of window 1 to $1"
}

# Return to black text on white background
on_exit () {
# echo exited
set_bg "{65535,65535,65535}"
set_text "{0, 0, 0}"
}
trap on_exit EXIT

# My color names
# green 10000,40000,40000
# blue 10000,20000,60000
# orange 60000,40000,00000
# red 60000,00000,00000
# yellow 60000,60000,40000

case $HOSTNAME in
fisheye) set_bg "{60000,60000,40000}" ; set_text "{0,0,0}" ;;
jira|jira2) set_bg "{10000,40000,40000}" ; set_text "{0,0,0}" ;;
# unused colors follow
# blue) set_bg "{10000,20000,60000}" ; set_text "{65535,65535,65535}" ;;
# orange) set_bg "{60000,40000,00000}" ; set_text "{0,0,0}" ;;
# red) set_bg "{60000,00000,00000}" ; set_text "{0,0,0}" ;;
# yellow) set_bg "{60000,60000,40000}" ; set_text "{0,0,0}" ;;
# gray) set_bg "{60000,57000,55000}" ; set_text "{0,0,0}" ;;
*) set_bg "{60000,57000,55000}" ; set_text "{0,0,0}" ;;
esac

/usr/bin/ssh "$@"

Wednesday, March 31, 2010

There's a way to do that in emacs

Given a number of lines of text such as

foopy charlie
foo bravo
food alpha

and you want to sort them by their second field so they end up like

food alpha
foo bravo
foopy charlie

the right emacs incantation is:

C-u 2 M-x sort-fields

That's all.

Monday, March 29, 2010

Michelle Shocked concert

Katherine and I went on our yearly pilgrimage to Moe's Alley to see Michelle Shocked last Saturday. Steve Wozniak was there too, quietly enjoying this tiny "Reggae Pub". As ever, Michelle was truly amazing. Her energy, her humility and that soaring voice. Mostly her older songs, but with lots of local guests and backing from a band lead by James Nash who just smoked that guitar!

As Michelle says of herself,

I've been through some dark times but I've experienced joy too. Now that joy can't be suppressed.

Thursday, March 18, 2010

97 Things Every Programmer Should Know



Another useful book in the "97 Things" series from O'Reilly has been published, this time for programmers. My contribution is "How To Use A Bug Tracker". There are more details at O'Reilly and Amazon.

This book was created by each person adding their contributions to a Wiki, where it was edited and discussed. The whole process worked really well due to the editor, Kevlin Henney.

p.s. My photo on the cover is four rows down, third from the left, just in case you're looking.

Wednesday, March 17, 2010

Ambiguity everywhere

I use emacs for writing code, which is considered a bit old-school by many Java programmers. One of them recently commented that "watching someone use emacs is like watching ballet". Was that a compliment or not? "Graceful" and "efficient" come to mind, but maybe he just doesn't like watching ballet.

Wednesday, March 10, 2010

One of those mornings

6am. Our eldest child woke me from my slumbers with "Daaaad, the toilet's overflowed!". Turns out it had thoroughly clogged itself late last night and then a leaky tank valve had allowed water to gradually drip into the bowl overnight. Ugg. However, the rather questionable design of many American low-flush toilets is not the point of this post. In the process of clearing the clog I realized that this was where an education comes in useful. I asked her to flush another toilet in the house which created a partial vacuum in the sewer line and helped my efforts with the plunger. It worked wonderfully! A discussion of the physics involved ensued, but the best bit was seeing my daughter continue to believe that her Dad could fix anything.

Wednesday, December 23, 2009

Which letters are never doubled in English words?

There is now a handy website for searching an English dictionary using regular expressions. It appears that the only letters that are never doubled are 'j', 'q', and 'x'. Mind you, you have to go to Uzbekistan to get their unit of currency which is named a "tyyn".

Perhaps I should make up a word such as "sajjaqquixx" to fix the missing ones. I'm not sure what it means yet, and neither is Google. Suggestions welcome.

Happy Christmas,

~Matt

Tuesday, December 8, 2009

Testing, testing


This log post should also appear on my Facebook page, along with a picture of our house as it was in 1948.