Unit testing is important to ensure the stability and the correctness of the code throughout all lifespan of the project. However, testing some code requires a connection to external services (like SMTP, web, etc.) which in all cases must be avoided to simplify the test and development environment and to not add external variables which…
Following the last post about the buffer overflow protection, today we finally talk about strings.
Easy post today: simple method to detect if a number is a power of 2 in O(1) complexity. Yes, O(1), no naive loops involved .
Now that I have a spare machine where I can do all my experiments, I can start again to write posts about Disassembly C code for fun but, wait, my current hardware is a 32-bit Pentium-M CPU and I want to build and disassembly 64-bit code! Let’s set up my Ubuntu for 64-bit cross-compilation.
Last night I brought to a new life my old laptop to be used during my commuting time to write posts, to experiments some technologies and last but not least show how old hardware can be recycled and used efficiently. With my great surprise I discovered most of the 32-bit distro available a this moment…
Counting the number of 1′s in a binary representation of a number (aka Hamming weight aka popcount when binary numbers are involved) with Python using different implementations (naive implementations are obviously excluded ).
Originally this article was about strings but as soon as I disassembled the first C test code I saw an interesting bit of assembly code so I switched the topic: today we will talk about buffer overflow protection and the canary (obviously I’m not talking about the little bird but about this canary). A Buffer…
Today we will talk about code inlining which means the ability of the compiler to replace a function call with the body of the called function.
The datetime.datetime object can return the current date and time with a resolution up to microseconds which is true on *nix platforms but not completely true on Windows platforms.
I’m working on a script on Windows to automatically install Python packages listed in a text file like pip does. Because easy_install doesn’t support a requirements.txt as a packages’ list I made a small Batch file to simulate the pip‘s behavior, and I discovered the for loop of Windows’s command line.