This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ---------------------------------------------------------------------------- | |
* "THE MATE-WARE LICENSE" (Revision 42): <[email protected]> wrote this | |
* file. As long as you retain this notice you can do whatever you want | |
* with this stuff. If we meet some day, and you think this stuff is worth | |
* it, you can buy me a Club-Mate in return. Leandro Pereira | |
* ---------------------------------------------------------------------------- | |
*/ | |
#include <arpa/inet.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import math | |
def pack_bits(*bits): | |
n = 0 | |
max_n = 1 | |
for value, prime_for_value in bits: | |
while n % prime_for_value != value: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
struct task { | |
void *(*cb)(void *data); | |
void *data; | |
bool runnable; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* SPSC Bounded Queue | |
* Based on public domain C++ version by mstump[1]. Released under | |
* the same license terms. | |
* | |
* [1] https://github.com/mstump/queues/blob/master/include/spsc-bounded-queue.hpp | |
*/ | |
#if !defined(__ATOMIC_RELAXED) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
def parse_nm_output(handle): | |
current_object = None | |
symbols = {} | |
symbol_to_object = {} | |
for line in handle.readlines(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import time | |
import random | |
import pygame | |
import pygame.camera | |
import pygame.transform | |
from pygame.locals import * | |
UDP_IP = "192.168.50.50" | |
UDP_PORT = 2711 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <lwan.h> | |
#include <lwan-template.h> | |
#include <strbuf.h> | |
struct thing { | |
lwan_tpl_list_generator_t generator; | |
const char *name; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Buildbot 0.9.x shield generator | |
* Copyright (c) 2016 Leandro Pereira <[email protected]> | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of | |
* this software and associated documentation files (the "Software"), to deal in the | |
* Software without restriction, including without limitation the rights to use, copy, | |
* modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, | |
* and to permit persons to whom the Software is furnished to do so, subject to the | |
* following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% sudo cpupower frequency-set -g performance ~/git/benchmark/build | |
Setting cpu: 0 | |
Setting cpu: 1 | |
Setting cpu: 2 | |
Setting cpu: 3 | |
% ./test ~/git/simdswitch | |
Run on (4 X 2746.51 MHz CPU s) | |
2017-01-06 08:06:24 | |
Benchmark Time CPU Iterations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace io { | |
struct Reader { | |
virtual std::tuple<int, moku::error> Read(moku::slice<uint8_t> p) = 0; | |
}; | |
struct Writer { | |
virtual std::tuple<int, moku::error> Write(moku::slice<uint8_t> p) = 0; | |
}; | |
} // namespace io | |
namespace fmt { | |
moku::error Errorf(std::string format, moku::slice<moku::empty_interface> a); |