Ten Mile Tack

My front tire picked up this thumbtack on the ride home yesterday. I noticed a clicking sound coming from the front wheel, but didn’t realize what was causing the noise until I was halfway to work today. Since the tire was still fully inflated, I decided not to mess with it.

The tack has clearly punctured the tube as well as the tire, but, remarkably, the tube doesn’t seem to be losing any air. I don’t know whether this is thanks to dumb luck, perfect circumstances, or the “Protect Air” feature advertised on the sidewalls of these Hutchinson Top Slick 2 tires.

Posted on Thursday, June 3rd, 2010.

Gear Ratios

I know from experience that my bike has a few different gear combinations that yield very similar mechanical advantages. Sheldon Brown’s authoritative bike website features a gear calculator, which inspired me to examine my sprockets so I could calculate the exact gear ratios at my disposal.

My bike has 26″ wheels. In the front, my biggest chainring (high gear) has 44 teeth and the smallest chainring (low gear) has 22 teeth. In the back, I have an 8 speed cluster, ranging from 34 teeth (low gear) to 11 teeth (high gear). Here’s what this information looks like when plugged in to the calculator:

The output is a table of every gear combination. There are a few units to choose from. I like meters development: how many meters the bike will roll forward for each revolution of the pedals. Here’s the table, labeled with front gears across the top and rear gears down the side:

What this shows is that in my highest gear (the most teeth driving the fewest teeth) the bike will go forward 8.3 meters for each revolution of the pedals, whereas in my lowest gear one revolution of the pedals will move the bike forward just 1.3 meters – albeit with enough torque to climb a wall, given sufficiently grippy tires.

Certain sprocket combinations aren’t practical. Generally speaking, I only use high gear in front with high gear in back (top left of the table), and low gear in front with low gear in back (bottom right of the table). Otherwise, the chainline crosses from left to right, or vice versa, which causes more wear and tear; it can also be difficult to shift into these gears. Fortunately, similar ratios to these extremes are available using the middle chainring.

Posted on Saturday, May 29th, 2010.

Helmet Wrap

Helmet and Skull Cap

I found that this bargain-bin skull cap I rarely wear will stretch to fit around my bike helmet. It’s not waterproof, but I wonder if it might provide a little extra warmth (or at least a little less wind) in cold weather. Of course, typically a cap like this would be worn under the helmet – but in my case, there’s not much room to spare. Pluto got bumped from the planet list just to make way for my noggin.

Posted on Friday, May 28th, 2010.

Story Synopses for May 26

I have backlog of notes on story podcasts. Here are limerick synopses for a scant few of them:

Remembrance Is Something Like A House by Will Ludwigsen (via Podcastle 100)

A house that was home is forsaken;
abandoned in shame, it awakens.
With a creak and a lurch
it sets off on a search
to put right what once was mistaken.

Acceptable Losses by Simon Wood (via Pseudopod 191)

Mission’s the same, boys – collect our dead
with shovels and buckets and dread.
Many battles are won
and the Queen thanks you, son,
for her best weapon needs to be fed.

Intelligent Design by Ellen Klages (via Drabblecast 159)

In the kitchen with Grandma, baking,
young God learns the way of world-making.
“A pinch, a touch – you see?”
But He breathes life care-free;
another batch of bugs is waking.

Posted on Wednesday, May 26th, 2010.

Torchlight Screenshots

Steam is is like an iTunes Store for computer games. It was recently released for the Mac, and Torchlight was among the first “Steam powered” Mac games available. It’s a dungeon-crawling action RPG reminiscent of Diablo – and that’s a good thing. I have to admit I’ve been playing it quite a bit since buying it as an early birthday present for myself. (I’m also pleased to report that, unlike many other modern games, it runs well on my first-generation MacBook, at least with the “Netbook Mode” setting enabled.)

Torchlight provides a built-in screenshot function to save snapshots of your adventures. The keyboard command is Shift-F9. The screenshots are supposed to be saved in ~/Library/Application Support/runic games/torchlight/screenshots/. However, presently they are written to the torchlight folder with a filename like screenshots\05222010_081129195.png. If you look in ~/Library/Application Support/runic games/torchlight/local_settings.txt, you’ll see that the SCREENSHOT PATH variable includes a backslash, so the path gets misinterpreted as part of the filename on Mac OS X. Fix it to read as follows and your screenshots will be filed appropriately:

SCREENSHOT PATH :screenshots/

I’m sure that was bugging you.

Posted on Saturday, May 22nd, 2010.

Collective Behavior Model interface

Here’s an update on the model. As a convenience for the purposes of debugging and experimentation, I’ve added a “dashboard” readout that can be used to display any variable. I’ve also added manual controls to adjust the behavior parameters while the simulation is running. It’s fun! You can cause the agents to clump together, disperse, or exhibit other apparent patterns. Lastly, I’ve added a rudimentary pause mode (bullet time, as I announced to all within earshot upon implementation).

Pausing is handy, but I expect it will need to be rewritten in a way that allows more continuous control of the simulation speed – slow motion or step-by-step modes would also be nice.

Still lots to work on and review in the model itself. In particular, I want to examine the turning rate code; I see a lot of jittery motion that suggests something may be off.

Want to see and hear more of this project? I can continue to post updates. Some will be more focused on the concepts of the model and some will be more focused on the implementation – for example, I don’t really know much about Java, so I may post code examples of whatever strikes me as clever or confusing.

