OpenStreetMap’s rising popularity

Craigslist is on board: OpenStreetMap soars to new heights

Craigslist is now using OpenStreetMap for showing the location of apartment listings! This is great for two reasons. First, looking for apartments will become much easier on Craigslist. Second, it’s validation that OpenStreetMap’s dataset is hugely valuable and robust enough for commercial use. Hopefully, I’ll be rolling out my OpenStreetMap project within the next week or so. The project is a re-rendering of the basic slippy map with topographic lines and hiking trails taking more prominence. More to come!

Backbone.js: Thankfully, a great MVC framework for the frontend

Frameworks, frameworks…

On the backend, web development frameworks have been growing quickly in popularity. Rails, Django, CakePHP, and others are popular because they save developers a ton of time. Someone once said that a good developer is a lazy developer, and frameworks enable developers to kick back with a Corona on a beach (well, not quite, but close) by making a lot of the architectural decisions for the developer. Rails is a great example of this, with a clear MVC structure, preset file system hierarchy, and even database schema conventions. If you were coding a site in pure Ruby, you’d need to make all of these decision yourself.

While backend frameworks are really popular, there has been a dearth of good choices in front end frameworks. As web apps are moving more processing to client-side Javascript, this was becoming a growing problem.

The front-end Javascript jungle

Front-end javascript tends to be a huge mess of jQuery callbacks, DOM elements stuffed with extra object properties, and a polluted root window object. As client-side applications are get larger, this is completely unsustainable. It makes code hard to maintain, hard to understand, and un-testable with unit testing libraries. Backbone.js greatly helps with all of these issues.

Enter Backbone.js

Backbone is a minimalist MVC framework for Javascript. It adds models and collections with persistance code that works well with JSON REST APIs, as well as views that automatically re-render on model updates and controllers that handle hash-bang URLs or HTML5 pushState.

All of this comes in 4KB of minified Javascript that ties in with jQuery, Underscore, or any other Javascript library.

Backbone dos and don’ts

I’m currently working on a small side project to brush up on some Javascript coding, and decided to use Backbone as a front-end framework (I’m using Rails on the backend). Here’s some brief notes from a my first impressions:

Do

  • Put most of your front-end application (or business) logic in the models. This is basically the same thing you would do with a MVC app on the server.
  • Use a templating library. Underscore.js has a pretty decent _.template() function. HTML in really clutters your Javascript code.
  • Try using the Rails asset pipeline or some other way to minify and compile your JS. This way, you can spread your Backbone code out into many files. I tended to use a folder hierarchy similar to Rails (folders for models, collections, controllers, and views).

Don’t

  • Put much logic in your views. It is very hard to debug view code because the function that renders the view is typically created programmatically by the templating library.
  • Don’t prematurely optimize your view code. The easiest way to render a view is to just create an HTML fragment from a templating library then insert it into the DOM with jQuery. This is fine for most cases. You can also manipulate the DOM by changing the inner text of elements on a view re-render, which might be faster but often isn’t worth the extra work.

Kayaking and confidence

I went out kayaking last night and did some river running for the first time. Up until now, I’ve been in the relatively controlled conditions of a man-made slalom course and some small Class I-II rapids in Mather Gorge, just south of Great Falls in Potomac, Maryland. Last night, I went out to run the Maryland side of Little Falls, a Class II-III rapid just north of Washington, DC.

Wow, what a completely different experience! I though I had a pretty decent kayak roll, but at the first rapid on the open river, I quickly went over and had to wet exit. The next few rapids went much better, though, and I think the big difference was confidence. That first one I approached timidly and by not paddling strongly, I ended up pinned to a rock and couldn’t roll into the current. The next few I paddled through with a much stronger stroke and more control of the boat. Literally, the only difference was confidence; I didn’t pick up any new skills in the five minutes between rapids.

This got me thinking: what other things could you do better with the skills yo have now plus just a little more confidence?

Four weeks of shippage

I recently started reading Ikigai by Sebastian Marshall. Its a really good, informative read on philosophy, business, and productivity. One of the points that Sebastian makes in the book is that there’s a difference between a generalist and a dabbler. A generalist is someone who has skills in many areas and has made important contributions. Think of Ben Franklin: he made significant contributions to the founding of the United States, science, and business. He’d be considered the archetypal generalist. Many of the other founding fathers were also generalists, as was Leonard da Vinci, Teddy Roosevelt, and many other important historical figures.

On the other hand, you have dabblers. People who work on many things but make no significant contributions. They might even be very good at many things, but yet they dabble in obscurity. What’s the difference? The difference is that generalists “ship”. They put their creations out in front of others, get feedback, and make refinements that make their next projects more and more successful. Dabblers stop when the project is 95% finished and move onto something else.

