BenEngebreth.org

Maine and Acadia National Park

Tuesday, June 22 2010

I visited Maine and Acadia National Park for the first time two weekends ago. The park is a gorgeous place when it's not raining. Unfortunately, it rained most of the time when we were there. Driven out of camp early by the weather we made our way down the coast visiting Bailey Island and Portland along the way. Both places were beautiful and I'd love to go back and spend more time in each again soon. Perhaps it's just a simple minded comparison drawn from the equivalent names of the largest towns in the two states, but Maine really reminds me of Oregon. I had to keep telling myself I was still on the east coast for most of the trip.

Here's the full set.

Sunrise over Cadillac Mountain

Personal Kyoto

Thursday, May 27 2010

A couple of years ago I built a site called Personal Kyoto that scraped electric use data from Con Ed (the New York area eletric utility) and presented it on the web in a way that allowed a person to see their electric use change over time. The idea was to give people feedback on their electric use because measuring consumption is a requirement for reducing it. It turns out I was interested in building a demonstration of the the concept more than anything else, so the site effectively shut down a year or so later.

I still thinking tracking electric use (or any energy use really) is a prerequisite for any kind of sustained reduction in use and have lately been wondering what my electric use looks like at my current place. I borrowed some of the tools that I've built for Department of Numbers and got a very crude Personal Kyoto like environment up and running again. The goal here is to keep that green line (a 12 month rolling average) heading down. If I do that it means that I've used less electricity in the current month than I did in the same month the prior year. Keep doing that and the cumulative effect can be pretty substantial.

Nice View

Monday, April 19 2010

It's a crappy iPhone photo, but it still illustrates the amazing views to be had from rooftops in DUMBO.

Minimizing CSS Files with Ruby

Monday, January 18 2010

I've been using YSlow a good deal lately to attempt to wring out every last ounce of speed from Department of Numbers. I'm not sure if this is the best investment of my time or not, but it is a strangely satisfying task. I've heard that Google may be considering factoring page speed into their ranking algorithms, so I guess that's how I justify expending the effort to try to win these infinitesimal performance gains.

So as YSlow recommends, I decided I'd consolidate and compress DoN's css files to both limit the number of HTTP requests and return the smallest file possible. I grabbed the Ruby css compressor Rainpress and ran my css files through it. While I did get a noticeably smaller file this way it also became quite difficult to read. As I still value the whole view source nature of the web, I don't want to unnecessarily obfuscate my html and css for a negligible performance boost (negligible in my case at least). Given that Rainpress appears to have file input and output options but no formatting options, I decided to try to make something really simple (dumb some would say) where I could customize the output a bit more.

Here's what I came up with: mincss.zip


#!/usr/bin/env ruby

#define formatting around the characters
colon = ':'
semicolon = '; '
comma = ','
open_brace = ' {'
close_brace = '}'

