123Together.com Setup with Mac OS X Mail.app

Setting up Mac OS X’s built-in Mail application to work with hosted Microsoft Exchange service from 123Together.com is actually pretty easy once you know how, but it took a bit of messing around to figure out the right steps.

Start by adding a new account to Mail. Choose “Exchange 2007″ as the server type, and enter your email address and password. At this point it will fail to auto-configure itself.

Next, enter exch1.123together.com as your incoming email server. Keep your email address as the username and enter your password if it is not already there. Enter anything you like for the description field — it’s the label you’ll see in the sidebar. Hit OK and you should be good to go.

text-rendering:optimizeLegibility;

Safari has historically had lousy kerning on its text rendering. This was particularly notable for headlines.

A while back, a fix was implemented. It wasn’t turned on browser-wide because of the performance implications, but it can be turned on by a web developer by setting the appropriate style.

The attribute to set is text-rendering and the value to set it to to enhance kerning and enable ligatures is optimizeLegibility.

The examples below show two pairs of headlines. The first in each pair has this style attribute set, and the second does not (technically, the second is set to optimizeSpeed). If you have Heveltica and Zapfino installed on an OS X device, you should see nicely rendered text below:

Text

Text

baffle

baffle

Find more about thc/marijuana detox.

Chaining vs. Nesting

Any UNIX sysadmin who’s been around the block a few times has probably written a line something like this:

netstat -n | grep tcp | awk '{ print $5}' | sort | uniq -c | sort -n

Each command in this line produces output, and the end of the line, since it’s not shunted off to a file anywhere, prints to stdout. Every command (other than the first) accepts input on its stdin and has its output directed into the next command to the right.

If we were to write this in C-like pseudocode, it would look something like this:

print(sort_n(uniq_c(sort(awk(grep(netstat_n(), "tcp"), 5)))));

Or we could use the Lisp convention of including the function name as the first element of an S-expression:

(print (sort_n (uniq_c (sort (awk (grep (netstat_n) "tcp") 5)))))

This is essentially the same functionality as the command line, but this time each function passes its output to the enclosing function. Each function takes input from one of its arguments and optionally modifiers from the rest of its arguments. To the untrained eye it looks almost inside-out. You could reverse the order like so:

(((((((netstat_n) grep "tcp") awk 5) sort) uniq_c) sort_n) print)

Which makes it read from left to right but doesn’t make it any more readable: the problem is that you’ve got the primary parameter, followed by the function name, followed by any secondary parameters. We can change it once more and loop very nearly back to the original command by translating it into a method-chaining style, as is common in Ruby or jQuery:

puts netstat_n.grep("tcp").awk(5).sort.uniq_c.sort_n

This is certainly shorter (although I’ve cheated by omitting optional parentheses as allowed in Ruby) and arguably more readable. There is some evidence that non-programmers basically don’t really grok hierarchies, and I, for one, definitely have an easier time thinking about sequences than about hierarchies.

But making this happen is a bit more subtle than it appears at first glance. netstat_n would produce an array object, which would have a grep method that takes one argument (the expression to search for), and would output an array of the objects that match. awk would be another method on an array that would take an array of strings and return an array of substrings. sort, uniq_c, and sort_n would similarly be methods of the array object.

So at the very least you’re muddying up your array class with a bunch of things that are only peripherally related to arrays. Ruby solves this by making your write the more application-specific functionality as a block that gets passed to, say, the select and collect methods on array. So things are kept relatively in order.

Another to keep in mind is that the Lisp syntax may be easier for a program to manipulate: because the whole program consists of a giant nested list, any program with a nested-list-processing facility is able to manipulate the program with ease (it is likely, however, that one could define a relatively straightforward transformation from one form to the other).

Method chaining’s sweet spot seems to be in areas where functions have one dominant input (plus zero or more modifiers) and an equally obvious single output. Where the method chaining approach breaks down is in areas where two inputs have roughly the same importance. For instance, a conditional:

(if (> price 50) "expensive" "cheap")

You almost have to introduce some kind of special syntax, e.g.:

(price > 50) ? "expensive" : "cheap"

But this is the sort of muddling of statements and expressions that makes the Baby McCarthy cry. You could introduce a new syntax, for instance using a comma to separate two inputs that should be directed to a single consumer:

"expensive","cheap".if(price > 50)

But I’m not sure if that’s unfamiliar or just plain ugly. The way this would work is that if would be a method of a two-element tuple object that would return the first value if its parameter were true or the second if it were false.

It would make more sense to have if be a method on a boolean expression, but I can’t think of a clean way to encode that without having a clean way to feed a function multiple inputs.

So it’s certainly doable, but that last code snippet is a good deal less readable (for both man and machine) than the Lisp version. A language based almost completely on method chaining might make for an interesting academic exercise, but it looks like it won’t buy too much in practice.

Obvious but Subtle Password Policy

After having a friend’s email account compromised (which he only found out about after a bunch of fortunately harmless spam went out), I got to thinking how it might have happened.

I’m guessing it wasn’t a terribly strong password, but at the same time, attacking a site like gmail with more than a few bad passwords will get you CAPTCHA’d if not completely locked out. Then it occurred to me that what likely happened is another site was compromised that used his email address as the username and the same password.

Typically I’ve had three levels of passwords: One for banking, PayPal, eBay, and other things where security is really job one. I use a second password on accounts like, say, Amazon, where someone might be able to order stuff in my name. If it’s compromised it will be a pain in the ass, but ultimately I’m not going to lose my life’s savings. Finally I have a password that I use for throwaway sites (comment boards, registration walls, etc.). In a perfect world I would have unique passphrases for every site I visit, or give my life over to something like 1Password, but the preceding is basically how I roll.

