How to compile a linux shell script to be a standalone executable *binary* (i.e. not just e.g. chmod 755)?

The solution that fully meets my needs would be SHC – a free tool, or CCsh a commercial tool. Both compile shell scripts to C, which then can be compiled using a C compiler. Links about SHC: https://github.com/neurobin/shc http://www.datsi.fi.upm.es/~frosal/ http://www.downloadplex.com/Linux/System-Utilities/Shell-Tools/Download-shc_70414.html Links about CCsh: http://www.comeaucomputing.com/faqs/ccshlit.html

Inserting and selecting UUIDs as binary(16)

So, as a response to comments. The correct way to store a 36-char UUID as binary(16) is to perform the insert in a manner like: INSERT INTO sometable (UUID) VALUES (UNHEX(REPLACE(“3f06af63-a93c-11e4-9797-00505690773f”, “-“,””))) UNHEX because an UUID is already a hexed value. We trim (REPLACE) the dashes in the statement to bring the length down to … Read more

How do you convert a fraction to binary?

In university I learned it this way: Multiply by two take decimal as the digit take the fraction as the starting point for the next step repeat until you either get to 0 or a periodic number read the number starting from the top – the first result is the first digit after the comma … Read more

Two’s Complement Binary in Python?

It works best if you provide a mask. That way you specify how far to sign extend. >>> bin(-27 & 0b1111111111111111) ‘0b1111111111100101’ Or perhaps more generally: def bindigits(n, bits): s = bin(n & int(“1″*bits, 2))[2:] return (“{0:0>%s}” % (bits)).format(s) >>> print bindigits(-31337, 24) 111111111000010110010111 In basic theory, the actual width of the number is a … Read more