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
replacelist <- list( | |
list(c("18-25 years"), "18-25"), | |
list(c("26-35","26-35 years", "26-45 years", "36-45", "36-45 years"), "26-45"), | |
list(c("46-65 years", "46-55", "56-65", "56-65 years"), "46-65"), | |
list(c("66 years or older","66-75", "66-75 years", "76 and over", "76-85", "76-85 years", "86 years or older"), "66 or older")) | |
for(e in replacelist) { | |
for(f in e[[1]]) { | |
db$age <- replacefact(db$age, f, e[[2]])}} |
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
ggplot(db[db$gender %in% c("Male", "Female"), ], | |
aes(x=course, fill=gender, stat="identity")) + | |
geom_bar(position="fill", width = .5) + | |
geom_bar(data=db,mapping=aes(x="All Courses",fill=gender)) + | |
labs(title="Gender distribution") + | |
coord_flip() + | |
scale_x_discrete(labels = course.titles) + | |
scale_y_continuous(labels = percent) |
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
2013-09-28 18:02:20.051 [NotebookApp] KernelRestarter: restarting kernel (1/5) | |
ERROR: Pkg2 not defined | |
in include at boot.jl:238 | |
in include_from_node1 at loading.jl:96 | |
in reload_path at loading.jl:121 | |
in require at loading.jl:50 | |
in include at boot.jl:238 | |
in include_from_node1 at loading.jl:96 | |
in include at boot.jl:238 |
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
macro whichs(ex) | |
ex = expand(ex) | |
exret = Expr(:call, :error, "expression is not a function call") | |
if !isa(ex, Expr) | |
# do nothing -> error | |
elseif ex.head == :call | |
exret = Expr(:call, :whichs, map(esc, ex.args)...) | |
elseif ex.head == :body | |
a1 = ex.args[1] | |
if isa(a1, Expr) && a1.head == :call |
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
PlotLikert <- function(var1, var2, ...) { | |
likert(data.frame | |
(t | |
(unclass | |
(prop.table | |
(table(var1, var2),2)))), ...) | |
} | |
reshape.likert <- function(x, factors=c("Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"), columns="ALL") { | |
row.names(x) <- NULL |
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
class Object | |
def add_safe(var,val) | |
if val.class == Fixnum | |
if self[var].nil? | |
self[var] = val | |
else | |
self[var] = self[var] + val | |
end | |
else |
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
Total words: 26463 | |
Total stems: 4719 | |
Stems occurring more than 10 times: 391 | |
Stems occuring more than 10 times represent 67.0% of the text | |
Top stems: | |
и 1292 | |
он 842 | |
не 645 |
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
-- | |
-- Sudoku solver using constraint propagation. The algorithm is by | |
-- Peter Norvig http://norvig.com/sudoku.html; the Haskell | |
-- implementation is by Manu and Daniel Fischer, and can be found on | |
-- the Haskell Wiki http://www.haskell.org/haskellwiki/Sudoku | |
-- | |
-- The Haskell wiki license applies to this code: | |
-- | |
-- Permission is hereby granted, free of charge, to any person obtaining | |
-- this work (the "Work"), to deal in the Work without restriction, |
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
(.py3) ~|⇒ cat ~/.ihaskell/ipython/bin/ipython | |
#!/Users/Stian/.py3/bin/python | |
# This script was automatically generated by setup.py | |
if __name__ == '__main__': | |
from IPython import start_ipython | |
start_ipython() |
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
Debugger entered--Lisp error: (error "el-get: make el-get could not build jedi [make requirements]") | |
signal(error ("el-get: make el-get could not build jedi [make requirements]")) | |
error("el-get: %s %s" "make" "el-get could not build jedi [make requirements]") | |
byte-code("\203\261@A\306 \307\"\306 \310\"\306 \311\"\312 | |
!\205\" |