Skip to content

Instantly share code, notes, and snippets.

View cscherrer's full-sized avatar

Chad Scherrer cscherrer

View GitHub Profile
@cscherrer
cscherrer / diagnostics.txt
Created January 21, 2014 23:26
result of rstudio --run-diagnostics
21 Jan 2014 23:22:26 [rdesktop] ERROR R did not return any output when queried for directory location information; LOGGED FROM: bool core::r_util::<unnamed>::detectRLocationsUsingR(const std::string&, core::FilePath*, core::FilePath*, core::config_utils::Variables*, std::string*) /home/ubuntu/rstudio/src/cpp/core/r_util/REnvironmentPosix.cpp:483
Using R script: /usr/bin/R
Attempting to launch R session...
R_HOME=/usr/lib/R
R_DOC_DIR=/usr/share/R/doc
R_INCLUDE_DIR=/usr/share/R/include
R_SHARE_DIR=/usr/share/R/share
LD_LIBRARY_PATH=/usr/lib32::/usr/lib/R/lib:/lib:/usr/lib/x86_64-linux-gnu:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server:/usr/lib32
@cscherrer
cscherrer / cabal_upload.txt
Created August 8, 2014 17:21
Haddock trouble with Hackage
$ cabal upload -c -v3 fastbayes-0.1.0.0.tar.gz
Checking fastbayes-0.1.0.0.tar.gz...
POST http://hackage.haskell.org/cgi-bin/hackage-scripts/check-pkg HTTP/1.1
Content-Type: multipart/form-data; boundary=8886efd84c82b8
Content-Length: 3798
Accept: text/plain
Sending:
POST /cgi-bin/hackage-scripts/check-pkg HTTP/1.1

Keybase proof

I hereby claim:

  • I am cscherrer on github.
  • I am cscherrer (https://keybase.io/cscherrer) on keybase.
  • I have a public key whose fingerprint is 728F 27F0 9B71 C5BA D817 C1A6 8898 A111 C6C3 1E5A

To claim this, I am signing this object:

@cscherrer
cscherrer / ihaskell-log.txt
Created November 4, 2016 17:56
Log from stack build ihaskell-inline-r
This file has been truncated, but you can view the full file.
Version 1.1.3, Git revision 675f834b2ea46963206d48cd84ec19efa833040a (3735 commits) x86_64 hpack-0.14.0
2016-11-04 09:53:37.913628: [debug] Checking for project config at: /home/chad/git/monad-ppl/stack.yaml @(stack_0wyO5SXLQRo4g09I2zgdw7:Stack.Config src/Stack/Config.hs:823:9)
2016-11-04 09:53:37.914228: [debug] Loading project config file stack.yaml @(stack_0wyO5SXLQRo4g09I2zgdw7:Stack.Config src/Stack/Config.hs:841:13)
2016-11-04 09:53:37.917132: [debug] Checking whether stack was built with libgmp4 @(stack_0wyO5SXLQRo4g09I2zgdw7:Stack.Config src/Stack/Config.hs:327:5)
2016-11-04 09:53:37.917465: [debug] Run process: ldd /home/chad/.local/bin/stack @(stack_0wyO5SXLQRo4g09I2zgdw7:System.Process.Read src/System/Process/Read.hs:292:3)
2016-11-04 09:53:37.936395: [debug] Stack was not built with libgmp4 @(stack_0wyO5SXLQRo4g09I2zgdw7:Stack.Config src/Stack/Config.hs:331:14)
2016-11-04 09:53:37.936803: [debug] Trying to decode /home/chad/.stack/build-plan-cache/x86_64-linux/lts-6.23.cache @(stack_0wyO5SXLQRo4g0
fn topic_prior array(prob):
fn word_prior array(prob):
fn z array(nat):
fn w array(nat):
fn doc array(nat):
fn docUpdate nat:
array zNew丏 of size(topic_prior):
(product i from 0 to size(topic_prior):
product i丣 from 0 to size(word_prior):
product j from 0 to (summate i丙 from 0 to size(w):
@cscherrer
cscherrer / logreg.jl
Last active November 16, 2017 07:22
Max likelihood logistic regression using NLopt and ReverseDiff in Julia
using ReverseDiff: GradientConfig, gradient!
using Distributions
using NLopt
using StatsFuns
X = rand(MvNormal([1.0 0;0 1]),1000)'
α = [0.0]
β = [1.0,1.0]
y = rand.(Bernoulli.(logistic.(α[1] + X*β)))
@cscherrer
cscherrer / csvsplit.jl
Created December 4, 2017 22:58
Split a (possibly very large) CSV file into a file for each column, using Julia
# https://stackoverflow.com/questions/632475/regex-to-pick-commas-outside-of-quotes
comma = r"(,)(?=(?:[^\"]|\"[^\"]*\")*$)"
open(datafile) do csv
header = split(readline(csv),comma)
numCols = length(header)
outs=[open("$f.txt","w") for f in header]
while !eof(csv)
vals = split(readline(csv), comma)
foreach(zip(outs,vals)) do outval
@cscherrer
cscherrer / SourcePPL.jl
Created December 28, 2017 20:34
Probabilistic programming with source transformations, in Julia
using Distributions
using StatsFuns
using MacroTools
using MacroTools: postwalk
# A model is just a special kind of quoted expression:
myModel = quote
real(μ)
@cscherrer
cscherrer / gist:e728ac5bdb936066881c2a4ad7c68589
Created January 4, 2018 02:58
VS code error for Julia extension
```
INFO: Set{String}()
Error: Connection got disposed.
at Object.dispose (/home/chad/.vscode/extensions/julialang.language-julia-0.9.1/node_modules/vscode-jsonrpc/lib/main.js:825:25)
at Object.dispose (/home/chad/.vscode/extensions/julialang.language-julia-0.9.1/node_modules/vscode-languageclient/lib/client.js:57:35)
at LanguageClient.handleConnectionClosed (/home/chad/.vscode/extensions/julialang.language-julia-0.9.1/node_modules/vscode-languageclient/lib/client.js:1864:38)
at LanguageClient.handleConnectionClosed (/home/chad/.vscode/extensions/julialang.language-julia-0.9.1/node_modules/vscode-languageclient/lib/main.js:106:15)
at closeHandler (/home/chad/.vscode/extensions/julialang.language-julia-0.9.1/node_modules/vscode-languageclient/lib/client.js:1852:18)
at CallbackList.invoke (/home/chad/.vscode/extensions/julialang.language-julia-0.9.1/node_modules/vscode-jsonrpc/lib/events.js:71:39)
at Emitter.fire (/home/chad/.vscode/extensions/julialang.language-julia-0.9.1/node_modules/vscode-jsonrpc/li
Chads-MacBook-Pro:dscurriculum_beta chad$ git push origin master -v
Pushing to git@github.com:cscherrer/dscurriculum_beta.git
Counting objects: 118, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (37/37), done.
packet_write_wait: Connection to 192.30.255.112 port 22: Broken pipe
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly