Home
Rob Mayoff [entries|archive|friends|userinfo]
Rob Mayoff

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Moved [Nov. 4th, 2006|07:50 pm]
I have moved my blog to qwan.org.
link2 comments|post comment

(no subject) [Sep. 17th, 2006|10:48 pm]
We're sitting around watching a video on youtube of "strikeouts", which is where you take a bong hit and hold it in, chug a beer, take a shot, and then exhale. Tony says, "I bet bird flu will put an end to this."

Everyone else says, "Bird flu? What the fuck?"

Tony says, "Who would want to share a bong with bird flu running around?"
linkpost comment

making spotlight tolerable [Aug. 15th, 2006|12:28 pm]
The Mac OS X Spotlight menu (the blue circle in the upper right corner of the screen) is incredibly annoying.  You decide to use Spotlight to find something, so you click the menu or press Command-Space, you type your search string, and then you remember how annoyingly slow Spotlight is.  And you can't decide to do anything else on the computer while you're waiting, because clicking anywhere else will abandon the search.

The key to making Spotlight useful is to change Command-Space to pop up the Spotlight window instead of the Spotlight menu.  The window can perform a search while you're doing things in other windows - the menu can't.  So the frustrating slowness of Spotlight becomes tolerable because you're not locked out of your Mac while waiting for the search results.

You can change the mapping by opening System Preferences.  Click on Keyboard & Mouse.  Then click the Keyboard Shortcuts tab.  Scroll down a bit to the Spotlight section.  Uncheck the checkbox next to "Show Spotlight search field".  Double-click the shortcut area at the right end of the line that says "Show Spotlight window" and then press Command-Space (or whatever you want to use).  Now, pressing Command-Space will open the Spotlight window with the insertion point right in the search field, waiting for your input.  While waiting for the results, you can work in other windows.
linkpost comment

Mortgage Calculator [Jul. 2nd, 2006|05:11 pm]
I've been thinking about how to compare mortgages, because I'm buying a house. There are several decisions to make. I've written a mortgage calculator that takes them all into account. It's in Javascript, and I've tested it in Safari and Firefox. I seriously doubt it works in Internet Explorer. Anyway, here are the decisions.

Any money used to pay off the loan principal is effectively an investment with the same interest rate as the loan. Several of the decisions are between paying down the principal and investing the money elsewhere. You have to decide whether you think you can invest at a better rate than the loan's. If so, you generally want to invest rather than pay down the loan principal. If (like me) you think you can't invest at a better rate than the loan's, then you have to decide how much liquidity you want, because money used to pay down the loan principal can't easily be reclaimed.

You can spend money on "points" to get a lower interest rate, or you can put that money into a larger downpayment, or you can invest the money. This has an additional tradeoff: if you think you'll refinance the loan at some point, you have to consider whether the lower interest rate will cover its cost by the time you bail out, which involves looking at your equity and your investment at the time of the bail-out. On the other hand, if you intend to pay off the loan without refinancing, then you will always end up with the full equity of the property and you only need to consider your investment's value at the end of the loan.

You can choose a shorter loan term, which gets you a lower interest rate, but your monthly payment is higher. Or you can take a longer loan term, which gives you a higher interest rate but a lower monthly payment. You can then go ahead and pay extra each month, paying off the loan early. By taking the longer term loan and higher interest rate, you're buying the option of making lower payments, which is handy if you might want or need to live off your savings for a while.

You can deduct the mortgage interest from your taxable income, so a higher interest rate gives you a larger tax deduction. You can either invest the tax savings or you can add it to your monthly payments.

There's another factor which I haven't implemented yet: inflation. You're borrowing today's dollars and paying back future dollars. Because of inflation, future dollars will have less buying power than current dollars. If you assume that your earning power will keep up with inflation, then inflation effectively reduces the interest rate of the loan. I haven't decided exactly how to handle this in the calculator yet.
linkpost comment

John Raese is a spammer [Jun. 29th, 2006|11:35 am]
If you live in West Virginia, please don't vote for John Raese.  He's a spammer.  I don't even live in West Virginia and he's sending me his junk email.
linkpost comment