But I learned an important caveat: your email should have its own unique password, different from those you use anywhere else, particularly places where your email address is your username. After all, in most cases someone who has access to your email can use a “forgot password” link to be able to log into almost any site you’re registered for. So having your email compromised is kind of a Big Deal.

So until the day when you have unique 20-character passphrases for everything, do change your email password to something strong and different from anything else you have a password for.

Dealing with 20 Languages on a Résumé

A few months back I interviewed with a local internet company. During the course of the interview, they mentioned a pretty brilliant strategy for separating the people who know the names of 20 different programming languages from those who have actually used those languages.

If you don’t already have experience with some or all of the languages a candidate lists, it’s pretty hard to design a test to see if a candidate knows how to program in a language. Particularly if the reason you’re hiring is that you’re so busy that you hardly have the time to interview prospective hires. For the purpose of the interview, you need to be able to pretend that you’re an expert in the languages listed. This is the sort of situation game theorists refer to as bullshitting a bullshitter*.

You want to ask for something that anyone who has built a significant project in the language  would have memorized in the first week. It should also be something that is pretty quick to look up and can be unambiguously checked against a language spec. It shouldn’t involve any of the language’s dusty corners that even someone with years of experience might have to look up, if for no other reason than that it’s pretty hard to come up with a question like that coming from a position of zero experience.

One good option is to pick a very simple problem, like having them write “Hello World” — or slightly more time-consuming, FizzBuzz — in the languages they’ve listed. But if you don’t have a compiler or execution environment handy, it’s fairly time consuming to check, particularly around obscure obsolete language number 19.

The easiest option, which also has an important side benefit, is to ask the candidate how to write a valid comment in each of the languages they’ve listed. Anyone who has any significant experience in a language should be have the comment syntax down pat, even for something they haven’t used in years. The side benefit is that you can find out to what degree the candidate bothers to comment his or her code.

Like any bullshitting-a-bullshitter situation, it’s a brittle strategy: If the candidate knows the question, he or she can cram for it as easily as you can. But it has the advantage that it’s no worse than other cram questions, and is really easy for an interviewer to cram for.

*The part about the game theorists is totally made up. Bullshit, as it were.

You can’t tell people anything

Randy Farmer and Chip Morningstar’s Blog “Habitat Chronicles” is full of really excellent insights, not just with regard to building virtual worlds and communities. 

One of my favorites is this piece, called You can’t tell people anything:

What’s going on is that without some kind of direct experience to use as a touchstone, people don’t have the context that gives them a place in their minds to put the things you are telling them. The things you say often don’t stick, and the few things that do stick are often distorted. Also, most people aren’t very good at visualizing hypotheticals, at imagining what something they haven’t experienced might be like, or even what something they have experienced might be like if it were somewhat different. 

But also check out their entry on how smart people can rationalize very bad ideas and their hilarious dismantling of post-modern literary criticism.

Improving on “Righty-Tighty”

Most mechanically-inclined people are familiar with Righty Tighty and his sister, Lefty Loosey (Lucy?). The idea is that to tighten a fastener, you turn it clockwise (moving the top of the fastener to the right relative to its center), and to loosen it you turn it counterclockwise (moving the top of the fastener to the left). 

This works great for standard situations, where you’re facing the fastener and “loosening” the fastener results in it moving toward you. However if you’re trying to loosen a nut on a bolt that’s at any other angle relative to you, the mnemonic won’t help, and could very well end with a shorn-off fastener. God help you if you’re trying to loosen a pipe union. 

My solution to this (mine only in the sense that I arrived at it independently) is both completely obvious and yet unheard of by most people. Engineers refer to the standard way in which fasteners are threaded as “right-handed.” Only a few items on Earth (for instance the left pedal on most bicycles and the left axle nut on some cars) use the other orientation (called, you guessed it, “left-handed threads”). It turns out this nomenclature has some basis in the real world.

The Right-Hand Rule

The Right-Hand Rule

Sophomore physics students are familiar with illustration above from the right-hand grip rule in electromagnetics: if your right hand is grabbing a conductor such that the current flows in the direction your thumb is pointing, your fingers point in the direction of the circular magnetic field around the conductor. 

Well right-handed threads obey a similar rule: a fastener turned in the direction that your closed right hand’s fingers curl will move in the direction that your extended thumb is pointing.

So if you’re trying to remove that stubborn oil filter from the other side of the engine block, just point your right thumb in the direction that you want it to move (presumably away from the engine block) and turn in the direction your fingers are pointing. 

Just remember when to use your left hand changing the pedals on your bike.

My Favorite Election Website

I’m not sure how well known this site is, but it’s a great tool for understanding the politics of federal elections in the US. The site is http://www.electoral-vote.com/. If you’re not familiar with it, check it out.

These Folks Don’t Mince Words

In some industries, it’s best to be less than completely forthright about what your product does:

dog-shit-bag.jpg

My guess is some poor sap with a Chinese-English dictionary printed up a few tens of thousands of these, only to have mainstream pet retailers reject them. The ended up at a dollar store in Calgary.

HOWTO Disable that annoying Emacs Splashscreen

The new emacs included with OpenSuSE 10.3 includes a “feature” that displays this irritating little splash screen when you’re trying to edit a file. It’s almost irritating enough to switch to vi.Fortunately, there’s an easy way to disable it. Create or edit the file called .emacs in your home directory:

$ vi ~/.emacs
and add the following line:
(setq inhibit-splash-screen t)
and voila, it’s gone for good.