Skip to content

Instantly share code, notes, and snippets.

@bluetyson
bluetyson / unzip.pl
Created July 30, 2018 23:54 — forked from eqhmcow/unzip.pl
Perl unzip example with IO::Uncompress::Unzip
#!/usr/bin/perl
# example perl code, this may not actually run without tweaking, especially on Windows
use strict;
use warnings;
=pod
IO::Uncompress::Unzip works great to process zip files; but, it doesn't include a routine to actually
extract an entire zip file.
@bluetyson
bluetyson / 00.README.md
Created June 29, 2018 04:54 — forked from rmoff/00.README.md
RMarkdown - repeating child block with changing variable value

When you use knit_expand it appears that the inclusion of the Rmd is done on the first pass, and then the complete document evaluated. This means that a Rmd block referenced in loop with knit_expand will only evaluate changing variables at their last value.

This can be worked around by passing the literal value of the variable at the time of the knit_expand with {{var}} syntax.

This is documented in the knitr_expand docs, but less clear (to an R noob like me) for embedded documents rather than strings.

@bluetyson
bluetyson / ggiraphloop.R
Last active June 29, 2018 01:28
idea for ggplot htmlwidget interactive loop
#how to output a list of interactive ggplots . e.g. so can click on a bar and something happens..basics.. a loop of basic ggplots will output, but not the ggiraph version
x <- 0
for(i in unique(checkfiles$Volume)){
x <- x + 1
plotserieslines3 <- function(yvar){
data <- subset(checkfiles, Volume == i)
@bluetyson
bluetyson / elasticsearch-example.js
Created September 13, 2017 13:12 — forked from StephanHoyer/elasticsearch-example.js
Simple example how to use elastic search with node.js
'use strict';
var elasticsearch = require('elasticsearch');
var Promise = require('bluebird');
var log = console.log.bind(console);
var client = new elasticsearch.Client({
host: 'localhost:9200',
log: 'trace'
from pylab import *
from numpy import *
from numpy.linalg import solve
from scipy.integrate import odeint
from scipy.stats import norm, uniform, beta
from scipy.special import jacobi
a = 0.0
from pylab import *
from numpy import *
from numpy.linalg import solve
from scipy.integrate import odeint
from scipy.stats import norm, uniform, beta
from scipy.special import jacobi
a = 0.0
b = 3.0
theta=1.0
@bluetyson
bluetyson / min-char-rnn.py
Created June 30, 2017 02:26 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)