This file contains hidden or 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
g := Module[{str, lis, numScores = 12}, | |
str = InputString[]; | |
lis = ToExpression[StringSplit[str, "+"]]; | |
If[Length[lis] != numScores, | |
Beep[]; | |
Print[lis]; | |
Speak["Length is " <> ToString[Length[lis]]], | |
Speak[Total[ToExpression[StringSplit[str, "+"]]]]; | |
Print[Total[ToExpression[StringSplit[str, "+"]]]]; | |
] |
This file contains hidden or 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
\begin{align*} | |
\text{minimize}\qquad & $1 \\\\ | |
\text{subject to}\qquad & $2 \\\\ | |
&x_{i}\geq 0, \qquad i=1,...,n. | |
\end{align*} |
This file contains hidden or 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
\begin{align*} | |
\text{minimize}\qquad & $1 \\\\ | |
\text{subject to}\qquad & $2 \\\\ | |
&x_{i}\geq 0, \qquad i=1,...,n. | |
\end{align*} |
This file contains hidden or 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
#install.packages("catnet",71) | |
library(catnet) | |
## Build network | |
cnet <- cnNew(nodes = c("S", "L", "F", "T", "C"), cats = list(c("winter", "spring", "summer","fall"), | |
c("NA","SA"), c("salmon","bass"), c("wide","thin"), c("light","medium","dark")), | |
parents = list(NULL, NULL, c(1,2),c(3),c(3)), probs = | |
list( | |
c(.1,.2,.5,.2), | |
c(0.6, 0.4), |
This file contains hidden or 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
nom0039665aru:code tdhopper$ sudo pip install matplotlib --upgrade | |
Downloading/unpacking matplotlib | |
Downloading matplotlib-1.1.0.tar.gz (9.2Mb): 9.2Mb downloaded | |
Running setup.py egg_info for package matplotlib | |
basedirlist is: [] | |
============================================================================ | |
BUILDING MATPLOTLIB | |
matplotlib: 1.1.0 | |
python: 2.7.1 (r271:86832, Jun 25 2011, 05:09:01) [GCC | |
4.2.1 (Based on Apple Inc. build 5658) (LLVM build |
This file contains hidden or 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
from multiprocessing import Pool | |
from scipy.stats import uniform | |
def unwrap_self_f(arg, **kwarg): | |
return C.f(*arg, **kwarg) | |
class C: | |
def __init__(self, x = []): | |
self.x = x | |
This file contains hidden or 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
ListPlot[Table[ | |
Mean[Table[ | |
Norm[RandomReal[1, dim] - RandomReal[1, dim]], {x, 1000}]], {dim, | |
2, 20}]] |
This file contains hidden or 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
f = open('ydata-ysm-advertiser-bids-v1_0.txt', 'r') | |
for x in f.readlines(): | |
with open("split/" + x.split()[0].replace("/","") + ".csv", "a+") as out: | |
out.write(", ".join(x.split())) | |
out.write("\n") | |
This file contains hidden or 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
f = open('ydata-ysm-advertiser-bids-v1_0.txt', 'r') | |
for x in f.xreadlines(): | |
with open("split/" + x.split()[0].replace("/","") + ".csv", "a+") as out: | |
out.write(", ".join(x.split())) | |
out.write("\n") |
This file contains hidden or 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
ggplot(noah.most.frequent.phrase[noah.most.frequent.phrase$user %in% users[1:10],])+ | |
aes(x=day, y=bid, color=factor(user))+geom_jitter(alpha=0.9) | |
ggplot(noah[noah$user==users[1],])+ | |
aes(x=day, y=bid, color=phrase)+geom_jitter() | |
qplot(log(key.phrase.counts), geom="histogram") | |
ggplot(noah[noah$phrase==most.frequent.phrase,])+aes(x=user, y=bid, color=clicks.zero, shape=position.one)+geom_jitter(alpha=0.7, size=10, width=0.5, height=0) | |
ggplot(noah[noah$phrase==most.frequent.phrase,])+aes(x=day, y=bid, color=clicks.zero, shape=position.one)+geom_jitter(alpha=0.7, size=2, width=0.5, height=0) | |
ggplot(noah[noah$phrase==most.frequent.phrase,])+aes(x=bid, y=position)+geom_jitter(alpha=0.7, size=2) |
OlderNewer