Jonny Quest


Growing up this was always one of my favorite cartoons. This stop-motion homage is fantastic.


Golden Ratio and Fibinacci Numbers


The Apple logo is filled with fibonacci numbers and conforms to the golden ratio. Is anyone surprised by this?


Pagination Part Deux


Recently I wrote about pagination issues I was having on my site. It turns out they were entirely my fault. The process of updating the Octopress framework that my sites rests upon has three steps, and in the most recently update I performed I only completed one of those steps.

Whoops.

The first step is to pull the latest changes from the ur-Octopress repository via a git pull command:

$ git pull octopress master

This updates the core components of Octopress but does not update the SASS theme files or the source files that you may have altered in creating your site. In order to safely allow for updates to the theme and the source files that use the theme, there are two rake commands you must run. Each makes a copy of the existing SASS or source files so that you can reapply any modifications you may have made.

$ rake update_source
$ rake update_style

When I only ran the git pull I introduced a new version of the pagination code. Code that required the HTML source be updated as well. Since I didn’t run the update_source command, my site was still using the previous pagination HTML. Once I completed a full update cycle, my site’s pagination was working properly.

The moral of the story is, understand the consequences of not following all the directions.


Pagination


Update September 11, 2011 As interesting as figuring out all of the ins and outs of pagination in Octopress was, the real issue that caused my problems was an incomplete update cycle. When you update Octopress you first pull changes from Octopress and then there are two rake commands to run, one to update styles and one to update source templates. I neglected to do the rake commands after a pull and as a result I got plugin changes without the necessary source and styling changes to make them work properly. For a complete look at updating Octopress see the Updating Octopress section of the documentation.

One of the risks when changing how your site is published is breaking links. Links from external sources and links internally from post to post. Toward that end I’ve been making great use of Mint and it’s many Peppers to track visitors and any errors they may be experiencing.

After a recent source code update from Octopress I started seeing some errors referencing URLs that looked like “page/#/”. Last night I discovered pagination on my site was well and truly broken. Whoops.

Pagination is the process of taken all my many posts (1793 counting this one) and spliting them up into pages containing 10 or fewer posts. Since weblogs are published in reverse chronological order, each new posting causes a ripple through all the pages of a site. In my case there are 180 pages of prior posts to re-create. Each one linked to it’s nearest siblings via “older” and “newer” links.

There are many ways to structure a website. In my case I’ve choosen to have my primary page at the root of my domain. Others choose to house their site in a /blog subdirectory. By default Octopress assumes you fall into the later cateory, and want all your postings to live in a /blogs subdirectory. Since I don’t want that I’ve had to tinker with settings in the _config.yml file and also with the Liquid tags that render the primary index page.

By default the primary index page for an Octopress site wants to build an archives link that leads you to /blogs/page/#. It was easy enough to remove the /blogs portion of that link. The same piece of code was also creating pagination links that were incorrect, by embedding an extra /page in each and by adding an extraneous / at the end of the URL. After some debugging and testing on my site this morning, I produced the following code, which renders the three pagination links properly for my site structure.

  {% raw %}
    <nav role="pagination">
      <div>
        {% if paginator.next_page %}
          <a class="prev" href="{{paginator.next_page}}">&larr; Older</a>
        {% endif %}
        <a href="/archives">Blog Archives</a>
        {% if paginator.previous_page and paginator.page > 1 %}
          <a class="next" href="{{paginator.previous_page}}">Newer &rarr;</a>
        {% elsif paginator.previous_page %}
          <a class="next" href="/">Newer &rarr;</a>
        {% endif %}
      </div>
    </nav>
  {% endraw %}

This code also addresses a Liquid error I was seeing where the “Newer” pagination link wasn’t getting rendered at all. The original code was testing paginator.previous_page to see if it was greater than 1 and causing a “comparison of String with 1” error to be thrown. By changing the code to use paginator.page the comparison works properly.


Wright Robie House


Want! I have always loved Frank Lloyd Wright houses, and this masterpiece of Prairie style architecture is no exception. Plus I’ve never had Legos to play with.


The Internet Never Forgets


When I switched from WordPress to Octopress I heavily edited my .htaccess file on the assumption that no one would still have a bookmark to one of my old posts using an out-dated URL. That assumption was wrong.

In October 2003, for example, I posted a comment on a Kottke.org piece about the contents of your dock. And wouldn’t you know, that posting still gets traffic eight years later and that traffic still follows links buried in the comments, one of which leads to my site.

I know all of this thanks to Mint and the Error Tracker Pepper.

So this morning I reassembled my .htaccess file, bringing back in all the old MoveableType redirects, and while I was at it, I added one to catch all the old monthly archive pages too. The MoveableType redirects are specific to my site, but the basic format looks like this

Redirect 301 /blogs/######.html https://zanshin.net/YYYY/MM/DD/title-slug/

I no longer have the script I used to generate these, but it read the meta data for each posting exported from MoveableType in order to match up the meaningless 6-digit posting number with the Year, Month, Day, and post title for each entry.

The monthly archive redirects were easier to deal with as that URL pattern could be neatly fit into a regular expression:

Redirect 301 /blogs/\d{4}_\d{2}.html https://zanshin.net/archives/

In order to really clean things up I need to create a categories page that shows my remaining categories, with links to pages showing the entries for each of those categories, and once that hierarchy is in place, redirect old category links to that page. That will have to wait for another day. Until then the 404 page will have to suffice.


Das Smart eBike


Fantastisch.


Monsters of Grok


Fantastic tee-shirts imaging great scientists as rock band logos. I particularly like the Hawking and Tesla/Edison ones.


Compressed2



Dual-Screen Laptop


This would cause a bit of a stir at the nearby computer users group monthly meeting.