Archive for May, 2007

Chronologically ordered blog in wordpress

Monday, May 14th, 2007

I recently started the FedDibblety house blog, documenting our home improvements to our new home in Indiana (which Clare’s parents built). I set up accounts for my wife Clare, her parents, Dave and Ellen, and my parents, Harold and Fran. Ellen, being a technology nut like myself, immediately jumped in writing posts about the house, and also had some feature requests. One of those features was to have the blog read in chronological order. Most blogs read in reverse chronological order, but since this one was kind of diary-esque, it seemed more appropriate to have it in normal order. I am also dating posts corresponding to the improvements made, not the actual post date. I started searching around for forum posts and such about how to do this, and I came across two relevant ones. I came across one post on wordpress.org which had a very simple solution, of simply adding one line to the index.php file in the root directory, like so:

<?php
/* Short and sweet */
define('WP_USE_THEMES', true);
$order = 'ASC'; //adding this line
require('./wp-blog-header.php');
?>

This did exactly as one would expect. However, this also caused some problems. For those avid blog readers, now they would have to scroll way down (or go the archives) to see new posts, which doesn’t really make sense. In addition, the RSS feed was also chronologically ordered, so that RSS users would find it very difficult to see if the blog had been updated recently. While searching I also found another post on janegalt.net, in which the blogger asked the same question, and a reply by Jeff Licquia suggested a very simple solution:

To set up archives to use a different template, go into the management page, then go to Options, then Permalinks.

If you can’t, or don’t understand, the RewriteRules stuff, look at the note about not being able to use mod_rewrite. Where it says:

/index.php/archives/%year%/%monthnum%/%day%/%postname%/

Change “index.php” to something else, like “archives.php”, and put that in for the virtual site structure. Copy index.php to archives.php in your document root, then add the special flag to archives.php. You should be all set at that point.

(I’m a newbie to WordPress, but not to Web servers or Web stuff in general, so the above makes sense to me but isn’t tested. I’ll try to help if you have problems.)

This idea worked very well. I made the change in the Wordpress options page, then copied index.php to archives.php, using the $order=ASC flag, and removed that from index.php. Then I had to change the .htaccess file to direct queries to archives.php. I did not want to do this for feeds though, so I had to put in two rules, like so:

#.htaccess file for fedibblety/house blog
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /house/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !.*feed\/?$ [NC]
RewriteRule . /house/archives.php
RewriteCond %{REQUEST_FILENAME} .*feed\/?$ [NC]
RewriteRule . /house/index.php
</IfModule>

Then there was one last thing. In that blog (and in this one), I am using the fancy-archives plugin (as I write this post that site seems to be down, so I am not providing a link), which I have tweaked a bit. To get the archives in the sidebar listed in chronological order, I just had to change the SQL queries in the fancy-archives-list.php file to ORDER BY post_date ASC.

That was it!

  • FriendFeed
  • Reddit
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • Facebook
  • Fark
  • TwitThis
  • LinkedIn

My new computer — software

Monday, May 14th, 2007

Which operating system?

This was kind of a no-brainer. I was definitely not going to buy Windows, so it was going to be Linux. (I did think about something in the bsd family, and might still consider it at some point. I read a nice article comparing linux and bsd recently, which was informative and fairly unbiased. My take is that one of the biggest differences is that most people compile their own stuff for bsd, while most people get binaries in the linux world. I am happy with binaries right now. I can simply download a program and start using it, instead of having to wait 20 minutes for it to compile.)

Which distribution?

So, Linux. This website is running on Fedora Core 5, very happily, with very little problems. However, everyone is raving about Ubuntu these days, so I decided to give that a try. Since I have a super fast dual processor, dual core Xeon machine, I decided to install the 64bit alternate version of Kubuntu. I can always try other distributions as well.

Which Desktop Environment

I have been using KDE lately, because it seems a bit more configurable to me than Gnome, but again, I try to remain fairly open about this issue.

The programs I need/want:

Web Browser — Firefox
KDE comes with its own built-in file/web browser, Konqueror, which is very nice. It uses the KHTML rendering engine, which is the same engine that Apple’s Safari is built on. Like Safari, it seems to render pages very quickly, and has very good CSS support. However, also like Safari, some websites using advanced javascript (Web 2.0) do not work correctly, and it also lacks plugins. Although Firefox is generally slower than Konqueror on Linux, and slower than Safari on Mac, it has the advantage of being very configurable, and I think that is one of the main reasons it has gotten so popular. I particularly like the Firebug plugin, which has all sorts of neat web-design debugging tools for html, javascript, and CSS.
E-mail — Kmail
Kmail is the KDE mail program. I decided to give it a try. Getting my umich account configured correctly was a bit tricky, especially when dialog boxes kept popping up telling me things were configured wrong, and were preventing me from getting them configured right!! I found the following worked for me finally:

Using disconnected imap (much faster than regular imap, because messages are stored locally as well as on the server)

  • receiving: Port 993, SSL, login
  • sending: Port 587, TLS, login

For gmail (pop3), I had to use

  • receiving: Port 995, SSL, cleat text
  • sending: Port 25, TLS, plain

Once I got those things figured out, I had a lot of fun setting up spam filtering, via the Tools > Anti-spam wizard. The thing I really liked best though, is the templates for new, reply, reply-to-all, and forwarded messages. The templates allow you to insert the results of commands, making it incredibly easy to put it my auto quote selector script.

Run Windows programs — Wine
Wine on 64bit is still a little tricky. I followed the instructions here:
http://wiki.winehq.org/UbuntuAMD64
which worked very nicely
Web development testing — Internet Explorer (IE)
iescreenshot1.jpg
Screenshot of Internet Explorer 6 running on Linux with the KDE desktop

It might seem strange for many to run IE on Linux, since it is really a terrible web browser. However, many people still use it, and as long as that is the case, I want to make sure that my websites look decent (not necessarily exactly identical) in most major browsers. That means testing in as many browsers as possible. Thankfully, there is a script available from
ies4linux that makes the installation of IE 5.0, 5.5, 6.0 and (beta) 7.0 a snap. Just simply download the zip file, extract it, and then it downloads all the necessary files for you and sets them up. Note that it does require wine to already be installed and configured. 7.0 seems to render really slowly for me, but since it is still beta, I understand.

Photo Manager/Editor — Picasa
Picasa is a photo management program. It is now owned by Google, and is free. As of about a year ago, there is now an experimental Linux version. The Linux version runs under Wine, which means it is not a native Linux program, but it runs remarkably well. Installation was as simple as downloading the Linux version of Picasa. Since I am running Ubuntu, I chose the .deb package, and followed their instructions:

sudo dpkg -i /tmp/picasa_2.2.2820-5_i386.deb

Of course this didn’t work off the bat because I am running 64bit linux, and it is an i386 package, but I had learned a little trick installing wine to change this into:

sudo dpkg --force-architecture -i /tmp/picasa_2.2.2820-5_i386.deb

and it worked like a charm.

Desktop Search — Beagle / Kerry
As a Mac user for awhile now, I have become accustomed to good search via Spotlight. I would not say that I use it daily, but I definitely use it from time to time, and it is very handy. The good news is that Linux also has a very similar feature named beagle. Installing beagle was once again very simple:

sudo apt-get install beagle

Since I am using KDE, I also wanted to have the KDE front-end to beagle: Kerry. Kerry interfaces with Kmail and many other KDE applications which are not included in beagle by default.

That is about all for now. More on my adventures in Linux and trying to get my computer to run exactly as I want it in the future.

  • FriendFeed
  • Reddit
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • Facebook
  • Fark
  • TwitThis
  • LinkedIn

hyperref and natbib problems

Wednesday, May 9th, 2007

Today I was working on revisions to my dissertation, and I wanted to test something out in my slick two column layout, and was surprised when my document would not compile. After about a half an hour of commenting and uncommenting parts, and seeing the same error over and over again,

\pdfendlink ended up in different nesting level than \pdfstartlink

I narrowed down the problem to some citations that I had. I had one \citep command with two arguments, one of which contained a two author paper, and the other a three author paper. Apparently LaTeX was trying to typeset these all on the same line or something, and it was causing some problem with hyperlinks, which caused LaTeX to barf on the whole thing. I eventually ended up just changing the text a little bit, so that the first paper reference came on a different line than the second one. I am curious to know if there is a better solution than this.

Anyone??

  • FriendFeed
  • Reddit
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • Facebook
  • Fark
  • TwitThis
  • LinkedIn