Quantcast

How To Pretty-Print a Python ElementTree Structure

ElementTree doesn’t support pretty-printing XML. lxml does, but isn’t installed on our system. minidom’s toprettyxml() is seriously fucked up. What to do? Turned out PyXML was installed, so I took some advice from here and came up with this function, which takes an ET node and returns a pretty-printed string:

import xml.etree.ElementTree as ET
 
from xml.dom.ext.reader import Sax2
from xml.dom.ext import PrettyPrint
from StringIO import StringIO
 
def prettyPrintET(etNode):
    reader = Sax2.Reader()
    docNode = reader.fromString(ET.tostring(etNode))
    tmpStream = StringIO()
    PrettyPrint(docNode, stream=tmpStream)
    return tmpStream.getvalue()

Rolling Rubber Stamps

tires
Another lovely thing made with a sharp blade and something inexpensive. Betsabee Romero carved these intricate rubber stamps out of old tires.

Invasion of the Book Scanners

We’re on a roll scanning books, and are always running out of space for book scanners. I arrived at HQ today and found five book scanners that can been set up in the conference room over the weekend!

confroom

Alive in Joburg

From Wikipedia:

Alive in Joburg is a science fiction short film directed by Neill Blomkamp, released in 2005 by Spy Films. It runs approximately six minutes long and was filmed in Johannesburg, South Africa. The film explores themes of apartheid, and is noted for its visual effects as well as its documentary-style imagery.


link to IA page.

Alive in Joburg is being remade by into a feature-length film called District 9 that looks like it borrows heavily from Transformers.

Twinkle SIP phone, Fedora 11, PulseAudio

Linux distributions have recently been shipping PulseAudio, a daemon meant to handle mixing, resampling, and control of audio streams. Maybe they will get it working right someday, but as of now, it is frustratingly not ready for mainstream usage. Many applications do not work with it, or work poorly with it, requiring stupid hacks and workarounds.

One such application is Twinkle, a SIP phone for Linux.  Previously on Fedora 9, Twinkle worked okay.  It connected to ALSA directly, so I just needed to set up ALSA to handle software mixing.

However,  in Fedora 11, PulseAudio has been designated as the One True Intermediary between ALSA and the rest of userspace.  In the case of Twinkle, this resulted in no audio emissions from the computer.   Calls could be placed, and would appear to proceed normally, but nothing emerged from the speaker.   Running ‘pavucontrol’ during a call showed that PulseAudio’s ALSA emulation plugin had been started, but the VU meter associated with the Twinkle application was completely dead.

After struggling with a bunch of useless workarounds (padsp, pasuspender, asound.conf, killall pulseaudio DIE DIE DIE, etc); several other softphones, none of which worked, for completely distinct reasons;  and exploring half-heartedly what it would take to hack PulseAudio support into Twinkle, suddenly I accidentally got it “working.”

If, during the first call placed after Twinkle is launched, you send a DTMF digit (e.g., pressing one of the number keys), audio will unwedge for that call, and all subsequent calls.

I hope this saves someone some time and frustration.  It’s embarrassing how much time it took to figure this out!

Crafty

butterfly2

Look what can be done with some paper, an xacto knife, and glue! By Helen Musselwhite

the rocket experience

snoop dogg, talib kweli, and buzz aldrin, together at last.  just heard the song on the radio today.

Raj &tam



Raj &tam, originally uploaded by tiki.robot.

Is there some way to make the Terminal app more readable?

I’ve pinged a bunch of people about this but there doesn’t seem to be an easy solution. I’d love it if the Terminal app went from looking like this

terminal01

To something like this…

terminal02

Just a few font changes…it seem like a simple request, but alas, it’s not. Surely I can’t be the only one who wants this?

Counting…

einsteinshirt

I made myself a tshirt a couple weeks ago on Spreadshirt. They’re awesome! A lot better than any other print-to-order service I’ve tried like Cafe Press and Zazzle. The shirt is based off of this one that I saw a friend wearing. I didn’t like what it said though so mine says something different :-) You can’t see the whole phrase in the photo above but you can see it below (in a different font).

einstein03

River Jumping

This weekend I went up to Downieville to race in the Downieville Classic which is the biggest mountain bike race in CA. It was so much fun! I’m happy to report that I still have all 4 limbs that I started with and they are in their proper place the last I checked. I shot the video above of the River Jump championships which happened after the cross country race on Saturday. I didn’t do that. These guys were nuts.

Raj and Ralf at the Wind Harp



Raj and Ralf at the Wind Harp, originally uploaded by tiki.robot.

Before hitting our first 7-Eleven for a free slurpee on 7/11.

Zaggle: A Social Calendar For You and Your Friends

Zaggle

Well, here it is, the first rough cut of a Facebook Connect website that gathers all your Facebook events into one handy place. Check it out! and let us know what you think …
Zaggle Preview Screenshot