The Web, My Way

I used to work for an ad-supported company, so I’ve always felt kind of bad using AdBlock. I bifurcated for a while between keeping AdBlock off except for obnoxious sites, or keeping AdBlock and whitelisting sites I frequent that aren’t obnoxious. It ended up getting to be too much of a hassle, so I’ve browsed with AdBlock on full-time, and a handful of sites whitelisted. I still feel bad doing so, but not bad enough to unblock.

Recently I’ve noticed a couple sites that are really slow. Firebug shows they’re doing tons of crap. Uncrate seems to have something that will go off and do an AJAX post any time I scroll to expose new content, and content from several other sites is pulled in. Slowly. The site locks up my browser for a moment. Some other site I went to the other day managed to peg one of my cores at 100% CPU usage. I don’t even know what it was doing.

I’ve declined to use NoScript for a long time, because in 2010, the Internet just doesn’t work without JavaScript. It would be like me trying to avoid surveillance cameras in public, or trying to avoid using WiFi because I didn’t trust it. But I’ve just had a mini-rebellion. There is so much crap on pages. A page pulls in JavaScript tags from a half-dozen sites, and each of those pulls in more scripts that all make calls all over the place. I have a pretty fast computer and keep Firefox locked down, so when a page is able to lock up Firefox for a moment, something is really wrong.

So I’m browsing the web on my terms now. NoScript blocks just about all JavaScript and I’m starting to selectively whitelist. I did permit Google Analytics.

The other great thing about NoScript is that it blocks Flash by default. I like Flash for things like videos. But Flash is also insidious in its use of persistent cookies that your browser doesn’t control. Using Adobe’s site to view saved Flash cookies, I have a ton, mostly from sites I’ve never even heard of. I deleted content from all of them, but also don’t permit Flash to run by default.

The Internet looks pretty crappy now, but right now I prefer that to sites that are crappy.

Overclocking

When I put together my system, I picked the i7-930 because Microcenter offered it for less than the i7-920. Both are practically the same processor; the i7-920 is 2.66 GHz and mine is 2.8 GHz. Both are legendary for their ability to be overclocked. I didn’t necessarily run with the overclocking crowd, but I’ve always had in the back of my mind that it could be done. Last night I ran into some forum posts with people complaining that they “only” got to 4.1 GHz with my processor/cooler combination before they started hitting stability issues.

I don’t want to push things that hard, especially when I’m concerned about whether my CPU cooler is working at full efficiency. (I want to pick up some thermal grease and remount it.) But I was bit by the bug.

I can’t actually change the multiplier of my processor — it’s fixed at 21x the base clock frequency. But the base clock is trivial to change. I made sure all the thermal monitoring and auto-shutoffs were enabled and bumped it up from 133 MHz to 150MHz. And presto! I’m running a bit hot now, but one simple change and:

I’m not certain why it’s reported as a Xeon; it’s not. But the clock speed is accurate. When I get around to trying to remount the cooler, I think I’m going to have a go at the 4 GHz barrier, though I don’t want to run too far out of spec.

Politics

I think the best analogy for modern-day politics is sports teams. I root for the Red Sox, because they’re my local team. Yankees suck! This is foolish, of course. The Yankees are a great team. They’re not an enemy, but friendly competition.

Politics today are the same way. Democrats hate Republicans, and Republicans think Democrats are destroying America. And we are the fans, cheering for our side and booing the other.

But the problem is that the teams don’t matter, and a drama-filled game isn’t good in politics. We sit back and watch heated political debates, and start cheering for our side and vehemently opposing the other. But at the end of the day, politics isn’t a game we play for fun. It’s the operation of our country, and it impacts each of us every day.

It’s not just that we root for our teams that’s the problem, it’s that we do so without caring about the game. It would be like if I cheered fanatically for the Red Sox and talked the next day about how bad the Yankees were, yet I never bothered to watch a moment of the game. In politics, the teams don’t matter, and yet the “game” we all ignore is profoundly important.

This is interesting, because it doesn’t talk about political parties. I evaluated a whole bunch of proposals to fix problems, and did so without having much of an indication if I was backing a Republican idea or a Democratic idea. Doing so forced me to think about the pros and cons of individual bills, without hearing any twisted rhetoric from either side. This is what politics should be.

