Mac meets UPS

September 30th, 2009

I picked up a UPS. Now that I'm living in a house in the country and on a hill, I figure I'm more susceptible to power anomalies and wouldn't be surprised if the lines on the street get hit by lightning someday.

The UPS I picked up is an APC Back-UPS XS, on sale for $169 at Future Shop. It's beefy enough to keep my work PC and various peripherals, as well as the networking stuff, online for about 8 minutes if the power goes out. Long enough for a clean shutdown.

It supports USB for monitoring and for telling the computer that the power is out, so the computer can start shutting down. I plugged the UPS into the Mac to see what would happen, and I was surprised to see this:

200909291620-1
The Mac found the UPS, with no drivers installed, and added another battery monitor to the taskbar. No messages, no popups, no installing stuff. It just showed up.

I went and looked at the Energy Saver preferences panel, and it had a new USB pane:
200909291620

I did find what looks to be a bug in Snow Leopard when I unplugged the UPS. The status bar indicator didn't properly reset to one battery:

200909302059

Oh, and a mini-review of the UPS: The Back-UPS XS 1300 gets high marks from me for its front panel display, and the PC software (PoweChute) gives some great statistics on your power quality and the number of anomalies it's detected. I yanked the wall plug out and my desktop PC stayed on, and according to the front panel, would have stayed on for another 7 or 8 minutes. This is with hardware drawing about 300 watts of power. Good enough for the purpose of shutting down when the power goes out.

Jazz Festival: Brantford vs Ottawa

September 19th, 2009

It's my first real weekend in Brantford, and I went looking for something to do. In Ottawa, I'd check the Ottawa Events website, of course, but I wasn't sure where to find what's going on in Brantford. I asked Google and it's first response was this Brantford Calendar of Events apparently managed by the City of Brantford.

The reason I started Ottawa Events was because there were a number of competing organizations in Ottawa all of whom would promote their own events, and ignore the events sponsored by their competitors. I get the impression that Brantford doesn't have that problem, because it seems like the Brantford events calendar is fairly complete.

Anyway, I stumbled across the Brantford International Jazz Festival and decided to check it out.

There's a big difference between the Ottawa Jazz Festival and the Brantford Jazz Festival, and the comparison doesn't go the way you'd expect.

If you're looking to hear some particular big-name Jazz artist, you're more likely to be happy with the Ottawa Jazz Festival. But if you just want to hear some good Jazz and have a good time, in my opinion anyway, the Brantford event wins.

For one thing, admission is free (except to the Holly Cole concert).

And the Brantford doesn't go all strict on parking anywhere within a mile of the event, the way Ottawa does. I drove up and parked about a 2 minute walk from where the action was and walked over, no gate, no tickets, no cost.

I saw a couple of artists whose names I don't remember but who were quite enjoyable, and Joey DeFrancesco who was incredible. Overall I had a better time there than I would have had in Ottawa, where the festival seems to be a victim of its own size and success.

Old Houses

September 16th, 2009

I should have known, after buying and living in our old house on Meadowlands in Ottawa, not to buy another old house. And yet, here we are.

We've been in the house 5 days now, and the sink just backed up in the basement, dumping quite a bit of water on the floor. Here's what I think happened.

The drain is clogged. Water run in the laundry tub in the basement drains fine for a few seconds, and then very slowly - which to me says there's a blockage not that far into the pipe.

We have a water softener. I've been learning about water softeners, and they're interesting things. You give them salt and they give you softer water. Part of the process of softening water is charging some "beads" in a tank, and these beads need to be recharged nightly, which means running water into a separate container holding salt crystals, bringing that water into the filter tank, and then draining that water. Draining that water means dropping about 90 liters of water down the drain.

And when the drain is plugged? It means dropping about 90 liters of water on the floor.

So I've been using a wet-dry vac to suck water out of the carpet while some relatives dropped by to try to unclog the drain with a snake. They had no luck, so I called a plumber. He tried as well, and also failed.

So tomorrow they're coming back to "flush" the drain. I sure hope this works, because 5 days into owning this house I'd really hate to be spending even more than this is already going to cost.

Live from Brantford

September 15th, 2009

Last week, we moved from Ottawa to Brantford, Ontario.

