The Good Life... a weblog about life, technology, and the Opera web browser

Posts from February 2004

Date
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29

Migrating from Movable Type to Drupal

When moving between content management systems, one of the first things you have to think about is whether you can import your data from one system to the next. Importing from Blogger to MovableType was easy. They had straightforward, easy to find and follow instructions. They even document their import file format.

Drupal—what I'm planning on using here soon—is another story. They have documents scattered all over the web. And it's mostly technical jargon that's over my head. So, I'm going to detail the process I used, hopefully in a way that'll help someone in the future.

All the conversion scripts I found required Perl 5.8.2+, which none of the machines I have access to have installed (they all have 5.6.1). The conversion scripts also require the XML::SAX module, so I had to install and configure that. This, of course, is easier said than done.

Installing Perl for Windows

The version of Perl available for Windows is called ActivePerl. ActivePerl comes in two installation packages, an MSI installer and a ZIP file with a batch file installer. They recommend the MSI installer, but that might require the installation of an update version of the Windows Installer (which is linked to from the ActivePerl download page). Detailed installation notes are also available.

Installing XML::SAX

In order to run the script, you need to have the XML::SAX module installed. Using ppm to install it didn't seem to work (according to the error message and documentation I found about the error message), so I used cpan instead. To use cpan, you have to install nmake, then install cpan. Then, finally, install XML::SAX.

(Optional) Install XML::SAX::Expat

The Perl-XML documentation recommends installing a faster XML parser, so I installed XML::SAX::Expat. While in cpan, this should be a simple matter of typing install XML::SAX::Expat.

Export your Movable Type entries

At this point, I started following the Drupal documentation, though not exactly. The first step is to add a new Movable Type template (call it drupal.xml), which you'll then use as input for the convertor script. The Drupal documentation has a sample template. After trying this the first time, I noticed that my entries appeared in Drupal's blog management page backwards (they appeared correctly on my public blog page). I decided that was enough of a pain to do the import again. So, if you want your newest posts at the top, change <MTEntries lastn="1000" sort_order="ascend"> to <MTEntries lastn="1000" sort_order="descend">. This file should then be available for download from your web site.

Making the conversion script

Step 2 according to the Drupal documentation is to create and run the conversion script. This was one of the major stumbling blocks for me due to an error in the Drupal docs. So, save the conversion script to a file named convert.pl. The fourth line from the bottom should be my $filename = $ARGV[0];, otherwise you'll run into a parse error. This change and another change (setting the value for the changed column in the table) should be visible in the Drupal documentation soon.

Running the conversion script

The moment of truth. Now it's time to run the conversion script. Put convert.pl and drupal.xml in the same directory. Assuming Perl is in your path (type path in DOS to check the value of your path variable), navigate (in a DOS window) to the directory where convert.pl and drupal.xml reside and type perl convert.pl drupal.xml > nodes.mysql. Assuming this runs correctly, you'll now have a file full of SQL insert statements which you can then import into Drupal.

Importing into Drupal

