This file contains 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
/* Copyright (c) 2011 Gianni Tedesco */ | |
/* According to ACPI v4.0 spec */ | |
#include <stdint.h> | |
#include <inttypes.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <sys/stat.h> | |
#include <sys/mman.h> |
This file contains 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 <libusb.h> | |
#include <stdint.h> | |
#include <inttypes.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
static libusb_context *ctx; | |
static int do_init(void) | |
{ |
This file contains 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 <sys/mman.h> | |
#include <sys/stat.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <assert.h> |
This file contains 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
/* Fast grep thing, using boyer-moore delta-1 heuristic */ | |
#include <sys/mman.h> | |
#include <sys/stat.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <errno.h> |
This file contains 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 <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define REG_X0_BIT (1 << 0) | |
#define REG_X1_BIT (1 << 1) | |
#define REG_Y0_BIT (1 << 2) | |
#define REG_Y1_BIT (1 << 3) | |
#define NUM_REGS 4 |
This file contains 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 | |
class TokenBucket: | |
from time import sleep, time | |
def __init__(self, rate, burst = None): | |
'Rate in tokens per second, burst in number of tokens' | |
self.rate = float(rate) | |
if burst is None: |
This file contains 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 <stdlib.h> | |
#include <stdint.h> | |
#include <inttypes.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#include <errno.h> | |
#include <unistd.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <string.h> |
This file contains 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 | |
from sys import argv | |
from random import Random | |
def build_search_tree(a): | |
assert(len(a)) | |
if len(a) == 1: | |
return (a[0], None, None) | |
n = len(a) | |
return (a[n/2], build_search_tree(a[:n/2]), |
This file contains 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 | |
from sys import argv | |
from random import Random | |
def build_search_tree(a): | |
assert(len(a)) | |
if len(a) == 1: | |
return (a[0], None, None) | |
n = len(a) | |
return (a[n/2], build_search_tree(a[:n/2]), |
This file contains 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
/* Copyright (c) 2013 Gianni Tedesco | |
* Released under the terms of the GNU GPL version 3 | |
* mmap() packet socket transmission | |
*/ | |
#ifndef __linux__ | |
#error "Are you loco? This is Linux only!" | |
#endif | |
#include <stdio.h> |
OlderNewer