Posted by Doug
on July 05, 2009
Technology /
No Comments
On the theme I’m using (Big City), the wordpress default for showing counts next to categories looks awful. The lines break after the link, so it will say something like “Technology ::break:: (31)”. The solution I found was basically just to hack the code where it prints the count, and move that up. This stuff is hard-coded in wordress, and I couldn’t find a CSS solution to my problem (I do suck at CSS, but that’s another story).
Here are the changes as of WP 2.8.
In “general-template.php”, locate the lines that say
$after = ' ('.$arcresult->posts.')' . $afterafter;
and change them to
$text .= <...>
There are a number of such lines, so this will make them all consistent. I think I counted 4 such changes.
The other change to make is in “classes.php”. Break line 1336 (which looked something like this before I got to it)
$link .= $cat_name . "</a>";
So that it becomes
$link .= $cat_name;
$link .= "</a>";
Now move up this block between those two lines:
if ( isset($show_count) && $show_count )
$link .= ' (' . intval($category->count) . ')';
This will change your formatting slightly if you were using the feed code, and I don’t have a good answer for you on that.
Posted by Doug
on July 05, 2009
Excursions /
No Comments
July 4 was awesome, but I won’t recount it here. I just wanted to point out this very cool bike group out on the street. Disco ball bike crowd riding around at 2 am? Yes, that’s sweet.
Today I went riding out around Cambridge to improve my mental map of the place. My realization is that there are a few very old areas — Harvard, Kendal Square, Porter Square in Cambridge, Concord, Lexington, and of course Boston — with direct roads between them. The names of these roads are generally given by the larger place (at least locally), which explains the numerous Cambridge, Harvard, Concord, Lexington streets, although rarely in the place for which they’re named.
I also discovered the source of the Minuteman Bikeway. Although the maps show the starting point as Alewife Station, there is actually a pleasant extension from past Davis Square not marked there. (See also my previous post on my ride on the bikeway.)
Posted by Doug
on June 20, 2009
Technology /
No Comments
Add to my list of fantastic software you should be using (Firefox, Dropbox, Adblock, XMarks) another: Zotero. It is an organization tool for your research that exists as a Firefox add-in (I don’t know why it only supports FF). You can bookmarket pages (imagine that!), sort them, tag them. However, you can also store files in with your bookmarks, refile bookmarks in several places, add notes, citations, and annotations. Basically, it is your bookmarks on super steroids. You can back the bookmarks up to their server, and the stored files to your own server, so everthing can be duplicated across machines. (You know how I feel about that!)
Continue reading…
Posted by Doug
on June 17, 2009
Technology /
No Comments
For unknown or inadequate reasons, I bought a copy of Office 2007 the other day and loaded it up for work. (As an aside, Amazon has Office 2007 Home & Student for $80 and Excel 2007 for $105 — and it says people are buying the individal program after comparing the two?). For the past few weeks I have been developing code that pulls financial data from Yahoo and populates a template sheet, among other things. Because of the way I add the data to the sheet (the fastest way excel supports, setting a range’s value equal to a VBA array), some summary functions at the top of the sheet have to account for the fact that the data could be of an arbitrary height.
My solution to this problem in the original version, written and debugged in Excel 2003, was to have those summary cells reference the range A23:A65536 and take a count, etc. to get the number or summary of those cells. This was fine. My code would take 30 seconds per run, most of which I thought was spent in VBA.
Enter Excel 2007. On a whim, I saved my spreadsheet in 2007 format and ran it. It was slow. I mean, mind bogglingly slow. I thought it was just the network taking a long time to download the data, however my coworker ran it a few times and it locked up his computer. Then it dawned on me: the formulas were rewritten to now reference A23:A1048576. Excel was touching 1 million rows over and over again every time the sheet calculated, which was often (he was using an RTD link, so it recalculated constantly). A simple solution: write a UDF that would count excatly the size of my data array, and use that instead.
This was the surprise: since I only had about 1,000 data points (but I didn’t want to hardcode to that number, and so I referenced all rows on the sheet), my running time, even using Excel 2003, went down from 30 seconds to about 6 seconds. The original slowness I had mostly chalked up to Excel handling data poorly; instead, it was purely a function of my forcing it to handle the data poorly, a problem only exposed by migrating to a higher-throughput device. The moral of the story is that if it doesn’t scale, it may be your fault, not theirs.
Posted by Doug
on June 14, 2009
Excursions /
No Comments
I rode out on the Minuteman Bike Path from Cambridge to Walden Pond, and then came back on a southern route through Waltham and Watertown. Lots of roads involved, but not too well-traveled on a Sunday. I had a great partner, who asked directions at exactly the right time to keep us from getting hopelessly lost.
Continue reading…
Posted by Doug
on May 31, 2009
Excursions /
No Comments
I hesitate to file this under “Excursions” as it was more “exploration” than a trip someplace. Nonetheless, I went and explored Harvard Square on my bike, and rode down Mass Ave past MIT, and then back. Some observations:
- Most important, this is a real bike town. Unlike New York, where the bikes hide in parks, and only bike messengers, delivery boys, and the fearless/mentally unstable venture onto streets, people are going in all directions here. It may be partly a weekend thing, but it is truly much more bike friendly. Less car volume, less speed, better acclimated to cars. Fun. Apropos of my previous post, I think the way in which the streets are totally nonsense dissuades driving in Cambridge to a large degree.
- There aren’t any bke shops in Harvard Square. Why is that? Local residents (the three I polled) only directed me to ones a mile out along Broadway or Mass Ave (either direction).
- There are a damn lot of pubs.
- Memorial drive is not a good path to take; it is a narrow little sidewalk with lots of people and other bikes on it.
- There are not many interesting buildings to look at in Cambridge.
We’ll see how these observations evolve. I would like to take my bike out to work at some point (in Acton), although it is far and I don’t want to be sweaty all day.
Posted by Doug
on May 29, 2009
City Streets /
No Comments
Jane Jacobs makes an artful case in The Death and Life of Great American Cities against congestion pricing. The crux of the congestion pricing plan is to reduce the supply of vehicles indiscriminately. It vilifies trucks, and makes allowances for cars.
However, this is backward; trucks and other commercial vehicles have no alternative, and are the most needed of vehicles, and cars are the most destructive to pedestrian and transit alternatives. When the private automobile is allowed to thrive, it steals those marginal users from mass transit, lowering bus and train utilization. Streets are widened, made one-way, and streamlined to promote rapid car transit at the expense of pedestrians. Parking becomes an imperative at the expensive civic density. Trucks may be in nearly perfectly inelastic demand, but business will simply pass those costs on to their consumers in the city and lower quality of life and vitality within, something we can agree is totally counter-productive.
The proper alternative is one Jacobs proposes, and it makes inherent sense: make the city inhospitable to car traffic, and alternatives will be promoted. Reduce demand for private transportation. The core observation, and one that bears repeating is that transit is a nonlinear problem. This means that there is no fixed number of cars or even visitors to a city. There is no one story. Some come to shop, some to work, some to visit, some to make deliveries. The magnitude and frequency of these uses is a function of the city’s vitality, and the manner in which these activities are carried out is not predetermined for all.
Continue reading…
Posted by Doug
on May 29, 2009
Technology /
No Comments
A few weeks go I finally got fed up of picking out which music to listen to. I don’t have the biggest music library, and since I moved back to Windows, I have been at a loss to find something that displays it in a way conducive to listening to all my tracks. (Somehow, Amarok on Linux did that job very well. Awesome player.) As a result, I started using Pandora, and really liked it. At first it played my “seed” songs too much, but a little nudging caused it to branch out, and now I have a couple of really enjoyable stations with a good variety of music.
Now for the inevitable problem: my computer is loud and it’s a waste of energy and a distraction to turn it on to listen to music. The solution: listen to Pandora on a stand-alone device. As a secondary requirement, I wanted a device with an iPod dock, since I have felt a similar problem with not being able to listen to the iPod.
The only device I found out there was the Grace Digital Audio IR3020. It has quite a bit more features than my basic requirements; it plays Sirius radio over the internet (with a subscription), Pandora, iPod, any of a number of streams (podcasts, terrestrial radio over the internet), and music files shared over your local network. You can also set an alarm clock and a sleep timer. It has a remote, and you can set 99 presets (haven’t explored that feature).
Out of curiosity and interest, I have tested most of those features, except for the podcasts (although I’m checking it out now), and the Sirius. Here are some thoughts on each of them and the device.
- Pandora. Works as advertised. All your stations show up in a list, and you bookmark, thumbs up or down, and skip tracks. The Quickmix is available, but you can’t select which stations go into the quickmix (I’m not sure if your configuration from the website holds over.) The big downside is the remote is completely ineffective for this. They don’t have the “Reply” button on the remote, and so you can’t give feedback or skip tracks.
- iPod. You can navigate with the iPod wheel to pick music as usual. Similar to Pandora, you can’t really control the iPod with the remote. Shockingly, I couldn’t even change tracks; I could fast forward and pause. Unlike the radio stations, you can’t set iPod as a preset, so you have to be able to see the screen to play the iPod.
- Streaming Radio. Thousands of stations from around the world are available to stream, and you can add them to your player through the website. This web-config option is one of the coolest things. Change a setting on the internet, and the option appears on the player. This doesn’t have many controls, so there’s nothing the remote can’t do.
- Network Music. I actually did not expect this feature; it can play music from a Windows share, as well as from a Universal Plug’n'Play server. I haven’t been able to get the former to work (very frustrating!), but Windows Media Player 11 sets up the latter with ease, and if my computer is on, I can access my entire library through the radio. And to really placate me, it allows you to navigate through your music either by artist, etc. according to the ID3 tags, or through the filesystem. I am really organized, so the latter is generally a very good choice for me. If you have a home media server, this would be a really sweet feature.
- In general, the interface is very poor. I have harped on how the remote doesn’t really do anything. The turn-wheel on the front of the player, used to navigate menus and make selections, has so much resistance that when you try to push it, you slide the radio across the table. The screen is too small for its functionality–showing only 3 lines of information and a line of status–so you are constantly scrolling and discovering easter eggs because you didn’t know certain menu items exist!
- It has both an ethernet jack and a wireless b/g antenna. It was a little annoying entering the 16-digit (or however long) key for the router in there using the scroll wheel, but it was a one-time exercise. One cool thing is that it sets the time automatically when you get online, so it pays you back in effort right there.
- For completeness, I’ll tell you that it (apparently) has 2 20-watt speakers, RCA and headphone out. The equalizer has a half-dozen presets.
Overall, it is a very good device. It meets your needs, but on its terms. That, of course, is the story of consumer electronics.
Posted by Doug
on May 26, 2009
Excursions /
No Comments
I have been dreaming about the almost-completely-separated bike paths from the Upper West Side to Orchard Beach, in the Bronx, for months now. Today I tried to take them there, and failed. I am much less excited about the route now; it is very haphazard going through the Bronx.
Continue reading…
Posted by Doug
on May 21, 2009
Miscellaneous /
No Comments