After the conversion script runs successfully, upload nodes.mysql to your drupal directory. Now, from a shell session, navigate to your drupal directory and type mysql -h hostname -u username -p database name < nodes.mysql (where you've replaced the emphasized text with the appropriate values). Now all your entries should be imported into Drupal. Almost done!

Fixing Drupal's incrementer

Drupal has an auto-incrementer that normally counts which entry ID to use next. But when using raw SQL insert statements, this doesn't work. So, now we have to update the incrementer manually. If you're using phpMyAdmin, this is as simple as opening the database, checking the number of rows in the nodes table, then updating node_nid in the sequences table to the number of rows in the nodes table plus 1. If you don't have phpMyAdmin, you'll have to run three SQL queries:

  1. select max(nid) from node;
  2. select * from sequences;
  3. update sequences set node_nid = result from first query plus 1;

That's it! Now, you have all your entries imported. Unfortunately, you've left behind your comments and categories. I'm still working on those. I'll let you know what I figure out.

Delaying Intital Mail Check

Opera Mail has the hidden ability to delay the length of time before initially checking mail. This works per account and is defined using the "Initial poll delay=" setting in your accounts.ini file. The initial value is 5 (seconds).

For instance, if you want to delay mail check for the same amount of time as your mail check setting, just copy the "Poll interval" setting to "Initial poll delay".

Proud to be an American

On Wednesday evenings, I head over to the University of Oslo for a Christian Union (CU) meeting. CU is a lot like InterVarsity Christian Fellowship, a group I was part of in college. My first week there, students from eleven countries attended the meeting (including another American from Montana).

This past Wednesday, an Iranian man talked to us about some of his friends and family. He read in the newspaper that one of his friends was being accused of terrorism. As he was talking about this, he kept looking directly at me, completely ignoring the other twenty some-odd people in the room. I tend to think I'm a good listener, so maybe he was just appreciating my attention. But part of me wonders if he was talking to me because I was clearly an American and his friend was arrested by Americans. After the meeting, one of the leaders apologized for it, as she'd noticed it too and she didn't want me to be bothered by it.

I think people in the US often have different opinions of our political leaders than the rest of the world because we see them from a different perspective. Most Americans are more concerned about domestic policy issues (taxes, health care, and education, to name a view), while the rest of the world cares about a president's international policy. It's perfectly reasonable on both group's account, as each is more concerned about policy that affects them most.

Most Americans are more nationally-minded, anyway. I, for instance, thought until very recently that Switzerland was part of Scandinavia. And I have a hard time remembering where all fifty states are, let alone countries on other continents. On the flip-side, very few Norwegians know where my home state is. It goes both ways.

Being a representative of the US (which I instantly become since I'm American) can be such a hard thing because the country is so large and the people so diverse. Some foreigners expect me to understand everything and sometimes I want it to be enough just to say, I know the US might look like some international bully, but it's my home and I like it there.

One of the CU leaders grew up in Jerusalem. She went to Bethlehem College and regularly dealt with being shot at or almost arrested. It's not something I can even come to close to beginning to understand, but for her, it's home. Maybe that's what being American is: you can't understand it unless you've grown up there. Whatever the case, it's my home and I like it there.

7.50 Preview 2 Released!

After almost two months of work, it's finally here. One of the first things a lot of you will notice is that favicons work in Bookmarks now. And we've done a lot of improvements in Opera Chat and Opera Mail. Have fun and enjoy!

Custom Start Panel, Part 2

Not only can you add search buttons, you can also add custom search fields. So, just drag any of the following to create a new search field in your Start panel or any other toolbar!

Search RFCs
Search Google Groups
Search Opera Support
Search IMDB

And now for the goodies, where I tell you how to do this yourself. ;) The buttons and search fields are regular links, with the href set to a custom URL. The URLs are of the format "opera:/edit/Search, "search-URL"" or "opera:/button/Search, "search-URL"" with the title attribute and link text set to the button/field name. The spaces and double quotes have to be escaped, so they come out as %20 and %22, respectively. Just copy one of the links to have a look at how they're put together.

Walking in the Snow (Updated)

Picture of me from our ski trip

NOTE: I left a few things unsaid when I originally posted this, so here's another go at it.

This Saturday was another first for me: I went cross-country skiing. I had a fantastic time with Eirik (roommate and co-worker) and Frode (co-worker), no matter how much of a beginner I am. When trying a new sport where you're unsteady on your feet, I've always been told that you should learn how to fall. I perfected falling. I had a couple very spectacular falls, in fact. But each time I got up and kept going. Which impressed Eirik a lot.

I've done a fair amount of downhill skiing before, usually going once a year over the past couple of years. And I'm pretty good at ice and inline skating. All these things put together set a good base for cross-country skiing. There's always the issue of stopping, though. And slowing down. There's the whole pie thing you're supposed to do with your skis, where you point the tips together to make a pie slice. It helps, but it usually doesn't cut it for me. Maybe I have too much inertia. Yeah, I'll go with that.

It's really easy to go skiing here. Back at home, I have to drive several hours to find a ski resort and even then, it's not usually good conditions. In Oslo, you get on the T-Bahn (part of the mass transit system), and take that straight up the mountain to the top of the ski trail. One stop along the way rents toboggans and another rents skis. People line up at the first stop with their skis, snow boards, and toboggans. It's a quick ride of the mountain and you step off the train, put on your skis, and go on your way.

There are a couple of necessities when skiing in Norway. The first is chocolate. Second, lots of stamina (we did ~8km or 5m). And it's always nice to have some good friends along.

For a look at pictures from the trip (and me in all my snow-covered glory), check out Eirik's or my gallery site.

Custom Start Panel

One of the neat things about the next preview release of Opera 7.50 is the ability to customize the Start panel. In addition to the "Search the Internet" button, you can add any number of searches. So, just type your search term in the input and press the appropriate button.

Even cooler is that you can make your own buttons and let others drag them to their Start panel! I've gotten a head start. :) When 7.50 Preview 2 is out, just drag any of the links below to your Start panel and you'll have instant searches.

Search RFCs
Search Google Groups
Search Opera Support
Search IMDB

I'll keep adding new searches as I make 'em. Have fun! :)

