11 Feb 2016

feedPlanet TurboGears

Christpher Arndt: Organix Roland JX-3P MIDI Expansion Kit

Foreign visitors: to download the Novation Remote SL template for the Roland JX-3P with the Organix MIDI Upgrade, see the link at the bottom of this post. Zu meinem letzten Geburtstag habe ich mir selbst einen Roland JX-3P geschenkt, inklusive einem DT200-Programmer (ein PG-200 Klon). Der JX-3P ist ein 6-stimmiger analoger Polysynth von 1983 und […]

11 Feb 2016 8:42pm GMT

13 Jan 2016

feedPlanet TurboGears

Christpher Arndt: Anmeldung für das PythonCamp 2016 ab Freitag, 15.1.2016

PythonCamp 2016 Kostenloser Wissensaustausch rund um Python (The following is an announcement for a Python "Un-Conference" in Cologne, Germany and therefor directed at a German-speaking audience.) Liebe Python-Fans, es ist wieder soweit: Am Freitag, den 15. Januar öffnen wir die Online-Anmeldung für Teilnehmer des PythonCamps 2016! Die nunmehr siebte Ausgabe des PythonCamps wird erneut durch […]

13 Jan 2016 3:00pm GMT

02 Nov 2015

feedPlanet TurboGears

Matthew Wilson: Mary Dunbar is the best candidate for Cleveland Heights Council

I'll vote for Mary Dunbar tomorrow in the Cleveland Heights election.

Here's why:

02 Nov 2015 5:14pm GMT

06 Aug 2015

feedPlanet TurboGears

Matthew Wilson: Beware the trap of the local optimum

Lots of problems look a little like this:

1-11. Local and global optima.

The Y-axis measures success at whatever problem you're trying to solve.

You start at the farthest left point on the curve and you can move left or right a little bit every time you work on the problem.

After you make it to the top of the first hill, the only way to make it to the top of the second hill is by going down first.

In jujitsu, if I'm lucky enough to get to mount, my instinct is to camp out there. Maybe I can submit the other guy by sweating on him. I'm in a relatively safe position now, so I don't want to take risks. In other words, I'm at the local optimum.

If I go for a submission like an arm bar, given my current skill level, my opponent will probably escape the mount, and I'll be in a worse position afterward.

So in a self-defense situation, it might be smart to camp. The failure penalty is high!

But in class, because the cost of failure is so low (really, I just don't get to feel like a badass when I tap out) I am wasting an opportunity to learn (and move to the right along the curve)!

06 Aug 2015 7:43pm GMT

22 Jul 2014

feedPlanet TurboGears

Christpher Arndt: EuroPython training checklist

Here's a checklist for participants of my training session Interactive experiments in sound synthesis with Nsound, numpy and matplotlib at EuroPython 2014 in Berlin. Have/bring a laptop with Linux (preferred), Windows, or OS X and good headphones. An external audio interface may help with audio performance but is not essential. Download and install my virtual […]

22 Jul 2014 2:01pm GMT

Christpher Arndt: Setting up a virtualenv for IPython and Nsound

These instructions detail how to create a working environment for participants of my training session Interactive experiments in sound synthesis with Nsound, numpy and matplotlib at EuroPython 2014 in Berlin who do not want to or cannot use the virtual machine appliance I created for the course. These instructions are geared to Linux users, though […]

22 Jul 2014 2:00pm GMT

19 Jul 2014

feedPlanet TurboGears

Christpher Arndt: Virtual machine for my EuroPython 2014 sound experimentation training

I have created a virtual machine for virtualbox for the participants of my training session Interactive experiments in sound synthesis with Nsound, numpy and matplotlib at EuroPython 2014 in Berlin. It provides a ready to run Manjaro Linux System with an XFCE desktop and all the software necessary to follow the course. Update (2014-07-22): if you […]

19 Jul 2014 5:49pm GMT

20 Apr 2014

feedPlanet TurboGears

Curia: Announcing the pyramid_assetmutator package

If you're like me, one of the first things you do when starting a new web application project is set up a CSS alternative such as LESS or SASS/SCSS. Those who aren't particularly fond of JavaScript might also tend to add CoffeeScript. These "metalanguages" can assist in making client-side/asset code more pleasurable to work with, as they typically provide functionality that's "missing" in the the languages they get interpreted into.

Some frameworks (e.g. Ruby on Rails) give you support for these alternatives out-of-the-box, but in the land of less opinionated software things can require a bit more work. Since I am personally a fan of the Pyramid web framework, I've used the pyramid_webassets and pyramid_fanstatic packages in the past to provide this support. However, these packages are so powerful and comprehensive that they can also tend to be somewhat involved in regards to configuration, so I recently decided to roll my own Pyramid add-on: pyramid_assetmutator

Although definitely not as "feature-full" as the packages I have mentioned earlier, as of this writing it provides the following:

Feel free to check it out on GitHub or browse the documentation, and share here or open a GitHub issue if you have any comments or suggestions.

20 Apr 2014 1:07am GMT

03 Apr 2014

feedPlanet TurboGears

Christpher Arndt: Select a Python code block in Geany with Lua

Here's a nifty little Lua script for the Geanylua plug-in for the Geany text editor to select a Python code block in Geany with Lua. When the script is activated, it will select the block corresponding to the current code folding level of the line the cursor is on in the active document. E.g. if you place the cursor in the body of a Python function on a line that is on the same indentation level as the first line of the body of the function, it will select the whole function. Also, if the cursor is on the opening line of a block, e.g. a line starting with class, def, if, etc., the script will select the block started by this line.

03 Apr 2014 11:09pm GMT

10 Mar 2014

feedPlanet TurboGears

Matthew Wilson: RIP hen #1

For two years now, I've been letting my hens free range around in a fenced-in section in my back yard during the day. They love it.

Went out to check for eggs today after work and found one of my girls had been killed in the coop.

Head bitten off. No other signs of predation. Internet forums say this was likely a possum or a raccoon.

Going to set up a live trap tonight. And some wire snares.

I raised these girls since they were a day old. Can't really remember the last time I was this angry and sad.

10 Mar 2014 11:01pm GMT

18 Feb 2014

feedPlanet TurboGears

Christpher Arndt: Benjamins Schlaflied

Welcome, my Nephew Here is a little song I wrote for my nephew, who was born two weeks ago, to welcome him into this world and hopefully give him some comfort while he rests from the tiring all-day business of processing his mother's milk. It is thus called Benjamins Schlaflied (Benjamin's Lullaby) and I play […]

