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
# Override default parameters in R from command line with 4 lines of code (the numbered lines) | |
# Run from command line: | |
# R --slave -f demo.r --args p.success=0.9 num.of.tests=1000 | |
# R --slave -f demo.r --args p.success=0.5 num.of.tests=10000 | |
# R --slave -f demo.r --args p.success=0.3 num.of.tests=10 | |
# | |
# Created 29/10/12 by Yoav Ram (www.yoavram.com), licenced under the WTFPL free software license | |
# default parameter values | |
num.of.tests <- 100 |
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
\documentclass[10pt,$if(lang)$$lang$,$endif$]{article} | |
\usepackage[T1]{fontenc} | |
\usepackage{lmodern} | |
\usepackage{amssymb,amsmath} | |
\usepackage{ifxetex,ifluatex} | |
\usepackage{fixltx2e} % provides \textsubscript | |
% use microtype if available | |
\IfFileExists{microtype.sty}{\usepackage{microtype}}{} | |
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex | |
\usepackage[utf8]{inputenc} |
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
bits.to.uint <- function(bits) { | |
s=0 | |
for (i in 1:length(bits)) { | |
s = s + 2^(i-1) * bits[i] | |
} | |
return(s) | |
} | |
cat(bits.to.uint( c(0,1,1,0,0) ) == 6) | |
cat(bits.to.uint( c(0,1,0,0,1) ) == 18 ) |
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
library(shiny) # http://rstudio.github.com/shiny/tutorial/#hello-shiny | |
library(Rgraphviz) # http://www.bioconductor.org/packages/2.11/bioc/html/Rgraphviz.html | |
shinyServer(function(input, output) { | |
output$graphPlot <- reactivePlot(function() { | |
g <- randomGraph(1:input$V, 1:input$M, input$p) | |
plot(g) | |
}) | |
}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
<html> | |
<head> | |
<!-- LaTeX support--> | |
<!--extensions: ["tex2jax.js"], | |
jax: ["input/TeX", "output/HTML-CSS"], | |
tex2jax: { | |
inlineMath: [ ['$','$'], ["\\(","\\)"] ], | |
displayMath: [ ['$$','$$'], ["\\[","\\]"] ], | |
processEscapes: true | |
},--> |
% Creating PDFs with Pandoc % Yoav Ram % 2012-12-16 11:36:00 +2
This post will show how to convert a [Markdown] document to PDF, mobile-PDF and EPUB documents using [Pandoc].
The guide is not exhastive but rather a walkthrough of my own experiments. The mobile-PDF especially is lacking - it is based on somewhat advanced
The source [Markdown] file use for this post, [creating-pdfs-with-pandoc.md], is available as a gist.
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
import requests | |
#http://docs.python-requests.org/en/latest/user/quickstart/#post-a-multipart-encoded-file | |
url = "http://localhost:5000/" | |
fin = open('simple_table.pdf', 'rb') | |
files = {'file': fin} | |
try: | |
r = requests.post(url, files=files) | |
print r.text |