Technically I guess it's Brant, Ontario since we're just outside the Brantford city limits, and this seems to be confusing about 50% of the companies we call to update our address. I used to think it was cool when a company cross-referenced your postal code with your address to make sure it was right, but now I just find it annoying. Canada Post has our address as in Brantford, but some other database has it in Brant. Canada Post has our address with an "RR2" (Rural Route #2) at the end. Some companies require I say Brant, some Brantford, and some with the RR2 and some without.

That aside, this is a beautiful house with a great view, and (the reason we moved) close proximity to my wife's family.

So what about work? Thankfully Adobe has allowed me to telecommute, and continue to do the same job, working on LiveCycle Designer, remotely. This isn't a new thing for Adobe - two of the people on the Designer team were already remote - and for me it's just an excellent situation.

I plan on posting on some of the challenges of working remotely and how I'm dealing with them. So far there haven't been many - it's been pretty smooth. And thanks to a hardware VPN box and an IP phone (and Connect Pro for attending meetings), other than stopping by my desk and seeing it empty, the rest of Adobe wouldn't know I'm not in the office.

One thing that feels weird, though, is the lack of a technical safety net. I've always been fairly cavalier about, say, running beta OS firmware on my wireless router, but now that all this home gear has become "mission critical" and I don't have Chuck in the next cube to beg an OS reinstall disc from, I might have to become more careful. We'll see how long that lasts.

Grand Central Dispatch

September 2nd, 2009

If you're looking for information on how Apple is trying to solve the concurrency problem for programmers (on the Mac anyway) check out pages 11 through 13 of John Siracusa's review of Snow Leopard.

In a nutshell, they added a feature called blocks to C (and Objective C and soon C++) which are basically what other languages call closures, and they added a task queueing system and dispatch system that creates threads as required and balances jobs (from multiple applications) among them.

What's really elegant is how these two things, blocks and dispatch, come together to make taking existing code and changing it to support threading, easy.

- (IBAction)analyzeDocument:(NSButton *)sender 
{ 
  dispatch_async(dispatch_get_global_queue(0, 0), ^{
    NSDictionary *stats = [myDoc analyze]; 
    dispatch_async(dispatch_get_main_queue(), ^{
      [myModel setDict:stats]; 
      [myStatsView setNeedsDisplay:YES]; 
      [stats release];
    });
  });
}

Or, in C++ speak:

void CMyDoc::OnAnalyze()
{ 
  dispatch_async(dispatch_get_global_queue(0, 0), ^{
    MyStats *stats = Analyze();
    dispatch_async(dispatch_get_main_queue(), ^{
      SetStats(stats);
      GetStatsView()->ShowWindow(SW_SHOW);
      delete stats;
    });
  });
}

This code runs an Analyze function in the background, and then gives the results of the analyze back to the main thread to display. The key to keeping the changes all local to the function are the code blocks introduced using the ^ operator, which lets you pass a code block as an argument.

This is the most pragmatic method I've seen to moving background processing off the main thread. There's still some work to make sure that the user doesn't pick the Analyze function while there's already an Analyze running.

You'd want to centralize that - having an application-level list of background jobs that are currently processing, so you can display a "Processing..." indication somewhere on the UI and disable buttons that would kick off duplicate jobs. Even after adding that, the function is still manageable:

void CMyDoc::OnAnalyze()
{ 
  // Presumably your OnUpdateAnalyzeUI would do this and cause the 
  // Analyze menu item and toolbar button to disable, but let's do it here 
  // to demonstrate
  if (JobQueue::GetInstance().IsExecuting(IDC_ANALYZE))
    return;

  JobQueue::GetInstance().NotifyStartJob(IDC_ANALYZE);

  dispatch_async(dispatch_get_global_queue(0, 0), ^{
    MyStats *stats = Analyze();
    dispatch_async(dispatch_get_main_queue(), ^{
      SetStats(stats);
      GetStatsView()->ShowWindow(SW_SHOW);
      delete stats;

      JobQueue::GetInstance().NotifyEndJob(IDC_ANALYZE);
    });
  });
}

Still a pretty small price to pay.

Gmail, IMAP, and “Account Exceeded Bandwidth Limits”

August 26th, 2009

Apple Mail is failing to fetch mail from Gmail, with the following error:

200908261034

Googling this error message shows lots of other people running into the same problem. Some bandwidth limit on Google's side is cutting me off. When this happens, I'm put in a penalty box and not allowed to connect via IMAP for some period of time.

I'm not using mail excessively. I don't get a lot of big messages; I do get a lot of spam but there's not much I can do about that.

Other users have complained to Google and gotten nowhere. I'm not paying for this service so it's not like I can call a customer support line and threaten to quit. What can I do?

Rogers Sales Calls

August 22nd, 2009

Rogers has been calling me a lot lately. Twice in the last two days for the Rocket Stick, a USB wireless adapter that will let your laptop get on the Internet from anywhere.

The iPhone 3G supports tethering, and Apple has been nice enough to enable tethering on all their data plans for no additional charge. Seriously I think this is a great move by Rogers. Data is data, and not charging extra for it is just a nice lack of evil (whereas AT&T does charge extra in the US).

With the iPhone and bluetooth tethering, I can open up my laptop, click Connect on the Bluetooth menu, and I'm online. I don't even have to take the phone out of my pocket. This is easier than digging around for a USB wireless adapter, and I'm quite happy with the performance.

So they're trying to sell me the Rocket Stick and I just don't need one. But whoever wrote the script that the sales people follow wasn't going to take "No" for an answer.

To start with, saying that I had an iPhone apparently triggered the 'customer has an iPhone' script, which involves telling me that the screen size is too small, that I'm going to get eye strain using it, don't I type email and find the onscreen keyboard difficult, and so on. Nice way to trash talk the product that you sold me.

I explained that I connect the iPhone to my laptop. Now I was on the 'customer has a laptop' script, which involves asking me if I ever use it outside the house, and wouldn't it be nice to have the Internet anywhere. So I explain how tethering works and that I connect the laptop to the Internet using my iPhone.

Apparently there is a page for that in the script, because next she was trying to make me see some value in the Rocket Stick over bluetooth tethering. "I understand you're using your phone to get online, but don't you find that unreliable?" Um, no, it works fine for me, thanks, and if I did find it unreliable, I'd be calling Rogers, since they're the ones that supplied the iPhone, the network connectivity and the ability to tether!

She eventually accepted that I really didn't need another way to get my laptop online. Then she asked about my wife, who doesn't have an iPhone and clearly needs a Rocket Stick. Sigh.

I wish these sales calls had a safe word that you could use that's code for "I've considered the option you're trying to sell me and I really don't want it, I know why I don't want it, and your sales call isn't going to change my mind. You'd be better off moving on to the next customer". I hate being rude to the folks calling me, but I know if I let them proceed I'm wasting their time as well as my own.

(And, I've had to explain to three different Rogers reps that when I move, I am cancelling my Rogers service not because I don't want Rogers at my new location, but because it's not available. And no you can't have my postal code to check again, because the last 2 people did that and I know for certain that it's not available there. No, I don't need you to check again. No, you can't have my postal code. No. Sigh.).

Snow Leopard Upgrade Partitioning

August 16th, 2009

Somehow when I configured my Mac 500gb drive, I ended up with a drive partitioned using the Apple Partition Table. I don't know how I did it, but turns out, it was a mistake.

The Mac installer, and Snow Leopard will likely be no different, refuses to upgrade an Apple Partition Table-partitioned drive. And you don't get the option to simply change the partition table format: You have to blow away the existing partitions and create new ones, losing all your data in the process.

So to get ready for Snow Leopard, I spent a chunk of the weekend doing a full backup to Time Machine, repartitioning and reformatting, and restoring my backup. It went smoothly, but took a good chunk of the weekend.

Next stop: Snow Leopard!

Windows 7 Setup Hung? Here’s a Tip

August 10th, 2009

If your Windows 7 Setup is hung or taking a long time at the "Transferring files, settings, and programs" step and you're wondering what the heck it's up to, here's a way to find out.

Press Shift-F10. This will open a console window. In the console window, type "taskmgr" and hit enter.

This opens the Task Manager, right in the middle of setup From here, you can go to the Performance tab of Task Manager and click "Resource Monitor..."

The Resource Monitor window shows you all kinds of things about what your system is doing, but expand the Disk section and then the File column and you can see what files are being accessed. This is a great way to at least convince yourself that Setup is busy doing something and not just hung.

You'll probably see some log files being accessed during the setup as well - you can go back to the console window, go to the \Windows\Panther directory ("cd \windows\panther") and see what log files there are. Type "dir" to see a list, and use notepad to have a look at them (for example, "notepad setupact.log").

Windows 7 Install Weekend

August 10th, 2009

I spent part of the weekend installing Windows 7 on some computers at home, now that the RTM is available from MSDN. Overall it went very well.

One computer is an HP Pavilion system I bought at Costco a few years ago, and of course didn't come with drivers for a lot of the built-in hardware, but Windows 7 just found most of it. It didn't find the audio driver, so I had to hunt one down. My usual trick worked here: Going into the control panel, device manager, finding the device with the yellow triangle next to it, going into properties and finding some sort of hardware ID that I could google for. That gets me the name of the device (in this case it was an AC97 chipset), and then I can google for that.

The second computer is a bit older and I had the same sound driver problem there. I used the same trick for the second computer, which had SoundMax audio. Found an XP sound driver which worked fine.

I have yet to find a driver that didn't work on Windows 7. This will make the process of upgrading to Windows 7 relatively painless for most people. I hope they are confident enough in the driver model they introduced in Vista that they can stick with it for a few more major OS revisions, as it really cuts down on the headaches.

I switched most of my home computing to the Mac a few years ago, and this doesn't signal a switch back. This is all hardware I bought before I bought my Mac. But using Windows 7 reminded me of some of the things in Windows that I really miss on the Mac.

The biggest one is UNC paths. Being able to reference \\server\share\somefile and have it just work is a killer feature. I can point any Windows app at \\server\music and it can find my MP3 collection. With the Mac, I have to make sure it's mounted. If I take the Mac to work, when I get there a little dialog tells me my Music share is gone, and when I get back home, it doesn't automatically reconnect. There are tools to make this happen, and I've tried some, but still this just works better on Windows.

And Windows 7 has this great home network feature called Homegroup. This lets you essentially merge your pictures, music, videos and other folders ("libraries") with those of another user. Any files you drop into a homegroup library live on your computer, but show up for everyone else in the homegroup as if they were on their computer. I didn't play with it much but I love the promise of it.

Apple could do a much better job with home networking. They've got the Airport Extreme base station which takes care of backups (beautifully, I might add) and the Apple TV, but sharing photos and music between users at home (the killer app for a home network) is still just not very easy or reliable. And it doesn't look like this is getting any better with Snow Leopard.