Quick Searches

by Tom Temple

17 August 2010, 06:51

I’ve been using Quicksilver ever since I got a Mac. My favorite feature was the ability to make a “trigger” i.e., hotkey, for web searches. I used to press ctrl-apple-g, type some text and then my web browser would come up with the google results. ctrl-apple-w and it would be wikipedia instead.

I set this up again in 10.6 (using QS ß58 (3841) and the Web Search module (version 104)), but the custom trigger breaks whenever I restart quicksilver. So I played around until I found a work-around here.

Basically, what you do is you

  • install the “Service Menu Module”
  • turn on “get selected text from front application” in prefs/extras
  • assign a hotkey the “Command With Selection” trigger

The last two bullets are things that I wanted anyway. Since Safari offers “search with google” as a service, that’s all the pieces.

This isn’t quite what I wanted, but it works. If I want to search selected text I do the hotkey then “s” and then enter. If I want to search for what I type, I do the QS hotkey then the search string (adding a space if there isn’t one) then tab, “s” and enter.

I can live with that, but I want wikipedia too. I can’t see how to add other searches as a service to Safari. It seems that to make something a service it needs to be in a menu. Maybe I’ll see if Chrome or Firefox can do it. But I think I’m near the point where the additional return isn’t worth the effort.

Update: You can eliminate the need to type “s” by increasing the priority of “search with google.” I’d recommend something between “open url” and “large text”

Saving unsavable pdfs

by Tom Temple

17 April 2010, 11:22

This tax season you might have used an Adobe web form. I used one for Ohio. I just did an SF85 (clearance form) and it was one too. If you tried to save the form, it would tell you something like “Saving form data is disabled. Do you want to save the blank form?” So you tried to print it to PDF. Disabled. Postscript. Disabled. Bullshits!

So I installed a CUPS-PDF printer. The idea is that you add a printer that actually just saves it to a file. Linux users will be saying “duh” here, but when using an Adobe product on a Mac, its not obvious how.

Go here for a really easy Mac installer. Well, it wasn’t super easy. I had to do some chmoding and making a directory ~/Desktop/cups-pdf (all described on the linked page) before I could do it. Also, the printer it created wasn’t called “virtual printer” but “CUPS-PDF” so it took a minute to find.

UPDATE: It seems that sometimes you need to “print as image” (in advanced options in the print dialog).

Back up plans

by Tom Temple

8 March 2010, 16:31

I’ve done a little bit of job applications before but never in earnest. I recently lost some naivete that I think I should share with you.

I already knew that hiring people are always very positive. They want to keep their options open. If it is possible under the most improbable set of circumstances that they might want to hire you someday in the future, they want to keep that option. So I don’t get excited when I have good interviews and hear encouraging things from HR or management.

What I didn’t know was how far they’ll go. I just had a job offer rescinded after a month. During that month I passed up a number of opportunities that I’m probably not going to get back.

I just learned to keep hunting until a contract is signed. And if you’re going to be working “at-will”, I would keep job hunting until I had my name on a door… and not in paper.

Minimum Squared Loss

by Tom Temple

26 January 2010, 09:46

I think I’ve got Netflix pretty well trained to give me good movies. Of course this is largely a good job on their part; but I think that I had something to do with it.

I only rate 5s and 1s. Everything in between I don’t rate.

I’m pretty sure that Netflix still uses quadratic loss when predicting your ratings. I think this is really holding them back since it puts an artificial central pressure on ratings. I’m also suspicious that there is a thresholding effect at 4 stars. Specifically, for clustering purposes, I think considers 4 and 5 stars to be the same thing, “movies you liked”. It finds other people who have a high intersection of 4—5 movies and uses them as predictors.

Early on, I rated X-men 3 at the 4 level which led to systematic over-prediction of franchise action movies. That was a mistake. I fixed that by downgrading it to 3 but then putting a 5 on X-Men 1.

Every time I see a bad movie, I make sure to tell Netflix, especially if everyone else rated it highly, e.g., Million Dollar Baby.

Rollover Gotcha

by Tom Temple

7 January 2010, 14:03

If your wireless usage is between 550 and 2100 min/mo and you’re on AT&T, it might strike you as a good idea to get the the 2100 min/mo plan to take advantage of rollover minutes. That is because you don’t have to worry about going negative and paying the ridiculous premium, while at the same time taking advantage on the price non-linearity.

