This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import wave | |
import numpy as np | |
import scipy as sp | |
WINSIZE=8192 | |
sound='sound.wav' | |
def read_signal(filename, winsize): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import scipy as sp | |
import numpy as np | |
import math | |
import optparse | |
import tempfile | |
import wave | |
from itertools import izip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Store = require('store-prototype'); | |
var UserStore = new Store(); | |
var users = {}; | |
var loaded = false; | |
UserStore.extend({ | |
loadUsers: function() { | |
loadUsersSomehow(function(err, results) { | |
users = results; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Obtain the latest version of the CMU dict from github | |
wget https://raw.githubusercontent.com/cmusphinx/cmudict/master/cmudict.dict -O cmudict.dict | |
# Get rid of the alternative pronunciation markers and normalize formatting | |
cat cmudict.dict | perl -e 'while (<>) { | |
chomp; | |
@_ = split (/\s+/); | |
$w = shift (@_); | |
$w =~ s/\([0-9]+\)//; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import re, math | |
def LoadPPLFile (pplfile) : | |
""" | |
Load up the salient info from a -debug 2 PPL file | |
generated by the SRILM ngram tool. | |
""" | |
ppl_info = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 2 ] | |
then | |
echo "USAGE: $0 <lexicon> <order>" | |
echo " Recommended: order=6~9 for English" | |
exit | |
fi | |
#Triage the lexicon a bit to overcome my poor design |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Play around with WCT scores using the .csv files from the ASP website. | |
Download the latest rankings in .csv format: | |
http://www.aspworldtour.com/rankings/asp-world-championship-tour-ranking | |
Run the parse-asp.py script with the .csv file: | |
$ ./parse-asp.py --csv wct.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- mode: python; coding: utf-8 -*- | |
from wsgiref.simple_server import make_server | |
from cgi import parse_qs, escape | |
import urllib, urllib2, cookielib, sqlite3, re | |
html = """ | |
<html> | |
<head> | |
<style type="text/css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void M2MFstAligner::expectation( ){ | |
for( int i=0; i<fsas.size(); i++ ){ | |
//Comput Forward and Backward probabilities | |
ShortestDistance( fsas.at(i), &alpha ); | |
ShortestDistance( fsas.at(i), &beta, true ); | |
//Compute the normalized Gamma probabilities and | |
// update our running tally | |
for( StateIterator<VectorFst<LogArc> > siter(fsas.at(i)); !siter.Done(); siter.Next() ){ | |
LogArc::StateId q = siter.Value(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
CSS markup customization for r/surfing - 2012 | |
Most of this CSS was cribbed from other subreddits or tutorials with | |
special mention going out to: | |
r/battlefield3, r/skyrim, r/fitness, and r/trees | |
Credit for the various images can be found below in the related | |
code blocks. | |
*/ |