April 18 2008
Updated: Code now available
Yesterday I got an email from an engineer at the mothership asking for advice on tweaking a small utility I put together. The utility automates the creation of on-screen menus for TVNZ 6, which are created using Apple’s Final Cut Pro and indirectly use Apple’s Motion.
Today via Creative Workflow Hacks I see that Apple has now documented the Motion XML format, which should make it easier for assembling smooth automated workflows. The FCP XML format is already well documented.
Database + XML + Python + Python libraries + FCP/Motion = rocking solution
I did some weekend based research on FCP’s Apple Event (AE) support whilst investigating the best way to do those menus. With the help of HAS’s appscript AE bridge I put together a first cut of some Python code that could get and send XML to FCP via AE. I didn’t use this approach in the actual solution, instead opting just to have the operator manually import a XML file.
I’ve placed that code onto the Python code snippets site Useless Python, hoping that it err may be useful to some. Why is Useless Python developed in PHP?
It’s not available yet, will link directly to it after it’s been reviewed and approved.
Well, turns out Useless Python is useless, nothing happening there. So I've pasted the code onto Pastie for those that are interested
Filed under:
mac
media
python
April 16 2008
I’ve written at least three blog posts on that Act that passed the third reading last week, and I’ve binned them all. I’ve decided that’s too easy to be snarky…
I will however quickly note that in the UK the music biz is fighting a rear guard action on format shifting. They are seeking to impose a iPod tax as compensation.
Instead a quick post on something more positive.
I spent a couple of hours at the Small Business Expo today where my pick of the show would have to be Statistics NZ. There is a huge resource of free market research stats waiting for businesses to tap into. Some is free, some is charged for. The whole focus on business enablement and the savviness I encountered on their stand was impressive. The free stats are in large part due to additional funding they’re received. Good work govt. Let’s have more funding for this department to enable them to free up more of their stats.
IP telephony company Vadacom were also to be seen at the show. They use Python in their products and host the Auckland meetings of the NZ Python Users Group at their K Road base.
Filed under:
start_up
python
copyright/ip
December 10 2007
Web operations have been described as the secret sauce of 2.0. It’s not an area that I deal with at work but I keep up to date with architectural decisions that impact web ops - especially around caching. I found Artur Bergman’s talk on the LiveJournal approach to architecture at Kiwi Foo both entertaining and informative. The LJ approach is being leveraged by many in both the Rails and Django community, with memcached, perbal or nginx being used as building blocks for scaling 2.0 operations. For more background on web operations/architecture check out the O’Reilly Radar Operations blog for more of Artur’s and others wisdom. O’Reilly are running a conference on the subject next year. High Scalability is another source of information on scalable web architecture.
With this in mind, when I was asked this weekend for some advice from a friend looking to put together a web play together I stressed the need for them to get the combo of a decent architecture, an ops machine in place before going crazy with feature development. Once this is in place they can get a minimal release up, then push out new functionality quickly and reliably - well at least from the web ops side of the equation. The less effort they have to focus on deployment and admin the more they can spend on developing the functionality that matters for their users.
So after dispensing this advice I thought that I should walk the talk myself and implement some of my own advice for this blog’s system. This blog was the typical ‘my first django project’. It was rapidly constructed around Christmas last year, porting existing content from the Rails based Typo system I had previously used.
I don’t make many changes to the code, arguably I don’t make that many changes/additions to the content either. However I’ve now placed the code under Subversion control and have installed Capistrano to automate admin tasks, specifically the deployment of new code onto my production server. Version control is mandatory for projects with more than one person working on them and highly desirable even if there is just one. For more information/explanation - should it be required - check out this visual guide to version control.
Simply put, Capistrano is a tool for automating tasks on one or more remote servers. It executes commands in parallel on all targeted machines, and provides a mechanism for rolling back changes across multiple machines. It is ideal for anyone doing any kind of system administration, either professionally or incidentally.
Capistrano is a Rails related tool. It’s primarily used for deployment but can be used to automate any set of tasks. And whilst it has come out of the Rails community and is written in Ruby it can be used in association with any language/web framework. Tasks to be automated are described in its own domain specific language (DSL) so there’s no requirement to learn Ruby. Capistrano is now at 2.1 and whilst there is a chapter on version 1.0 in the online Rails book there is little on 2.0, though improved 2.0 documentation can be expected. So here’s the sources I used to grok it for for deploying a non-Rails web application.
Prerequisites:
- ssh and client certificates setup to provide password-less access to your production server from your workstation
- knowledge of how your production environment works
- a version control system, such as subversion setup and accessible from your production server
Timothee Peignier has written up the best description on how one can utilise Capistrano with Django. However I would qualify that by saying that you will get more, or get it quicker, if you first read up on Capistrano generally. Start with the minimal getting started doco, then read through the slides by Jamis Buck from the RailsConf. Test things out with some of the small examples. Understand how Capistrano is typically used with Rails, via the capify command that produces a Capfile and an associated config file. Find and read through the source (deploy.rb) for the Capistrano default tasks. Then read through Timothee’s post. You’ll almost certainly have to tweak the tasks to get things working for your own environment.
Unless you have a compelling reason to do otherwise I would go with the flow and use Capistrano’s method for organising releases. This approach lets you get the most from what Capistrano provides for free, with you only having to refine the tasks specific to your environment.
update:
Django added auto escaping of HTML in the version that I installed when putting Capistrano in place. I missed addressing that in the feed's templates.
Fixed now.
Filed under:
django
start_up
tech
python
August 27 2007
A quick Pythonic burst before I depart for IBC later this week.
Video
In my spare time I’ve been tinkering around with Final Cut Pro’s XML capabilities and FCP’s interesting Apple Event support with the goal of automating the production of some channel elements. Python’s great libraries and the community behind their production is one of its strengths.
For this work I have employed Appscript from HAS to allow me to send Apple Events to FCP. For the XML processing Fredrik Lundh’s elementtree was the natural choice. I used the Python Imaging Library (PIL) for a similar project several years ago for the automated production of id boards.
Once I’ve cleaned things up I’ll publish my FCP Apple Event class as an example of using Appscript.
Phones
Python for s60 mobile platform went gold last month. I need to dust off my PC to install some Windows only software that’s required to create a developer certificate. The dev cert allows you to get at the tastier capabilities of the phone.
Synthetic Programming
Corepy is a Python package for creating applications targeted at the IBM’s PowerPC and Cell architectures.
“Synthetic programming was developed to provide a new approach to high-performance and multi-core computing using scripting languages. The design of the synthetic programming environment encourages developers to experiment with different approaches for mapping algorithms to processing resources and generating optimized code sequences.
Synthetic programming itself is a methodology for building applications that combines high-level language code with user generated machine code. The synthetic programming environment exposes the underlying processor instructions as first-class functions in the host language and provides components for building and executing instruction sequences built using the instruction interfaces. The instruction sequences, called synthetic programs, can contain any instruction available for the processor, allowing developers to create highly optimized kernels for high-performance tasks. An application can contain many synthetic programs, all of which can be executed an arbitrary number of times synchronously or asynchronously, allowing the application to make full use of data and processing resources.” - Mueller C., Synthetic Programming: User-directed Run-time Code Synthesis for High Performance Computing
So the ease of use and elegance of Python is employed to create high performance machine code, making “assembly fun again”.
This is one of those times when having an older machine has its advantages as copepy will only run on PPC Macintoshes, so time available I’ll be able to load it up on the trusty PowerBook. Probably of more interest to those in scientific programming, such bioinformatics.
Filed under:
mac
tv
media
tech
s60
python
May 30 2007
Over the years I’ve worked in a number of environments where typography has been taken extremely seriously. This includes setting up the initial Letraset web presence in 1994 and working with them and International Typeface Corporation (ITC) for a number of years. These experiences have provided me with some appreciation of the craft of designing type and the use of it.
So I was intrigued to see two examples of Python powered typographical tools emerge this week.
Typogrify
The first is a set of template filters for the Django web development platform. Typogrify has been created by Christian Metts and includes a bunch of individual filters that can be used to make your text look the best it can. Jeff Croft explains more. Here is an example on what it does.
A Digital Remake
A little more esoteric is Andrea Novali’s research project into illuminated letters. Sadly I don’t understand Italian so can’t read the research paper itself. But there’s a overview available explaining the basis for the development of a script that creates illuminated letters. The script uses Nodebox, the "core engine in a research project on design automation and artificial creativity" created in a Belgium art college, which looks very interesting as the basis for all sorts of static and animated graphic production. Can’t understand how I haven’t come across this before…
Filed under:
python
typography
May 18 2007
Freeview
Freeview has been around for a month on my non-Freeview tuner. I don’t get to use the MHEG-5 based EPG but contrary to some press reports I still have an EPG. Given that’s how I select what to record on the Topfield PVR I would not be terribly happy if it disappeared.
I am happy to have TV3 and C4 available to record. The Daily Show now gets selected in my weekly time-shifting trawl through the EPG, where I select the programmes that week that will get recorded and which we will watch…whenever and without commercials. After a hard days work a bit of Jon Stewart with dinner is nice way to start the evening. The quote above is from last night’s show, or rather the episode that I watched last night, but was probably recorded the night before.
Final Cut Pro & MXF
Talking of work I never really concluded the discussion of my investigation into mixing FCP and MXF within a workflow. FCP 6.0 does not provide any MXF capabilities period. Compressor 3, bundled as part of FCP Studio, can use an optional Episode Pro plugin from Telestream that provides the ability to rewrap QuickTime <=> MXF. I believe that Omneon’s ProExchange also provides this functionality.
In the scenario that I was looking into we’ll probably stick with QuickTime from ingest through production and play-out but will rewrap into MXF for archiving.
Python and the Nokia E65
Don’t have much time for happy hacking the Nokia E65. I am a bit disappointed that the 3rd edition S60 security model is so restrictive that I couldn’t get some of the API to produce any results in my initial peeking. location.gsm_location() produces nada without ReadDeviceData, ReadUserData, and Location privileges. It seems that in order to get these privileges on the phone you own you need to acquire a developer certificate. Hmmmmmm.
I’m not a big user/fan of Twitter but I was planning to do a proof of concept script that would update Twitter as one moved between cell locations.
Lastly
Jim Barksdale argues for the need to more effectively archive our bits.
And given Microsoft’s recent patent threats this video of Columbia Law Professor, Eben Moglen, is worth five minutes of your time.
Filed under:
tv
media
pvr
tech
s60
python
Read 1 Comment
May 9 2007
E65 & Python
Ever since Nokia introduced Python for their Series 60 phones I have been planning on acquiring one. The phones have slowly become smaller, less expensive and with more features. Whilst the N95 represents the future of features, with a decent camera, WiFi and integrated GPS, it’s not there in terms of cost, size and battery life. So I have selected the E65, only slightly heavier than my current phone but with lots of S60 goodness, WiFi and VoIP capabilities.
Naturally the first thing I’ve attempted is to install Python. There are a couple of gotchas, one a bug and the other related to increased security measures within the 3rd edition of Series 60.
1. You need to configure the phone to allow self-signed applications to be installed before installing Python.
2. When installing Python you must install the current version to the phone memory rather than the memory card (BTW: the micro-SD cards are tiny), this is a known bug and will be fixed in future releases.
Nokia provide great access to the phone’s features via Python so I’m looking forward to seeing what I can do with it. Here are some initial ideas: send the phone a SMS to take a photo, time lapse photo sequence with auto-upload to flickr and have the phone record locations of open WiFi spots detected (requires the external GPS).
JB HiFi
After buying the E65 I chanced upon JB Hi-Fi on Queen St. opposite Smith & Caughey. The Ockker retailer looks set to stir things up - they have a massive selection of games, music and DVDs with a smattering of consumer electronics. Nice to see some more competition in Auckland. Its not a pretty retail environment with its fluoro sale now look and if you’re looking for decent staff recommendations I would still head down to Marbecks.
Filed under:
nz
music
s60
python
consuming_interests