realmike.org Relaunch

I can’t believe the last article that I posted (then still at geocities.com/foetsch) dates back to June 1, 2005!

Since then my interests have shifted even more to Python, GNU/Linux and FLOSS in general, but the most prominent articles on my homepage were still about DirectX and Borland C++Builder (something else I can’t believe—that I ever thought C++Builder was good…).

Now it’s time to revamp the homepage and post more often about things that I actually care about. At least, that’s the plan. If nothing else, this project gives me a chance to get myself up-to-speed with more recent web technologies than the static HTML pages that I used to write.

Legacy DirectX And C++Builder Articles

I moved over the legacy DirectX and C++Builder articles from my old homepage. Surprisingly, they still get a few page hits after all these years.

GNU Automake By Example

Originally published: June 1, 2005

Table of Contents

  1. Abstract
  2. A Minimal Project
  3. Editing Automake-based Projects with KDevelop
  4. Adding Doxygen Support
  5. A More Complex Example
  6. Topics Not Covered
  7. Links

Abstract

This article presents several simple Automake/Autoconf-based projects. I assume that you know what Automake, Autoconf, and configure are, and that you know how to install a software package from sources (i.e., you know how to invoke "configure & make & make install"). (If you don’t, you can still follow the instructions to create a very small project to play around with.) This article does not contain lengthy explanations or detailed background information. Rather, I present a few examples that (hopefully) get the ideas across.

Some of the topics for which examples are presented:

  • Doxygen support
  • Multiple subdirectories
  • Flex/Bison support
  • Libtool Convenience libraries
  • KDevelop Automake Manager

. . . → Read More

Building SWIG Python Extensions on GNU/Linux

Originally published: May 27, 2005

Table of Contents

  1. Abstract
  2. Building Manually on the Command Line
  3. Adding SWIG to Autoconf
  4. Adding SWIG to Automake
  5. An Example Project

Abstract

In the article Python Extensions In C++ Using SWIG, I describe how to extend Python with C++ code. That article also contains instructions for building SWIG extension DLLs on Windows. This article contains instructions for using GNU Automake and Autoconf to build SWIG extensions as shared objects on GNU/Linux.

. . . → Read More

Introduction To New-Style Classes In Python

Orignally published: May 8, 2005

Table of Contents

  1. Why New-Style Classes?
  2. Properties
  3. Static Methods
  4. Class Methods
  5. Descriptors
  6. Attribute Slots
  7. The Constructor __new__
  8. Cooperative Super Call
  9. Conclusion
  10. References

Why New-Style Classes?

New-style classes are part of an effort to unify built-in types and user-defined classes in the Python programming language. New-style classes have been around since Python 2.2 (not that new anymore), so it’s definitely time to take advantage of the new possibilities.

. . . → Read More

Python Extensions In C++ Using SWIG

Originally published: Oct 8, 2003 (Last update: August 15, 2007)

Table of Contents

  1. Abstract
  2. Introduction
  3. The Python/C API
  4. SWIG Basics
    1. A Quick Example
  5. Building Extensions on GNU/Linux
  6. Building Extensions on Windows
    1. Setting Up The Environment
    2. Enabling Syntax-Highlighting For .i Files
    3. Setting Up The DLL Project
    4. SWIG As A Custom Build Step
    5. Troubleshooting
  7. A Case Study: “pymfg”
    1. Namespaces And Other Reasons Why Your Classes Aren’t Wrapped
    2. Hiding The Unwanted And Faking The Non-Existent
    3. Someone Has Done All The Work – Using STL Classes
    4. The Problem With Pointers To Pointers
  8. Conclusion

Abstract

This article walks you through the process of writing a Python extension module in C++. To simplify the task, we are going to use SWIG to produce the “glue code” between Python and C++. The article presents the following concepts:

  • Converting between C++ and Python data types
  • Setting up an extension module project that uses SWIG
  • Using SWIG interface definition files
  • Exporting functions and classes
  • Exporting STL containers

. . . → Read More

Google+