How do I force Python to be 32-bit on Snow Leopard and other 32-bit/64-bit questions

You can find out a lot about the Python version you’re running via the platform module (the sys module also has a few simple helpers) On Mac OS X, you can run a “fat binary” with your chosen architecture with, for example, arch -i386 /usr/bin/python I do not recommend altering /usr/lib/python itself (with the lipo … Read more

Why cannot take address to a nested local function in 64 bit Delphi?

This trick was never officially supported by the language and you have been getting away with it to date due to the implementation specifics of the 32 bit compiler. The documentation is clear: Nested procedures and functions (routines declared within other routines) cannot be used as procedural values. If I recall correctly, an extra, hidden, … Read more

Fast computing of log2 for 64-bit integers

Intrinsic functions are really fast, but still are insufficient for a truly cross-platform, compiler-independent implementation of log2. So in case anyone is interested, here is the fastest, branch-free, CPU-abstract DeBruijn-like algorithm I’ve come to while researching the topic on my own. const int tab64[64] = { 63, 0, 58, 1, 59, 47, 53, 2, 60, … Read more

Conditionally use 32/64 bit reference when building in Visual Studio

Here is what I’ve done in a previous project, which will require the manual edition of the .csproj file(s). You also need separate directories for the different binaries, ideally siblings of each other, and with the same name as the platform you are targeting. After adding a single platform’s references to the project, open the … Read more

How can I test a Windows DLL file to determine if it is 32 bit or 64 bit? [duplicate]

A crude way would be to call dumpbin with the headers option from the Visual Studio tools on each DLL and look for the appropriate output: dumpbin /headers my32bit.dll PE signature found File Type: DLL FILE HEADER VALUES 14C machine (x86) 1 number of sections 45499E0A time date stamp Thu Nov 02 03:28:10 2006 0 … Read more

Why do 64-bit DLLs go to System32 and 32-bit DLLs to SysWoW64 on 64-bit Windows?

I believe the intent was to rename System32, but so many applications hard-coded for that path, that it wasn’t feasible to remove it. SysWoW64 wasn’t intended for the dlls of 64-bit systems, it’s actually something like “Windows on Windows64”, meaning the bits you need to run 32bit apps on a 64bit windows. This article explains … Read more

tech