I hereby claim:
- I am glesica on github.
- I am glesica (https://keybase.io/glesica) on keybase.
- I have a public key whose fingerprint is 4378 8FCD 8E05 A920 2EA7 71DE E23B F398 FEBF A545
To claim this, I am signing this object:
convolution <- function(A, B) { | |
# Computes the convolution of two vectors. | |
# | |
# Args: | |
# A, B: column vectors representing polynomial coefficients. | |
# | |
# Returns: | |
# The coefficient vector resulting from multiplying the polynomial | |
# represented by A by the polynomial represented by B. | |
Ap <- c(A, B*0) |
#!/usr/bin/env sh | |
# Filename: update-hosts.sh | |
# Author: George Lesica <george@lesica.com> | |
# Description: Replaces the HOSTS file with a customized version that blocks | |
# domains that serve ads and malicious software, creating a backup of the old | |
# file. | |
HOSTS_URL="http://someonewhocares.org/hosts/zero/hosts" | |
NEW_HOSTS="hosts" |
from math import pi | |
from cairo import SVGSurface, Context, Matrix | |
WIDTH = 6 * 72 | |
HEIGHT = 4 * 72 | |
s = SVGSurface('example1.svg', WIDTH, HEIGHT) | |
c = Context(s) | |
# Transform to normal cartesian coordinate system |
import sys | |
import time | |
from cmsketch import CMSketch | |
RECEIVED = 1000000 | |
EVENTS = 1000 | |
if len(sys.argv) != 3: | |
print("usage: benchmark.py <error> <prob>") |
# Switch Go (swgo) | |
# A very simple and intensely opinionated Go version manager. | |
# | |
# Author: George Lesica <george@lesica.com> | |
# | |
# To use, create a file called ".swgo" in any project directory. | |
# Inside of this file, set two variables: GOROOT_ and GOPATH_ | |
# to the values you want assigned to GOROOT and GOPATH, | |
# respectively. Then, while in that directory, just run "swgo" | |
# and your GOROOT, GOPATH, and PATH will be updated accordingly. |
#!/bin/sh | |
sudo apt-get install libharfbuzz-dev libfreetype6-dev libfontconfig-dev lua5.1 lua-lpeg-dev lua-expat-dev lua-zlib-dev lua-filesystem-dev liblua5.1-0-dev |
I hereby claim:
To claim this, I am signing this object:
""" | |
Contouring using the Marching Squares algorithm. | |
George Lesica | |
""" | |
from cairo import SVGSurface, Context | |
WIDTH = 8 * 72.0 | |
HEIGHT = 8 * 72.0 |
# contour(A, v) | |
# Implements the Marching Squares contouring algorithm (see: | |
# https://en.wikipedia.org/wiki/Marching_squares for details). The | |
# matrix `A` is an m x n scalar field and the scalar `v` is the | |
# value to be contoured. The return value is an (m-1) x (n-1) matrix | |
# of contour line type indices (see the Wikipedia article). | |
# TODO: Implement in parallel | |
function contour(A, v) | |
rows, cols = size(A) |
sentiment <- function(str, words, weights=NULL) { | |
if (is.null(weights)) { | |
weights <- rep(1, length(words)) | |
} | |
if (length(words) != length(weights)) { | |
stop('Length of words and weights not equal') | |
} | |
str.wts <- rep(0, length(str)) |