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
# vim: set ai expandtab: | |
cmake_minimum_required(VERSION 3.2 FATAL_ERROR) | |
# The following must be set BEFORE doing project() or eanble_language(). | |
# ::-------------------------------------------------------------------------:: | |
if (NOT CMAKE_BUILD_TYPE) | |
message(STATUS "No build type defined; defaulting to 'Debug'") | |
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING | |
"The type of build. Possible values are: Debug, Release, RelWithDebInfo and MinSizeRel.") |
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
## If the package won't let you "Show Package Content" on right-click then... | |
pkgutil --expand Foo.pkg some/path | |
## This will probably yield one more more child .pkg files. Inside them | |
## look for the Payload file. Then... | |
mv Payload Payload.gz | |
gunzip Payload.gz | |
## Which results in Payload uncompressed. Use 'cpio' to extract files... | |
cpio -iv < Payload |
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
class frugal1_estimator(object): | |
def __init__(self, qtile): | |
self.qtile_target = qtile | |
self.m = 0.0 | |
def add(self, new_data): | |
r = random.random() | |
if new_data > self.m and r > (1.0 - self.qtile_target): | |
self.m += 1 | |
elif new_data < self.m and r > self.qtile_target: |
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
import math | |
import random | |
class Item(object): | |
def __init__(self, label, weight): | |
self.label = label | |
self.weight = weight | |
self.nonce = 0.0 |
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
# vim: set ai ts=4 expandtab: | |
# ::=========================================================================:: | |
cmake_minimum_required(VERSION 3.5 FATAL_ERROR) | |
# The following must be set BEFORE doing project() or enable_language(). | |
if (NOT CMAKE_BUILD_TYPE) | |
message(STATUS "No build type defined; defaulting to 'Debug'") | |
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING | |
"The type of build. Possible values are: Debug, Release, RelWithDebInfo and MinSizeRel.") |
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
import logging | |
import socket | |
from twisted.internet import abstract, address, interfaces, defer | |
from zope.interface import implementer | |
try: | |
import netfilterqueue | |
except: | |
netfilterqueue = 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
project(dhewm3) | |
cmake_minimum_required(VERSION 2.6) | |
# TODO | |
# osx: place game .dylib's in the bundle (next to the binary) | |
# osx: -weak_framework ? | |
# maybe add these as options: | |
# TARGET_MONO |
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 <stdlib.h> | |
#include <maxminddb.h> | |
int main(int argc, const char * argv[]) { | |
MMDB_s *mmdb = (MMDB_s *)malloc(sizeof(MMDB_s)); | |
MMDB_open("/tmp/GeoIP2-City_20160105/GeoIP2-City.mmdb", | |
MMDB_MODE_MMAP, mmdb); | |
int gai_error = 0; |
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
def read_absolute(conn, metric_name, start_time, end_time): | |
""" | |
:type conn: pyKairosDB.KairosDBConnection | |
:param conn: The connection to KairosDB | |
:type metric_name: string | |
:param metric_name: The name of the metric to query (graphite does one at a time, though KairosDB can do more) | |
:type start_time: float |
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
UP |
NewerOlder