I’m completely guilty of dabbling. I have a ton of have finished projects sitting around that could be useful to someone. They are all in different stages of completion, but none of them are finished enough for someone else to use. While I don’t think any of them are Declaration-of-Independence quality, I’m going to spend some time the next 4 weeks “shipping” them in some form. That means polishing them to the point where they are usable and then putting them in front of some people to get feedback.

Here’s the projects in case you are curious:

  • The Time Series Database
  • My experiment to re-render OpenStreetMap for hiking
  • A Backbone.js-based nutrition calculator

I hope that pushing these to some kind of finished state will make some things that are useful to other people and let me clear out my list of half-finished work!

 

Real artists ship
— Steve Jobs

5 Government datasets for building web apps

Recently, I’ve gotten interested in using some open government data to build useful web applications. There has been a bit of work in this space, with many Federal agencies sponsoring app contests for developers to create products that show off the agencies’ datasets. Challenge.gov is the central listing of these app contests; take a look if you are interested in seeing what kind of challenges are open for entries. I’ve had a bit of experience working with government data and here’s some of the most interesting datasets that I’ve found so far.

U.S. Census TIGER

This is the mother of all mapping datasets in the U.S. It contains most roads, populated places, and administrative boundaries (for counties and states). There is also a ton of demographic data available subset by geographic location. These are huge datasets, and would need specialized GIS knowledge to do much with. The OpenStreetMap project has imported most of the roads and administrative boundary data, making the U.S. portion of their map pretty detailed. One issue with TIGER data is that many of the roads in the dataset no longer exist. This is especially true in areas that have lost population, like abandoned towns or areas converted to national parks.

Federal Reserve Economic Data (FRED)

Almost any conceivable economic indicator for the U.S., going back as far as government data exists. Want to know the USD/GBP exchange rate in 1974? Got it. CPI for 1951? No problem. There are also a lot of useful graphing tools built into the site and a nice REST API for accessing the data from web services.

NOAA Weather Radars

Historical RADARs back to the 1990s and near real-time radar images (10 minute or so delay). This website also has satellite images back to the 1970s. I’m sure there is some kind of really cool big data project you could create with these. Maybe show the historical likelihood of rain in a particular location on a particular day of the year, or check historical satellite images to determine when is the best change for a sunny day.

Securities and Exchange Commission EDGAR

Near real-time display of all filings for publicly-traded companies in the U.S. New share issuance,  corporate governance changes, and quarterly reports are all there.

USGS Stream Flow

I’m mostly putting this on here because I check it frequently for kayaking. This site has near real-time data on the flow and temperature of many rivers in the U.S. The data comes from gauging stations operated by USGS.

 

Takeaways from Lean Startup Machine DC

Last weekend, I went to Lean Startup Machine DC, which is a weekend-long workshop on applying the principles of Eric Ries’ book The Lean Startup. The weekend is incredibly intensive, and we made a lot of progress validating and invalidating some of the assumptions we had for our local peer-to-peer lending platform, Clovest.

For me the biggest take-away is the importance of talking to your customers early and often. Instead of writing code and building the website, we focused completely on customer interviews, market research, and developing a trial ad campaign to see how interested the community is in this project.

Far too often, technical people (myself included) would rather spend a few hours building something in Rails, or whatever is the current coolest technology, instead of talking with end users. Building software has instant gratification, it feels productive, and the risk is minimal (besides wasting time and getting carpal tunnel syndrome). Talking to people is difficult and uncomfortable, and forces you to consider the possibility that they will reject your idea. However, wouldn’t you rather have your idea rejected while its just a sketch on a napkin and not 20,000 lines of code that took 200 man-hours to write? I’d definitely prefer the former, and that’s probably the biggest takeaway from the whole lean startup methodology.

Heading to Buenos Aires for Februray

Poster at a bus stop in Buenos Aires of tango dancers

Credit: oijulia

The next four weeks are going to be a whirlwind of travelling: Miami for the Miama Half Marathon, then on to Buenos Aires for most of February.

I’ve wanted to go to Argentina for a while now, but kept putting off the trip for a variety of reasons: no time, no money, the usual. I though about going a few months ago, but at the time decided to put it off, yet again, for the same reasons. Then, this winter, with a fairly flexible work schedule, a friend who can sublet my apartment in DC, and dirt cheap flights from Miami, I realized that now was the time to go!

I’ll be staying in Buenos Aires for most of the time, working during the day and taking Spanish classes at night. I’m planning a few weekend trips to Uruguay (Montevideo) and possibly Mendoza for some hiking. Stay tuned for photos from the trip.

Proudly powered by WordPress
Theme: Esquire by Matthew Buchanan.