Monday, June 2, 2014

Leafy Goodness

I bought a Nissan Leaf a couple of weeks ago, and I like it a lot. Here are some reasons why, in no particular order:
  1. Although probably not a core design criterion, by its nature an electric car has instant torque and good acceleration. I wouldn't pit the Leaf in a 0-60 (under 10 seconds) or 0-100 (never) contest, but 0-40 in this car is fun.
  2. The car wouldn't start if you're plugged in, presumably to prevent you from ripping the charger cable off. An almost insignificant and probably common feature, but it's nice.
  3. The iPhone integration actually supports Chinese characters. The font isn't something I'll write home about, but it's much better than asterisks that the Scion would display.
  4. You can hear a low whine as the motor ramps up or down, but it's otherwise very quiet. Nissan apparently engineered the headlights to protrude, in order to reduce the wind noise that would otherwise have been generated by the side mirrors.
  5. There's a US$7,500 federal tax credit and a US$2,500 California incentive, which combine to lower the cost to just over US$20,000 after taxes and fees. That's comparable to the Prius c that I had previously been considering.
  6. No oddball gear settings to figure out. There's drive, economy drive, reverse, park, and neutral.
  7. And if the DMV should ever give me my registration, I'll be able to apply for the magic stickers that let me use the HOV lane.
The main drawback, as you might imagine, remains range. Nissan claims 84 miles on a full charge, but obviously nobody is going to try that. The actual range depends on how aggressively you drive, but I can do the 29-mile drive in morning traffic to work using about 35% of the charge, which means I should be able to get just under 83 miles.

Also, for some inexplicable reason, the base models don't come standard with a rear cargo cover. Since vehicle break-ins can be a problem here, particularly during the holiday season, I bought it separately on Amazon for US$150. And of course, actually trying to buy the car was still filled with the usual nonsense, from pre-paid maintenance to extended warranties. No means no, dude.

All in all, I'm liking it.

Saturday, March 15, 2014

Early 2008 Mac Pro Mid-Life Upgrade

The Mac Pro we bought in 2008 has two 2.8 GHz Quad-Core Intel Xeon processors, and is really more than adequate for what we actually need. To extend its useful life, the first upgrade I made was to add 4 GB of RAM (PC6400 DDR2 ECC 800MHz 240 Pin FB-DIMM), which cost US$122 in January of 2012 and $65 today, for a total of 6 GB.

More recently, with SSDs becoming more affordable and the Mac's original drive now alarmingly in its seventh year of service, I decided to make a more ambitious set of upgrades to give the Mac a few more years. The Fusion Drive is Apple's marketing name for combining a SSD and a traditional hard drive into a single bigger volume, automatically moving more frequently used data to the faster SSD. This promises to be a good compromise between the increased speed of SSDs and the still superior storage capacities of magnetic disks.

I also wanted a new video card that could run Final Cut Pro X and maybe X-Plane (a flight simulator), since the original ATI Radeon HD 2600 was just a bit too weak now. Apple's officially-supported cards were rather old at this point, but still very expensive, so I decided to just get a PC card instead.

Finally, we'd recently switched from DSL to cable internet, and the access point had to move downstairs near the TV, so I needed to add WiFi capability to the Mac upstairs.

I decided to buy "local" and went to Central Computers in Fremont a few weeks ago. They have a good variety of computer parts, and a rather Asian habit of locking up the more expensive parts in glass cases, but I came home with the following bits:
  • 3 TB Seagate Barracuda SATA hard drive (the 2 TB was out of stock), US$113
  • 240 GB Crucial M500 SATA SSD, US$126
  • TP-Link USB WiFi adapter, US$30
  • 2.5" to 3.5" hard drive bracket, US$5
  • 2 GB Sapphire Radeon R7 260X, US$126
I haven't bought this many toys in a while, so I was moderately excited to get home to try things out. I encountered two problems immediately: one, the Sapphire card requires additional power, but the supplied cable used a "molex connector" that the Mac Pro motherboard does not support; and two, the Mac Pro has a proprietary bracket to attach drives to the computer without using any cables, and the normal drive brackets would not position the SSD in the right place for the connection.

