Taking the C++ Challenge

This week I’ve decided to roll up my programming sleeves and finally learn how to program in C++. I’ve been avoiding it for over a decade, so cracking open my copy of the C++ Primer took some courage.

To my surprise, my recent forays into Python and Java have prepared me pretty well for what I’ve encountered so far. I’m 250 pages into the book, and though some elements of the language seem strange to me (why would you use arrays and pointers when you’ve got vectors?), nothing has flown over my head.

That could change as I get deeper into the language.

If any of you are familiar with C++, is there anything I should look out for, or pay special attention to?

Balticon 08: Thursday

arrived in baltimore. wondered why i didn’t pack a jacket when i know they turn the a.c. on as soon as it hits 60 outside. bbbrrrr.

had dinner with ken and shari 🙂 then said goodbye to lora for the night 😦 and took the light rail to the hotel, which was clean and mostly empty and really cheap.

after checking in, had drinks with cmar, burns, lafferty, hutchins, and others (b*tch). actually referred to these photos of Cmar with his 30th birthday cake as ‘not as sexy as they sound,’ thus proving i was at least somewhat drunk. good times.

Sound Fix for MacBook with Ubuntu 8.04

After upgrading to 8.04, I found a strange bug: my sound worked normally from the internal speakers, but when I plugged in a set of headphones, no sound came out.

I scratched my head for a while trying to work this out till I found the workaround recommended here.

Basically all you need to do is right-click on the Volume Control applet, select Open Volume Control, then Edit -> Preferences. Check the box for “Surround,” then close the Preferences window and unmute the track marked “Surround.” That should do it.

I’m a-Twitter!

I’ve hopped on yet another Web 2.0 bandwagon by joining Twitter.

My username’s mindbat (of course). Join up, and let’s Follow each other about all day (it’s not as creepy as it sounds, I promise).

Scary Reading: Adobe’s AIR EULA

I was all set to install an application built using Adobe’s AIR platform when I took a minute to actually read the End-User License Agreement. What I read made me cancel the install, rather than agree to the EULA.

What was so bad? Well, for a development platform that’s supposed to let users run web apps from their desktop, regardless of their operating system, AIR can apparently only be used once:

2.1 General Use. Subject to the terms of this agreement, including the important restrictions in Section 3, you may install and use a copy of the Software on one compatible computer. The Software may not be shared, installed or used concurrently on different computers

Did you catch that? They’ll let you install it once, on one computer, and that’s it. How useful is that? I migrate between a Mac computer at work and a Linux computer at home; this EULA means I can only have use AIR programs on one or the other, but not both.

As if that weren’t crazy enough, Adobe still has the balls to claim they offer AIR with no warranty and no guarantees. So not only do they restrict where I can install and use their “free” software, but they also won’t take responsibility for any damage it causes.

I was excited when I first heard about Adobe AIR. No more. AIR’s EULA places Adobe firmly in the doesn’t-care-about-user-freedom-at-all camp, and that’s a camp I’ve left behind.

Upgrading the Macbook to Ubuntu 8.04

Bit the bullet today and upgraded to the latest Ubuntu distribution: 8.04.

I decided to try the automatic updater built into the Update Manager (after backing up all my data).

Everything went well until it asked me what to do with the /boot/grub/menu.lst file.

Since my system is dual-boot Ubuntu/Windows, I’ve customized by boot menu to display the Windows XP partition when the computer starts. When the updater noticed the altered file, it asked me if I wanted to keep the old one or use the default (new) one.

I told it to keep the old one, since I wasn’t sure I could duplicate the changes I’d made easily. The updater went along with this decision for a while, then decided it couldn’t get some files it needed from the internet and crashed.

Luckily, my system was still running okay, so I found the menu.lst file and made a copy of it, then rebooted. The computer booted up into 7.10 fine, but when I ran the update manager, it told me my system was up to date!

What had happened? After looking around for a bit, I noticed my /boot folder had references to a new linux kernel, 2.6.24-16-generic. I pulled up my old /boot/grub/menu.lst file and saw it referred to the 2.6.22-14-generic kernel.

Ah-ha! I thought. The new kernel must be the one for 8.04. So I edited the menu.lst file so that this was the first entry:

title Ubuntu 8.04, kernel 2.6.24-16-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=03265ecc-a831-4aaf-8d13-fc06036d9211 ro quiet splash
initrd /boot/initrd.img-2.6.24-16-generic
quiet

(the part after UUID may vary from what’s on your computer; be sure to use whatever your old menu.lst file lists for your old linux kernel)

Then I rebooted the computer. Sure enough, this time it told me I was in Ubuntu 8.04! I ran the update manager again to check for anything it didn’t load after crashing, and found 2 updates I needed.

When I pressed “Update” though, it told me dpkg was already running, and I had to run “dpkg –configure -a” to fix things.

So, I opened a Terminal and typed in “sudo dpkg –configure -a”. It downloaded a few files, then asked me (again) if I wanted to replace the /boot/grub/menu.lst file. This time I let it use the default (new) one, secure in the knowledge that I had a backup of the old file.

That fixed everything. It wrote the menu.lst file it wanted, then rebooted. After reboot, I copied the part of the old menu.lst file that referred to my Windows install and pasted it into the new menu.lst.

Everything works now, none of my data is missing, and I can still get to Windows.

So, if you’re upgrading to 8.04, be sure to backup your menu.lst file if you’ve changed it. Let the updater overwrite your old file, then manually paste your tweaks into its /boot/grub/menu.lst once the update’s over. If I’d just done that, my update would’ve gone smoothly.

PS–If you’re upgrading a Macbook, your sound may not work when you boot into 8.04. Try running “alsamixer” from the Terminal, then use the up arrow to max out the volume for the each of the channels it shows. That should do it.

To Balticon!

Lora and I get to take a deserved break in two weeks when we go up to Balticon.

It’s become an annual pilgrimage back to Maryland for us. We get to see old friends, try to make new ones, and pick up some new medieval dance moves. Plus, two good friends of ours–Dr. John Cmar and Laura Burns–are in the Science Program, so we can heckle them while they give a talk 🙂

If any other Friends of the ‘Bat are going to be in the area, try to stop by the Con. Even better, drop me an email and let’s arrange to meet somewhere and catch up with each other!

Nokia N810: First Impressions

This is what my Palm TX should have been.

Granted, the Palm was a good organizer and datebook. But in the 21st Century, who cares about an electronic datebook that can’t load Facebook or YouTube properly? I don’t need a calendar application, I need to be able to get to my Google Calendar.

I do need to be able to watch videos without a lot of hassle. I do need to be able to read pdfs I’ve just downloaded. And I do need better text input methods than Graffiti.

The Nokia N810 delivers all this and more.

Here’s how:

1) Web browsing: The Nokia’s Mozilla-based browser renders web pages correctly, with all their CSS and Flash intact. And on the tablet’s 800×600 display, they look great.

2) Ebooks: The Nokia’s built-in pdf reader loads pdfs straight from the web and displays them perfectly. I don’t need to have them converted first, like I did with the Palm.

3) Handwriting recognition: The Nokia gives me true handwriting recognition right out of the box. Instead of being stuck learning someone else’s shorthand (Graffiti), I can train the tablet to recognize my own personal chicken-scratch. That makes it the first device I could see replacing my many notebooks.

Shiny!

I’m writing this on my brand-new Nokia N810 Internet Tablet!

It’s got trainable handwriting recognition, a fully-featured web browser, and Linux under the hood.

Goodbye, Palm. Hello, Open Source!