Archive for the 'computing' Category

Evolution of a Haskell Function

Thursday, March 11th, 2010

I’m going through Real World Haskell trying to get a handle on the Haskell programming language. Python is my current language of choice, but I like to learn new programming languages too.

So last night I was going over the chapter that introduces ‘let’, ‘where’, ‘case’ and guards and I wanted to try them out. I contrived a simple situation where I thought I could use them.

Link: PiCloud Overview

Thursday, March 11th, 2010

Here’s a great overview of using PiCloud that goes beyond “hello world” type stuff.
For those of you who don’t know, PiCloud is a cloud computing platform for Python that aims to simplify the task of running code in “the cloud.”
cw

On Tree Houses and Software

Thursday, November 12th, 2009

From the ShopTalk blog:
The Minimum Viable Tree House
A case-study in what not to do with your software project.

Beautiful Coroutines

Tuesday, October 20th, 2009

Some guy on some other blog wrote this. His name sounds familiar …
Beautiful Coroutines: Cooperative Concurrency in Python using Diesel
cw

Odd Old-Style vs. New-Style Class Behavior

Thursday, May 21st, 2009

So we have some older Python code at work that uses old-style classes. We usually try and bring those up to date when we encounter them.
The other day one of the developers did that and one of our tests started failing. A simple change from:

class Foo:
# stuff here

to:

class Foo(object):
[...]

Caching HTTP Responses with CherryPy

Wednesday, February 25th, 2009

The most basic case is very simple.

import time
import cherrypy
 
class WebSvc(object):
@cherrypy.tools.caching(delay=300)
@cherrypy.expose
def quadruple(self, number):
time.sleep(1) # make the real call somewhat costly
return str(int(number) * 4)
 
cherrypy.quickstart(WebSvc())

That uses an in-memory cache and [...]

My Solution for the Auto Industry (and the Economy In General): Smaller, Faster, Leaner

Saturday, December 20th, 2008

Ok, this post is on a controversial issue, and I’m entitled to my own ridiculous opinion. Therefore …
The fact that we have 3 major automakers in the US that our economy apparently hinges upon is a problem. From the news, the talk is that a failure of any of them is disaster.
The problem [...]

Useful Diagramming Web Application

Friday, October 17th, 2008

I stumbled across Web Sequence Diagrams the other day.
It’s a web-based diagramming application that uses a simple syntax to generate UML diagrams. No clicking around and positioning little boxes all over the place - just type in text that describes the diagram, and voila, there it is. He even provides a number of [...]

Customizing the Python Import System

Thursday, July 31st, 2008

So I’ve been programming with Python since 2001 and I’ve never had the need to do anything that the standard import system didn’t provide - until this week. We are planning on a little code reorganization for a project at work in preparation for collaboration from more developers. I wrote a simple custom [...]

Python’s Enhanced Generators

Friday, June 13th, 2008

So while I was mowing my grass last night, I got to thinking about Python 2.5’s enhanced generators and how I hadn’t tried them out yet. Here is a simple example that uses the consumer/pipeline model described in PEP 342.