Archive for the ‘The Great OS Wars’ Category

“#ifdef Considered Harmful”

Saturday, June 28th, 2008

This is an old (1992) paper on writing cross-platform C programs, but it’s useful nonetheless. A lot of the problems highlighted in it have all but vanished over the intervening years, but the general ideas are still valid, even on Windows machines. (Have you ever tried writing a non-trivial Windows application, using the raw Win32 API, that’s portable between Win9x and NT-based systems? “Fun” doesn’t begin to describe it.) The solutions that they suggest are good ones, though the Boost libraries and projects like wxWidgets go a long way toward making them unnecessary.

“Ballmer to Google: You’re a one-hit wonder”

Sunday, June 22nd, 2008

Pot, meet kettle.” :-)

Upgrade: Ubuntu Linux 8.04

Friday, June 13th, 2008

In the wee hours of last Sunday morning, I decided to take the plunge and upgrade my copy of Ubuntu Linux. I’d been using the previous major release (7.10) since it came out, eight months ago. I’d wanted to wait and upgrade Mini-mEee to 8.04 first, before subjecting my main work system to it, but that didn’t work out.

There are a lot of improvements, both major and minor, in this version. Compiz, the fancy-graphic-effects system, seems a lot nicer now, as well as fixing at least one odd-looking visual bug. Scanning drives on boot (only needed on occasion) is now shown graphically instead of in text-mode. The Sudoku program is much improved as well (which is nice, since I like puzzling through it on occasion). The audio on my USB expansion bar automatically works now.

There was a major problem with it though. After the upgrade, my Project X test programs wouldn’t run. I spent most of a day trying various things to track the problem down, finally running across a post on the Ubuntu forums that said there was a bug in the closed-source Nvidia driver, and that I could work around it by switching to an older version of it. That required a simple change, and I’m happy with the result.

I’m also happy with the program that I specifically wanted to upgrade for: Avant Window Navigator (AWN). Although it appears to be pure eye-candy, it’s quite useful as well. I’ve replaced the bottom Ubuntu panel on both of my systems with it. My only real complaint about it is that you can’t reposition the bar yet — on my dual-screen system, it appears at the bottom of the upper screen, and I’d like to have it at the bottom of the lower one instead. But that’s apparently scheduled for the next major release.

All in all, a very successful (and useful) upgrade.

Ubuntu 8.04 for the Eee PC

Monday, June 9th, 2008

I installed Ubuntu 8.04 on my main system over the weekend (I’m preparing a blog entry about it now). I’d hoped to try it out on the Eee system first, but that hadn’t been possible yet.

The Ubuntu-Eee project finally posted a Release Candidate for the 8.04 upgrade a week ago yesterday, on the second. Unfortunately, it had some kind of file error in it, so no one could use it — the install stopped at 25%. I waited patiently for someone to fix the problem, but no one had done so by last evening, so I decided to take a crack at it myself. The fact that I know absolutely nothing about the organization of it, or what had been changed, mattered little to me. :-)

I decided to start by picking up the original Ubuntu 8.04 CD image and compare the Eee image to it, on the assumption that they’d simply made some changes to it (because that’s how I’d have done it, after all). A little research showed me that there’s a program called “diff” that will compare files and show you the differences between them, so I got started.

Sure enough, there were only a few differences: two files in the “isolinux” subdirectory and three in the “casper” subdirectory. “isolinux” sounds like it has to do with the CD image itself, so I concentrated on the other one.

The differences in the two text “manifest” files seemed to be only version numbers. initrd.gz is a GZip archive file that contains a bunch of other files; I unzipped a copy of it from both files and compared them. Oddly enough, they seemed identical, even though the archive files were different. Copying the version from the original release didn’t seem to make any difference. That only left one file to work with: “filesystem.squashfs”.

The system didn’t know what to do with it, but a little digging turned up an explanation: it’s a highly compressed file system, and the tools to use it are readily available in the Ubuntu Linux archives. I unpacked it, and the one from the original CD, and started comparing them.

