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 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
# 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 math | |
import random | |
class Item(object): | |
def __init__(self, label, weight): | |
self.label = label | |
self.weight = weight | |
self.nonce = 0.0 |
OlderNewer