Windows Development Journal

Trond Werner Hansen, the man behind Opera's Quick UI, has started a journal. In his first post, he talks about 7.50 Preview 2 and beta testing. As one of the key developers on the Desktop team, he's got the information you want. Enjoy!

What could you measure in units of a millihelen?

Beauty. Helen of Troy in causing the Trojan War was said to have had "the face that launched a thousand ships". Therefore a face beautiful enough to launch one ship would be 1 millihelen.

Alternative answers and thoughts:

  • A millihelen is a face that can launch a single ship. I think the phrase was coined by Larry Niven. My life however has been full of women who could be measured in nanohelens, i.e. they could launch 2 lengths of deck planking and six rivets!
  • 1 Helen (H) is a huge quantity of beauty, and is thus inconvenient to work with. The smaller unit, the milliHelen (mH), representing the amount of beauty required to launch a single ship is more workable. Even this has problems, since the amount of beauty required to cause the spontaneous launching of ships must be large, since verifiable instances of beauty-induced ship launching are not commonplace. Also, there is no explanation as to how beauty could be "used up" in launching ships in such a way as to allow the count of successful launches to be able to be related to the total beauty.
  • Are there negative measurements (ugliness) and how are they measured? Spontaneous sinking of boats? Or the launching of submarines? With the reported problems of the Collins class submarines (a seriously ugly boat) probably resulting in extended times in dry-dock, their multiple launching could soak up a lot of ugliness in the world.
  • Is there a factor that needs to be applied to different classes of vessels to account for size, displacement, crew, etc. e.g. does a Trimaran require 1mH, 3mH, or some other amount of beauty to spontaneously launch?

I've had this sitting around for a while. I hope you got a laugh out of it, Helen.

Mean

Sometimes I catch myself being mean to people. It's usually certain people that have irked me in a very insignificant way. In retaliation, I'm consistently belligerent toward them. I feel particularly un-Christ-like when I realize what I've been doing. Yet, I can't seem to get out of the habit of meanness toward them. I feel really bad about it. I don't set out to be malicious. I'm often given the opportunity to be perfectly polite and helpful or sarcastic and belittling. Far too often I take the latter route.

I've been trying to understand why I do this. Is it human nature? Is it competitiveness? Is it residual meanness from years of bad experiences growing up? Am I bullying the only people I feel I can? Does it matter? Whatever the case, the fact that I'm doing it is just wrong. I know better. I even feel bad when I'm doing it. I'm going to work on that.