Twitter’s IPA
Hello,
Seeing that caniszczyk is a committer, I can assure you that they picked the acronym first :)
https://github.com/twitter/innovators-patent-agreement
Sadly, I bet there is a patent troll out there who already owns the patent on this contractual agreement…
I hope more companies will commit to this agreement or one like it even if it comes with a cost (e.g. a lower valuation due to the crippled IP? *shrug*). Doing evil with software patents is all too easy. This sort of tactic will hopefully make it less so. I commend Twitter for taking the stance publicly and in writing.
Add an Ubuntu badge to your video stream :)
Wow. I haven’t posted a blog in quite some time. I’ve been focused on being a dad, husband, and better programmer. However, with the introduction of “masks” in Google+ Hangout, I’ve recently become obsessed with video processing and gstreamer in particular. So let me just cut to the chase:
Steps to placing an Ubuntu badge in your video stream:
0. Buy a webcam :)
1. Install Ubuntu (Precise Beta1!!)
2. Install the Video 4 Linux (v4l2loopback) driver, this will allow you to create a “virtual webcam” so-to-speak,
# sudo apt-get install v4l2loopback-dkms
# sudo modprobe v4l2loopback
3. Download your badge,
# wget https://help.ubuntu.com/11.10/ubuntu-help/figures/ubuntu-logo.png
4. Composite your webcam’s video with a static image (the badge) and write it to the “virtual webcam” (for consumption in Google+ Hangout, for example),
The Cody Somerville-optimized version:
# gst-launch-0.10 multifilesrc location=ubuntu-logo.png caps='image/png,framerate=1/1' \
! decodebin2 ! videobox border-alpha=0 alpha=.75 top=-80 left=-20 ! videomixer name=mix \
! ffmpegcolorspace ! v4l2sink v4l2src ! ffmpegcolorspace ! \
'video/x-raw-yuv,width=640, height=480' ! mix.
Here you’ll see that the ‘imagefreeze’ plugin was scrapped for the multifilesrc which is quite clever. The multifilesrc is designed to loop through a collection of file sources at a given framerate. Here, Cody, is simply looping over the same image, faster than the eye can see. Significantly improves performance over the original version that I posted! Thanks!
Original version:
# gst-launch-0.10 filesrc location=ubuntu-logo.png ! decodebin2 ! imagefreeze ! videoscale ! \
videobox border-alpha=0 alpha=.75 top=-80 left=-20 ! videomixer name=mix \
! ffmpegcolorspace ! v4l2sink v4l2src ! videorate ! ffmpegcolorspace ! video/x-raw-yuv, \
framerate=\(fraction\)10/1, width=640, height=480 ! mix.
5. Start or join a Google+ Hangout and click on the
settings icon, click on the first drop down, and choose “Loopback video device”,

6. You’re all done. Because this is compositing (in a manner of speaking) the image to your physical webcam video stream and writing it to the “virtual webcam”, you should in theory be able to use this with any application that lets you choose your video source. Woo.

The astute Ubuntu user will notice that the logo is flipped :( This may just be a Google+ Hangout thing?
If you are a gstreamer pro, I would love to know if this could be further optimized so that I can use my native resolution without my laptop crying :)
*squeek*
I realize that I have not updated my blog for quite some time. The reason mostly has to do with the the birth of my daughter, Sophie. My wife and I are still getting adjusted to being new parents. Other than that, I have been quite busy with work. Not only did my team merge with another, we are in the process of “end-of-life”-ing a bunch of commercial projects which is taking a considerable amount of time to get through.
I’m at UDS/P in Orlando, Florida this week, so I thought it would be a good time to reestablish my commitment to blogging about the web services, libraries, and tools that are essential to my day-to-day job at Canonical. I’ve decided to share more of my personal thoughts and opinions of regarding Ubuntu and its community. And while I’m making promises to myself (since I don’t actually think anyone but me reads this), I will also be writing a UDS/P retrospective. Woo.
Submitting a form with GET using Django’s FormView
Let me just put it out there. I’m one of those people who think submitting form data with GET is a perfectly reasonable thing to do when implementing search functionality. If you use Django and think like I think, then you should know the following: This behavior is not currently implemented for Django’s generic FormView (dpkg -l python-django tells me I’m using 1.3-2). Submitting a form using GET will provide no form validation. Luckily for us, Django’s class-based views were designed to be customized and extended, and thanks to Daniel Swarbrick, we have some code to do just that:
def get_form_kwargs(self):
kwargs = {'initial': self.get_initial()}
if self.request.GET:
kwargs['data'] = self.request.GET
return kwargs
This method can either be provided by a shiny-new MixIn class or it can be added as an override to an existing FormView. If you’re asking me for my opinion on which way to go, then I’ll give it: I prefer the MixIn approach because it’s simple and reusable :)
Creating PPAs using the Launchpad API
This has technically been possible since October 2010 due to the efforts of Steve Kowalik and Cody Somerville (see branch). Google searches for “create ppa via api” or “create ppa using api” do not reveal an immediate example of how one might do this, so I’ll document it here, and hope that one day it filters to the top? It’s super easy!
create_ppa_via_api.py
import sys
from lazr.restfulclient.errors import HTTPError
from launchpad import launchpad_production_session # Borrowed from this post
launchpad = launchpad_production_session("create-ppa-app")
try:
ppa = launchpad.me.createPPA(name="shinynewppa",
displayname="Shiny New PPA",
description="A Shiny New PPA!")
except HTTPError, error:
sys.exit(error)