Posterous theme by Cory Watilo

geekofhearts

geekofhearts

Scientist, Developer, Designer, Freelancer. Apple fanboy. London.

Skyrim Review

Note for serious computer geeks- I've been playing skyrim so far on my laptop while at relatives' for Christmas, so I'm not going to be drooling over graphics or speed. In fact, there's an annoying bug that causes the framerate to bomb randomly every now and again; I blame Windows XP and Direct X 9, though, as it has also been observed on other games on the same system.

I totally ignored that I'd seen the Bethusela name before, and dived straight into the game without noticing the striking similarities to Fallout 3 (it was the lockpicking minigame that finally cemented the connection.)

Without this prejudice in my mind, I thoroughly enjoyed the game's opening sequence and character creation method, compared to their other offering which I've had for a while, and not played much. The principal distinction between this and its scifi counterpart was the pace. Fallout made you play through a bunch of slow, boring scenarios inside a nuclear fallout shelter - Skyrim opens with a multiple execution, followed by a dragon attack. Instead of picking your stats out of a children's story book, you're asked your name and race by a guard who has you at axe-point. The marked dramatic tension difference between the two is the making of Skyrim as an awesome game; from the start you're pumped about what's going to happen next and where you're going to.

Leaving aside the Fallout comparison, I've found Skyrim's combat, story/quests and landscape all perfect for a "Dungeons and Dragons with graphics" style game, complete with level-ups, magic, potions and monsters. Without a dungeon master steering you, you can happily bumble into a level 10 quest, when you're only at level 5, and die thirteen times before working out that you need to go and fight something other than a poisonous millipede before you can clear this cave. Complete with searching corpses for weapons and gold, this is a truly excellent substitute for a darkened room and a few D20s.

Especially worth a mention is the killing blow animation. When you're about to deliver a killing strike to a lone enemy, the game will sometimes slip into slow motion and give you exciting camera angles, sweeping around you as you fell the final opponent.

I've also enjoyed the non-combat tasks, from running errands to getting paid for your persuasive nature - and I believe it is even possible to get married in Skyrim.

This fantasy Nordland has something for every axe/arrow/arcania fan with a GPU.

My first android app - Notes by crunchyserver

OK, so about a week after the droid arriving I've gone and released an app.

I tried writing this in Titanium*, and I'm not sure how I'd even begin with even this simple a UI in SL4A**, but ultimately my most hated Java seems to have been the most performant and useful on a real device. I guess there's no substitute for coding the way it was meant to be done.

You can see the source, which was forked from the simple example app by google, on github, where I'm managing bugs and releases and stuff too.

Now, the app itself:

Maybe it's because I got a Galaxy Note, but I felt that the phone was lacking a decent default "notes" app, for storing musings.

The bundled app - S notes - is designed for playing around with colours, the pen, etc, but I couldn't be doing with it for everyday use. I missed my old iOS Notes app, the simple list of items and a blank textfield.

So, that's what I set out to code. And when I discovered google's example project - Notepad - which did a similar thing (but with a hideously clunky UI) I decided that here was some apache licensed code ripe for forking.

I think the choice of making an app I'll actually use as practise was good one - I'm now hooked not only on what people think but also on improving it to make it more usable for myself (which can only be good for end users too.) Another good choice seems to have been starting with someone else's good code and extending it - I've been able to dip into bits to learn as they interest me (UI here, SQLite there) rather than having a massive this is the structure of an app here are the complicated things you need to worry about lecture at the start.

Updates: woops!

I did release an update about 24hours after the initial release - crazy fail I know. I've resolved to stick to minimum two week update cycles from now on, as android developing is seriously addictive and I won't do anything else otherwise! It also means my users (all 5-10 of them) aren't bombarded with notifications from me. More than one bugfix or new feature per release FTW!

The future, this is it.

I am going to be fiddling about with this app a little more, while I learn about useful patterns for the platform and so on (in particular at the moment - settings and open data export) but I intend to go on to make better and more exciting apps as time goes by.

---

* Titanium was just darn slow. Sooo long sat on the splash screen, doing a bunch of stuff another programmer thinks is important. No thanks.

** The big problem I found with SL4A UIs is that they have no state - they're just a webview after all. In a mobile environment, where context switching is rapid and sometimes unexpected (the phone call scenario) I don't think that relaunching the web view from scratch each time the script gains focus is feasable or necessary.

ZOMG Android!

My first impressions of the Samsung Galaxy Note are pretty good:

