Archive

Archive for the ‘Open Source’ Category

Python @SBP

December 17th, 2010 No comments

My first encounter with python was the embedded scripting engine inside XBMC. The code that came with some of the XMBC add-ons sparked my Python interest to the extent that I picked up a couple of O’Reilly books on the topic and started learning the language.

When I joined Schuberg Philis, a few colleagues had Python skills, but Schuberg’s Python community was too small to ensure maintainability. This didn’t stop me from writing a couple of scripts in places where it made sense to use Python, like automating tasks in a Websphere environment using Jython (no, there is no Jerl ;-) ) and in writing one-off scripts where maintainability was not an issue. As a friendly language advocacy, some of the other engineers jokingly referred to Python as being “Perl for Germans”.

In the meantime more Python enthusiasts joined the company, resulting in more and more useful Python stuff being developed, checked into the repositories and actually being used on a daily basis. This including tooling for:
- Weblogic deployment
- Patch management on RedHat systems
- Reporting on incidents
- etc, etc.

So, all things considered, an in-house Python training looked like a good idea. Based on a one day Python training by Steve Holden I took at LISA2008, we approached Steve for a 2 day on-site training at Schuberg Philis HQ. So last week, this actually happened and about 10 of us joined the training.

After going through the python language features (datatypes, mutable vs immutable, namespaces, assignments, staments, functions, exception, modules, OOP, re module), we spend the last afternoon of the training in a free format discussion, touching an a lot of interesting topics like:
- iteration protocol an generator functions
- Pickling, marshalling and shelving objects
- Kodos, regular expression build and test tool
- Multithreading vs multiprocessing
- Network programming
- Unit testing

Everyone took something different away from the training. Some of my gems are:
- “Pyton Module of the week”, which has picked up a new subscriber
- the fact that there is an XML element tree in the standard library (which saves me from installing LXML all over the place), which was not covered in the 2.2 based “Learning Python book”.

The training was great and has certainly broadened as well as deepened our Python skills. So, if Python is Perl for Germans, I’m, proud to quote JFK in saying “Ich bin ein Berliner” ;-) . Let’s see more Python at @Schuberg Philis in 2011 and beyond!

Categories: Open Source, Python, Scripting, Training Tags:

Damian Conway’s Quantum::Superpositions talk

October 23rd, 2010 No comments

All things considered, Damians Conway’s talk is Yet Another Perl6 Promotion (YAPP), but a damn fun one.  Highlighting some very funky new features that Perl 6 makes happen, in constant time. Theoretically.

Conway is one of the best speakers I’ve seen so far. His talks have speed, passion, a big dose of absurd humor and loads of geek references. If you have the chance to attend one of his talks: go see him, you won’t be disappointed, promise.

The talks starts with a lighthearted refresh of the history of quantum mechanics, unexpected revelations about Bohrs activities in modeling and winter sports and so on.
When the audience is under his spell Conway dives a bit deeper and shows many examples of Perl 6′s more natural syntax, and possible uses of superpositions. Showing how superpositions -called Junctions in Perl 6, are not just reserved for mad scientists. Junctions might be damn useful for programmers; replacing contrived nested for loops with elegant code generating prime’s, testing list membership, doing string comparison, all the while letting Perl take care of parallelization automagically, in constant time. Theoretically.

A very simple example showing the power of superpositions, in Perl 5, taken from the description page of Quantum::Superpositions.pm:

$ideal = any( all("tall", "rich", "handsome"),
all("rich", "old"),
all("smart","Australian","rich")
);

Operations involving such a composite superposition operate recursively and in parallel on each its states individually and then recompose the result. For example:

while (@features = get_description) {
if (any(@features) eq $ideal) {
print "True love";
}
}

The any(@features) eq $ideal equality is true if the input characteristics collectively match any of the three superimposed conjunctive superpositions. That is, if the characteristics collectively equate to each of “tall” and “rich” and “handsome”, or to both “rich” and “old”, or to all three of “smart” and “Australian” and “rich”.

Find a good description of the concepts here, and most of the examples used in his talk on here but you’ll miss the funky Perl 6 rewrites of them. Junctions are documented in the Perl 6 documentation here.

Start using Superpositions/Junctions in Perl 5 by installing the Quantum::Superpositions module from CPAN. The module is currently maintained by Steven Lembark, and will only add the “any”, “all” and “eigenstate” operators. For a more up to date implementation with more junction operators and autothreading fetch Perl 6 by installing Raduko.

Can’t wait until Conway returns for part II: Time::Space::Continuum!

SigInt10: Opensource policies for governments

May 24th, 2010 No comments

By Arjen Kamphuis (@ArjenKamphuis)GPL Logo

Arjen started off by explaining why he thinks that software is important. About as important as the first book press. The creation of synthetic life earlier this has reduced the problem of life to a software problem, a very complex software problem, but a software problem non-the-less.

One day, after Arjen noticed that the main Dutch railway website could only be used with Internet Explorer he decided to write the railway and several Dutch politician, he got requested to put in a proposal for a Dutch law pushing open source software as a government policy. Since the Dutch government does 12% of Dutch software spending, they should lead by example. This bill got passed, partly because the day before it got known that Microsoft had a nett. margin of 92% on Windows.

Read more…