There were a lot of differences, but a comment from one of the error reports suggested that it was due to a symbolic link, so I dug up a method for finding broken symbolic links and ran it over the Eee version. Oops… there were thousands of them. :-( But oddly enough, almost all of them were under the /proc branch. After eliminating that, I had only a handful.

On a hunch, I did the same with the original CD image too, and compared the results. Bingo — there were only five broken links in the Eee image that weren’t also in the original, and they were all in the same directory. This morning, after fixing those and re-packaging the filesystem.squashfs file, I tried to install it again.

SUCCESS!

Mini-mEee is back up and running, with the “Hardy Heron” release of Ubuntu. :-D

UPDATE: Wow, an open-source project that actually appreciates help! I got several congratulatory messages on tracking down the problem, including one from the guy in charge of the project, who posted the “gold” version of the package within hours of getting my fix. That’s a lot better than the first two I attempted to contribute to.

The Agony of Switching IDEs

Wednesday, May 28th, 2008

(For the unenlightened out there, IDE stands for Integrated Development Environment, a program that usually includes a text editor specifically geared toward program source code, an integrated project manager to keep track of what files are part of your program, some kind of parser for error messages from your compiler, easy ways to call up your compiler and debugger, and possibly similar tools. It’s a programmer thing, you wouldn’t understand. ;-) )

About ten years ago, I was forced to drop Borland C++ and switch to Microsoft Visual C++, because Borland’s compiler simply didn’t support a feature that my project at the time required. It was a very traumatic experience… I’d been using Borland’s compiler products ever since college (Turbo Pascal, Turbo C, Turbo C++, and Borland C++), and I was comfortable with them. Even more, I liked them, as a company, as much as I disliked Microsoft… their no-nonsense license agreement (you could use its products “just like a book”; you were allowed to make multiple copies of a program, as long as only one copy was in use at any point in time) was very innovative and fair, and that I found it impressive might give you some idea of the state of software licenses at the time.

But Borland’s products, preeminent for fifteen years or so, had been going downhill for a while. Each version was buggier than the last, and the aforementioned missing feature was the proverbial straw that broke the camel’s back. I switched to Microsoft’s compiler instead, and was obliged to switch IDEs too.

I hated every second of it. Eventually I got productive with the new editor, but I never learned to like it. Minor features in Borland’s IDE, like the ability to display a faint line at eighty columns so that I knew when I should move to a new line, and the ability to automatically eliminate whitespace characters at the ends of lines… MSVC just didn’t support them. Some of these were politically motivated (you weren’t supposed to care about the number of characters in a line, that was text-mode thinking, nevermind the fact that different computers had different maximum resolutions), others were arrogant assumptions (if you put a space there, even accidentally, we’re going to keep it forever because you must have meant it), still others I never figured out the reasons for. And there were enough of these “minor features” missing from MSVC that I keenly felt the difference. I probably could have learned to write customizations for it that would have made up most of the lack, but I had too much real work to spend time on that. And you pretty much had to use an IDE to write Windows programs, at least the Microsoft way — if you didn’t, you were reduced to a slow and arcane method of creating text files that described the visual “resources” of your program (dialog boxes and the like), which was even more painful. (The excellent and cross-platform wxWidgets library solves that now, in the way that I’ve always wanted things to work.)

Fast-forward to last year, when I switched to using Linux full-time. Since MSVC doesn’t run under Linux (of course), I was obliged to switch IDEs again. As mentioned at the time, I ended up using Eclipse. It’s fully cross-platform, and works with any compiler, so in theory I would never again be forced to switch environments, even if I switched operating systems.

I don’t really require all that much from an IDE. I just want a decent editor, a very basic project manager, an easy way to go to the lines that the compiler is complaining about, and (the number one requirement) that it not get in my way. Eclipse, with the CDT plug-in, did most of that… the editor had a few quirks that I didn’t care for, but it seemed at least as good as MSVC. Until I started using the Boost libraries very heavily in Project X. Eclipse, written in Java, was just too slow… it spent more time “scanning” my files, when I tried to compile them, than it took to actually compile them. And it wouldn’t use the second CPU core to do it, allowing the compiler to use the other one to simultaneously compile the code.

