I hereby claim:
- I am ajakubek on github.
- I am ajakubek (https://keybase.io/ajakubek) on keybase.
- I have a public key whose fingerprint is 141A 9FFB B8B0 7F5B C564 1B59 53C6 3FF3 5CDA FFD9
To claim this, I am signing this object:
#!/usr/bin/env python | |
# The algorithms implemented in this module are based on the following article: | |
# D. Lemire, O. Kaser, and N. Kurz, Faster Remainder by Direct Computation, 2018. | |
import math | |
def div(value, reciprocal, fractional_bits): | |
return (value * reciprocal) >> fractional_bits |
M. J. Feigenbaum 19.12.1944 - 30.06.2019<br><canvas id=c width=640 height=400><script>c=document.getElementById('c').getContext('2d');c.fillStyle='rgba(0,0,0,.1)';g=Math.random | |
for(i=1e6;--i;){r=g()*1.6+2.4;x=g();for(s=99;--s;)x*=r-r*x;c.fillRect(r*400-960,x*400,1,1)}</script> |
#include <iostream> | |
#include <signal.h> | |
#include "signal_guard.hpp" | |
int main() | |
{ | |
signal_guard sg(SIGINT); |
I hereby claim:
To claim this, I am signing this object:
#ifndef PRODUCT_ITERATOR_H | |
#define PRODUCT_ITERATOR_H | |
#include <cassert> | |
#include <iterator> | |
#include <tuple> | |
#include <utility> | |
template <typename Iterator1, typename Iterator2> | |
class product_iterator |
I hereby claim:
To claim this, I am signing this object:
<?php | |
const RAND_MULTIPLE = 4; | |
$histogram = array_fill(0, getrandmax() * RAND_MULTIPLE, 0); | |
for ($i = 0; $i < 10000000; ++$i) | |
{ | |
$rnd = rand(0, getrandmax() * RAND_MULTIPLE); | |
++$histogram[$rnd]; |
commit 6e59bfbc45983b8680f023ac07a34cabe80985e5 | |
Author: Adam Jakubek <[email protected]> | |
Date: Mon Aug 13 01:24:39 2012 +0200 | |
Prevent focus stealing when opening diverted URLs | |
This patch allows to override current Chrome's behavior, where opening a | |
link from an external application (e.g. mail client) causes Chrome's | |
window to steal focus. | |
It works by introducing a new command line switch |
import math | |
from optparse import OptionParser | |
from PIL import Image | |
def entropy(img): | |
hist = img.histogram() | |
total_prob = sum(hist) | |
probs = [float(x) / total_prob for x in hist] | |
return -sum([p * math.log(p) for p in probs if p != 0]) |
"""Given a set of N numbers (operands) and a M binary operators, | |
finds all N-ary expressions evaluating to specified target value. | |
See this fragment of the Countdown TV show for a sample problem: | |
http://www.youtube.com/watch?v=EO472qM6M9g""" | |
import itertools | |
import sys | |
class Leaf: | |
def __init__(self): |