1. 2010
    Aug
    03

    Hall Pong: The sport of grad students

    Born out of a combination of ping-pong, racquetball, hockey, and sheer boredom, hall pong is a perfect way to procrastinate (and pretend to get some exercise) when you’re stuck in a basement office. It’s played in a hallway, with a goal line on the floor at each end, using a ping-pong ball and two paddles. The Official Rules are simple:

  2. 2010
    Jul
    26

    Linkless URLs in Facebook statuses

    Facebook doesn’t seem to distinguish between posted links and status updates anymore, which means that whenever you try to post a status with a URL in it, it automatically turns it into a posted link. Granted, they are mostly equivalent, but a link won’t show up as your current status or in the status update RSS feed, which I find annoying. But there is a solution! In retrospect, this should have been pretty obvious, but when you put a URL in your status, in the top right corner of the info box that pops up, there is a blue X which you can click to prevent Facebook from including meta-information about the URL. This has the side effect of making Facebook treat your update as a regular status, rather than a link.

  3. 2010
    Jul
    25

    Facebook does bug reports right

    There are a lot of complaints you could make about Facebook, many of them legitimate, but the bug reporting process is one thing I think they really do well.

    A while ago I had occasion to report a problem with the message inbox showing up as a blank page. As the first step in the process, Facebook presents you with a grouped list of categories corresponding to the different features of the site. Each one is tagged with the same icon used on other menus, so it’s easy to identify, and the images really help to visually distinguish the different categories. I much prefer that to the standard bug reporting interface, where all you get is a combo box with a long list of different products or categories (text-only of course), some of which you may not even be familiar with.

    On Facebook, when you click the category that matches your bug, you get a list of the common reports that have already been filed under that category. But unlike a typical bug listing which uses the (often non-descriptive) bug report titles submitted by users, the titles are written by members of the Facebook team, and they’re all …

  4. 2010
    Jul
    24

    RSS Graffiti

    I decided it’s about time to start syncing the posts I make here with Facebook to get some exposure for this site. Not because I think anyone will really care about my content, but everyone else seems to be doing it. I guess it puts pressure on me to write more interesting stuff, that’s probably good.

    Anyway, to test out the system and also as sort of an unsolicited “kickback” to what seems like it might be a good program, I wanted to mention RSS Graffiti. I picked up on it from a mention on the Webapps Stack Exchange site. Basically it’s an RSS/Atom feed aggregator: you configure it with the URLs of any number of feeds, and specify which ones should show up on your profile and the profiles of any groups, events, or pages you administer. The app checks periodically for new entries and posts them up to the destinations you specified. Nice and simple, which is actually just what I’ve been looking for in a Facebook RSS aggregator for a while. Here’s hoping it works as well as it looks!

  5. 2010
    Jul
    09

    Bad science on The Daily Show

    Normally I love The Daily Show. (Especially in HD) But Jon Stewart's interview with Marilynne Robinson last night really fell short of the usual standard. And not just because she wasn't funny. At 2:52 in:

    The more you delve into science, the more it appears to rely on faith.

    You know, when they start to speak about the universe, they say, well, it's actually, "Most of the universe is antimatter." "Oh really? Where's that?" "Well, you can't see it." "Well, where is it?" "It's there." "Can you measure it?" "We're working on it..."

    The Daily Show With Jon StewartMon - Thurs 11p / 10c
    Marilynne Robinson
    www.thedailyshow.com
    Daily Show Full EpisodesPolitical HumorTea Party

    No. Sorry. That's not science. For one thing, nobody with a clue really thinks most of the universe is antimatter. But the more important point is that observation is the core of science. If you can't see something, can't measure it, can't even produce any observable evidence that it exists, you can't pass it off as scientific fact.

    I have to wonder where Jon Stewart is getting this idea that scientists are relying on faith, claiming that things are true without having the …

  6. 2010
    Jul
    09

    Navicat for MySQL

    I’m used to using PHPMyAdmin (PMA) for managing my MySQL databases. It works fine for normal maintenance, like getting rid of the spam comments that sneak through my checks (of which there are, or rather were, none), but while setting up the new version of this site, I found myself wanting to transfer the entire contents of the database to my home computer so I could tinker with it and try to figure out how to convert it to the new format I needed. PMA doesn’t really do that. Sure, it can manage multiple servers, but it treats each one separately; as far as I know the only option for transferring data is to export it to a text file and import it into the new database. I’ve never had particularly great luck with PMA’s export function, and besides, since the whole structure was changing, I needed to take the information in each table of the existing database and split it up among different tables in the new database. I briefly considered processing SQL dump files with a Perl script but it quickly became evident that that would be a mess.

    So I went to my …

  7. 2010
    Jun
    24

    Environment variables and sudo

    A discovery I made: apparently sudo does not pass through environment variables you set in the shell. So if I’m trying to install git with the GUI, I need to do this:

    sudo USE=gtk emerge git
    

    instead of

    USE=gtk sudo emerge git
    

    The former starts a root shell and then sets the environment variable USE=gtk, whereas the latter sets the variable and then starts a root shell, but the new shell doesn’t inherit the value of USE.

  8. 2010
    Jun
    14

    Global USE=debug

    Don’t do it.

    A warning to any fellow Gentoo users: don’t put debug in your USE flags in make.conf, because there are many, many packages that produce copious amounts of debugging output and you can’t possibly care about them all. I think I’ve been getting about a thousand lines from PAM every time I su to root.

  9. 2010
    Jun
    13

    CMYK to RGB conversion

    It certainly took long enough, but after an hour or so of hunting I finally tracked down the formula that the ImageMagick color converter uses to convert CMYK colors into RGB. I rewrote it a little to make the expression more illuminating:

    $$r = Q_R (1 - c / Q_R)(1 - k / Q_R)$$
    $$g = Q_R (1 - m / Q_R)(1 - k / Q_R)$$
    $$b = Q_R (1 - y / Q_R)(1 - k / Q_R)$$

    for a CMYK color point \((c,m,y,k)\) and RGB color point \((r,g,b)\). The tricky part to locate was the constant \(Q_R\), and a related constant \(Q_S\), which ImageMagick calls QuantumRange and QuantumScale respectively.

    • \(Q_R\) is the range that each of the color values can take on, so if each of your channels (red, green, blue, cyan, magenta, yellow, black) is given by a number from 0–255, for example, \(Q_R\) would be 255.
    • \(Q_S\) is actually just the reciprocal of \(Q_R\). I suspect they give it a different name only because floating-point division is pretty inefficient so it saves some CPU cycles to precompute \(1/Q_R\).

    If anyone wants to track it down themselves, the algorithm is in the ConvertCMYKToRGB function in the ImageMagick source code (line 1327 of colorspace …