Continue...

Fahklift Certification

by Tom Temple

21 November 2009, 17:48

Dahndest thing happened to me today. I gave my usual class 4,5 class to a bunch of kids at MIT. Not only that, it was in that crazy fahking Statar Center up in this fancy-pants conference room.

They were all like 25-30 yeah olds so I assume theya all PhD students oha post-docs. So I ask them, “Whya you all wantin’ to drive fahklifts.” They look at me funny and one says, “because we’ve got one.” Fahkin’ MIT kids!

Continue...

Ricci and affirmative action

by Tom Temple

21 November 2009, 11:16

Looking at the Michigan case again through the lense of Ricci I think I’ve decided how to do affirmative action.

Continue...

An unexpected surprise hanging

by Tom Temple

11 November 2009, 09:34

This riddle is called The Unexpected Hanging Paradox

A judge tells a condemned prisoner that he will be hanged at noon on one weekday in the following week but that the execution will be a surprise to the prisoner. He will not know the day of the hanging until the executioner knocks on his cell door at noon that day. Having reflected on his sentence, the prisoner draws the conclusion that he will escape from the hanging. His reasoning is in several parts. He begins by concluding that the “surprise hanging” can’t be on a Friday, as if he hasn’t been hanged by Thursday, there is only one day left – and so it won’t be a surprise if he’s hanged on a Friday. Since the judge’s sentence stipulated that the hanging would be a surprise to him, he concludes it cannot occur on Friday. He then reasons that the surprise hanging cannot be on Thursday either, because Friday has already been eliminated and if he hasn’t been hanged by Wednesday night, the hanging must occur on Thursday, making a Thursday hanging not a surprise either. By similar reasoning he concludes that the hanging can also not occur on Wednesday, Tuesday or Monday. Joyfully he retires to his cell confident that the hanging will not occur at all. The next week, the executioner knocks on the prisoner’s door at noon on Wednesday — which, despite all the above, will still be an utter surprise to him. Everything the judge said has come true.

What is wrong? Is anybody abusing logic here? If so, who?

Suppose that he was told the execution would be either Monday or Tuesday (equivalently, the week only has two days) and he was executed on Monday. Is this case different?

But he was already winning

by Tom Temple

26 October 2009, 18:09

A while back Christopher Hitchens issues an open invitation to debate atheism with anybody. One of these debates turned into a movie that comes out (straight to DVD!) tomorrow. Honestly, I’m pretty confident that the movie is going to be consummately boring not least because Wilson concedes a lot and seems primarily interested in the “Without religion, i.e., if life is meaningless, how do you establish morality?” question. That should be a pretty easy one.

Anyway, I’m just posting to tell people to listen to the last little bit of this Laura Ingraham appearance where, on the buzzer, Hitch nails a three-pointer from half-court.

Cosmo's Anger, While Entertaining, Is Often Misdirected

by Joran Elias

21 October 2009, 14:06

Cosmo apparently doesn’t know much about credit/debit cards. Namely that everything he purchases from a merchant that accepts credit/debit cards costs as much as 3% more than it should.

(Yes, you read that right. Merchants often raise all their prices by 1-3% to cover the fees they pay to provide the optional convenience of credit/debit purchases. If you buy everything in cash, you’re still subsidizing other people’s use of credit/debit cards.)

Your government is trying to save you money, Cosmo.

Thank them.

The Perpetual Overhyping of US Men's Soccer

by Joran Elias

11 October 2009, 17:52

I didn’t get to watch the game, but the US men’s soccer team beat Honduras over the weekend by a score of 3-2, which assures their participation in the 2010 World Cup in South Africa.

Color me unimpressed. Honduras, media outlets are quick to point out, has been tough to beat at home. Of course, they really only play CONCACAF opponents, particularly at home.

And judging by the highlights, the US only barely edged out a win. Honduras should have tied the game in the 87th minute, but instead sent a PK over the cross bar. Not to mention the fact that Casey’s first goal looked, well, pathetic. For Honduras, that is.

It is stunning to me how much denial exists regarding the quality of soccer among CONCACAF nations relative to the rest of the world, Europe in particular. One really needs to keep in mind that Honduras (indeed, even Mexico these days) is just not a very strong force in international soccer.