Because the SSD was so light, I decided to just hang it off of the connector directly. Nothing bad happened to me this time, but you really shouldn't do that. Anyway, both drives were recognized by the OS, and the fusion drive instructions were pretty easy to follow. I then used Carbon Copy Cloner to clone my old drive. It couldn't clone over the recovery volume, unfortunately.

The confusing part here is that earlier versions of OS X only allowed you to make a logical drive out of the two, but didn't actually do the smart part of moving data to the faster SSD, so it's hard to know if you've just made a big logical drive or an actual fusion drive. I'm running OS X 10.8.5, which should work, but the command-line instructions I found weren't obviously conclusive, until I eventually found that  > About This Mac > More Info… > Storage is actually nice to enough to tell you outright:

under the icon on the left side. So I do have a fusion drive.

I went back the next day to return the drive brackets and pick up the power cable and an HDMI-to-DVI cable, since the Sapphire card only had one DVI output. They don't have the correct power cable, but I came home with an Icy Dock 2.5"-to-3.5" SATA bracket. Instead of the HDMI cable, I actually bought a DisplayPort-to-DVI cable, because I wasn't paying close enough attention. Luckily, the Sapphire card does have a DisplayPort output.

The Icy Dock was a bit confusing. It's made of flexible plastic, and there's a tab that I think is meant to help push the drive into the socket. Long story short, I tried several times and couldn't get the drive to be recognized by the computer. Good thing I didn't reformat the old drive yet, because a fusion drive would not work at all with the SSD part missing. So the SSD goes back to hanging off the connector, and I ordered the NewerTech AdaptaDrive 2.5"-to-3.5" converter bracket (US$15 from Other World Computing).

A few days later, I got the power cable (US$20 from OWC), but the Sapphire card just wouldn't work. After a lot more googling, I found out that the Radeon R7 doesn't actually work with OS X, even though a colleague told me that almost every video card should now work. This time I wanted to make sure, and found tonymacx86's guide to building Hackintoshes to be very useful. I had three criteria at this point: I didn't want to have to install third party drivers, I had a small (< US$150) budget, and X-Plane recommends at least 2 GB of video RAM. These helped me quickly narrow the choices to a NVIDIA GeForce GTX 650 based card.

Hoping that I could maybe avoid a restocking fee by buying another card from them, I went back to Central Computers, but they didn't have any GTX 650 cards, so I had to pay the 15% fee for the Sapphire card. I had also found out by accident that I had the foresight to customize the Mac with the built-in WiFi option when I bought it, just not the memory to remember that I did. So I returned the USB WiFi adapter as well. At this point, I'll admit that I wasn't feeling very smart anymore.

The AdaptaDrive was built with a solid but light metal frame, and the SSD fit easily and could be screwed securely into place. The frame can then be screwed onto the Mac Pro's bracket, and everything fit perfectly and worked great this time.

After comparing the very similar specs and prices of the various GTX 650 cards, I settled on the Gigabyte one (GV-N650OC-2GI, US$130 from NewEgg) because it had two DVI ports and seemed to have a slightly better reputation than PNY. When it arrived, it also worked the first time. I also belatedly found some very good information from MacRumors on upgrading Mac video cards.

In the end, I'm pretty pleased with the upgrade. Here's the hardware I actually kept:
  • 3 TB Seagate Barracuda SATA hard drive, US$113
  • 240 GB Crucial M500 SATA SSD, US$126
  • NewerTech AdaptaDrive 2.5"-to-3.5" converter bracket, US$15
  • 2 GB Gigabyte GeForce GTX 650, US$130
  • Apple video card power cable, US$20
for a grand total of US$404. The fusion drive is nice and fast, booting in just a few seconds, and is generally far more responsive than the old drive. I also ran some GPU benchmarks just for fun:

GpuTest 0.7.0
FurMark: from 3 fps to 17 fps (5.6x)
TessMark X8: from 3 fps to 291 fps (97x)
GiMark: from 7 fps to 16 fps (2.3x)
JuliaFP32: from 9 fps to 64 fps (7.1x)
Triangle: from 760 fps to 2,492 fps (3.3x)

OpenGL: from 9.97 fps to 37.19 fps (3.7x)

Unigine Heaven Benchmark 4.0 (Basic)
from 1.6-2.1 fps to 15-35 fps (7.1x-16.67x)

so it's probably safe to say that the GTX 650 is at least 3x faster than the Radeon HD 2600.

Two final kinks that I encountered were that Time Machine didn't seem to recognize the fusion drive as the same thing, and wanted to do a full backup, and that SketchUp no longer thought that the software was licensed. So there's something in the cloning that wasn't quite exact, but both problems were easily resolved.

Sunday, March 9, 2014


I think it's funny that the one thing that makes me feel grown up is booking flights. Flying in my childhood was this expensive thing, mainly reserved for Big Deals like visiting a sick relative, or something that requires physical presence like borrowing money from a relative. Needless to say, it was the adults who took all of these trips. When to fly was, in my little mind, the epitome of adult decision.

By the time I got to high school, the family's finances had improved somewhat, and reasons to fly started to include visiting family just because you haven't seen them in a while. I would fly back to Taiwan for the summer to spend time with my parents, for example.

The first flight I sort of decided for myself was visiting my then-girlfriend after finishing grad school. I was also visiting my parents in that victory lap of sorts on the same trip, so it wasn't really entirely mine. I also didn't quite pay for that flight, if memory serves. The next year I flew back to Manila to get married, but that was really also more of circumstances deciding for me, though I did pay for the flight.

I don't actually remember the first flight we decided to take without needing to, but to this day, I impress myself whenever I click that final button on an airline website.

Thursday, February 6, 2014

Unfit to Govern

Government is hard, particularly at the highest levels. The US Supreme Court, for example, generally takes a case only when lower courts have ruled differently on an issue. A president or prime minister is confronted constantly with problems with no good answers, because if there were good answers, the decision would've already been made by others.

One such problem is Palestine. Israel cannot remain Jewish and democratic if it insists on occupying a large number of Palestinians who are reproducing more quickly than the Jews are. This is a matter of simple and obvious math. At some point the majority must be either prevented from voting (therefore, not a democracy) or overwhelm the Jews (therefore, not Jewish) by sheer number. You can't keep them in Israel.

Another such problem is illegal immigration in America. Estimates apparently vary from some 7 to 20 million people, but suffice to say we're talking about millions of people. In contrast, even counting the disastrous War on Drugs, the entire US prison population is about 2.2 million.

America cannot remain the country that many (most?) citizens want it to be if it tries to round up and deport millions of people. Even if they all somehow reported to their nearest police station when called, there aren't enough police or jails or judges or maybe even busses to process their cases for many years, and it'll probably cause massive economic disruption to the US, never mind to Mexico where a large number of them will presumably return. You can't just throw them all out of America.

The first problem has an obvious solution: Palestinians need to be "ejected" from the Jewish Israeli state. But doing it the dumb way would surely create a power vacuum that would attract terrorists and other bad actors, and Israel's security would be compromised. This means that Palestine needs to be an effective (and of course cordial, if not friendly) state. It needs to be able to secure its borders. Yet, the Israelis don't seem to want to move on this, even at increasing cost to their international reputation.

The second problem also has an obvious solution: the illegal immigrants need to be brought into the fold. The proponents like to talk about upstanding college graduates who are "undocumented" because they were born a month before their parents snuck into the country, and the opponents like to talk about people who disrespected our laws and want amnesty. Neither really matters in the long run, because in another generation their children will all be US citizens by birth. Making life difficult for their parents only means this emergent class of citizens will engorge the underclass.