fedora core 4 upgrade problems [Mar. 4th, 2006|12:21 pm]
I tried to upgrade my Thinkpad A30p from Fedora Core 3 to Fedora Core 4. First I tried using a DVD, but apparently the A30p doesn't boot off DVDs. Then I tried a CD and it booted that but after LILO the screen just went black; even the text mode install ("linux text" at the boot prompt) didn't fix it. Using "linux nofb" at the boot prompt fixed that problem.

Then when I told it to start the upgrade, I got an unhandled exception:

Traceback (most recent call list):
  File "/usr/lib/anaconda/gui.py", line 1137, in handleRenderCallback
    self.currentWindow.renderCallback()
  File "/usr/lib/anaconda/iw/progress_gui.py", line 244, in renderCallback
    self.intf.icw.nextClicked()
  File "/usr/lib/anaconda/gui.py", line 873, in nextClicked
    self.dispatch.gotoNext()
  File "/usr/lib/anaconda/dispatch.py", line 174, in gotoNext
    self.moveStep()
  File "/usr/lib/anaconda/dispatch.py", line 242, in moveStep
    rc = apply(func, self.bindArgs(args))
  File "/usr/lib/anaconda/packages.py", line 827, in doPreInstall
    f.close()
IOError: [Errno 22] Invalid argument


This happened because I had replaced my /etc/mtab file with a symbolic link to /proc/mounts. Anaconda (the RedHat/Fedora Core installer) tries to truncate /etc/mtab and could not do so. Replacing the symbolic link with an empty file fixed this problem.
linkpost comment

How to get a $1550 discount on a flat-panel TV [Dec. 12th, 2005|09:22 pm]
Step 1. Own a TV stand that takes about 7.75 square feet of floor space.
Step 2. Buy a house for $200 per square foot.
Step 3. Buy a flat-panel TV and mount it on the wall.

You have now reclaimed approximately $1550 worth of square footage.