I Use This: iTerm

I ran into some trouble with the Mac’s Terminal not supporting vim colors properly. It turns out that Terminal doesn’t have very good support for some things. Someone recommended I try iTerm, so I did. I wish I’d done it sooner. And it implements the feature I’ve craved for the longest time: blurring the background if you have a translucent terminal window:

There’s a little weirdness in that it doesn’t seem to update quite as fast as Terminal did, and that triple-clicking selects the line shown, not the whole line if it wraps. For the most part they’re petty differences. Overall, though, Terminal’s a thing of the past, and iTerm’s here to stay.

Update: I’d noticed that iTerm hadn’t been updated in a long time. Thanks to George for commenting below that he’s picked up development and rechristened the project iTerm 2. Even better!

When Geeks Watch TV

I live about 10 miles outside of Boston, and probably about 5 miles from all the towers that the Boston stations use.

I rarely watch TV, so I opted to not get cable TV. (To the fury of Comcast, FiOS, and RCN, who each send me several advertisements every week.) However, I do want to watch local TV every once in a blue moon. Not having time to go to the store the first time I wanted to watch TV, I just strung a length of random wire behind the TV, connecting it to the antenna input. It worked passably at best. The signals were fairly weak and would occasionally drop frames or lose synchronization and drop out entirely for a bit.

I eventually hooked a higher-gain handheld ham radio antenna, and found that it works great. However, the setup was even more outrageously improvised: the antenna was a male BNC and I had the existing wire ‘antenna’ twisted around the center pin. This was a really unstable connection, so I used some electrical tape. This was really just a jury-rigged test. But it worked phenomenally well: the weak signals that dropped out are now DFQ. (Okay, “DFQ” isn’t meant to describe HDTV, but I can’t bring myself down to the level of describing my TV as having “full bars” now, and I don’t have a signal meter to be able to give an actual signal strength.)

I refused to buy a real HDTV antenna, partially because they’re $75+, partially because they’re huge, and largely because they’re typically meant for people who live further away and tend to feature preamps which can’t possibly do me any good. So my homebrew setup works great. It is, however, a touch, umm, improvisational.

Radio Shack does not sell female BNC connectors. Seriously. I found five separate types of uncrimped male BNCs, but not a single female. So that set me up for trouble right away. I eventually found a bulkhead-style connector that was female on both sides, and realized I could use that. I didn’t find any good stand, so I improvised a bit:

The opening in the top is just wide enough for the connector to stick through, but the white plastic connector doesn’t. Sadly, my inability to find a crimp-on female BNC connector means that the coax you see is just sitting with its conductor in the connector, not attached in any way. It’s secure enough that I don’t think it’ll pop out, though.

I also didn’t have any proper crimping equipment, so for the F connector into my TV, I had to try to crimp it with pliers, which didn’t work so well:

(An astute observer may not that it’s not even on right. It won’t screw in.) Obviously, if this were some sort of transmitting apparatus, the build quality would have to be much higher. But for receiving multi-kilowatt TV transmitters five miles away, I can get away with a lot.

When it’s all said and done, here’s how it looks:

From the couch, you can’t see it.

Of course, what really matters isn’t how ridiculously amateur it looks, but how it performs. And in that regard, well, it’s perfect. And since it’s over-the-air HDTV, I get flawless, uncompressed 1080p.

Science is Neat