The problem is real, the solution is fairly obvious, but (perhaps by coincidence) the right wings in both countries are unwilling to do anything about it. I, too, lament that Fairness and other values aren't more widely practiced in this world, but that cannot stop a government from moving to resolve real problems. Politicians who avoid this duty are unfit to govern.

Barack Obama is a troubling President. His stance on things like NSA eavesdropping will probably taint his legacy permanently, and should bother any supporter. However, he went for the best health care reform he could've gotten from Congress, even though a single-payer system is a rather obvious model adopted successfully by many other countries. He was willing to settle for less than everything when he got the main things that he wanted, the terrible rollout notwithstanding. On immigration, he's turning to executive orders to accomplish what he can. Which is far more than you can say for the Republican-controlled House, whose legislative output seems to consist solely of pointless attempts to repeal Obamacare.

Now, there are many, many details to complicated problems like these two examples above, and trying to address those would take many more words and wisdom that I don't have, but my main point is this: the difference is that Obamacare is now law and they're trying to work through the problems.

As the old adage says, don't let perfect become an enemy of good. I fear that while conservatives congratulate themselves on their moral superiority, the country merely spins on its toes as others catch up or even move ahead.

Friday, January 24, 2014

Happy 30th Birthday, Mac!

I wasn't really exposed to computers until later in grade school, so I don't have a moment in 1984 that I can recall, but as long as I've known of it I wanted a Mac. I learned to program on an Apple ][+ clone in a country where original Apple computers were rare treasures of rich friends, but the five-colored Apple logo had always been familiar and dear.

I grew up to regret somewhat that I wasn't old enough (or living in the right part of the right country, for that matter) to have been a part of the personal computer revolution. How exciting it must have been, I always thought, to have worked alongside the pioneers who eventually changed the world.

As much as I lusted after it, the Mac cost thousands of dollars, and was laughably out of my reach financially. In what must have been the late 80's or early 90's, however, the mouse made it to the PCs we could afford (I vaguely remember our first optical mouse - which needed a special grid mousepad - to cost 2,000 pesos) and I valiantly started to copy MacOS. Alas, the graphics library that came with Turbo Pascal and Turbo C were woefully primitive, and I remember trying to work out how overlapping windows worked. I even remember staring at screenshots in magazines to copy the shape of the mouse pointer pixel for pixel, annoyed that the PC's non-square pixels couldn't reproduce the look exactly.

In the early 90's the world around me started switching from DOS to Windows. I was in college, and one of our labs had a Mac that nobody ever used, but there were also Solaris and Linux machines that supported graphical desktops. In the years after college, the Mac struggled mightily in hardware and software, and I felt that it would probably soon be relegated to the dustbins of history to join the likes of Amiga, patronized as "ahead of its time".

Even then, when I graduated, I submitted my resume to Apple, only to ever get a postcard in return.

I was aware of Steve Jobs' return to Apple, but didn't think much of it at the time. The gum drop iMacs that followed were fun and I wanted one, but I couldn't justify the purchase because the Serious Hacker ran and evangelized Linux because it was efficient and relatively immune from the viruses that were all over Windows. I went from Slackware to Red Hat (because RPMs were so much better!) to Debian (because it was so pure!), as MacOS started to shed its cocoon to emerge as the NeXTSTEP-based butterfly. I remember when brushed metal was cool, but the rekindled old lust was still tempered by an unoptimized OS with a shaky future.

Around 2002, as Mabel was graduating, I decided that I was just tired of spending a good chunk of my weekends maintaining Linux and being constantly disappointed by the over-promises of free software advocates, and I'd heard good things about MacOS X Jaguar. So we bought our first Mac, the Quicksilver Power Mac. What a pretty machine that was! The gray body coated in translucent plastic, the sturdy and convenient handles, the tasteful logo, the fold down tray holding the motherboard, even the neat and close-cropped cabling: this was a machine that made you feel bad for putting it under the desk.

Though by then a very different company than the one in which Steve Wozniak labored over saving a single chip, it was still clearly a company that cared a great deal about the little things.

We never looked back.