Skip to content

Instantly share code, notes, and snippets.

View Thell's full-sized avatar

Thell 'Bo' Fowler Thell

  • Pyrapat Inc.
  • Arkansas, USA
View GitHub Profile
@Thell
Thell / SO-Meta-Q.md
Last active August 29, 2015 14:00
Community Imposed Answer Acceptance

Community Imposed Answer Acceptance

(For Abandoned Questions)

The Unanswered questions listings are a great place to find questions with some meat on their bones that take some time, thought, research and self-learning to answer, but the quantity of questions that build up which actually do have an answer makes finding those fun gems not so fun to find.

Sure, we have advanced search syntax, data.stackexchange queries and filtered questions but none of these stop the build up of abandoned and answered but unaccepted questions.

In the blog post Why Can’t I Accept My Own Answer? Jeff Atwood gives a great explanation of the spirit of accepting answers. Two pertinent quotes from that posting are...

@Thell
Thell / PandocMathTest.Rmd
Created April 9, 2014 23:57
Pandoc Mathjax Test Doc
---
title: "Pandoc MathTest"
author: "Thell"
date: "04/09/2014"
output:
html_document: default
pdf_document:
pandoc_args: --tex-escape-outer-math
---
---
title: "SO22524822"
author: "Thell"
date: "03/21/2014"
output: html_document
---
```{r setup}
# A killPrefix hook.
default_output_hook <- knitr::knit_hooks$get("output")
clang++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -I"/home/thell/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/include" -fpic -Wall -O3 -c RcppExports.cpp -o RcppExports.o
14
** libs
15
clang++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -I"/home/thell/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/include" -fpic -Wall -O3 -c RcppMultiPrecision.cpp -o RcppMultiPrecision.o
16
clang++ -shared -o RcppMultiPrecision.so RcppExports.o RcppMultiPrecision.o -lmpfr -lgmp -L/usr/lib/R/lib -lR
/***
*
* Scenario:
*
* You desire to use RCPP_EXPOSE_CLASS on a class and it needs to store
* a pointer to somewhere in a constructor initialized container either
* using the default initializer list or from within the constructor.
*
* Problem:
*
@Thell
Thell / SO11533438
Created February 28, 2014 05:03
SO rmd
_Why_ it is so slow? A little research located a mail group posting from a year ago this month where @hadley, the package author, [states][2]
> This is a drawback of the way that ddply always works with data
frames. It will be a bit faster if you use summarise instead of
data.frame (because data.frame is very slow), but I'm still thinking
about how to overcome this fundamental limitation of the ddply
approach.
---
@Thell
Thell / RCPP_EXPOSED_CLASS
Created February 27, 2014 01:20
Example of creation time for pre/post construction populated RCPP_EXPOSED_CLASS
// [[Rcpp::plugins("cpp11")]]
#include <RcppCommon.h>
class preVector;
RCPP_EXPOSED_CLASS(preVector)
class postVector;
RCPP_EXPOSED_CLASS(postVector)
// [[Rcpp::plugins("cpp11")]]
#include <ostream>
#include <iterator>
#include <RcppCommon.h>
class BadIter;
RCPP_EXPOSED_CLASS(BadIter)
#include <Rcpp.h>
@Thell
Thell / gist:8324791
Created January 8, 2014 21:14
Possible Wrapper to skip the last n lines of R read.csv
myread.csv <- function( file, header=TRUE, sep=",", quote="\"", dec=".", fill=TRUE, comment.char="", skip.footer=0, ... ) {
file <- readLines(file)
if( skip.footer > 0 ) file <- file[-(skip.footer)]
read.csv( file, header, sep, quote, dec, fill, comment.char, ... )
}
@Thell
Thell / Exmple.Rmd
Created June 20, 2013 23:59
R markdown to illustrate creation of in-document referencing for chunks, sections, pages, and such.
```{r setup, echo=FALSE, results='hide'}
chunkref <- local({
function(chunklabel) {
sprintf('[%s](#%s)', chunklabel, chunklabel )
}
})
secref <- local({
function(seclabel) {
sprintf('[%s](#%s)', seclabel, seclabel )