I can’t even begin to explain–or even understand for myself–how I got to be reading up on these things, but here are some things I’ve read about recently that I think are fascinating:

  • MagLev Trains, which, instead of having wheels riding on metal rails, levitate on electromagnets. MagLev trains have reached speeds exceeding 300mph.
  • The biggest obstacle with train speed now is air drag. And when air is harshing your mellow, what else is there to do but move into a vacuum? Vactrains, which don’t actually exist in production yet, are trains running in vacuums — tunnels “evacuated” of air — eliminating air drag and are predicted to be able to move around 5,000 mph.
  • MagLev trains depend on superconducting magnets. I had assumed that superconductors were materials that were excellent conductors, which is partially correct. In actuality, superconductors have zero resistance. (Not “really small” resistance, but exactly zero resistance.) Seemingly like a lot of things that turn everything I thought I knew about science on its head, superconductors only exist when cooled to absurdly low temperatures approaching absolute zero, but this isn’t as big of a hurdle as one might assume, and they’re apparently common in scientific settings. Since they have no resistance, it’s possible to “close the loop” and have them just retain their strong magnetic charge.
  • Superfluids are the liquid equivalent of superconductors, having absolutely no viscosity. The details are way, way over my head, but superfluids can do things like climb the walls of their containers and leak out. Here’s a more approachable introduction.
  • Biochar is charcoal mixed into soil. It’s popular now because it’s a good means of ‘sequestering’ carbon rather than releasing it into the atmosphere. But, incidentally, it’s excellent for soil. It comprises one of the major components found in terra preta, extremely fertile soil found in the Amazon basin.
  • Continuing on the super- line of thinking, there are superhydrophobes, substances which are exceptionally good at causing water (and other substances) to bead off. A common example is the Lotus effect, named after the Lotus plant. Water won’t stick to Lotus leaves, but, more interestingly, nothing really does: dirt and such are suspended on the surface. When water hits the leaves, the water droplets pick up the other contaminants, leaving the plant uncannily clean. There are countless obvious uses of superhydophobicity in real life, such as clothing. (Car wax?) Sto Corporation sells Lotusan paint, which claims to biomimic the Lotus plant.
  • Aerogel is interesting, too. The nickname “solid smoke” is somewhat fitting its construction, though it’s not literally smoke. They’re the least-dense solid known, and are exceptionally good thermal and conductive insulators.

Wish: An HDR Camera

I’m a big fan of HDR. These days, it’s done by taking a bracketed set of photos and then using software like Photomatix to combine them.

I’d like to think that some day I’m going to tell people about this process, and it’s going to sound just as absurd as describing how, once upon a time, photographers took their pictures on light-sensitive plastic film, washed it through a blend of horrible chemicals, and then projected it onto light-sensitive paper to expose an image… Which then went through more horrible chemicals.

If you view that image as the very small image I’ve posted, it looks great. The HDR really just makes it look more like it did in person. The camera just can’t capture such a wide gamut of brightness and colors.

But if you click on the image and view it at any reasonable size, you’ll realize that the image is worthless. The leaves are cloned all over the place. This is my biggest problem with HDR (well, that and the fact that it typically produces unrealistic-looking photos): in stacking the images and picking the ‘best’ parts of each, they rarely line up right. The software can correct for shifts — I moved the camera slightly from one shot to the next, and it’s easy enough for it to align them. But what it can’t possibly do is realize that the leaves and waves are in different positions in each shot and correct for that.

Last time I tried my hand at HDR, all of the shots were utterly useless because of similar problems, though it had more to do with me not holding the camera. So this time I brought a tripod. But it turns out that, if there’s any wind at all, you just shouldn’t bother.

I eagerly await the day when camera sensors have a couple extra stops of dynamic range on either end, so that it only takes a single exposure for shots like these.

Dead Rising 2: A Mini-Review

I loved Dead Rising. Like, really loved it. So when Dead Rising 2 came out, and I saw that you could combine weapons, I decided to replace my broken Xbox with a new one just to play it.

Having had a couple days to play it, I feel compelled to review it: I hate it.

There’s lots and lots to love about it. But people play video games to have fun, not to perform laborious tasks and juggle conflicting priorities. That’s real life, and part of the reason people play video games is to get away from it for a while.

In the game, my daughter’s been bitten by a zombie, so she needs to be given Zombrex every 24 hours or she’ll turn into a zombie. (It sounds terrible, but since it’s a video game, I’ll add that just letting her die is apparently not an option.) But you can’t just walk to the convenience store and get Zombrex. It’s extremely hard to find and is usually given to you for completing a really tough mission that you’d just as soon have not done. You can only give her her daily dose between 7am and 8am, which means that if you find some and get back at 6am, you might as well put down the controller and go make yourself a sandwich (IRL), because you don’t have enough time to do anything meaningful before 7am, and God help you if you’re not back by 8.