(No, I haven't bought a new house yet.)
linkpost comment

video games [Dec. 3rd, 2005|11:21 pm]
David Plays Guitar Hero

Shadow of the Colossus: Excellent. It's longer than Ico, with more action, and just as beautiful and intriguing.

Ratchet: Deadlocked: Disappointing. They kind of phoned it in on this installment, I think. The story was virtually non-existent. I didn't find the weapons to be as entertaining. Maybe I'm just getting tired of this series. I haven't tried the multiplayer support.

SSX On Tour: Satisfying. The snowboarding gameplay is largely the same as in SSX3 (except for the ubertrick system), but on a new set of runs. I haven't tried skiing yet.

Guitar Hero: Satisfying. Almost excellent. The guitar controller makes it easy for non-video-gamers to get into this game. However, for the hardcore gamer this game falls short of Dance Dance Revolution. DDR has an extensive practice mode, and GH desperately needs a similar mode.
linkpost comment

Tracing message sends in Objective-C [Oct. 30th, 2005|10:05 pm]
[Tags|, , , ]

So now I'm trying to get bindings working when I put my NSCell subclass in a table column. It appears, for the standard NSCell subclasses, that NSTableColumn looks at the subclass's exposed bindings and re-exposes them on itself. However, it's not doing that for my NSCell subclass's bindings.

So, I want to trace the messages that are flying around inside Interface Builder to see if I can figure out how NSTableColumn decides what bindings to expose. Ideally I'd have a little dynamic library with a logging version of objc_msgSend and I could get Interface Builder to run using that. I don't have that (yet). I found this old Usenet post from a NeXT engineer showing how to trace objc_msgSend using GDB. That will be much slower than smashing in a logging version of objc_msgSend, but it's better than nothing.

Of course, the GDB command in that Usenet post is for NEXTSTEP running on Intel. It'll probably work on MacOS X running on Intel, but my Powerbook has a PowerPC processor. Also, Apple introduced a new message-send function in Tiger, so you have to set two breakpoints. These commands work on MacOS X on PowerPC:
b objc_msgSend
comm
silent
printf "%c[%s %s]\n", $r3&&((id)$r3)->isa->info&2?'+':'-', $r3?((id)$r3)->isa->name:"nil", $r4
cont
end
b objc_msgSend_rtp
comm
silent
printf "%c[%s %s]\n", $r3&&((id)$r3)->isa->info&2?'+':'-', $r3?((id)$r3)->isa->name:"nil", $r4
cont
end

Here's some sample output from GDB, tracing the first few messages sent in -[NSObject exposedBindings]:
-[NSTableColumn _bindingAdaptor]
+[NSBinder binderClassesForObject:]
+[NSBinder _allBinderClasses]
+[NSDisplayPatternTitleBinder isUsableWithObject:]
+[NSBox self]
-[NSTableColumn isKindOfClass:]
+[NSWindow self]
-[NSTableColumn isKindOfClass:]
+[NSWindowTemplate self]
-[NSTableColumn isKindOfClass:]
+[NSTableBinder isUsableWithObject:]
+[NSTableView self]
-[NSTableColumn isKindOfClass:]
+[NSObjectParameterBinder isUsableWithObject:]
+[NSObjectParameterBinder binderClassesSuperseded]
+[NSArray array]
+[NSArray allocWithZone:]
linkpost comment

Dragging an NSCell subclass from an Interface Builder palette [Oct. 30th, 2005|05:18 am]
[Tags|, , ]

If you've got your own NSCell subclass that you want to put on an Interface Builder palette, you'll probably think that you need to call -[IBPalette associateObject:ofType:withView:] using IBCellPboardType as the type. This doesn't work. It turns out you need to use IBTableColumnPboardType. I don't know what IBCellPboardType is for.

Also, IB will send -[NSCell setObjectValue:] to your cell to fill in the dummy values in puts it tables in design mode. So you have to be able to accept the values it sends (probably of type NSNumber and/or NSString), even if your cell doesn't normally accept values of those types.

Also, if you want to see how IB's built-in "Data Views" palette (the one with the table view and the cells on it) draws the built-in cells, open up this nib:

/Developer/Applications/Interface Builder.app/Contents/Resources/CocoaFramework.palette/Contents/Resources/IBDataViews.nib

It turns out to be kind of a hack, with two NSTextFields and some appropriate control (NSButton, NSSlider, etc.) on top of each other, nested in a simple NSView. The NSTextFields are set up to overlap, with the bottom one having a black border and the top one having no border and covering the sides of the bottom one.

It's very handy to add a "custom executable" to your IB palette Xcode project, with the executable being "/Developer/Applications/Interface Builder.app". Then you can press Command-R to start IB to test out your palette, or Command-Y to run IB under GDB so you can debug your palette. Be careful not to start IB by some other mechanism (like by double-clicking a nib) if you're going to use this technique, because IB won't start up correctly and (at least for me) Xcode will probably hang.
linkpost comment

Full screen QuickTime Player for free [Oct. 14th, 2005|12:57 am]
It's fairly easy to make QuickTime Player go full screen, even if you don't want to pay for "QuickTime Pro". You can do it with a small AppleScript and the Script Menu. (This was inspired by QuikTimeFS, but that requires running an extra little application every time you want to go full screen.)

Instead of walking you through the process of enabling the Script Menu, creating the necessary folders, and using the Script Editor to create the one-line AppleScript, I've written an AppleScript that does all of those steps for you: Setup Full Screen.

After you download and run that, you'll have the Script Menu toward the right end of your menu bar. It looks like this: Script Menu icon.

If you launch QuickTime Player, you'll find a Full Screen script in the script menu:

Full Screen Menu Item

When you select that menu item, if you have a movie open, the movie will play full screen. You can press the Escape key (labelled "esc" at the upper left corner of your keyboard) to get back out of full screen mode.

If you don't trust me, you can inspect the Setup Full Screen script by opening it with Applications > AppleScript > Script Editor.

Update: It turns out I'm not the only one to think of this. QT Full Screen does roughly the same thing, but uses an Installer package to install the full-screen script instead of doing it in an AppleScript.
link12 comments|post comment

LabelWriter Catch-22 [Oct. 12th, 2005|09:05 pm]
Meanwhile, I'm way, way behind in my filing. I wanted to catch up a bit, and discovered that my Dymo LabelWriter 330 Turbo (which prints my folder labels) is dead. If I want to get it fixed under warranty, I need to find the receipt. To find the receipt, I need to file my huge backlog of documents. To file my huge backlog of documents, I need to print folder labels.

Update: I found the e-mail receipt from buy.com (in my "Receipts" e-mail folder, no less). It's still under warranty and I've got an RMA from Dymo.
linkpost comment

More 2405FPW [Oct. 12th, 2005|08:57 pm]
I've been so spoiled by the Dell 2405FPW on my desk at work that I just ordered one for home (about $780 before tax thanks to a 35% deal that expires today). Now I have to decide whether to sell my 2001FP (20.1" 1600x1200 LCD) or buy a PCMCIA video card so I can connect both to the Powerbook simultaneously.

Meanwhile, others at the company liked the 2405FPW enough that the company bought nine more of them.

Oh yeah, and the replacement for the defective 2001FP arrived Monday, right on schedule.
link2 comments|post comment

video games [Oct. 6th, 2005|11:07 pm]
Ultimate Spider-Man: Disappointing. I was hoping for a game that would improve on the Spider-Man 2 experience. This didn't. The graphics are fine - I like toon shading. The story is very short, and not nearly as good as Spider-Man 2's. The controls and the fighting are vastly simplified from Spider-Man 2. There is almost nothing in the way of ability upgrades, unlike Spider-Man 2.

We ♥ Katamari: Satisfying. There's nothing revolutionary here, but there are some nice new features. Katamari Damacy left me wanting more, and this meets that desire well. The soundtrack is not as good, though.

Sly 3: Band of Thieves Satisfying. I thought the original Sly Cooper and the Thievius Racoonus was pretty good, and I thought Sly 2: Band of Thieves was great. This is a lot like Sly 2, but the clue bottles are gone, you get to play several extra characters with neat abilities, and the mini-games are quite fun. Also, remarkably, Sly's special attacks work against the bosses, which is pretty unusual in my experience.

I'm looking forward to Shadow of the Colossus (from the creator of Ico), and I'll probably buy SSX On Tour and Ratchet: Deadlocked too. Yes, I've noticed that five of these six games are sequels.
linkpost comment

Dell support for the service-tag-impaired [Oct. 6th, 2005|10:39 pm]
If you have a Dell product with no service tag, and you need support, expect to spend a long time on the phone.

I bought a Dell 2001FP LCD monitor on 2005/2/17. A few days ago, it broke. Specifically, about 20 black lines now run down the center of the display, with a few pixels between each. These lines show up even in the self-test screen, so it's definitely a problem in the monitor.

You can see the lines running across this image: Close Up of Broken Monitor They run horizontally in the image because I've got the monitor rotated 90°. The problem is much more apparent in real life. It's difficult to photograph (at least with my crappy camera).

I quickly discovered that you cannot get on-line support unless you have a product with a service tag (a short unique string like a serial number). Dell monitors don't have service tags. If you have the monitor connected to a Dell computer, you can use the computer's service tag. My monitor is connected to my Apple PowerBook.

My only option was to call Dell tech support. The number wasn't easy to find, either. I found it on the warranty page, which was also not as easy to find as it should have been:

http://www1.us.dell.com/content/topics/global.aspx/policy/en/policy?c=us&cs=19&l=en&s=dhs&~section=010

As you might expect, this was followed by a total of about 30 minutes on hold. They have promised to ship me a new monitor, and it should arrive Tuesday or Wednesday.
link3 comments|post comment

Treo 650 at last [Sep. 13th, 2005|06:23 pm]
I finally gave up waiting for T-Mobile to release a Treo 650 and got one from Verizon. I was spurred to do so because I also wanted to get a Verizon EVDO card and the EVDO monthly rate is $20 less if you have a Verizon phone.

What do you call it when they fix a regression? The Treo 600 had a serious regression from the Treo 270. In the 270's phone application, you could either dial a number or do an address book lookup, without telling the phone which one you were doing, and it would magically figure it out. You'd just start pressing the buttons and the phone would figure out what you were trying to do. The Treo 600 lacked the feature and it annoyed me to no end. Well, the 650 has the feature again.

However, perhaps as payment, the Treo 650's calendar application has a serious regression. On previous Treos, the calendar has an "upcoming events" view that lists as many of the next future events as will fit on the screen. I used this view often. The Treo 650 lacks that view.

Also, the 650's Bluetooth support is weak. It supports headsets and handsfree kits, and supports hotsync over Bluetooth. There's a hack that lets you do (incredibly slow) Bluetooth dial-up networking (DUN). But there's no Bluetooth file transfer, nor does the 650 work with Mac OS X's Address Book.
linkpost comment

python debugger script [Sep. 8th, 2005|10:48 am]
Put this in a file named pdb in your $PATH and make it executable:

#!/bin/bash
exec python "$(python -c 'import pdb; print pdb.__file__')" "$@"


Now if you want to run some Python script under the debugger, run pdb on it. For example, if you have a script named reverse.py that you want to run under the debugger:

$ pdb reverse.py
> <string>(1)?()
(Pdb) s
--Call--
> /Users/mayoff/reverse.py(1)?()
-> class Node:
(Pdb) 
linkpost comment

A DVD player that sucks less [Aug. 7th, 2005|11:35 pm]
Remember the good old days, when you'd rent a video tape, put it in the VCR, and fast forward through the FBI idiocy and the trailers to the movie? Now you get a DVD from Netflix but you can't skip the FBI idiocy, and sometimes they even throw in some non-skippable ads. Then you have to watch a menu animate onto the screen, select "Play Movie", and watch the menu animate back off the screen. I hate Hollywood so much.

My savior has arrived in the form of a GoVideo VR3845. This combination DVD-recorder and VCR has a feature called "Autoplay". You put in a DVD and it automatically skips the FBI blah, the ads, the trailers, and the menu and just plays the movie. Brilliant! I've only tested it on one DVD so far (Igby Goes Down) but it worked like a charm.
link1 comment|post comment

Paul Graham's Accumulator Generator, in PostScript [Jul. 25th, 2005|06:45 pm]
In Revenge of the Nerds, Paul Graham defines the accumulator generator problem. Solving it requires using a programming language that has, or can simulate, closures and a polymorphic add function. He presents solutions in a number of languages, submitted by various people.

He's no longer accepting solutions, but I managed to solve it in PostScript anyway:

/make-adder {
    [ exch
        [ exch ]
        {
            dup 3 1 roll
            0 get add
            dup 3 1 roll
            0 exch put
        } /exec cvx
    ] cvx
} def


You can test it out in Ghostscript. For example:

GS>/x 1 make-adder def
GS>5 x ==
6
GS>/y 3 make-adder def
GS>2.3 x ==
8.3
GS>.7 x ==
9.0
GS>10 y ==
13
linkpost comment

Dell 2405FPW [Jul. 13th, 2005|02:52 pm]
At my office I've been connecting a Sony 20" 1600x1200 LCD monitor to my Powerbook. However, this only lets me put two 80-column Terminal windows side-by-side. There's more horizontal space, but not enough for a third 80-column terminal. (Not at my preferred font size, anyway). So I ordered a Dell 2405FPW, which is 24" and 1920x1200. It has enough room for a third terminal.

Most of the other LCDs around the office are Apple displays, but the Dell displays have a few advantages. First, they're cheaper. Second, the Dell stands are much more flexible. Third, the Dells have four USB ports. Fourth, the Dells support VGA, S-Video, and composite video inputs in addition to DVI. The 2405FPW also supports component video and has four memory-card reader slots. The only advantage of the Apple monitors is that they have a Firewire hub, but nobody here needs that.

My 2405FPW arrived Tuesday. The stand is height-adjustable and rotates, unlike the Apple stand. In addition, it supports rotating the monitor 90 degrees, into "portrait" orientation. MacOS X supports this (you set it in the Displays system preference pane), so I decided to try it just for fun.

It turns out that this is totally awesome. Here's what it looks like:

Powerbook and 2405FPW

I actually had a sense of vertigo looking at the monitor this way. The viewable area is about 20.5 inches tall. What sold me on this arrangement is that I can now get four tall (57-line) 80-column terminals on the screen with no overlap:

Powerbook and 2405FPW with terminals
link5 comments|post comment

navigation
[ viewing | most recent entries ]
[ go | earlier ]

Advertisement