18 Feb 2014 7:30pm GMT

11 Feb 2014

feedPlanet TurboGears

Christpher Arndt: Get the gist of it

Some months ago I finally caught up with modern development practices and switched to Git for new software projects. Though I host my own projects on my own server with the help of Trac and gitosis, one thing I do like about GitHub though, are Gists. Like many good ideas this one makes one wonder, why nobody came up with it before. It is also very easy to include Gists in your blog, which is what I'm starting with this post. Recently, on the German mailing list of the pyCologne User Group, someone was pointing out Python's poor performance at an implementation of the fibonacci series using recursion and showed some Scala code that profited from a few added type declarations. I showed that a similar performance gain could be achieved using Cython, with very few changes to the original pure Python code. I created a small shell function to automate the process of compiling a Cython source file with the --embed option and turning it it into a binary. The function then runs the resulting binary, so you can use this function to run a *.pyx file directly. Read full article...

11 Feb 2014 7:43pm GMT

02 Jan 2014

feedPlanet TurboGears

Matthew Wilson: What’s good and bad about github issues

Ticketing / workflow / bugtracker systems are always nasty. Github's is pretty good. Maybe the best of what's out there. But it ain't perfect.

Here's what I like:

And what I dislike:

02 Jan 2014 4:09pm GMT

08 Dec 2013

feedPlanet TurboGears

Matthew Wilson: I really like my gardening boots

You don't need many tools to start gardening. You can dig holes with a stick or a sharp rock. You can start seeds in tin cans. You can use all sorts of stuff to carry water. You really only need dirt, sun, and seeds. So don't run out and buy a bunch of stuff!

But when you realize you've got the gardening bug bad, there's a few tools that really help. First off, you need some rubber boots. Otherwise, you're going to track mud everywhere. That's going to make your significant other very annoyed!

I bought these boots in 2006. They've held up very well over the last seven years. They're waterproof, thick enough to block thorns, easy to hose off, and the sole is thick enough that I can push on a shovel with them.

They're made here in Illinois, USA, by Boss Manufacturing Company. They've been around since 1893!

You can order them on Amazon. You can't order them direct from the company.

Note: I will get some commission if you order the boots from the link below, so if you hate me, you should not click on that link.

08 Dec 2013 4:50pm GMT

16 Nov 2013

feedPlanet TurboGears

Matthew Wilson: Upload files directly to Rackspace from the browser with AJAX PUT

I just wrote this up on my biz site.

Upload files directly to Rackspace Cloudfiles from the browser with AJAX PUT

I hope it helps somebody out!

16 Nov 2013 9:43pm GMT

10 Nov 2013

feedPlanet TurboGears

Alessandro Molina: TurboGears 2.3 Hidden Gems #2 – Application Wrappers

One of the less known features introduced in TurboGears 2.3 are application wrappers.
Application wrappers are much like controller wrappers (available since 2.2), but instead of wrapping controllers they actually wrap the whole application providing an easier way to implement what in plain WSGI is done through middlewares.

The advantage of application wrappers over middlewares is that they have full access to TurboGears stack, they can access the current request, the database, session and caches as the application itself would do.

The great part is that, as they run between TGApp and TGController, they can also replace the TurboGears Context and the TurboGears Response providing a great way to hijack requests, responses or even replace entire features of the framework like the cache layer. A very similar concept is available in other frameworks like Pyramid Tweens.

A very simple application wrapper that intercepts exceptions and logs them without messing with the standard TurboGears error handling might look like:

class ErrorLoggingWrapper(object):
    def __init__(self, handler, config):
        self.handler = handler
        self.config = config
 
    def __call__(self, controller, environ, context):
        path = context.request.path
        try:
            return self.handler(controller, environ, context)
        except:
            log.exception('Error while handling %s', path)
            raise

The wrapper can then be enabled calling

base_config.register_wrapper(ErrorLoggingWrapper)

inside config/app_cfg.py

Now that we have an application wrapper able to log exceptions we can decide for example to add another one that suppresses exceptions and prints "Something went wrong!", as it is possible to specify the order of execution for application wrappers we can register a SuppressErrorsWrapper that should execute after the ErrorLoggingWrapper:

from webob import Response
 
class SuppressErrorsWrapper(object):
    def __init__(self, handler, config):
        self.handler = handler
        self.config = config
 
    def __call__(self, controller, environ, context):
        try:
            return self.handler(controller, environ, context)
        except:
            return Response('Oh! Oh! Something went wrong!', status=500, content_type='text/plain')

Then it can be registered after the ErrorLoggingWrapper using:

base_config.register_wrapper(SuppressErrorsWrapper, after=ErrorLoggingWrapper)

While applications wrappers are a powerful feature, most of their power comes from the new response management refactoring that makes possible to access the current context and replace the outgoing response while working with high level objects instead of having to manually cope with WSGI.

10 Nov 2013 1:16pm GMT