As stated in the note from the Sunlight Foundation′s Board Chair, as of September 2020 the Sunlight Foundation is no longer active. This site is maintained as a static archive only.

Follow Us

Labs Olympics 2011: How Is Babby?

by

For this year's Labs Olympics I was on an all-star team comprised of Aaron, Alison, Tim, and myself, better known as the Labs Olympics Winners (note: we did not win, this was just our team name). Alison has a young baby at home and Aaron was out during our first brainstorming session for the birth of his niece so it wasn't a big surprise that we wound up with a plan to make a sophisticated baby monitor. (It might come as even less of a surprise that we named it How Is Babby in honor of an infamous web meme.)

At first all we knew is that we wanted to use some random gadget or assortment of Arduino sensors to give geek parents a way to monitor their geek children, but it wasn't until we realized we had a spare Microsoft Kinect sitting around the office that we realized exactly how far we could take it.

Kinect

The Kinect is an impressive device, sporting 4 microphones, RGB and IR cameras, an additional depth sensor, and a motor that allows vertical panning. Getting the Kinect running on Linux is a fairly well documented process. We leaned heavily on instructions from the OpenKinect community, which worked pretty much without issue. After doing the usual

cmake, make, make install
dance, things worked without issue on Ubuntu 11.04.

Also included in the OpenKinect source tarball are bindings for a half dozen languages, including Python. Having a Python wrapper made things incredibly easy to experiment with as I had access to python OpenCV bindings for displaying image data and NumPy for manipulating the matrices that the Kinect driver returns.

With these tools in hand we just had to decide what we actually wanted to get from the Kinect. We decided to take regular snapshots to present via a web interface, and also have a mechanism for the Kinect process to notify the web client when there was motion. Snapshots were extremely easy: with just a single line of code, we were able to bring back the RGB image from the Kinect's main camera and convert it to a suitable format using OpenCV. Once we made the discovery that there was also the option to bring in an IR image, we added a night-vision mode to our application as well. This way, the parent can adjust the camera to either take a standard image in normal light situations or switch to the IR camera for the night. (Due to a hardware limitation of the Kinect, it is impossible to use the RGB and IR camera at the same time.)

Given the uncertainty in the amount of available light and the fact that the depth sensor provided simpler data to work with (essentially a 2D matrix of depth values refreshed about 30 times per second), we decided to use the depth sensor to detect motion. NumPy's matrix operations made this a breeze. By averaging the depth of the frame and comparing the deviation across a range of frames, we could flag each individual frame as likely containing motion or not. Depending on the desired sensitivity of the alerts, the application would wait for anywhere from ten to thirty frames of consecutive motion before notifying the web application that the baby was on the move.

The Web Application

As opposed to a traditional baby monitor, which has a dedicated viewing apparatus, we liked the idea of a web console that could be viewed from anywhere, including via a mobile device. The main features of the web app would be viewing, motion alerts, and configuration of features such as SMS notifications and nightvision. The basic web app was built with Django, but we used a few add-on libraries to help accomplish our goals in the two days given for the contest.

We decided that the easiest way to get images to the user was to have the web page embed a single image that the monitoring software would update at a set interval. We used Socket.IO for a very light-weight solution to keep the image updated to the latest version. In the best case scenario, i.e. the user's browser supports it, Socket.IO will use WebSockets to keep the connection open, but will degrade gracefully and fall back to AJAX or other means to get the job done.

Because our team lacked a designer, we used a CSS framework to take care of cross-browser issues and provide some pre-designed UI elements. Twitter just recently released their Bootstrap framework, so we went with it. It styled all of the UI elements on our site, including a navigation bar, alert boxes, buttons, and a form. Although we had some unresolved trouble with the form elements not lining up properly with their labels, it proved very easy to work with, overall.

The remaining technical component of the website was the AJAX alerts on motion events detected (and logged in a DB table) by the backend. There were a few criteria for how it needed to work, the most important being that alerts needed to be somewhat persistent to the user, so that a user couldn't miss an all-important alert saying that the baby was moving, just because they were clicking quickly between pages on the site, for instance. This meant that we needed something more sophisticated than Django's inbuilt messaging framework (django.contrib.messages). The answer came in the form of django-persistent-messages. It was built to work right on top of Django's messaging system, so it worked seamlessly and was a no-brainer to set up. With django-persistent-messages working, alerts now would not disappear unless dismissed by the user, hopefully averting any potential baby-on-the-move mishaps.

In the end, there were a few features we had to leave unfinished to get the project out the door on time, including audio monitoring and SMS messaging, but we were pretty happy with the results. As usual, all of our code is available on GitHub: How Is Babby.

Continue reading

2Day in #OpenGov 9/26/2011

by

Here is Monday's look at the week's transparency-related news items, congressional committee hearings, transparency-related bills introduced in Congress, and transparency-related events. News Roundup:

