GStreamer and Python experimentation
I recently played with GStreamer for the first time. I'd heard plenty of good stuff about the framework but had never spent any time developing with it.
In a nutshell, it's very powerful and very cool. Complex multimedia apps can be created with very little code. You link together small blocks to form a useful chain of functionality. The Python API is quite nice because the Python bindings are well supported by the developers.
The big problem is lack of documentation. The best starting point I found was Jono Bacon's excellent Getting Started with GStreamer with Python. After that, the C based docs and the
gst-inspect tool are probably your best friends. They make sense once you get your head around the general architecture.
In the interest of expanding the amount of reference information available for GStreamer I've put the results of a few hours of messing around online. It's a simple program that illustrates some interesting stuff using GStreamer. Despite the low line-count, what it does is somewhat impressive; it takes 2 arbitrary audio files and plays them over the top of each mixing in real-time. More details and the download link can be found on my code page.
posted: Fri, 27 Oct 2006 20:49 | permalink | comments
Martini Design Patterns?
Sometimes the random text to put off filters in spam emails is hilarious. This is an excerpt of one I received today (odd line breaks as per source):
In a way that lets you put principles will help the "Trading Spaces" show. support in your own code. so that you can spend You want to learn about the patterns that to know how they you get to take same problems. the patterns that in between sips of a martini. the patterns that or on the real relationship "secret language" Head First book, you know challenging. Something But you don't just in between sips of a martini. the next time you're Design Patterns, you'll avoid alone. At any given moment, used in the Java API deep understanding of whyLooks like they randomised the words of some design patterns book, although I don't know where the martini references come from.
Scheming on the way to Oz
I arrived in Australia 2 days ago to sort out various passport related issues and to get some time in the office (it's been 6 months). Since the flight gave me a spare 24 hours to fill I decided it would be an excellent time to start learning Scheme. This is something I've been meaning to do for ages, just to stretch my programming mind in new ways, but also because I'm just curious about Scheme/Lisp.
Before I left I installed the Fred Bayer's excellent LispMe Scheme interpreter on my Palm. This is a relatively complete, almost standard, Scheme implementation which includes APIs for Palm graphics, databases and UI elements. Not that I got that far ... I'm definitely closer to the "Hello world" end of the spectrum when it comes to Scheme.
For documentation I downloaded Dorai Sitaram's excellent free tutorial Teach Yourself Scheme in Fixnum Days on to my Palm. It's freely available in HTML, a page per chapter. A bit of fiddling with Pyrite Publisher gave me a suprisingly readable Palm version, one document per chapter. The output wasn't perfect but completely useable. Given a little more preprocessing I reckon I could get the whole tutorial into one document.
Although I would have loved to, I didn't get the classic Scheme/Lisp text Structure and Interpretation of Computer Programs onto my Palm. It's damn big and I couldn't figure out a way to convert it nicely in the time I had to do it. I think it is doable though.
By setting up shortcuts in the Palm launcher I was able to quickly switch between the book and LispMe and happily spend the much of the flight(s) teaching myself the basics of Scheme. Some thoughts:
- LispMe is cool! There wasn't anything that I covered in the tutorial that it couldn't do. Some of the demos programs are really impressive too, for example a 3D rotating cube!
- Teach Yourself Scheme in Fixnum Days is a nice tutorial. It doesn't mess around much and gets into more difficult ground fairly quickly. It's probably a good introduction for programmers experienced in other languages.
- I'd still like to go through SICP at some stage to get a more complete grounding in Scheme.
- Entering Lisp-like code via the Palm graffiti input system requires a certain amount of dedication. There is a Palm hack that comes with LispMe to help with parentheses matching but unfortunately it doesn't work on more recent Palm's like my Tungsten.
- I don't think I could see myself using Scheme for any major projects, not when I already find Python to be such a good fit for most things. That isn't really the point of this exercise though (and I should never say never).
I have a lot more to learn. I certainly didn't get through the whole tutorial but skipped ahead a bit to see what other stuff is covered. Continuations, the non-deterministic operator (amb) and macros look really interesting. The brain stretching really begins when you start getting on to these more advanced topics. Maybe for the flight back to the UK...
posted: Thu, 19 Oct 2006 23:06 | permalink | comments
Planet London Python is online
I've just installed the Planet London Python site. Planet took a small amount of fiddling but it's all quite logical. A little more customisation is probably required. Some more feeds wouldn't go astray either!
Thanks to Remi from WebFaction for the hosting space.
posted: Mon, 09 Oct 2006 13:32 | permalink | comments
Why PHP is bad
Now look at the standard library that comes with PHP. There is no consistency whatsoever, and any units of functionality larger than a single function are a mess on the semantic level. The distribution of responsibilities is often peculiar. So just like I could never get my Tk-centric code into a reasonable shape, I never manage to get my PHP-standard-library-centric code into any reasonable shape either. The whole thing is a gigantic mass of hodge-podge quick&dirty hacks. As Larry Wall said, the PHP philosophy is I thought of a way to do it so it must be right.
posted: Wed, 04 Oct 2006 14:27 | permalink | comments