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
data { | |
int<lower=2> K; // num topics | |
int<lower=2> V; // num words | |
int<lower=1> M; // num docs | |
int<lower=1> N; // total word instances | |
int<lower=1,upper=V> w[N]; // word n | |
int<lower=1,upper=M> doc[N]; // doc ID for word n | |
vector<lower=0>[K] alpha; // topic prior | |
vector<lower=0>[V] beta; // word prior |
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 | |
# encoding: utf-8 | |
import sys | |
import os | |
def runProduct(fin,fout,generator,n): | |
for line in fin: | |
vals = line.split() | |
for term in generator: |
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 | |
# encoding: utf-8 | |
import sys | |
import os | |
def runProduct(fin,fout,generator,n): | |
for line in fin: | |
vals = line.split() | |
for term in generator: |
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
<?php | |
$find = array("findWord1", "findWord2"); | |
$replace = array("replaceWord1", "replaceWord2"); | |
// wouldn't suggest keeping the file in the same directory as being search | |
// so make the line below a string of an absolute folder location | |
$home = getcwd(); | |
$all = array(); | |
function bfs($path) { |
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
(* | |
Alex Beutel | |
July 23, 2009 | |
Simple script to show wagon-wheel effect / stroboscopic effect | |
for a propeller in terms of the y coordinate vs. time and | |
radians vs. time. Graphs both with varying "frame-rates." | |
*) | |
f1[x_] := Cos[x]; | |
f2[x_] := Cos[x + 2 \[Pi]/3]; | |
f3[x_] := Cos[x + 4 \[Pi]/3]; |
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
/* | |
This method adds a new menu to the top menu bar | |
string title - The title of the menu | |
hrefs - array of strings that contains the URLs for the menu items | |
links - text to be displayed for the link. if you would like a menu seperator, pass '<hr>' as the string | |
*/ | |
function buildAndInsertMenu(title, hrefs, links) | |
{ | |
var cond = title.replace(" ", "_"); | |
var menu = document.createElement('div'); |
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 | |
# encoding: utf-8 | |
import sys | |
import random | |
import os | |
def clearscreen(numlines=100): | |
if os.name == "posix": | |
# Unix/Linux/MacOS/BSD/etc |
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 | |
# encoding: utf-8 | |
import sys | |
import random | |
import os | |
def clearscreen(numlines=100): | |
if os.name == "posix": | |
# Unix/Linux/MacOS/BSD/etc |