This is perhaps an unfair comparison, but the Honduras men’s Olympic team lost all three of its games in 2008 (3-0 to Italy, 1-0 to Cameroon and 1-0 to South Korea). And this is the country we are excited about barely beating on the road?

Perhaps the most distressing fact about the team? Their midfield is so shitty, a player who has logged zero minutes with the US team, indeed hasn’t (to my knowledge) even practiced with the US squad, or any squad because he’s still rehabing from surgery is generally considered a likely starter as soon as he’s available, and has effectively been penciled into the lineup for the World Cup.

And this fact is referred to as a positive sign for the US squad going forward. Good grief.

Don’t get me wrong; if Jones is what people say he is (I’ve never seen him play) then he will surely help. But doesn’t this suggest something about the level of player we have right now? That some guy we’ve never seen play on our squad and is currently injured is considered a potentially massive upgrade in player quality?!

If I were Ricardo Clark, or Michael Bradley, or Benny Feilhaber or Sacha Kljestan, I’d find this situation fairly embarrassing.

Browsing for Images in OS X

by Joran Elias

9 October 2009, 14:03

This from Cosmo has me a little confused, because I generally consider him to be way more knowledgeable on the intricacies of OS X than myself.

And picking on Cosmo when I think he’s whining excessively is a sort of pastime of mine. So I would suggest to him scrolling down in the left pane of the open file dialog box. If he did, he ought to see a Media menu that expands to include a subset of Music, Photos and Movies.

It’s in every app that I’ve tried on my computer. I didn’t look carefully, but I’m guessing Cosmo was trying to upload an image from Chrome? If Google hasn’t implemented this feature, that’s their fault, not Apple’s.

Residency Matching

by Tom Temple

29 September 2009, 10:51

A few of my friends are going through residency matching with hospitals right now and by coincidence we ended up discussing that very problem in an optimization class.

The problem, as posed, is to find a perfect stable matching. The simple explanation is they are trying to find any matching such that there is no pair of assignments in which the two hospitals and two students would (all four) prefer to switch. This has little to do with optimality, except for that if anything were changed, at least one player would be worse off. It is notable that the classic version of the algorithm would produce a matching that favored one group or the other. In the residency problem, I wonder which is given the preference?...

The main point of this post is just to point interested people to that Wikipedia article. Beyond that, more recent scholarship has identified a number of nice properties of the problem (e.g. there exists a self-dual linear relaxation), which make it easier than it looks to find feasible assignments. As a result, I’m suddenly quite suspicious that DOC trips could effectively use commercial optimization software for trip assignments. That would be fun—perhaps even more fun than doing it by hand. Remember that, guys?

Gender selection

by Tom Temple

15 September 2009, 13:44

Saletan just posted an article about gender selection that reminded me a lot one I wrote.

In retrospect, my position was insufficiently nuanced to completely answer Bill’s question, so I’d like to clarify it.

I think that all the stated techniques are “okay” which should be interpreted as “should be left legally permisable.” From the context it should be clear that there is an ordering of preference going increasing from later abortions up to special condom. I guess you could say that this preference is “moral”. I like to think though that my system of ethics is more straightforward than that though.

So let me briefly write out Tom’s system of Ethics, (TSE).
Assume there is some global function (subject to restrictions that are beyond the scope of this article) that assigns values to various outcomes. An action’s “goodness” would simply the expected change of this global function. However, we cannot globally agree on this function.

Assume that we can somehow establish “robust consensus” on some convex family of functions. Any action with expectation greater or equal to zero for some function in the interior of this family is “permisable.” We can define a partial order such that an action is “better” if and only if there does not exist a function in the family which contradicts this preference. But this is not a full order, and certain preferences will be left to personal measurement.

We could try to define universal goodness in terms of measures over this family, but that’s what I would call “hide the potato”—agreeing on measures will be no easier than agreeing on a global objective.

Logarithmic Parlor Trick

by Tom Temple

11 September 2009, 01:16

Seeing how it is fast becoming job interview season, I thought I’d share a parlor trick with you guys. Business-type people are very easily impressed if you can do compounding interest in your head.
It boils down to being able to estimate natural logarithms. Here’s how:

Continue...