Posted on Thursday, May 13th, 2010.

Working on a Model of Flocking Behavior

A month or so ago I started working on a simple model of “flocking” behavior, based on work presented at a seminar I attended. I implemented most of the math, but left the visualization for later. It lay fallow for a few weeks. Over the past two days, I dusted off the project and added some simple graphics. It works!

Try it out for yourself right here (Java plugin required). The current camera controls are designed with a three-button mouse in mind, but support for the center button (scroll wheel) seems inconsistent across browsers. Hey, it’s just a demo.

Here are a few slides from a brief presentation I gave to my colleagues when I began this project.

Iain Couzin gave a talk in March as part of the EvoS seminar series. Iain’s research program involves computer modeling and experimental observation of collective animal behavior systems (schools of fish, flocks of birds, herds of ungulates). Rigorous feedback between theory and observation was evident in his work. It was inspiring.

Iain’s presentation catalyzed interest in agent-based modeling in our lab (I am an affiliated staff member). Others jumped in with NetLogo, but I decided to see what I could do with Processing due mainly to my recently rekindled interest in the language. The Obsessive Camera Direction library makes it easy to navigate the visualization.

My implementation is derived from two of the publications which formed the basis for much of the work displayed during Iain’s EvoS seminar. The first paper describes the basic rules from which a variety of flocking behaviors can be elicited, depending on particular parameter values:

Couzin, I. D., Krause, J., James, R., Ruxton, G. D., & Franks, N. R. (2002). Collective Memory and Spatial Sorting in Animal Groups. Journal of Theoretical Biology, 218(1), 1-11. [PDF]

The second paper adds goal-oriented behavior to the model and explores the effect of different proportions of “leaders” in a group (how many cooks constitute too many cooks in the kitchen?):

Couzin, I. D., Krause, J., Franks, N. R., & Levin, S. A. (2005). Effective leadership and decision-making in animal groups on the move. Nature, 433(7025), 513-516. [PDF]

My implementation does not yet include any goal-oriented behavior, but it is designed with the addition of this and other extensions in mind:

Here’s a conceptual diagram of how the pieces of the simulation are arranged. Every speck you see flying about is an Agent, and every agent may exhibit one or more Behaviors. A Collective behavior dictates the direction an agent will move based on its proximity to other visible agents. This design may be be extended to model the interaction of multiple agent types.

Whether I proceed with all or any of the potential improvements to this model is an open question. I may decide to apply this approach to other problems more closely matched to existing research programs at BU. However, I do think it would be swell to develop and test this implementation sufficiently to replicate the varied patterns presented by Iain Couzin.

Posted on Tuesday, May 11th, 2010.

Using LDView to make it easier to add parts to your LDraw library

A common concern among LDraw users is how to add new parts to their libraries. Often, “in-progress” versions of desired parts are available in the LDraw.org Parts Tracker (get involved!), but downloading and installing them manually can be tedious. If you don’t want to download every unofficial part, you can let LDView download and install the parts you want for you.

First, identify the number of a needed part. Let’s suppose it’s this brick:

It’s not yet in the official part library, but an unofficial version of 60475 is in the LDraw.org parts tracker. You can download the unofficial part and its prerequisites manually, or you can create a dummy model that requires it, and let LDView retrieve the files you. Here’s how.

Create a file consisting of a single reference to the desired part, 60745.dat:

1 71 0 0 0 1 0 0 0 1 0 0 0 1 60475.dat

Let’s call it download.ldr. Next time you want to download a new part, just change the highlighted part number (or add a new line for the new part; it doesn’t matter how the parts are positioned):

LDView can download missing parts automatically. First, make sure “Automatically check ldraw.org for missing parts” is checked in the “Updates” tab of LDView Preferences:

Next, open download.ldr in LDView. If it’s already open, reload it. (This will happen instantly if you’ve selected “Auto-update immediately” from the File → Polling menu.) When LDView loads the model, it will attempt to retrieve any missing parts from the parts tracker. After a moment, your new part should appear:

The new part (and any prerequisite sub-parts or primitives) will be added to your library:

To use your new part in Bricksmith, click “Reload Parts” in the “Parts” tab of Bricksmith Preferences:

The new part will now be available in the Bricksmith Parts Browser:

So, the point is that if you want to use a part that’s not yet in your library, just paste the part number in download.ldr, open it in LDView, and reload your parts library in Bricksmith.

Posted on Saturday, April 24th, 2010.

LDTrim Service

LDTrim is a little command line utility I wrote to help format LDraw code. Using Automator in Mac OS X 10.6, I made a Service that applies LDTrim to selected files in the Finder:

The screenshot above shows exactly how to set it up. So, if you’re cleaning up a lot of old LDraw files, now you can do it with nothing more than a right-click on the file or files of interest.

Posted on Sunday, April 18th, 2010.

NetNewsWire Folders

I use NetNewsWire as my newsreader. I like it, but I wish that it would display a list of posts (or even just unread posts) from subscriptions in a folder when that folder is selected. This is how Google Reader works, and it is a sensible behavior. Perhaps I’d like to read all bike-related news, instead of opening the folder to look at items blog-by-blog.

Is there an option I have overlooked that enables this sort of behavior?

Clarification: NetNewsWire does this with unread posts – all new items from subscriptions within a folder appear together when you select the folder – but I’d like to be able to browse all items, whether or not they’re new.

Posted on Friday, April 16th, 2010.