I hereby claim:
- I am phil8192 on github.
- I am nocturneprotocol (https://keybase.io/nocturneprotocol) on keybase.
- I have a public key ASCiT1ji6I0BlJuM1vVjb0t9-YigzPiI8vZ2ymHjodcpQAo
To claim this, I am signing this object:
# 255 tints of red | |
red_tint <- function(v) as.hexmode(bitwOr(0xff0000, bitwOr(bitwShiftL(v, 8), v))) | |
cols <- paste0("#", red_tint(1:255)) | |
barplot(255:1, col=cols, border=cols) |
require 'sinatra' | |
require 'json' | |
post '/*' do | |
puts JSON.pretty_generate(JSON.parse(request.body.read)) | |
status 201 | |
end |
from theano import function, config, shared, sandbox | |
import theano.tensor as T | |
import numpy | |
import time | |
vlen = 10 * 30 * 768 # 10 x #cores x # threads per core | |
iters = 1000 | |
rng = numpy.random.RandomState(22) | |
x = shared(numpy.asarray(rng.rand(vlen), config.floatX)) |
oi <- c(0,1,0,0,-1,0,0,1,0,-1,0,0,0,0,0,1,0,0,0,-1,0,0,0) | |
cs <- cumsum(oi) | |
# ^-- map: 0 1 1 1 0 0 0 1 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 | |
# ^-- to: 0 1 1 1 0 0 0 2 2 0 0 0 0 0 0 3 3 3 3 0 0 0 0 | |
(rle.cumsum.trickery <- function(mask) { | |
rle1 <- rle(mask) | |
x <- rle1$values | |
rle1$values <- cumsum(x) * x | |
inverse.rle(rle1) |
##' cumulative sequence of sequence changes. | |
##' | |
##' assigns a cumulative sum to a sequential occurrence in a vector. | |
##' | |
##' @param x a vector containing sequences. | |
##' @return a vector containing change counts. | |
##' @author phil | |
##' @examples | |
##' | |
##' my.seq <- c(6, 6, 6, 20, 20, 5, 3, 3, 3, 3, 6, 6) |
# http://www.bgs.ac.uk/data/webservices/convertForm.cfm#convertToLatLng | |
import pyproj | |
x, y = (383772, 800512) | |
p1 = pyproj.Proj(init='EPSG:27700') | |
p2 = pyproj.Proj(init='EPSG:4326') | |
lng, lat = pyproj.transform(p1, p2, x, y) |
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
curl -s "https://www.buscms.com/api/REST/html/departureboard.aspx?clientid=CardiffBus&stopid=14302" \ | |
|sed 's/.*data-departureTime//; s/<.*//; s/.*>//' |
#!/bin/bash | |
## combine and clean logs ready for gource | |
## https://github.com/acaudwell/Gource/wiki/Visualizing-Multiple-Repositories | |
# user/org repo location | |
src="https://github.com/phil8192" | |
# some repos to combine... | |
repos=("ob-analytics" "limit-order-book" "shiny-ob-analytics" "tsp-java" \ | |
"ticker" "image-evolution" "tsp-lisp" "dithering-algorithms" \ |
#!/bin/bash | |
## make gource video from gource logfile. | |
# tmp output location. this example will need 13G free. | |
OUT_PPM="/mnt/raid/phil/out.ppm" | |
# result | |
OUT_MP4="dump.mp4" | |
# dump to $OUT_PPM | |
gource -1280x720 --camera-mode track --hide progress --output-ppm-stream $OUT_PPM \ |