Articles by
David Zwarg

Azavea’s Coffee ‘Uber’ Assistant: Caféduino

cafeduino

Azavea has a clearly defined symbiosis with coffee. We have a designated Minister of Coffee, a world-class coffee grinder, and we get selections of coffee from around the world; some of it hand-delivered, and some of it hand-crafted.  However, one of the problems opportunities that I observed with our coffee system was that as coffee was brewed and consumed in the office (about 6 brews a day),  unlucky staffers would frequently pick up the (opaque) coffee pot to find it empty.  I don’t personally drink coffee, so I was unaware of how much anticipation one feels when approaching the pot and the extreme let down experienced upon encountering an empty pot.

I slowly set to work in my free time to solve this conundrum.  To me, it seemed like an individual would want to know if there was coffee in the pot before approaching the coffee maker (whom some of us address reverently as Zojirushi-san).  This could be 1) a web page, 2) a desktop app, or 3) an IRC (not IIRC) bot.  I drew up some schematics, took some measurements, and retreated to my home lab to build an Arduino based, web-enabled measurement system tailored for the coffee pot. I used an Arduino Diecimila, an Ethernet Shield, a couple piezoelectric sensors, a 3 color LED, a couple of buttons, and an awesome hand-crafted wooden base (thanks to Chip, our resident guitar maker).

A short while later, I had a working prototype ready for testing. The device now sits in Azavea’s kitchen, constantly measuring the weight of the coffee maker, and reporting the measurements to pachube.  After doing some internal evaluation, the name ‘Caféduino’ stuck, and I developed a couple methods of viewing the coffee pot status.

1. Direct Web Access

cafeduino_webaccess Using this method, it’s possible to directly address the Caféduino.  This gives the coffee addict aficionado direct access to the measurement values, but is more useful for other applications that are polling the data frequently.

2. Caféduino Notification

cafeduino_notification

Using this second method, the Caféduino is polled continuously, and the tiny coffee mug in the system tray is updated as the coffee level changes.  This is the most aggressive method of monitoring the Caféduino which, mysteriously, is the most comforting for users.

cafeduino_notifierchartWhen the coffee mug is clicked, the history of the Caféduino is charted in the window.  What you are seeing is a Google visualization applet that is consuming the historical data, stored on http://www.pachube.com/.

3. IRC Bot Integration

cafeduino_botintegration

Lastly, the most interactive method of polling the Caféduino is through our internal IRC channel. The above screenshot is the conversation that I initiated with the IRC bot, and its response.  It has reassured me that there is indeed, 77.78% of a pot of coffee left.

Now our staff can check in on the coffee pot, to insure that their next visit to the kitchen will be without disappointment.  While this system works well for monitoring the coffee level, the next steps may be more involved – building a machine to automatically brew coffee.

Research Project: Sourcemap

"I am proud to be a part of the project, and Azavea is happy to see its staff working on such cool projects."

One of the many perks about working at Azavea is the opportunity to conduct an independent research project. Full time staff that have been with the company for at least 6 months are eligible to develop a research project plan, and pitch it to the powers that be. We have profiled several other research projects in previous newsletters, each solving a different problem. Sometimes staff choose to take on projects pro-bono, rebuild older Azavea applications, or learn more about a given technology.

Last year, I learned about the MIT Media Lab’s Tangible Media Group-produced ‘Sourcemap’ project. Sourcemap is a tool, “for producers, business owners and consumers to understand the impact of supply chains.” My personal interests initially attracted me to the project, and Azavea approached the Sourcemap project in November of 2008 to see if they could use any contributions of the mapping and/or web development kind. They were happy to have contributions, and I began working on the spatial database and mapping components of the project. They generously moved to an MIT Open Source License, partially in order to accept the mapping and web development contributions I would make.

Some of the components I have been working on have included:

  • Migrating from a proprietary web mapping API to OpenLayers
  • Implementing specialized “arcing” cartography between parts and objects
  • Rendering material networks across the International Date Line

