Modeling, simulation, and engineering

Archive for the ‘Software development’ Category

Using Python to generate XML files for visualization in Paraview

Thursday, November 13th, 2008 Posted in Linux, Python, Software development | No Comments »

VTK is an open-source software system for "3D computer graphics, image processing, and visualization" developed by by Kitware. VTK is the foundation of Paraview, an industrial-strength CFD visualization tool that I have found to be very useful. I ...

Unexpected integer/float math behavior in Python

Thursday, November 6th, 2008 Posted in Python, Software development | No Comments »

I wasted some time today tracking down a bug in one of my programs.  It turned out to be "unexpected behavior" rather than a bug.  I was aware of this aspect of the language, but I made an assumption and ...

Even faster collision detection in Python using Numpy

Thursday, October 16th, 2008 Posted in Python, Software development | No Comments »

Last night, in the shower, I realized that my collision detection routine could be even faster. Here is a representative snippet of code from my previous post: d2 = (x-self.x[0:i])*(x-self.x[0:i]) + (y-self.y[0:i])*(y-self.y[0:i]) + (z-self.z[0:i])*(z-self.z[0:i]) For some reason, I ...

Speeding up Python math with Numpy: collision detection example

Sunday, October 12th, 2008 Posted in Python, Software development | 1 Comment »

Python is a very-high-level language.  That makes it easy to write code quickly, but the program may not be as fast as a program compiled from a lower-level language.  For this reason, many scientific programs are written in Fortran or ...

Python Pickle: Painless binary storage for Python objects

Monday, September 15th, 2008 Posted in Python, Software development | No Comments »

The pickle module provided with Python is so useful that I'm surprised I haven't used it before. Pickle allows you to save an entire data structure (such as an object) to disk as a binary file in a effortless ...

Python threads are easy (with example)

Tuesday, August 19th, 2008 Posted in Software development | No Comments »

It's remarkably easy to spawn a Python thread.  However, before doing so, I caution you that a Python thread is not the same thing as an OS thread.  Python threads run within the Python interpreter, but the Python interpreter always ...

Fun with threads in Python and wxPython

Monday, August 11th, 2008 Posted in Software development | No Comments »

I have finally gotten back to programming in the last couple of days.  Our project has finally started to generate a lot of data, so I've been refactoring and improving my code that reads data stored in LabView binaries.  Today ...

Reading Labview binary files with Python

Wednesday, June 25th, 2008 Posted in Software development | 1 Comment »

My research group uses Labview 7.1 to write custom data acquisition (DAQ) software. I code everything else in Python, so I need to get data from Labview into Python for processing. Our DAQ program produces Labview binary files, so ...

Server move completed and general update

Sunday, June 22nd, 2008 Posted in Linux, Software development, Stage Lighting | No Comments »

The site is back online after a server move.  Actually I can't blame the server move for the downtime, because I went out of town and then had a lot of catching up to do, and as a result I ...

Presentation at BarCamp Orlando 2008

Sunday, April 6th, 2008 Posted in Software development | No Comments »

I gave a presentation at BarCamp Orlando on 5 April 2008. Here is a link to my presentation, Data Analysis with Python.

My current Gentoo Linux setup

Monday, November 12th, 2007 Posted in Software development | No Comments »

This post is a reminder to myself more than it is intended for anyone else.  Well, that's most of this blog.  Gentoo is a great distribution of Linux, but you have to install everything yourself. This is a good ...

ODEPACK re-released

Tuesday, September 25th, 2007 Posted in Software development | No Comments »

Minutes ago I uploaded a tarball containing my re-release of ODEPACK, a standard numerical tool for the solution of systems of ordinary differential equations. The algorithms and numerical code are identical to the distribution found on Netlib, but everything ...

Direct access to C++ containers from Python

Thursday, September 13th, 2007 Posted in Software development | No Comments »

In previous examples, I've shown how to pass Python lists into C++ using Boost.python. Because Python lists can contain a mixture of objects of different types, C++ has to use extract<type> to determine what kind of data to get ...

Mixing objects of different types in a Boost.python list

Wednesday, August 8th, 2007 Posted in Software development | No Comments »

Demonstration Code--mixing objects of different types in a Boost.python list In Python, a list is allowed to contain objects of various types. Using Python's introspection capabilities, it's easy to process a mixed list because you can just test each list ...

USPTO tries peer review for software patents

Wednesday, July 4th, 2007 Posted in Software development | No Comments »

The US Patent and Trademark Office (USPTO) has launched a trial program to subject software patents to peer review online.  Naturally, the big software companies aren't exactly publicizing this.  We all know that a lot of stupid patents get issued.  ...

Example: using an extractor class in Boost.Python

Sunday, April 15th, 2007 Posted in Software development | No Comments »

The documentation for the Boost.Python extractor class is not terribly enlightening for a new user. The examples given in the tutorial are code fragments, and it's never clear exactly what the context is or what they are supposed to accomplish. ...

“Ubuntu” actually means “eats your config files”

Wednesday, March 14th, 2007 Posted in Software development | No Comments »

The Dapper-to-Edgy upgrade was surprisingly smooth, once I figured out how to do it. Unfortunately, the new version overwrote my "/boot/grub/menu.lst" so I could not boot Windows. I have enough experience with Linux that this was a five-minute ...

Ubuntu is an African word that means “devours your soul”

Monday, March 12th, 2007 Posted in Software development | No Comments »

When it comes to Linux, I'm a Gentoo guy. Go ahead, make fun of me and call me a ricer. Then go try to do something difficult on Redhat or Ubuntu, and come back and tell me what you ...

Python calling C++ calling Fortran

Thursday, March 8th, 2007 Posted in Software development | No Comments »

I got it working a while ago, but I haven't had a chance to update my eager audience.  I built a simple simple simulation tool using this crazy combination of languages.  It's a library written in C++ that uses the ...

Subtle aspects of using Boost and LAPACK

Tuesday, February 27th, 2007 Posted in Software development | No Comments »

I spent part of the afternoon wrestling with LAPACK integration in a C++ program, using the unofficial Boost bindings. I learned a couple of interesting things. test.C is a file that demonstrates them. 1. You need to create column-major ...