#include <stdio.h> /* printf */
#include <string.h> /* strcat */
#include <stdlib.h> /* strtol */
const char *byte_to_binary(int x) {
static char b[9];
b[0] = '\0';
int z;
for (z = 128; z > 0; z >>= 1) {
strcat(b, ((x & z) == z) ? "1" : "0");
}
return b;
}
int main(void) {
printf("%s\n", byte_to_binary(5));
return 0;
}
7z a name.7z files/directorys
7zip can make also zip
files, just add the desired extension to the end of the file you want to make the archive.
zip -r myfiles.zip myfiles
stackexchange
DELETE FROM `table_name`
WHERE id NOT IN (
SELECT id
FROM (
SELECT id
FROM `table_name`
ORDER BY id DESC
LIMIT 100 -- keep this many records
) foo
);
Find number or rows in project:
find . "(" -name "*.json" -or -name "*.js" ")" -print0 | xargs -0 wc -l