See also: Heapify

Pages: 1

Object pools (Python)

A very common problem in software engineering is optimising out the problem of construction and destruction of objects. I don't necessarily mean objects exclusively in the context of object orientated programming. I mean objects as in data objects, which could be a large array or a struct and so on.

If you don't need objects for a long time it does seem silly to construct an object, initialise it, then destroy it and discard it. Especially as memory allocation can be expensive.

The most common approach to minimising the impact of this is object pools. An object pool is a collection of pre-constructed objects, sometimes even pre-initialised objects. When a program wants to use an object for a short period of time they can check-out an object, configure it to their needs (if necessary), use the object and then check it back into the pool.

...

Read more

There are no comments on this post.

How to Streamline Asterisk

So, you use Asterisk professionally, for fun, or both, and you want to know how to optimize the shit out of your Asterisk platform? No problem, I've got you covered.

Grab a beer, free up the next 2 hours of your time, and let's get to it!

...

Read more

There are no comments on this post.

Python Challenge Thoughts

If you didn't read my previous post, you'll want to check that out first: The Purely Functional Python Brainfuck Challenge.

So, today was the first day I really invested some thought and time into the challenge. I decided that before just diving into code I'd spend some time reading up on functional programming in python, and learn a bit.

The first thing I read through was the official python functional programming page which you can find here. This had a bunch of useful information regarding functional programming tools in python, but didn't really have any examples of actual functional programs.

...

Read more

There are no comments on this post.

Serving Static Content With Django

A question that is frequently asked by new Django programmers is: "How can I serve static content (css, images, javascript) with the Django development server?". This article is my attempt to answer that question by demonstrating the best practices way to do so.

Why Doesn't Django Serve Static Content Automatically?

Well, Django (and python in general) is built around the idea that it is better to be explicit than implicit. This concept means that you may need to write more code in order to do something, but that by doing it that way, you preserve code clarity and reduce complexity.

...

Read more

There are 3 comments on this post.

Populating Default ManyToMany Field Values in Django

At work, I'm the lead developer of a rather large, complex web application which interacts with many different technologies (Asterisk, Freeswitch, Cisco routers, python, XML-RPC, JSON, Django--to name a few). A few days ago, while implementing a ban system, I bumped into an interesting problem that was not trivial to find a solution to. So, here it is :)

Background

The web application I'm developing is a private portal which allows users to manage teleconference lines real time. Since all of our telephony services are free of charge, we often get callers onto certain teleconference lines who want to abuse services (think of those trolls on the internet, except over the phone). As you can probably imagine, without strict regulation & technology in place, telephone trolls could cause huge problems for normal users.

...

Read more

There is 1 comment on this post.

The Asterisk Spooling Daemon

While working on the new v2 release of pycall, I was doing some research on the internal limitations of Asterisk call files, and thought I'd share some interesting (technical) bits of information here.

All information below has been gathered from the latest Asterisk release (v1.6.2.7). If you don't do any programming, you may want to skip this article, as it is a bit geeky.

...

Read more

There are no comments on this post.

A Technical Introduction to Asterisk Gateway Interface (AGI)

Introduction

The Asterisk Gateway Interface, commonly referred to as AGI, is a language-independent API for processing calls. It allows programmers to write simple programs to manipulate and route calls on Asterisk servers in a simple, easy manner.

This article provides a technical introduction to the AGI, explaining how it works, how it can be used, where you can find API documentation, and even provides some basic code samples which demonstrate how to use the AGI. The intended audience is programmers, telephony enthusiasts, or IT people who want to learn more about adding functionality to their Asterisk PBX systems. This is not a full programming reference, and will not explain how to write AGI programs, it will merely teach you what the AGI provides and how to use it high-level.

...

Read more

There are no comments on this post.

My Git

A few days back I ordered a copy of Scott Chacon's book: Pro Git, which I am really enjoying reading. Scott is an excellent writer, and really does justice to Git. I was reflecting on his enthusiasm, and thinking about my own. Here are my thoughts on Git, and my experience with it over the years.

I started using Git around 2 years ago when I saw a screencast discussing it online. What initially drew me to Git was that it was created by Linus (who was very enthusiastic about it), and that my previous experiences with version control systems (VCS) were horrible. Naturally, I wanted to give it a try, and get back to the best-practices way of doing things (using a VCS).

When I first learned about VCSs, pretty much everyone used SVN or CVS. When I researched them both, there was no doubt in my mind that SVN was clearly the most popular, and so that's what I decided to learn. I started using SVN for all of my code (most of it was hosted on Sourceforge at some point or another), and learned it well enough to push periodic updates to my projects and do basic collaboration with a few other people.

...

Read more

There are no comments on this post.

Hashing: the whats and the hows

Introduction

Hashing normally makes people think of cryptographic hashing often used to store passwords. Understandable considering this is what users might more familiar with. However, the principles of hashing are used for more than simply preventing retrieval of certain data.

What I'm referring to is hashing for the purposes of efficient data referencing. This is better known to developers rather than users.

...

Read more

There are 2 comments on this post.

Pages: 1

RSS
Powered by Debian, Guinness, and excessive quantities of caffeine and sugar.