file = !STDIN.tty? ? STDIN.read : File.read(ARGV[0])
file.split('}').each do |block|
 #one block per line 
 block.gsub!(/\n/,' ')

 #get rid of comments
 block.gsub!(/\/\*.*?\*\//m,'')

 #apply formatting defined above
 block.gsub!(/\s*:\s*/,colon)
 block.gsub!(/\s*;\s*/,semicolon)
 block.gsub!(/\s*,\s*/,comma)
 block.gsub!(/\s*\{\s*/,open_brace)

 #single spacing
 block.gsub!(/\s\s+/,' ')

 puts block.strip + close_brace if block.include?('{')
end

To maintain css readability I opted for one block per line with spacing after the semicolons and before the open braces. I think the results are more appealing now, but I can change this very easily if I wanted to by manipulating the define formatting around the characters section in the code above. Just modify the strings to represent what you want the space around each of those characters to look like.

As I said, this is pretty dumb code. It doesn't have any knowledge of css syntax or grammar it can use to shorten or correct your code; it just removes extra spacing and consolidates your css to one block per line. If you really want to get your css file as small as possible, Rainpress is probably the best bet as far as Ruby utilities go. But if you're looking for a flexible and concise yet readable view of your css, you might find this tool useful.

Usage is as follows:


> mincss.rb styles.css
> cat styles.css | mincss.rb

You can pass the input css via STDIN or as an argument. I operate with 3 distinct css files in my development environment but then have a Rake task that concatenates them and pipes the output to mincss.rb for the production environment. Now my development css files are verbose and my production css is concise.

Update: A reader sent in a fix for a greedy inner-block comment deletion. All the code has been updated. Thanks Jeff!

Catherine & Aaron's Wedding

Wednesday, September 30 2009

Here are a couple of photos from Catherine and Aaron's wedding in Pennington New Jersey. Actually, I didn't take any photos at the wedding at all. After the formal stuff was finished we all ended up hanging out in the hotel lobby till late. That's were all of these came from. There are a few more in the full set on Flickr.

Glacier National Park

Tuesday, July 21 2009

A trip to Montana. Full set on Flickr.

White Glove Tracking

Thursday, May 03 2007

Evan and I just put out a new project called White Glove Tracking. From the site:

There are 10,060 frames of video in Michael Jackson's 5 min 35 sec nationally televised landmark performance of Billy Jean. The White Glove Tracking project (W.G.T.) is an effort to isolate just the white glove from this moment in pop-culture history. Rather then write unnecessarily complex code to find the glove in every frame of the video I am asking for the assistance of 10,060 individual internet users to simply click and drag a box around the glove in one frame.

Help us out! It's a surprisingly addictive process. Get started loggin' frames.

Big thanks to Eyebeam and Rhizome for the support!

Electric Use Map for Personal Kyoto

Tuesday, April 17 2007

PK-Map-Post.jpg

The map above shows the average monthly electric use of Personal Kyoto users. A frequently updated map is also available at the Personal Kyoto site.

Getting the average use data out of PK and getting the data into Google Maps was pretty simple. What turned out to be challenging was working with the US Government's zip code boundary lat/lon data which is in a completely weird format. It's just a lot less user friendly than it could (should?) be. One could imagine that public data (which this zip code boundary information is) could be a lot more accessible. This seems to be a trend I've observed with most of the public data I've worked with now.

Personal Kyoto

Tuesday, October 03 2006

Well, I've finally to put Personal Kyoto out there for public use. Personal Kyoto is a web application that I developed at Eyebeam in the Openlab as part of my Fellowship. PK allows New Yorkers (and hopefully more people from other cities later) to monitor their home electric use by grabbing their account data from the local utility (ConEd in this case). Additionally, Personal Kyoto analyzes each user's electric use and computes an electric use reduction goal that is based on historic electric consumption and US Kyoto Protocol targets.

The project is based on the idea that observing behavior is often the impetus for changing behavior. For instance, there's lots of anecdotal evidence that cars with MPG computers encourage drivers to drive more efficiently because they learn the driving behaviors that lead to more gas consumption and those that lead to less. Similarly, the first step for changing your financial behavior is to track your income and expenses (i.e. keep a budget). This process almost always illuminates areas where your spending can be reigned in because you see things that were invisible to you before you started recording that information. The point is that measurable, comparable feedback on behavior can change behavior.

The ideal solution for an electric consumption monitoring tool is probably to install a physical device that monitors your electric use real-time in your home or work place. However, such a device would likely be expensive (or at least cost more than $0). Personal Kyoto, however, is really the same thing — it just works with more course data supplied by your monthly electric bill and via the web instead of a physical device. It does have the benefit of being completely free though.

I've already become pretty hardcore about sniffing out vampire loads (seceretly always-on devices such as TVs, stereos, charging devices, etc) and replacing the few remaining incandecent bulbs I have at home. The results seem to be showing in my decreasing monthly average usage. If you're a New Yorker interested in reducing your energy use (and/or the money you spend on your electric bill) do check out Personal Kyoto yourself and get that average use metric heading south. If you're a software developer and are interested in working to bring PK to your city, send me an email (ben [dot] engebreth [at] gmail [dot] com).

Update/Note: I forgot to thank Mike Frumin for contributing his technical knowledge to the project as well as a few significant conceptual points. Thanks Mike.

Eyebeam R&D Call for Fellows

Friday, August 04 2006

The Eyebeam Openlab has the Call for Fellows out right now. I've been an R&D Fellow for the last year and have had a wonderful experience. Working with creative minded nerds is pretty cool. If you feel the label artist, engineer and hacker fits you well, be sure you get your application in before August 14th 21st. The fellowship is 11 months long and starts in November.

While a fellow can work on whatever projects he or she is interested in, the lab's (and Eyebeam's) themes as of late have been leaning towards (1) Energy, Technology and Sustainability and (2) Urban research, urban interventions and media in public space.

Speaking of Energy, Technology and Sustainability, look for my next project, Personal Kyoto, in the next couple of weeks.