But finding Zombrex is hard. It’s especially hard when you have other time-sensitive missions, and a crazy lady constantly texting you missions. Your quest for Zombrex means that you can’t complete a mission, but whoops, that mission was required and now you’ve lost. So you try again and focus on the mission, but whoops, now you missed giving the Zombrex and lost, too.

Right now some evil villain is looting the city, specifically the casino vaults. Why it’s my job to stop him, I’m not quite sure. I want to slay the zombies, not stop looters. The casinos, for some reason, are always packed with zombies, which makes merely walking through one a chore. But now, on top of that, I’m being shot at by an army of mercenaries hired by the evil looting villain. I eventually clobbered one of the mercenaries to death with my crowbar — no easy task when I’m also being mauled by zombies and being shot at by four other mercenaries who suddenly got grenades too. I died at least a half-dozen times first.

Once he was dead, I got his gun. But it requires manual aiming to be any good, and standing still in a swarm of zombies is pretty hard, because they’ll start to attack you too. Or, right as you’ve got your shot lined up, one of the other mercenaries will shoot you, and you’ll have to start aiming all over. Killing a mercenary requires most of the 30 rounds in the gun, which means that if you miss more than a couple shots — perhaps because you’re being shot at, or perhaps because a zombie is gnawing on your neck — you’ll have to drop the gun and somehow bludgeon him with an axe or something, which is no easy task when he and his compatriots have automatic weapons.

I finally defeated my second set of mercenaries, concluding that the game was really just not fun with crap like this. And then, an “URGENT” text message came in: there were more! This time, there’s probably more like a dozen. I’ve tried this one over and over. There are so many zombies that my health is usually seriously depleted by the time I get there. So I pack a bunch of juice and whiskey and cake (all of which are used to restore health) in place of weapons, which helps for a while, but then I don’t have enough weapons. (Oh, and speaking of health, the beer, wine, and whiskey restore health, but if you have too much, you begin vomiting uncontrollably. But all that you’ll find in the casinos is alcohol, which means that if you try to restore too much health at once, you’ll be in the middle of fighting off another mercenary when you suddenly bend over and vomit, dropping your weapon in the process.)

So Rockstar, I have no idea how you’ve done it, but you’ve managed to make a game where you get to combine weapons — like a boat paddle and chainsaws — and kill zombies with them into something tedious and irritating. I’ve stopped playing and am going to go pack up my summer clothes and move my air conditioner into storage, because that seriously sounds like more fun right now.

Productivity

This is reassuring: a good programmer might write about 10 lines of code a day in the long run. I often recognize this in my own work without believing it’s normal. Before I started doing this professionally, and before I learned that you’re supposed to think before you start writing code, I’d have guessed 500-1000 lines. Part of it’s just that good code shouldn’t really take ten thousand lines. But the other part is that programming is really much more about thinking and just slightly about actually producing code. I’ve known for a long time that “lines of code” is a horrible inaccurate measure of productivity, and yet I can’t stop counting subconsciously.

I think it’s probably normal for programmers to have days when they spend the entire day tracking down an obscure bug. You can’t reproduce it, but then after another 30 minutes of going through exception logs you figure out that it only happens in some oddball case, and finally you’re able to make it fail, though you still don’t have the first clue why. You start looking through it more closely, and start debugging in earnest. Finally, after a couple hours, you find the line of code where the weirdness is happening, though you’re still baffled about why it’s failing the way it is. And then it finally hits you what’s happening, and it’s something really trivial and kind of silly. You chuckle, make some extremely trivial change to one line of code, check it in, and then it’s 5:30 and you have a train to catch.

I still try to measure my productivity in terms of lines of code. All day and I made a minor change to one line? What a waste! But what’s hard for me to get used to is that everyone else just sees that I spent all day working hard on a difficult problem before emerging victorious. And yet my total time spent writing code was about one minute, and my total output was a trivial change to one line.

Of course we have days when we add a lot more. I added about 100 lines today, but that’s because I added some new classes and added several features that took long and floury code. But, in the game where productivity is measured by lines of code, it makes up for the days when I’ll work even harder and end up netting one line of code. Or “worse,” the days when I delete substantially more code than I add.