Daniele Esposti's Blog

Disassembly C code for fun – Part 6: inlining expansion

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 sample code and disassembly The code outputs the power of two between 0 to 9 by colling a power() function: #include <stdio.h> int...


Timestamp and microseconds on Windows platforms

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. The problem On both platforms, and at least with Python 2.7, the minimum resolution reported by datetime is 1 microsecond: >>>...


For loops in Windows command line

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...


Distribution of wealth in a society of equals

In this blog I usually write posts related to information technology, but I stumble upon this post on NoiseFromAmerika (an italian blog about politics and economics) and I was surprised about how a concept backed by the common sense it’s so wrong when it’s analysed with scientific method. I made...


Multiple prefixes match

I’m not using often string manipulation (I usually handle SQLAlchemy’s queries and sometime XML/XHTML manipulation with the lxml library) but sometimes I need to analyse some paths expressed with a dotted notation comparing every path with a predefined list of path prefixes. The obvious solution is to compare in a...