Last week, all of this came to a head when I started working on a new portion of the project, and realized that I was going to have to recompile (for testing) a lot in the near future. I decided that the time spent looking for, and learning to use, a new IDE would be more than made up for by the potential savings in compile-time.

I also wanted whatever I was using to be open-source. I have no problem paying for software (I’ve got several shelves dedicated to the for-pay software that I’ve bought, and I’ve written for-pay software for nearly a decade), but the company that makes it has complete control over it — if it dies or decides to kill off the package, you’re stuffed (there can never be any more updates to it, period), and if they get some nut in charge that has a different sense of what is esthetically pleasing, you get the dubious benefit of his changes, like it or not. Thanks but no thanks, I’d had enough of both with Borland. At least with open-source software, I can continue to update it if I don’t like how slowly it’s moving, or the direction that a later version is taken.

Anyway, the three top contenders, after a bit of research:

KDevelop. Pros: highly recommended, multiple language support, extensible via plug-ins. Cons: Linux-specific, no simple way to support the Boost::Build system that I use, and I have a personal and irrational bias against KDE. I didn’t even want to try it until I’d exhausted the other alternatives.

Anjuta. Pros: also highly recommended and extensible, with multiple language support, and GNOME-based. Cons: also Linux-specific, Boost::Build only supported via a make-based hack. I actually installed this one and gave it a whirl, but when I tried to make a project with it so that I could test it out, it immediately demanded that I install something else first, so I put it off.

Code::Blocks. Pros: highly recommended, extensible, fully cross-platform using the wxWidgets library, can support Boost::Build with minimal settings changes. Cons: C/C++ only, not available via Ubuntu’s repositories. It’s labeled version 8.02, but that’s misleading because it’s using the Ubuntu version number system. It’s actually only on its second major release; the project is about three years old, and its youth shows in a few areas that aren’t as polished as in other projects — such as, when you try to compile a program and come up with errors, and edit the file to fix the first one, going to the next error takes you to the line number that it was originally on, rather than the one that your previous editing moved it to.

Nevertheless, it fits my aforementioned criteria — especially about staying out of my way so I can do my work. It has several of the minor features that I haven’t had since Borland’s compilers, and a few unique ones that I’m rapidly coming to like as well.

So the search is over. I’ve decided to stick with Code::Blocks, at least until I find a darn good reason to change. Maybe I’ll even find some time to contribute code to fix some of the unpolished edges, we’ll see.

Safari for Windows… but why?

Monday, April 21st, 2008

I was recently discussing the state of computers with a friend, and it occurred to me that there’s no obvious business case for Apple to make their Safari browser available for Windows.

It makes sense for them to have their own browser for the Mac, so that they’re not at the mercy of any other company for one, but what does a free browser for a competing OS get them — especially when essentially all the competition is free too? I don’t see the business sense behind it. They can’t hope to gain enough market share to become a de facto standard, which is the only way I see that they could gain any strategic advantage from it (as Microsoft did after they killed off Netscape).

“Curiouser and curiouser…”

My Asus Eee 4G odyssey

Friday, April 18th, 2008

Well, I’ve had this thing for four days now, and I’ve finally gotten it set up the way I wanted it.

The first thing I wanted to do was replace the Xandros Linux on it with Ubuntu, both because I wanted the same set of programs available to me as on my larger systems, and because the customized Xandros system was fairly limited. That proved to be easy to do, thanks to earlier Eee users with the same idea.

But even before I did that, I wanted to expand the RAM in the system, so that I wouldn’t have to use a swap-file (this is a flash-memory-based system, a swap file would eat through the internal flash memory card’s limited lifetime of writes far too quickly, as well as being a security hole). A little research showed that it could take a single 2GB memory module, and the specs for it, and a local electronics store supplied the module. (I probably paid more than I needed to for it, but not by too much). With the extra RAM, I was also able to put all of the OS’s temporary and log files in a RAM-disk instead of on the internal flash drive. It means that my log files are erased every time I reboot, but that’s a small price to pay.

