Don't expect os.environ.pop to do anything meaningful

It doesn't actually remove things from the environment, just from its local copy of the environment. The Python developers seem to simply have left it out of their implementation in os.py. Gustavo Niemeyer noticed this one.

>>> import os
>>> os.system("echo $ASD")

0
>>> os.environ["ASD"] = "asd"
>>> os.system("echo $ASD")
asd
0
>>> os.environ.pop("ASD")
'asd'
>>> os.system("echo $ASD")
asd
0

The Orange Box

As I was telling Jp yesterday, Valve has become masterful at creating near-perfect interactive multimedia experiences. That is to say, Portal is frickin' awesome. As Tycho says, they have proven the first person puzzle comedy genre.

1. It's short, but includes a satisfying amount of story content (especially if you snoop around a bit. Look for a slide show).
2. It is thoroughly and consistently hilarious, while maintaining its drama.
3. It has a very cool style and atmosphere, starting out strange and eventually growing spooky.
4. The music is excellent; Valve has always been good at timing their distinct music to maximize emotional response. Plus they got Jonathan Coulton to write the ending theme song (yes, there's an ending theme song!).

They have an interactive commentary version of each level of the game that you can play as soon as you've completed the respective level. It shows how they've thought about extremely subtle things. I would really like to see how someone who's never played a first person shooter gets along with it.

Moving on to the rest of the Half Life universe (which Portal very intriguingly refers to), Half Life 2 Episode 2 offers many of the same qualities. It's not as much of a comedy, but they make up for it. I don't know what else to say about EP2, really; if you can even tolerate first person shooters but have not yet played any Half Life 2 games, then you are missing out on a very good artistic, dramatic, and cerebral experience. And it keeps getting better with every episode.

Which reminds me: I have an extra copy each of Half Life 2 and Half Life 2: Episode 1 burning holes in my pocket; Valve has set Steam up such that I can give a copy of those to someone else since I already owned them when I bought the Orange Box, which includes them again. Who wants them?

Why thank you

I came across a review of Landscape written by Kristian Erik Hermansen. He also goes on about how great Twisted is, and how he apparently used it while working at Cisco. It made me happy.

Coherence

It turns out Coherence is a bit better at serving music to my Xbox 360 than uShare is. Currently my setup is improved over uShare thusly:

  • It doesn't include non-genre/album/artist/playlist entries in those respective categories (that was a very strange thing on uShare's part; it put individual files in those categories, or at least that's what the xbox saw)
  • My xbox hasn't frozen up while playing media from it yet.

I was playing Wik while listening to Sunny Day Real Estate today. That was confusing.

It's also written with Twisted, which is neat. There is also theoretically support for meaningfully listing Artists and Albums, but the plugin which is responsible for that is not working for me yet.

Fortunately a developer was around to help me out with configuring it. I'll show you how I got it working, but I'll skip all the parts about installing Coherence and its dependencies (which was very easy for me). All of the dependencies are either in Ubuntu or are part of the software stack that I have development checkouts of (Twisted, Nevow, Divmod stuff).

First create a file with the following contents:

logmode = warning
interface = eth1
web-ui = yes

[subsystem_log]

[plugins]
[[FSStore]]
content = /home/radix/Media
name = Coherence Test Content


Then run ./bin/coherence -c /path/to/your-coherence.conf

Coherence has a way to go, as its web site explains: "This is still young software! It won't destroy any data - at least it isn't supposed to ;-) - but it might not yet fulfill your expectations in your particular environment." Etc.

Here's a hint, guys:

1. WRITE UNIT TESTS. Preferably before you write implementation. Please. Your software is doomed to suckiness if you don't have a good suite of unit tests.

2. Don't use 0 as a default web server port. I shouldn't have to run "netstat -nlp | grep python" and guess at ports to find out where my web UI is. Either choose something like 8080 (and document it) or show an error message if there isn't one. OTOH, this isn't a big deal right now since the web UI doesn't really do anything.

3. Make your software easier to set up and use, and write better documentation. I know this goes without saying, but here's a suggestion: every contribution should be peer reviewed and ensured to have full documentation. It's really much easier to keep the quality of your code and documentation high when you have a strict set of rules in place, as we Twisted developers have learned.

However, good job on giving me a media server that sucks less! I'll be filing bugs and working with it until I can get a movie to play :-)

playing media on an Ubuntu system with my xbox 360

Just to give it a bit more google juice: ushare can act as a replacement for Windows Media Center for playing media hosted on a linux box on your XBox 360. I googled for quite a while before figuring out what exactly I needed (and I learned that UPNP has media protocols. wacky.)

1. Install the Ubuntu .deb (you're using Ubuntu, right?). The direct link on their web site to the .deb is a 404 -- I browsed their pool directory to find the directory with ushare debs. Download whichever one you need, for your 32bit or 64bit OS. You can also add their deb line to your Software Sources.

2. Edit the configuration file to change which interface to listen on, because the -i (--interface) option doesn't actually work (or the configuration file takes precedence). Pretty lame.

3. Run "ushare --xbox --content ~/Media".

4. Go to the media tab of your Xbox 360 and browse movies and music. They'll be listed.

There are several problems. First, I haven't managed to play any movies — I probably just need to transcode them to whatever codec the 360 supports with mencoder. Second, all unrecognized files seem to end up under the Music section, so there's lots of cruft in there. Third, it doesn't seem to recognize Artists, Albums, Playlists or Genres separately from Songs. That is, all of my files are showing up in all of those sections through the 360 media browser. I guess that this is a ushare bug, but I don't know. The last problem is that it seems music will just stop playing in the middle of a song. I tried starting the music again but it just froze my entire xbox. It looks like ushare still needs some tweaks to be less flaky.

Oh yeah, btw. I got an Xbox 360. Sorry guys. Halo 3 is really awesome. I'm radeex in the Recreation zone. Friend me.