Archive

Archive for August, 2009

OOP in different languages

August 26th, 2009 recon No comments

OOP is different in each programming language. Some languages like Python and C# don’t offer all the OOP features that you can get from C++.

Python doesn’t really support traditional access modifiers, and C# doesn’t offer true multiple inheritance (you can inherit from one class and multiple interfaces).

While C++ offers the most OOP features of the three languages, it has some disadvantages. If you compare C++ to modern languages like Python, Ruby or C#, C++ starts to show it’s age. Further more, given a small application, it’s usually much faster to write it in Python than in any C language.

The question ultimately becomes, are all the OOP features in C++ really needed in every day development? For small projects, most likely, no. For large projects with a team of developers, maybe.

Categories: Uncategorized Tags: ,

BackupDir updated

August 26th, 2009 recon No comments

I’ve updated the backupdir script. It’s much more robust, and I converted all the strings to use the same quoting style. You can download a copy from here.

Categories: Uncategorized Tags:

Python’s self

August 26th, 2009 recon No comments

Python methods (functions that are part of a class) have a special explicit parameter called self. Through self, methods can access class members (without a self parameter, the method is static (no access to instance variables)).

In most C languages, the “self” parameter is hidden (an implicit parameter), and is usually accessible through a reserved word (e.g this is C++ and C#).

Which is better? Python’s upfront approach is nice for beginners, but for experienced programmers, it creates some extra work.

Categories: Uncategorized Tags:

Blogging from an iPhone or iPod Touch

August 21st, 2009 recon No comments

I just installed the WordPress app for my iPod Touch. It looks great so far. It seems to automatically detects if you have SSL available, and, if you do, it will send all requests over SSL.

Categories: Uncategorized Tags: ,

Designing small software projects

August 20th, 2009 recon No comments

All of the OS software that I’ve built to date has had one developer working on it, me. I’m writing the software so that I can use it, therefore, I know what I need to develop. I usually rough out a design in XMind, which is a open source “mind mapping” tool. XMind’s default mapping style is like a bullet list after a few years in major league baseball (read on steroids).

As I rough out a design, I usually discover things along the way, like I forgot a DB table, the way I was planning to implement something isn’t practical, what APIs I might be using, which language would be the best suited to the task, etc. If I notice task that might be really technically difficult, I might write a proof of concept, to prove that it’s reasonable (meaning that it won’t take a lot longer than planned) to complete the task.

Here’s the basic design for pygcp:

Read more…

A little update…

August 17th, 2009 recon No comments

Classes started today, pretty exhausted…

I’m planning a new project, pygcp, which will be a GCP for people who have a dedicated box, and want to manage their servers from a web interface.

At this point, I’m planning to write pygcp for people who install their own servers, but want to use something to manage the task of running them (it would replace something like ServerChecker) from a web interface.

I might add auto installs and a master/slave system, but that’s a long way off.

Categories: Uncategorized Tags: , ,

Phone + traffic controller – supervisor = ?

August 14th, 2009 recon No comments

The supervisor is out of the building (they are required to be in the building), and the air traffic controller decides to get on the phone. Where does the FAA find these people?

The FAA claims that these actions didn’t contribute to the incident. Somehow, I find that really hard to believe. If someone was sitting at a radar screen, and saw the two aircraft heading towards each other, wouldn’t they get on the radio and have one of them get out of the way?

Categories: Uncategorized Tags:

Distributing Python modules

August 14th, 2009 recon No comments

If you come across a Python module that doesn’t have a Windows installer package available for it, and it’s packaged with distutils (almost every module is), you can make one by running:

setup.py bdist_wininst

If you look in the dist folder, you’ll find a nice Windows installer for the module. More information on distutils can be found here.

I compiled some of the modules that I use, that don’t offer a binary package for Win32 Py2.6. You can download them from here.

Categories: Uncategorized Tags:

mysql-python – Compiling on Windows

August 13th, 2009 recon No comments

Compiling mysql-python shouldn’t have been too complicated, since distutils automates the compilation process, but there were two minor issues.

This particular module needed the /MANIFEST linker option, and the windows setup script didn’t work properly.

After fixing both of those problems, I present the compiled binaries (MySQL-python-1.2.3c1.win32-py2.6.exe (83)), and the fixed setup_windows.py (mysql-python-setup_windows.py (79)), if you want to compile mysql-python yourself.

Categories: Uncategorized Tags: ,

Getting started with Python (part 6 – for newbs)

August 10th, 2009 recon No comments

Loops are another “flow control” tool, like an if statement. Loops allow you to repeat the same piece of code multiple times, which can be very useful when you are processing data.

There are two types of loops in Python, the for loop, and the while loop. The for loop is one of the easiest ways to process data. Let’s take a look:
Read more…

Categories: Uncategorized Tags: ,