S Pen? Working great!

Too big? Just right! :)

However, I do already have some gripes (surely not?!) That I'm yet to work around.

Firstly, the massive display seems to mean the phone is a bit slow. Its running about 3x the pixels of the S2 on the same dual core processor, is this the problem?

Secondly, being used to an iPhone, I seem to feel the screen is a little unresponsive. I can't tell if thats problem 1 again, or just the quality of the capacitive detectors.

Finally, OMG KEYBOARD! It's very annoying of you, Samsung, to have removed the default android keyboard and replaced it with one that has a global autocorrect on/off - apps like SL4A should be able to hook into the api and tell the keyboard to stop autocorrecting code!

Luckily, the default keyboard is available from the market, although using any keyboard with the charger cable plugged in (e.g. during one's seemingly endless initial charge) is painful to say the least, and landscape typing on such a large device nigh impossible.

Here endeth the rant, although there'll no doubt be more about this phone/APK development up here soon!

Why I'm jumping ship to Android

I've had an iPhone since the second model (the 3G). I was enraptured with the speed, the convenience, and the shiny. In particular, I found that GPS maps and live train departure boards, alongside 24/7 email, were irreplaceable and quickly felt their absence when in low signal/no data areas, like the countryside and abroad.

The iPhone is also responsible for my twitter addition (I'm currently at 20,707 tweets and counting..) and I also use the native Wordpress and posterous apps occasionally.

I happily upgraded to an iPhone 4 - continuing to enjoy the automagic syncing of my music, and rejoiced at wifi tethering (which is free within my existing data allowance with my network - 3UK really do rock on that score...)

However, I basically don't use the 50 other apps on my phone - most of them free, some of them were 59p or a little more - they were all ideas: todo lists, guitar tuners, GPS training apps, Bibles and Shakespeare, functionless online-only apps like dropbox or Nebulous (London Underground has no data signal or wifi - if it doesn't work completely offline it's pretty much useless to me as an "ideas" app...) and so on.

The main reason for this is that they are subject to one or other restriction imposed by Apple - most recently this random deleting of the user's cached data - but having spend a week messing around with a very cheap and rubbish android phone (resistive, low-res touchscreen, tiny SD card, etc) I am starting to see the possibilities of an open and hackable platform that hadn't even occurred to me in the "apps as a service" environment of the iPhone.

Indeed, so much of the Apple App Store is apps you install, play with once, and then discard as they are completely non-useful. No doubt there is a similar glut in the Android Market, but at least there are a subset (some requiring a rooted device, but many not) which have the potential to be truly productivity enhancing, and remain fully customisable, if not completely open source. And by open source, I mean in the true meaning of the phrase where one can download, build and run the code on the intended end-point device without paying to sign your life over to the hardware manufacturer.

For example, (without rooting your phone) you can have access to most of the APIs and features in a scripting environment with SL4A (Scripting Layer for Android.) I've played with Titanium before, but this environment allows me to quickly prototype and develop on the device itself - adding hooks to trigger scripts on systems events like SMS and email arrival. There is of course also a means to export your hacks and distribute them as an APK (with a dependency on the SL4A app, unfortunately, for now) although you need a proper machine with eclipse to get this far.

The possibilities that have started occurring to me have made me realised the real power of an open and unrestricted platform - I'm currently writing a custom app to track my progress around a half marathon course and "speak" my current progress and projected finish time at important points, and I've got plans for an SMS/email bridge that would allow me to receive, reply to and compose texts from any computer, and with a proper screen who knows what I'd think of next.

I'd not be able to do this with my own iPhone or iPod touch without buying the developer license and certificate signing permission from apple that would allow me to install beta apps on my device. These are not things that I'd release into the outside world (except perhaps as an afterthought,) and thus there's no business case for me making them for iOS; with a significant barrier to entry and speculative/hobby development.

Thus, with reluctance (I will miss the seamless prettiness of the iOS experience..) I will be placing an order for a Samsung Galaxy S2 (the top rated 'droid for the last year straight, and widely acknowledged as iPhone 4-quality hardware (indeed, more 4S given that it's dual core..)) and getting on with my scripted, customised mobile device experience.

 

 

Who ate all the RAM?

Python! Python ate all the RAM!

I store my data as JSON, because I use python to work with it and javascript/HTML5 canvas to render it, and I can just eval() to deserialise in both environments.

However, having saved a moderate dataset (about 3MB after gzip compression) this trick entirely crashed OS X!

Running a python interactive session, just to grab a few stats from the data (how many of X object, total areas of the Ys) I imported gzip, read in the file (no probs so far) ran eval() on the string and BOOM, major slowdown, spaces animation crashing, other applications sluggish as crazy. Stayed like this for a good 5 minutes, until I took the time to kill the process.

Now I checked my RAM usage, just JUST in case I was being silly, and noticed that VirtualBox was idling an XP VM with a healthy 2GB RAM, meaning I only had about 1.5 / 8GB free for Python. Surely that was enough? I killed VB just to be sure, and low and behold when I re-ran the same eval(), and watched Activity Monitor with my steely eyes.

Python jumped from 30MB to 1GB, to 2GB, to 4GB, peaking at 5.8GB, to eval a JSON string a few MB long. This time, with so much RAM spare, Python only ground OS X into the dirt for a few seconds, and the pain quickly subsided. A bit of app switching and everything was back out of paged space, and nice and zippy again.

But seriously, Python, 5.8GB? to crunch through some struct initialisation instructions?

You fat process, you fat process, *points* YOU ATE ALL THE RAM.

In praise of Eclipse

I have written some pretty complicated software in TextMate; several websites, a big scary C extension for a python module, not to mention the python module itself. I've even written a daemon in gedit, and countless shell scripts in nano.

However, I also make GUI apps using Appcelerator Titanium occationally, and their new development environment Titanium Studio (TS) reminded me what I missed about Visual Studio from back when I had a job.

Now TS is basically an eclipse clone, modified to have nice point-and-click buttons to common Appecelerator tasks, as well as using the Android extensions for mobile development (which I don't use, but hey, nice to have everything in one place, I guess). One cool thing about writing HTML5 GUI apps in Titanium Desktop is that you can use python scripts that interop with your javascript. Now their communication layer (Kroll) is painful, grinding-and-gnashing-of-teeth slow if you're passing massive arrays of data objects, although I worked around this by just using python's built in gzip support and letting javascript do the eval()ing on the JSON.

Anyway, I was playing with python in this Eclipse clone and remembered how damn convinient it is to have variable autocompletion, and automatic argument insertion / documentation popups. I swore I'd never miss them, and their intrusiveness, but in fact I was coding python far faster than I had been for a while.

So, I took the plunge and installed Eclipse proper, added the PyDev library for intelligent python support (which I now notice seems to be a community project from Appcelerator...), and imported my current python project.

Issues:

  • python path: I had been doing all my imports wrong, apparently, and all my relative ones were failing. I was worried that eclipse insisting on modifying the python path would mean my code would only run from within the IDE, but in fact everything still works fine from the command line and from within shell scripts.
  • colour scheme: I spend a very very very long time finding all the settings to get a dark background and light foreground colours. I then exported my preferences, and tried to reimport them on another machine, only to get errors when restarting the IDE and crashes when I tried to open files. At least one source of the problem seemed to be the different usernames I use on my iMac at the office and my Macbook Pro at home, although the python parser seemed to be trying to use a string as an int....I think. I ended up just rediscovering how annoying it was to change all the colours manually again. I think Eclipse needs themes ASAP... UPDATE - head over to Eclipse Colour Themes to use themes in eclipse. I am a fool for not finding this faster - much easier! My faith in stackoverflow is clearly not strong enough...
  • indentation: I use 2 spaces to indent my python code, so that I don't need an ultra-widescreen monitor to view my rather overcomplicated procedural physics code. When importing existing sources, Eclipse/PyDev seemed incapable of understanding this, marking my entire project as one massive syntax error, until I found the relevant setting and changed it from 4 to 2 - the python interpreter can handle this, why can't my IDE?!

But, enough with the setup and configuration gripes!

I try to write clean code. Now, as you may guess from my 2-space indentation habit, I may not be able to stick to 3 line methods. But I do like my verbose, clear variable names. for example:

Var-names

Eclipse beautifully suggests the extra long variable names, filtered for the local context, and also offers class names that haven't been imported yet (and automatically adds the import). This is bliss, I tell thee!

I am able to see instantly what code in unnecessary (unused variable names are highlighted as errors) and what code is a parse exception waiting to happen (so are actual syntax errors or unknown names). And it even spellchecks my comments.

Now, I will still use nano to edit shell scripts an conf files quickly. I will still use TextMate to edit LaTeX, and compile it for me. But python (and, probably, C later if I can work out how) will from now on be loaded into a proper IDE and auto-ized, and my weapon of choice for this will, for now, be the mighty Eclipse.

Upgrading to OS X Lion- a developer's tale

protip: Read to the end before you start; there are a few gotchas that might make you postpone the upgrade!

Step 1: Download and run the Mac OS 10.7 Lion installer

Head to the Mac App Store and download the installer. Remember that the installation is good for 5 Macs once you've paid.

The installer will leave you in stasis for half an hour or so while it runs the system updates.

Step 2: Download the new XCode, too

The OS upgrade will completely replace /usr/bin (don't worry, /usr/local/bin seems unscathed) so you now have no gcc or anything else useful. So... Head to the developer site? Nay! That is the old way of doing things.

Now, just like the OS, we use the Mac App Store to download our developer tools goodness. Luckily, this one's free still.

Step 3: Rebuild those python packages

Lion upgrades our default python install to 2.7, which means the "site packages" (locally installed python libs) are all gone. In fact, in completely overwrites 2.6 as well, so if you want to stick with 2.6 you could just dig around in your time machine image for the site packages folder under /System/Frameworks/Python.framework etc and rescue the precious dynamically linkable binaries, and then configure the /usr/bin/python link to point to python2.6 at the same location. Hopefully the libraries will have been sensible and put their executables in /usr/local/bin safely out of harms way.

Alternatively, if it's about time you had a spring clean and upgraded your libraries and platform, just download and recompile all your dependancies. Obviously this only works after step 2, if your libraries include C extensions.

Of course, if you use macports or some other custom python, you may need to double check other locations to see if your libraries survived.

Step 4: Check for PPC binaries

There is no support for PPC applications in Lion, so you'll need to source alternatives, or rebuild people's apps from source.

I found that a bibtex app I use (implemented in Java) was flagged as PPC because of a rogue launcher/wrapper. I just rewrapped the jar directly using Jar Bundler (which was buried somewhere on my system, located with the help of spotlight) and presto it woke up good as new, even picking up the old preferences.

protip: Getting the icon right with Jar Builder is easy; build with the standard one then "get info" the new app and the old one side by side. Highlight the old one's icon (top left, it should gain a blue halo) and cmd+C, then highlight the new and cmd+V. Simples!

Step 5: Get used to the freakery

Mission Control replaces spaces and expose - which I've just got down to a fine art! - and I'm yet to decide whether this is an improvement. They've enforced linear desktops, i.e. there's no "space above/below" anymore, although the reason for this is great- full screen apps that create their own space. You have to use the cocoa API for this though; chrome's full screen mode just covers the existing space, while terminal (and I believe mail and iphoto) swoosh right and make a spacehole.

The thing I liked about spaces was that it was fully keyboard happy - I could see where I was going without changing hand position, and with 2 sqrt(N) arrow key hits too - It looks like that's gone, and we now require either multitouch gestures, mouse clicks or both to get a good look at where we're going, or get there quickly. Of course you can still jump blindly left and right using the keyboard, and that may be good enough. Also, the four finger expose swipe on the current space is gone, although it does still exist (default activation seems to be a keyboard shortcut,) so I'll have to see if I can get that working too. You activate Mission Control with a 3 finger swipe.

Additionally, Multitouch Scrolling is the wrong way round! They've brought OS X in line with the iOS convention where your fingers directly manipulate the page, rather than the mouse convention where you're manipulate a pointer or use a scroll wheel. This is as good a convention as any, but it reverses what my brain currently knows! Freakery.

Worth it? I've not decided yet.

While it is indisputable that Apple systems kept up to date run faster, I'm not certain if I like the new face of OS X. Mission Control is a whole new window management system (just after I've got used to 2 1/2 years of the old window management system, coming from Windows) and I'm not sure how I'm going to adjust.

In any case the few gotchas I found (gcc gone and my python libraries with it!) were by no means insurmountable. Enjoy the other 247 new features! :)

EDIT/UPDATE: I have discovered that:

  • There is a preference pane for pretty much all the gestures, including the backwards scrolling: 
    Trackpad-settings
  • There is another new convention (long overdue, although a bug I used as a feature occationally) which is that apps close when you close their last window! I noticed this when taking the above screenshot, as I usually use the fact that preview lingers to be able to take multiple shots, saving and closing the windows as I go.
  • Finally, that there is an (as usual excellent) Ars Technica review of the OS, which you should be reading instead of my half-baked nonsense about the new usability features!

openSUSE build service comes to life - Build Studio

I've just found SUSE studio - a website that lets you generate and share custom openSUSE linux builds as CD ISOs, images to drop onto USB sticks, or VirtualBox or XEN appliances.

This is awesome - being able to have templated server or thumbdrive linux images, stripped down to only include what you need most, is clearly what I've been hunting for in all my years of installing Linux again and again in search of The One.

In fairness, I decided that an obscure BSD distro was my One some time ago, but that's not stopped me from running everything from ubuntu to gentoo on my old, redundant hardware for fun (or, more recently, as VMs for specific tasks).

But way to get me back into Linux proper, guys! A web interface for dropping on the odd TGZ for software you can't just select yourself, specify the packages down to the smallest details, and then watch (or make tea) as the server spends ten minutes building and compressing the thing for you.

My first build was a shell only install with GCC, python, ruby and the node.js source code as a scripting playground with minimal visual overhead - I even remembered to install the only CLI text editor you will ever need*.

You can of course save the configuration for ever, although the individual builds are only cached for 7 days. The GZIP compression seems to be mightily effective (a 1.2GB image down to just 250MB, for my first example,) and you can share your builds with the world for later.

Overall, I'm reasonably excited having only just discovered this awesome tool - if you're also an "oh I'll just reformat and start again" sort of Linuxer, you might enjoy it too.

* you know, the one that says to the vi vs. emacs debate "screw you both, I want to be able to type stuff and be left alone without a five day learning curve!" otherwise known as nano.

I love 'scripting - an ActionScript 3 XML library

There is something very satisfying about writing ultra generalised code. I spent a significant amount of time working in ActionScript 2 at my last real job, and it taught me a fair bit about ultra minimalist javascript-style languages - how to use functions as data, how single-threaded yet event-driven code works in practise, and how not to meld the syntax of javascript with an object model.

In my joy at briefly being able to work in AS3 for once, I wrote this little XML library, re-released here under the MIT license. It takes both dynamic objects and actionscript visible classes and serialises them to XML in such a way as they can be restored to memory later without loosing any dynamic properties. Of course, it can only access public properties, it's not actually magic. I believe the functionality is similar to Python's "pickle", except that this is for Flash/Flex.

(In the biggest hard-way SEO lesson yet, I released it at a page with a generic URL, and titled "XML Serialiser". Never use British spelling on the internet!)

In any case, I repost it here as an example of how libraries should work - short, sweet, just 2 functions.

Given that flash devs use XML extensively, this library might actually save people some unsupportable getter-and-setter messes. Copied below is my original post, edited a bit for nonsense.

AS3 XMLSerialiser (2009)

Implementation

The implementation uses some plain old AS3 tricks like class "reflection" (aka flash.utils.describeType), running a for..in on dynamic objects, and the easy as pie XML.@attributename syntax for storing and retrieving metadata on nodes. Skip to the end for a download link, if you want to know more.

Demonstration

Have a look at the following test method and the code output. It is set up in the bundle as a document class which runs this code as part of the constructor. The methods to watch out for are:

h2j9k.XMLSerialiser.serialiseThat(objectToSerialise:Object, rootName:String):XML
h2j9k.XMLSerialiser.deserialiseThat(xmlToDeserialise:XML):Object

You will need a cast on the way out, and you need to specify the name of the root node (since it is impossible to detect the instance name of the variable you are passing in.) Here they are in action:

// Initialise a dummy object:
var ddh:DummyDataHolder = new DummyDataHolder();
ddh.ONE = 1;
ddh.TWO = 2;
ddh.three = 3;
ddh.FIVE = 5;
ddh.HELLO_WORLD = "Hello, world!";
ddh.setFour();
ddh.FOO = new Object();
ddh.FOO.understand = "cake";
ddh.artichoke = "cauliflower cheese is awesome";

// Call the actual methods:
var ddhAsXML:XML = serialiseThat(ddh, "Arbitrary");
var ddh2:DummyDataHolder = deserialiseThat(ddhAsXML) as DummyDataHolder;

// Trace the results:
trace("ddh before serialisation:");
ddh.traceMe();
trace("ddh as XML:");
trace(ddhAsXML.toXMLString());
trace("ddh after serialisation:");
ddh2.traceMe();
trace("test of dynamic vars, FOO.understand:");
trace(ddh2.FOO.understand);
trace("and ddh2.artichoke");
trace(ddh2.artichoke);

and the result:

ddh before serialisation:
ONE: 1
TWO: 2
three: 3
four: 4
FIVE: 5
HELLO_WORLD: Hello, world!
FOO: [object Object]
ddh as XML:
<Arbitrary type="h2j9k::DummyDataHolder">
  <FIVE type="int">5</FIVE>
  <FOO type="Object">
    <understand type="String">cake</understand>
  </FOO>
  <HELLO_WORLD type="String">Hello, world!</HELLO_WORLD>
  <TWO type="int">2</TWO>
  <ONE type="int">1</ONE>
  <three type="int">3</three>
  <artichoke type="String">cauliflower cheese is awesome</artichoke>
</Arbitrary>
ddh after serialisation:
ONE: 1
TWO: 2
three: 3
four: 0
FIVE: 5
HELLO_WORLD: Hello, world!
FOO: [object Object]
test of dynamic vars, FOO.understand:
cake
and ddh2.artichoke
cauliflower cheese is awesome

Notice that the only data not transferred in the .four property, which only has a get defined (see the ddh class in the bundle for the details). It is initialised on the first object by calling setFour().

Apologies for the silly test data. Enjoy the free code! I am releasing this under the MIT license since it's not much more than a snippet, so yes you can use it at work.

Installation

All you need to do to get this working in your application is create an h2j9k folder in your FLA's directory and copy in the XMLSerialiser. You can delete the constructor and the import flash.display.* (and the "extends MovieClip" nonsense which is just to get it working as a document class in the test setup) and just import h2j9k.XMLSerialiser.

UPDATE: or, use version 1.0, which comes de-exampled and ready to use (no new code, though.)

Download

Download Version 1.0, which doesn't have any example code left in.

Download Version 0.1 (alas, linked back to my old site since this posterous can't handle ZIP attachments?!)

 

Analysing Shakespeare on UNIX

I saw this post[PDF] on Hacker News ("Unix for Poets" by Kenneth Ward Church), and had a quick look at the first example; using UNIX commands to slice and dice a document and give you a sorted list of word occurrence frequencies.

Needing test data (and inspired by the literary title) I went and grabbed a text version of the Complete Works of Shakespeare off Project Gutenberg, and duly copied and pasted the following command into my shell:

tr -sc '[A-Z][a-z]' '[\012*]' < Downloads/shakespeare.txt | sort | uniq -c > Downloads/shakespeare.out

On my now 2 year old MacBook Pro (Intel Core 2 Duo, 4GB RAM) I was pleasantly surprised by the runtime (a few seconds, maybe 10) before receiving Shakespeare's full wordcount, including some highlights:

   2 Howsoe
   3 chopt
1650 hath
   1 tattlings

Ian Hislop's minions perhaps? The very tragic:

 117 woe
  27 woeful

and, of course, because I forgot to remove the copyleft notice at the top:

  14 Gutenberg

While reading a second hand copy of "The UNIX Philosophy" recently, with suitably retro 90s cover design:

Photo
I was gently reminded that the original idea was to have simple, highly optimised C programs controlled by Shell Scripts which were portable across systems. The bash snippets in the above PDF probably exemplify this, and in theory allow anyone (even windows users, via cygwin) to put the old P3 under their desk to work performing linguistic analysis (or for that matter, any form of data processing they choose).

Anecdote (sort of) related

I am currently working on a library as part of my PhD to perform data analysis, and have chosen to work, rather than in shell scripts, in Python. By dropping down into Cython or just plain C when necessary, I have already chopped down one naïve O(N2) problem to linear RAM and CPU (algorithm from a book, not of my own), and by using Python modular wrappers made my code scriptable.

This will not be a revelation to most of the hackers on the internet - of course you want code to be small portable units, otherwise how will people ever fork it on github? - but it sounds like physicists need the UNIX lesson again; they still seem to code monolithic single file programs in FORTRAN or C, often with code copied and pasted from other programs, or worse just sit for hours waiting for matlab just so they can plot it all at the end.

These kind of programming heroics are not conducive to a collaborative academic atmosphere, and scientists sometimes attach crazy and restrictive custom licensing to their public domain code - as well as making the user interfaces unusable (I have had programs I was supposed to be reusing segfault on me because of a data file format.)

Lessons for physicists aside

Whether it's Python or bash scripts, academic data processing code can and should be architected and open sourced in order for other investigators to be able to pick up where you left off like  - especially if you're funded by The People®, like me. Church's snippets are there for researchers to reuse in a few minutes like I did, and hopefully one day my PhD will be too.