All Articles

  1. Pain

    I've spent the last 2 days trying to get a stack trace from a crashing python extension module in windows. And I still haven't figured it out. That's sooo very motivating.

    Give me GNU/Linux any day.

  2. cifs why don't you follow unix conventions?

    Often it's nice to just have conventions and gentleman's agreements. But then sometimes someone doesn't and the harm is done, it's too hard to reverse.

    NFS has introduced the de-facto standard of using <host>:<path> for the device of a remote mount. Yes this break because you can have ":" in …

  3. Letters on keyboard stop working

    Dear Lazy Web

    I have some Very weird behaviour where the lowercase letters "C" and "V" stop generating the Correct key press event after a short while (which is why I am typing them as upper Case here...). But only when using Compiz as window manager, when switching away from …

  4. How to bring a running python program under debugger control

    Of course pdb has already got functions to start a debugger in the middle of your program, most notably pdb.set_trace(). This however requires you to know where you want to start debugging, it also means you can't leave it in for production code.

    But I've always been envious of …

  5. via cygwin ssh (visual studio 2003)

    Integrating an automatic build on a windows host with the rest of your one-command cross-platform build system can be quite a pain. Luckily there is cygwin which makes things like ssh, bash, make etc all work on windows. It's great.

    The trick to building using visual studio from there is …

  6. Importing modules in C extension modules

    It seems that if you need another module in a function of your extension module, the way modules in the standard library seem to solve this is like this:

    static PyObject *
        PyObject *foo;
        foo = PyImport_ImportModuleNoBlock("foo");
        if (foo == NULL)
            return NULL;
        /* do stuff with foo */
        return …
  7. Singletons in a Python extension module

    If you want a singleton in a C extension module for CPython you basically have to do the same as when doing this in plain Python: the .__new__() method needs to return the same object each time it is called. Implementing this has a few catches though.

    static PyObject *
    MyType_new …
  8. Voting and identification in the UK

    Last Thursday I had the pleasure of being able to vote for the local council as well as for the European Parliament. Since I'm a Belgian citizen living in the United Kingdom this involved convincing the officials at the voting office to re-read their instructions (at first they only allowed …

  9. Raising exceptions in threads

    It's not simply raising an exception in a thread that I want. I want to raise an exception in a thread from another thread. It's like sending signals to threads, only signals in pyhon can only be delivered to the main thread (for portability). But Python has a other asynchronous …

  10. New home for PSI

    PSI, the Python System Information package that pulls interesting information from the kernel and makes it available in a nice Python API, has a new home at bitbucket. This means that the source conde now lives inside a mercurial repository instead of subversion.

    This actually happened about a week ago …

  11. Compiling applications in

    If you need to compile a random application in this is not that hard:

    cc = distutils.ccompiler.new_compiler()
    cc.link_executable(['test.c'], 'a.out')

    There is no need to create the object files explicitly with cc.compile() first if you have no need for …

  12. Sun Fire T1000 not closet friendly

    Obviously the Sun Fire T1000 is a noisy machine, that's why it's sitting in the closet in the first place. But it has more shortcomings that make it a closet-unfriendly server:

    • It shuts down at 50 degrees Celsius. That means wrapping it in a duvet to damp the noise is …
  13. Time, floating points and python modules handling time

    Some memory in the back of my mind tells I've once read a rant about storing time that argued you should never store time in floating point variables. My memory seems to think the rant convinced me and it does indeed seem better to store time in integers so that …

  14. Reading a 64-bit core from a 32-bit proc on solaris?

    I'm trying to read some pointers from a 64-bit address space file (from /proc/pid/as) while running in a 32-bit process - all this on Solaris. To do this I'm using the transitional large file compilation environment, i.e. where you get both open()/pread() and open64()/pread64() since I …

  15. Replacing the screen of your digital camera

    The screen of my Canon Digital Ixus 40 compact camera broke on my last trip (sport climbing in Geyikbayiri near Antalya, Turkey - if you climb: it's an amzing place!) which made me rather sad. But with the help of Ebay I found a new screen and have just managed to …

  16. How to send emails

    Dear World

    Subject lines in emails are there for a reason.

    Please use them.



  17. Virtual memory size (VSZ) on AIX

    If you have ever looked at the ps(1) output on an AIX box and wondered why the virtual memory size (VSZ) is so small, often even smaller then the resident set size (RSS), then here's the answer: it's not the virtual memory size. It is actually the size of …

  18. Closed source frustration

    Developing against a closed source libraries is jut painful and wastes your time. Function definitions are missing from the header files, so you get to declare them yourself from the manpages. Then you get random error messages even though you do everything just like the manpage tells you. Some dark …

  19. ssh magic

    Dear Lazy Web

    If I write the following in my ~/.ssh/config:

    Host bartunnel
      HostKeyAlias bar
      HostName bar
      LocalForward 8822 foo:22
    Host barjump
      HostKeyAlias bar
      HostName localhost
      Port 8822

    Then I can connect to host bar via host foo (circumnavigating a firewall that stops me from going to bar …

  20. Planning upgrades

    So Debian has finally released again. Congratulations. Time to start planning upgrades of servers then.

  21. Compiling 32-bit Python on amd64

    If you ever feel the need to compile a 32-bit version of Python on a amd64 bit machine, this is how you do it on a Debian/Ubuntu system.

    Firstly you need the correct compiler stuff, this means you need gcc-multilib and 32-bit development libraries of at least libc. On …

  22. sed for binary files: bbe

    While GNU sed takes care not to munge NULL characters this is not the POSIX standard, therefore it's no surprise some implementations don't manage to edit binary files properly (not to mention that many implementations will struggle with long lines). Hence the search for a binary sed:

    bbe is just …

  23. Specifying the RUNPATH in sofiles

    When you create a shared object that depends on another shared object there are multiple ways to tell it where to look for the shared object. Two of these are by encoding (at linking time) a DT_RPATH and DT_RUNPATH entry in the .dynamic section. A third one is to use …

  24. Resistance to change

    Why can C developers be happy with using config.h to get constants about where to look for configuration or data files for example, yet Python developers seem to refuse to think of any way they might want to support finding these files in a portable way?

  25. FreeBSD on Virtualbox

    Virtualbox is my desktop virtualisation technology of choice most of the time and I wanted to have a play with FreeBSD. Seems they don't get along tough and you won't get a network connection.

    • Solution 1: Change the network adaptor in Virtualbox to PCnet-PCI II (instead of PCnet-PCI III). I've …
  26. datetime.datetime.totimestamp()

    There exists a datetime.datetime.fromtimestamp() and many a time I've wondered why there is no .totimestamp() equivalent. The answer is that not all datetime objects can be represented by a timestamp. But if you know this restriction and want it anyway, this is the magic:

    time.mktime(datetime_object.timetuple …

« Page 3 / 7 »