Lower bound of Wilson score confidence interval for a Bernoulli parameter
All implementations use 95% probability.
pos
is the number of positive votes, n
is the total number of votes.
#!/usr/bin/env bash | |
# Generates gource video out of multiple repositories. | |
# First, get a local branch/clone of each repository. | |
# Then, pass the repositories as command line arguments. | |
# | |
# Example: | |
# $ gource-multiple-repositories.sh /path/to/repo1 /path/to/repo2 | |
################################ | |
gource commands | |
################################ | |
# basic command for big and long projects | |
gource --max-user-speed 500 --seconds-per-day 0.05 --file-idle-time 10 -e 0.005 -f --max-files 300 --hide-files | |
# some easy to understand commands | |
# for output file | |
--output-ppm-stream ~/ppm/ppm-kohana |
# mitmdump -s capture-graphql.py | |
import json | |
import re | |
from mitmproxy import http | |
def response(flow: http.HTTPFlow) -> None: | |
if flow.request.url.endswith('/graphql'): | |
payload = json.loads(flow.request.content.decode('utf-8')) | |
filename = re.sub(r'[^a-zA-Z0-9]', '_', payload['operationName']) + '.graphql.txt' |
<# | |
Before you execute this, run this in powershell to get notification script installed: | |
Install-Module -Name PoshNotify | |
#> | |
$LOG="$HOME/.myip" | |
# Update the log file and show a notification with the current IP | |
function Update() { |
# Install boxstarter: | |
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force | |
# | |
# You might need to set: Set-ExecutionPolicy RemoteSigned | |
# | |
# Run this boxstarter by calling the following from an **elevated** command-prompt: | |
# start http://boxstarter.org/package/nr/url?<URL-TO-RAW-GIST> | |
# OR | |
# Install-BoxstarterPackage -PackageName <URL-TO-RAW-GIST> -DisableReboots | |
# |
// Node.js implementation of Evan Miller's algorithm for ranking stuff based on upvotes: | |
// http://www.evanmiller.org/how-not-to-sort-by-average-rating.html | |
const stats = require('simple-statistics') | |
const lower_bound = (upvotes, n = 0, confidence = 0.95) => { | |
if (n === 0) return 0 | |
// for performance purposes you might consider memoize the calcuation for z | |
const z = stats.probit(1-(1-confidence)/2) |
Lower bound of Wilson score confidence interval for a Bernoulli parameter
All implementations use 95% probability.
pos
is the number of positive votes, n
is the total number of votes.
import discord | |
import asyncio | |
class Bot(discord.Client): | |
def __init__(self, token): | |
super().__init__() | |
self.token = token | |
print('%s->' % token, end='') | |
async def on_ready(self): |
OLDNAME=$(hostname) | |
hostnamectl set-hostname ${1} | |
mkdir -p /etc/pve/nodes/${1} | |
cp -a /etc/pve/nodes/${OLDNAME} /etc/pve/nodes/${1} | |
echo 'A reboot is required, Exit with CTRL-C' | |
read |
In February 2017, Google announced the availability GPU-based VMs. I spun up a few of these instances, and ran some benchmarks. Along the way, I wrote down the steps taken to provision these VM instances, and install relevant drivers.
Update April 2019: Updated instructions to use instances with the Tesla T4 GPUs.