Government
  • Nobody is happy with President Obama's newly proposed set of ethics rules for executive branch employees. K Street thinks they are too stringent; reformers counter that they don't go far enough. (Roll Call $)(The Hill)
  • Improved oversight and administration of defense contracts is necessary for the Pentagon to reach a 2017 deadline for auditable books, according to a Defense Department deputy inspector. (Government Executive)
  • Many have suggested that agencies should create vendor management offices to oversee contractors' work quality. (Federal Computer Week)
  • A CATO study gave Congress a C+ for how well it provides access to its legislative data. (GovFresh)
Lobbying
  • A former White House official is serving a year in prison for lying to federal investigators about his dealings with lobbyist Jack Abramoff. (Federal Times)
  • The Energy Department has not disclosed any records of being lobbied by the failed solar energy company Solyndra, despite its K Street lobbying firm reporting lobbying the department regarding the stimulus package. (The Hill)
  • After spending mostly on the Democratic side in 2008, Google has gone on a "spending spree on the Republican side of the aisle." The company is now spending the same amount on lobbying as Microsoft. (techPresident)
Technology
  • Government and technology are coming together to design apps to aid disaster response. (Federal Computer Week)
State and Local
  • South Carolina's governor and other officials went overseas to attend the 49th International Paris Air Show, ultimately costing taxpayers $231,500. This information only came to light after the South Carolina Policy Council spent three months investigating, including filing multiple FOIA requests and writing a $270 check. (The Nerve)
  • Philadelphia has approved regulations that will require lobbyists to register with the city's ethics board. (Philly.com)
  • DC Council member Tommy Wells plans to introduce his draft legislation seeking to limit lobbyists' influence on city policymaking next week. (Washington Post)
  • New York Governor Cuomo's new website, Citizen Connects, will be used to host live online chats with the governor and his staff. (GovTech)

Continue reading

Labs Olympics: Nice Neighbor

by

As part of the 2nd Annual Labs Olympics, Team Leaf Peepers built NiceNeighbor, a network designed to put helpful neighbors in contact with each other.

Inspiration

It's been an interesting couple of months on the East Coast and in the DC area in particular, with earthquakes, torrential rains and flooding, terror threats and even a 2-0 start to football season in the mix leaving Washingtonians confounded, confused and generally insecure. Amidst these troubling times we've observed a pattern: In the face of uncertainty, people can tend to be jerks to each other. We hoard things, Jam up the roads and grocery aisles, and get pushy and rude. However, when disaster strikes, we are helpful, compassionate neighbors, each pitching in to face hardship together. It was our team's goal to help encourage this second behavior pattern all the time.

The team

Yes, the team, but wait. Leaf peepers? I recently returned from vacation in Vermont, where Luigi assumed I'd be photographing leaves. Nevermind.

Our juggernaut of raw, unstoppable productive force consisted of Luigi, Caitlin, Casey and myself, covering nearly every discipline represented in the Labs from design to research to front-end and back-end web development. With this veritable cornucopia of skills, we knew we had to bite off something significant.

Getting to work

Despite high confidence in our ability to execute, we were pretty strapped for ideas until late afternoon on the Friday before go time. We had been toying with a voice and SMS interface to guide people in rural areas without broadband internet toward the local public services they need, but Casey discovered in preliminary research that the infrastructure to make such an app worthwhile really wasn't there. We'd already scrapped some decidedly lesser ideas, such as a kitchen cleanliness tracker (pfff!), an rfid/motion sensor combo that played WWE-style entrance music for every Sunlighter as they came into the office each morning, and 'Auto-Tune the Law,' which would have set Sunlight Live to music, pitch-shifting testimony a la T-Pain, which (sadly!) didn't appear to fit the timeline or budget.

So, after reaching consensus--and without a comfortable degree of consideration of our problem domain--we got cracking Monday morning. The plan was to use a plain old Rails/ActiveRecord/Postgres stack to deliver the web interface, and Twilio for SMS and voice. Casey took our basic concept of 'have' and 'need' and set forth on IA and taxonomy, while Caitlin began on a color palette and logo. Luigi dug into the Twilio API, and I spun our project up on Heroku and started modeling.

Collaborating

Good teamwork is everything when dealing with compressed timelines, and we did our best to keep in touch throughout the process. We set up an IRC channel on Freenode that we hung out in each day for answering quick questions, and escalated to face-to-face as needed. Heroku provides an IRC bot to notify the room of deployments, which came in handy for status tracking and letting team members know when to update their code. For copy and user stories, we worked with an EtherPad instance that Eric had stood up for everyone to use, and found it to be great for collaborative typing.

Noteworthy tech

