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.
# Description: Boxstarter Script | |
# Author: Jess Frazelle <jess@linux.com> | |
# Last Updated: 2017-09-11 | |
# | |
# 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: |
if (process.version.startsWith("v6")) throw new Error("This Bot requires Node 7v+ because of async/await") | |
const Discord = require("discord.js") | |
const express = require("express") | |
const app = express() | |
const superagent = require("superagent") | |
//Config | |
let INVITE = process.env.INVITE || "", //An Infinite Invite to your discord server. | |
GUILD = process.env.GUILD || "", //The ID of the Guild for this invite ^ |
const Web3 = require('web3'); | |
const provider = new Web3.providers.HttpProvider('http://localhost:8549'); | |
const web3 = new Web3(provider); | |
let acc = web3.eth.accounts.create(); | |
let last = acc.address[acc.address.length-2]; | |
let last2 = acc.address.slice(acc.address.length - 2, acc.address.length ); | |
console.log(last2); | |
while(last2 != '00' ){ |
""" | |
Exports Issues from a list of specified repository to a CSV file | |
Credits go to https://gist.github.com/unbracketed/3380407#file-export_repo_issues_to_csv-py for the initial work, but I had to adjust it a bit | |
FYI: you need to install 'requests' before, best via pip: "$ sudo pip installs requests" | |
""" | |
import csv | |
import requests |
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): |
# Published on Docker Hub with above user alexellisio. | |
# If you want to rebuild your own copy, follow below instructions | |
# Build this on each type of machine so you have the correct CPU extensions. | |
FROM alexellisio/boostbase | |
RUN git clone -b Linux https://github.com/nicehash/nheqminer.git | |
RUN cd nheqminer/cpu_xenoncat/Linux/asm/ && sh assemble.sh && cd ../../../Linux_cmake/nheqminer_cpu && cmake . && make | |
ENTRYPOINT ["./nheqminer/Linux_cmake/nheqminer_cpu/nheqminer_cpu"] |
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.
// 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) |
db.votes.aggregate([{
$lookup: {
from: "users",
localField: "createdBy",
foreignField: "_id",