Skip to content

Instantly share code, notes, and snippets.

View William-Lake's full-sized avatar

William Lake William-Lake

  • State of Montana
View GitHub Profile
@selfsame
selfsame / rnn.py
Created September 19, 2018 19:26
textgenrnn utility scrips
import sys, os, re
import pprint
from util import *
import re
from textgenrnn import textgenrnn
textgen = textgenrnn()
def gen(cnt="10", temp="1.0"):
textgen.generate(int(cnt), temperature=float(temp))
@pratos
pratos / condaenv.txt
Created November 30, 2016 07:01
To package a conda environment (Requirement.txt and virtual environment)
# For Windows users# Note: <> denotes changes to be made
#Create a conda environment
conda create --name <environment-name> python=<version:2.7/3.5>
#To create a requirements.txt file:
conda list #Gives you list of packages used for the environment
conda list -e > requirements.txt #Save all the info about packages to your folder
@kristopherjohnson
kristopherjohnson / noise.sh
Last active February 27, 2025 19:25
Generate Brown Noise, White Noise, or Pink Noise using SoX (http://sox.sourceforge.net)
# Requires SoX
#
# On OS X, using Homebrew: brew install sox
alias brownnoise='play -c 2 -n synth brownnoise'
alias whitenoise='play -c 2 -n synth whitenoise'
alias pinknoise='play -c 2 -n synth pinknoise'
@hanleybrand
hanleybrand / java_String_hashcode.py
Last active November 20, 2022 18:09
python function that produces the same result as java's String.hashCode() found at http://garage.pimentech.net/libcommonPython_src_python_libcommon_javastringhashcode/
def java_string_hashcode(s):
h = 0
for c in s:
h = (31 * h + ord(c)) & 0xFFFFFFFF
return ((h + 0x80000000) & 0xFFFFFFFF) - 0x80000000