With the lofty goal of a backend, 3 interfaces and loads of location-aware goodies in just a couple of days, we had our work cut out for us. As mentioned above we decided to let Rails and Twilio handle the interfaces, and even though I tend to prefer Python/Django, it felt good to have a chance to play with some of the less-familiar-to-me-bits of Rails such as single-table inheritance for 'needs' and 'haves,' and scoped/nested routing patterns that are new-ish in rails 3. For IP-to-location, geocoding and radius search I used GeoKit, which was a pleasure to work with, though initially it forced me to trade sqlite in development for postgres.

For the SMS and Voice features, Luigi evaluated Twilio and Tropo. Both are excellent telephony systems, with straightforward RESTful APIs. But Luigi figured out how to get a custom phone number through Twilio first (719-522-NICE), and so that's what he chose. When working with telephony systems, outgoing activity is straightforward: make an API call. But how does one handle incoming activity? Twilio expects developers to implement endpoints in their app using a custom XML-based markup language, TwiML, while Tropo allows developers to host scripts on Tropo's cloud. Tropo also supports an endpoint-based solution, similar to Twilio. On top of all that, Tropo offers a new service called SMSified that makes development even more straightforward if one only needs to support SMS.

Overcoming adversity

By the end of Monday, we had a solid start--Catilin had a great logo that pulled inspiration from the letters 'NN' back-to-back to form a Mr. Rogers-esque cardigan, we had hello world in SMS, an admin scaffold, an auth system, some models and a sense for how requests and offers would be delegated. But to poorly paraphrase Bret Michaels, every Monday has its Tuesday. While working with Caitlin to help her get started integrating her markup/css into the project, Luigi mistakenly deleted all of her work! The next several hours were spent attempting to reconstruct it from browser cache, which turned out reasonably successful, though very costly in time.

To add illness to insult and injury, Caitlin came down with food poisoning that night, leaving your Leaf Peepers woefully short-handed during Wednesday's pretend-like-you're-working-but-try-to-make-up-for-lost-time sprint to the finish.

For fun, if not profit

By our measure, we didn't quite make minimum viable product, but the fruits of our effort stand nonetheless at http://niceneighbor.net, with code at github. We stand by the idea and perhaps will develop it further at some point to get it over that elusive hump of 'usefulness.' Results aside, we had a great time working together and learning about bits of tech we don't normally use.

Continue reading

2Day in #OpenGov 9/23/2011

by

Happy Friday! Here is today's look at the week's transparency-related news items, congressional committee hearings, transparency-related bills introduced in Congress, and transparency-related events. News Roundup: Federal Spending

  • The GAO audit of the Federal Reserve was the first audit of the Fed's emergency lending programs, but was surprisingly under-reported in the mainstream media. A more thorough investigation of the Fed is due on October 18th. (Forbes)
  • The Commission on Wartime Contracting's final report, released in August, found that the government has lost between $30 and $60 billion to waste and fraud in Iraq and Afghanistan. These findings have left the government slightly unsure of how to remedy the problem. One early response came from Rep. John Tierney (D-MA), who introduced a bill to create a permanent inspector general for wartime contracting. (Federal Computer Week)
  • On average OPM is paying $120 million annually in payments to deceased beneficiaries. (Government Executive)
Access to Information
  • Executives from Solyndra, the failed solar power company that has been in the news recently for receiving large loans from the federal government, invoked their 5th Amendment right to remain silent before the House Energy Committee today. (Executive Gov)
  • OpentheGovernment.org released their annual open government report last week, which expands upon much of what was discussed in the 2011 Knight Open Government Survey. Topics include aggregate FOIA data, the cost of FOIA, and the renowned FOIA backlogs. (Unredacted)

Continue reading

Israel, Palestine spend millions on lobbying, PR campaigns

by

As the United Nations considers the Palestinian referendum for statehood, possibly as early as Friday, both parties are vying for an approval from the UN Security Council and for a U.S. vote. Both Israel and Palestine have a long history of lobbying the U.S. and in the past year alone, the Palestinian Liberation Organization spent over one million on public relations. During the same time, Israel spent over $13 million on lobbying, public relations and related costs. Both interests contacted important policy makers and set up a vast PR campaign.

In the last few months as the issues ...

Continue reading

Googling the audience

by

Yesterday, senators quizzed Google's former CEO and current board of directors president Eric Schmidt about the company's size, practices, and potential for anti-competitive behavior. Concerned that the government might try to flex its muscle against the search and mobile giant, Schmidt assured the senators that Google was no Microsoft, and that 2011 was no 1995.

The hearing, titled "The Power of Google: Serving Consumers or Threatening Competition?" provides some insights into the concerns of some members of the the subcommittee on Antitrust, Competition Policy and Consumer Rights. Others with those concerns filled the hearing room. We'd like ...

Continue reading

CFC (Combined Federal Campaign) Today 59063

Charity Navigator