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
# These problems are current as of | |
# commit fe93b8ae11c43f8e33cb0252a25d260a769d4ded in ggplot2 | |
# A data frame with four levels of 'g' | |
dat2 <- data.frame(x=factor(1:5), | |
y=3, | |
g=c("B","A","C","D","D")) | |
p2 <- ggplot(dat2, aes(x=x,y=y,fill=g)) + geom_bar() |
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(granovaGG) | |
# Explicitly printing four plots per page | |
pdf(file="~/Desktop/BrianTest1.pdf", onefile = TRUE) | |
data(rat) | |
fake.contrasts <- matrix(c(1, 1, 1, -1, -1, -1, -1, 1, 0, -1, 1, 0, 1, 1, -2, | |
1, 1, -2, -1, 1, 0, 1, -1, 0, 1, 1, -2, -1, -1, 2), ncol = 5) | |
fake.contrasts <- fake.contrasts[ ,1:3] | |
granovagg.contr(data = rat[ ,1], |
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
foo <- function(..., values) { | |
return(values) | |
} | |
bar <- function(values, ...) { | |
return(values) | |
} | |
# foo() will fail to match on "values" and claim there's no default | |
foo(value = "red") |
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
#!/bin/bash | |
D=`date +%Y%m%d%H%M%S` # store the current system-clock as a date-stamp, down to the second | |
branch=`git status|grep -ie 'on branch master'` | |
if [ -z "$branch" ]; then # if the length of the string in variable "branch" is zero; | |
# or, in other words, if you're not on the master branch | |
cat DESCRIPTION | sed -e 's/^\(Version: [0-9]*\.[0-9]*\).*/\1.'$D'/' > DESCRIPTION.temp # cat the DESCRIPTION | |
# match on the version number | |
# append the full datestamp to the matched version number |
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
test<-data.frame(a=c(2,2,2,4,4,4,4,6,6,6,6,6,6,8,8,8,10,10,10,10,10,10,10),Pre=c(100,110,90,100,120,130,170,150,150,120,140,150,120,90,90,100,40,50,40,40,20,60,30),Post=c(b-15)) | |
testMelt <- melt( | |
test, | |
id = c("a"), | |
measured = c("Pre", "Post") | |
) | |
p <- ggplot( |
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
# This gives a short-hash (%h), a simple date, and just the subject line of the commit | |
git log --format="%h | %ad | %s" --date=short | |
# an alternative, which omits the date | |
git log --oneline | |
# the standard git log, which usually has way too much information to be useful | |
git log |
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
(define (my-length lst) | |
(cond | |
[(empty? lst) 0] | |
[else (+ 1 (my-length (rest lst)))])) |
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
int main () | |
{ | |
// Do stuff | |
} | |
int main () { | |
// Do Stuff | |
} |
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
static OSStatus | |
SSLVerifySignedServerKeyExchange(SSLContext *ctx, bool isRsa, SSLBuffer signedParams, | |
uint8_t *signature, UInt16 signatureLen) | |
{ | |
OSStatus err; | |
... | |
if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0) | |
goto fail; | |
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) |
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
{"pages": [ {"playerName": "Boris", | |
"livesLeft": 1}, | |
{"playerName": "Anna", | |
"livesLeft": 1} ], | |
"items": ["broadsword", "healingPotion", "mirrorShield"] | |
"timestamp": 12593829349045 } | |