The migration to OpenLayers increased performance of object maps, and enabled the maps to display a much greater number of features. This introduced a second problem when there became too many features on the map to be able to distinguish them – if any two parts of an object and an object itself was collinear, it would be impossible to see their connection. By slightly arcing the network, it became possible to discriminate parts in complex objects. Lastly, mapping a network across the IDL introduces many fun problems – one of which is that mapping a part from Japan to an object in Alaska went the wrong way around the globe! The solution I came up with involved creating networks that repeat across the globe and represent the shortest distance between points.

The Sourcemap project generously moved to an MIT Open Source License, partially in order to accept my contributions. The challenges of working with the team at MIT from Azavea’s offices in Philadelphia introduced some growing pains to the project, but the project lead, Leo Bonanni, was committed to opening up the project to outside (of the Media Lab) contributors, and managing a distributed team.

Now, Sourcemap is getting ready to go live (http://www.sourcemap.org/), and they have some beautiful and informative maps. I am proud to be a part of the project, and Azavea is happy to see its staff working on such cool projects.

Click here for an interactive Sourcemap!

Interactive Sourcemap (Firefox only)!

‘The Root’: Map Your Family Tree

"The family is one of nature's masterpieces" - George Santayana

“The family is one of nature’s masterpieces.” — George Santayana

If you have been following the news, you have probably heard a lot of buzz about that famous nucleic acid, DNA. Rest assured, Azavea hasn’t jumped onto the genetically modified bandwagon*- we’re just helping people put together the pieces of their family history. We partnered with WashingtonPost.Newsweek Interactive to integrate a family tree editor and mapping application into their new website, theroot.com. The Root is a daily online magazine that provides commentary on today’s news from a variety of Black perspectives. The family tree editor and mapping application are meant to complement the site’s interactive genealogical section to trace one’s ancestry through AfricanDNA.com, a DNA testing site co-founded by Henry Louis Gates, Jr., who is also The Root’s Editor-In-Chief.

A sample, editable family tree on WashingtonPost.Newsweek Interactive’s ‘The Root’ website.

Using common genealogy metaphors, we developed a powerful editor for building and maintaining family trees. Built with Flex and the yFiles graphing framework, this editor enables dynamic editing and visualization of an individual’s family tree. Leveraging our geographic background and indulging in our strong interest in Open Source software, we integrated geocoding from Google, OpenLayers, and PostGIS to display family members on a map, anywhere in the world.

This project was an exciting whirlwind of development, lasting only 6 weeks, including design, debugging, and load testing. A couple fun hours were had by all when we unleashed all of our staff on the application, in an attempt to find bugs. What was most enjoyable was listening to the cackles of laughter after attempts at SQL injection.

We are continuing to work on this project, and future releases to the mapping tool will include a GEDCOM exporter, support for really complicated family relationships, tight integration between the family tree and map views, and with DNA test results from AfricanDNA.com. So stay tuned!

*No comment on the quality of the genetically modified developers we hired recently.

Mapping Citizens’ Voices

"Turn it around in a little over a week? That was where the fun began."

“Democracy is the worst form of government except for all those others that have been tried.” —Winston Churchill

The Citizen’s Compact with City Hall (http://www.reformballot.org/) is a grassroots democracy action born out of the Reformer’s Roundtable, an organization convened by Philadelphia Forward (http://www.philadelphiaforward.org/). We like what these people are trying to do to improve city government in Philadelphia, so we’re lending a hand.

The idea was to get a quick and intuitive representation for the geographic distribution of individuals who sign the Citizen’s Compact with City Hall. When a visitor signs the compact, their contact information and address are saved. The Reformer’s Roundtable wanted to show a map that changed as more and more citizens volunteered to become involved. Not only that, we wanted to protect each individual’s address using some geographic aggregation. Turn it around in a little over a week? That was where the fun began.

Azavea turned to ESRI’s ArcWeb Services, GoogleMaps and Open Source software to achieve this dynamic, interactive map. The addresses are geocoded with ESRI’s ArcWeb Services (http://www.arcwebservices.com/), processed and stored in a PostGIS database, and rendered in OpenLayers via MapServer using the GoogleMaps basemap. All in all, a tidy package that processes visitor information and dynamically generates a map of aggregated citizen distribution.

This is an exciting project for us – it is a good cause and it involves an intriguing constellation of geographic information technologies. As part of our staff’s research, we have developed a bit of expertise in each of these realms, but hadn’t had the opportunity to bring them all together in one project. We are excited to see it in action, and we hope you take a moment to check it out.

And if you live in Philadelphia, please consider signing the Citizen’s Compact. When you sign the compact, you’ll get access to a wiki where you can contribute your own ideas for political reform in the City. In a couple of weeks, you’ll have a chance to rate those ideas. Then, the top-rated ideas will be sent to each of the candidates for City Council and Mayor to see what they are willing to support. The results will all be posted online.

What’s in a Widget?

"Development of widgets as new faces for existing web services pushes geographic data to lightweight and easily distributable clients."

As a technology company, Azavea is competing in an ever-changing market.  One way Azavea stays current with emerging technologies is by sanctioning research projects in variegated technologies, headed by full-time staff members.  Research projects range from Open Source projects to pro bono GIS services for the community.  One of these research projects involves the Yahoo! Widget Engine, which builds upon Azavea’s existing Web Services expertise.

Widgets are cross-platform applications that run inside of a runtime engine.  These widgets, while compact, are built upon an internet-ready engine that provides connectivity to URL resources and Web Services with minimal programming.

In addition, widgets have strong support for innovative interface designs, challenging the “window” interface modality that is ubiquitous across all desktop applications.

Development of widgets as new faces for existing Web Services pushes geographic data to lightweight and easily distributable clients, in addition to providing Web Services for application level support.  Azavea is continuously exploring ways to disseminate geographic knowledge; exploring and challenging the way existing knowledge is transacted enhances the company’s repertoire of geographic solutions.

Inside Azavea: Subverting Our Software

Azaveas development team constantly relies upon Software Configuration Management (SCM) software to author robust and dependable software. Whether development happens in Philadelphia, Seattle, Vermont or on the road, a copy of Subversion, running off a server in the office maintains logs and copies of code for collaborative, secure, and redundant storage. As all of Azaveas developers are seldom in the office at the same time, maintaining a central repository is critical to the integrity of Azaveas products and solutions. With the addition of TortoiseSVN, developers can write code from anywhere in the world that has access to the web, and easily manage their checked out versions of code in a familiar Windows environment.

It doesn’t matter if someone changed some code last week or last year, Subversion keeps track of those changes, and even includes a “blame” feature. Making each developer accountable for his or her changes maintains a higher quality of code, as each developer writes code with this informal contract in mind. This accelerates the Azavea development lifecycle when multiple developers work on one project. Not only because there are more people on a project, but because they constantly update the common code base, implementing application features in parallel. The resulting collaborative effort produces a shorter development time and quicker delivery to Azaveas clients.

Inside Azavea: Why We Wiki

Azavea’s development team is always technically savvy when it comes to communication and organization, which is why we decided to use a wiki to respond to the myriad of challenges of organizing large amounts of information in a group setting. The development team at Azavea uses the wiki software (dokuwiki, available for download from http://www.splitbrain.org/projects/dokuwiki ) to store project information, technical tips and tricks, and administrative contacts. What is a wiki?  A wiki is a type of website that allows users to easily add, remove, or edit content and is used as a tool for collaborative writing and knowledge management (http://en.wikipedia.org/wiki/Wiki).  The wiki stores technical curricula for new employees, contact information for shared office resources (calendaring, benefits, source control, technical tips and tricks, etc), and occasionally office humor. By opening the wiki to all employees, the timely and accurate distribution of information ensures that all employees have the resources they need to get started with a new technology or address administrative or technical issues. The benefits of using the wiki system over a typical inter-office memo are multifaceted: the information is immediately available on the office’s Intranet, can be ‘rolled back’ to older versions, is searchable, and can be appended with newer information as it becomes available. Having a dynamic, community-maintained information repository helps us share knowledge and keeps Azavea’s team on top of projects and new technologies.