Skip to content

Instantly share code, notes, and snippets.

library(RJSONIO, quietly =TRUE)
goOn <- TRUE
while(goOn){
jIn <- scan('stdin',
'',
n=1,
quiet=TRUE,
sep="\n")
@wactbprot
wactbprot / r-json-iso
Created June 14, 2011 19:35
R JSON isomorphism implemented by RJSONIO v0.7-2 & v0.7-3
digraph g {
size="46.8,33.2!" landscape=false
overlap=false splines=true
label="RJSONIO \nv0.7-2 & v0.7-3"
graph [
rankdir = "LR"
];
node [
fontsize = "12"
@wactbprot
wactbprot / readF.R
Created January 26, 2012 10:02
low level readLines
path <- "../data/"
setwd(path)
ff <- list.files(pattern="^.*\\.txt$")
dat <- list()
l <- 1
for(i in 1:length(ff)){
datName <- ff[i]
a <- readLines(datName)
#Beginn der Rechenzeit
#t1 <- proc.time()[3]
#Namen der einzulesenden Dateien
Dateinamen <- list.files()
#Einlesen der ersten Datei
rec <- read.csv(Dateinamen[1], sep = "\t", header =TRUE, quote="", row.names = NULL, as.is=TRUE)
#Schleife zum Einlesen der restlichen Dateien
@wactbprot
wactbprot / coloRs
Last active August 28, 2020 19:37
R and colors from another dimension
n <- 200
np <- n*pi
x <- 1:n
y <- cos(x/np)
z <- sin(x/np)
zp <- z - min(z)
zpp <- zp/max(zp)
cf <- colorRampPalette(c("blue","yellow","red"))
@wactbprot
wactbprot / markdown.emacs.install
Created March 4, 2013 20:35
install markdown mode 4 emacs
;; wactbprot@alpha60:~> cd .emacs.d
;; wactbprot@alpha60:~> git clone git://jblevins.org/git/markdown-mode.git
;; in ~/.emacs say:
(add-to-list 'load-path "~/.emacs.d/markdown-mode")
(autoload 'markdown-mode "markdown-mode"
"Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
@wactbprot
wactbprot / uncert_geo_vol
Created June 12, 2013 13:07
play around --> persp()
remvalue(all);
v1 : %pi*r1^2*h1;
v2 : %pi*r2^2*h2;
v3 : %pi*r3^2*h3;
V : 2*v1 + v2 + 2*v3;
sr1 : diff(V, r1);
@wactbprot
wactbprot / couch-r.md
Last active August 29, 2015 14:05
wiki txt
@wactbprot
wactbprot / min-mocha-cb-example.js
Created August 14, 2014 12:49
min assert test
var assert = require("assert");
var db_op = function(cb){
setTimeout(function(){
cb();
}, 1000)
};
var c = function(cb){
for(var i = 0; i < 10; i++){
@wactbprot
wactbprot / test.fail.js
Created December 14, 2014 10:29
failing testes crash nodejs if executed inside a ndata callback
var _ = require("underscore")
, ndata = require('../index')
, assert = require('assert')
, conf = {port: 9003}
, server
, client;
describe('ndata#known to fail', function () {