The installation of the OS and several of my most-often-needed programs took up about 70% of my internal 4GB flash drive, leaving me a little over a gigabyte for personal data. Nowhere near enough space (at its most pared-down, my data measured 1.5GB), but I didn’t want to use the internal flash for personal and often-changing data anyway — not only would it eat through flash-memory lifetime, but I couldn’t easily move the data to my main system when I needed the extra processing power. Fortunately, the Eee supports SDHC memory cards (a newer type of SD memory card that can handle capacities greater than 2GB), so I picked up an ultra-fast 4GB one.

Then came the “interesting” part.

I absolutely must store some of my data in an encrypted form, especially on portable systems. I also must have maximum reliability, at least to the point of knowing immediately if any data is corrupted, which to me means using Sun’s Zettabyte File System (ZFS) — arguably the most advanced file system available to date, and unarguably the most advanced one available on Linux. But ZFS doesn’t support encryption (yet), so I had to do some experimenting.

In the end, I figured out a way to have TrueCrypt encrypt the entire card, and create a ZFS pool on the encrypted device. It wasn’t that difficult, but as it turns out, that was only part of the answer: I couldn’t mount the ZFS device as my home directory, for various reasons, so I ended up just moving a small number of data directories to it (including my ~/.mozilla and ~/.mozilla-thunderbird directories) and (re-)creating symlinks to them in the same script where I mount the encrypted device and import the ZFS pool.

It’s not perfect. The Eee turns off power to the SD card slot when it goes into suspend mode, force-disconnecting the encrypted drive, so I have to manually unmount it before letting the system sleep. But it’s a small price to pay for the multiple layers of security (from theft or loss, from silent data corruption, etcetera) that it gives me though.

Now I can get back to my work. :-)

Congratulations, Ploni Almoni!

Tuesday, April 15th, 2008

I’d like to be the first to congratulate my friend Ploni Almoni (on the Recyclosphere blog) on his new Mac Mini. Have fun with it, Ploni!

Asus Eee PC 4G

Tuesday, April 15th, 2008

I had been trying to get a look at one of these for months, but no place around here seemed to carry them. I wasn’t too concerned, because I’d planned to wait for a later version of it before I took the plunge. Ah well, “the best-laid plans of mice and men often go awry…” I’m writing this entry on one now. :-)

This afternoon GoddessJ and I stopped at a nearby mall, and I was left to my own devices while GoddessJ did some shopping. I, of course, hit the two electronics shops in there… and what did I find, but that one of them carried it, and it was in stock! I was suitably impressed with the size, but I still managed to hold out, until I told GoddessJ about it, and she wanted to see it too. Then I just couldn’t put it off any longer… I walked out with one.

This thing is freakin’ TINY! Much smaller than the smallest notebook computer I’ve ever had, or even seen. The keyboard is fairly cramped (though I’m getting used to it already), but the screen is very readable, and quite adequate for a single full-screen program at a time. I’m updating the software on it as I’m typing this… I don’t see any option for a command-line window so far, but I’ll find a way to get one on there pretty soon, I’m sure.

(This is the Linux version, of course. I wasn’t interested in using it for games, and games are the only thing I use Windows for nowadays.)

I’m planning to use this as my carry-everywhere system, once I can get a few vital software packages on it — my password manager, and maybe the GCC compiler and Eclipse (I can’t tell if GCC is on here already or not, since I can’t get to a command line yet). It’s quite portable, and I’d be a lot less worried about having it stolen or lost than I am with its big brother, the Dell XPS M1210 laptop that is my main system right now.

More as I discover it.

“Microsoft: Vista feature designed to ‘annoy users’”

Friday, April 11th, 2008

Surprise, surprise. :-)