Skip to content

Instantly share code, notes, and snippets.

Avatar

Thell 'Bo' Fowler Thell

  • Pyrapat Inc.
  • Arkansas, USA
View GitHub Profile
@Thell
Thell / rcpp_vs_rust_zeros.R
Created Dec 20, 2021
Benchmarking returning zero filled rcpp vs rextendr vector and matrix.
View rcpp_vs_rust_zeros.R
# compare rcpp and rust zero matrices performance to test wrap times.
library(microbenchmark)
Rcpp::sourceCpp(
code = '
#include <Rcpp.h>
using namespace Rcpp;
@Thell
Thell / example.pq
Last active Feb 7, 2021
An example of unpivoting multiple columns.
View example.pq
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText(
"bcxBCoAgFATQq8hf28L5p+gM4iLJoE1FtLDbl4INhLth/rzvvYzbnLJYOc60rNlc95Gc8cu+u9Br0W3116L7AW0brBf33iZTVsMXwag1Rg5iawsGMYhBDGIQo2IlVmIlVmIlVgnhAQ==",
BinaryEncoding.Base64
),
Compression.Deflate
)
@Thell
Thell / Basic-RStudio-WSL2-Install.md
Last active May 3, 2022
A very basic, no-frills, setup of RStudio on WSL2.
View Basic-RStudio-WSL2-Install.md

VERY Basic WSL2 RStudio Install

Begin with a plain Ubuntu distro from the Windows App Store. If one is already installed and you want to start from scratch simply:

wsl -t Ubuntu
wsl --unregister Ubuntu
Ubuntu
View as-overhead.cpp
// [[Rcpp::plugins(cpp11)]]
#include <Rcpp.h>
using namespace Rcpp;
// Rcpp containers
typedef Rcpp::NumericMatrix nm;
typedef Rcpp::NumericVector nv;
typedef Rcpp::IntegerMatrix im;
typedef Rcpp::IntegerVector iv;
typedef Rcpp::LogicalMatrix lm;
@Thell
Thell / apt-fast-progress.sh
Last active Mar 19, 2022
Aria2 rpc based progress monitor for apt-fast in non-interactive shells.
View apt-fast-progress.sh
#!/bin/sh
# Aria2 rpc based progress output for apt-fast
# trigger using --on-download-complete callback.
# Provide bytesNeeded in the parent environment...
# apturis=$(apt-get -qq --print-uris "$@")
# export DLLISTBYTES=$( echo "$apturis"| awk -F " " '{bytes+=$3} END{print bytes}' )
aria2_rpc () {
@Thell
Thell / MathjaxVer.Rmd
Created Aug 7, 2015
RStudio MathJax Version
View MathjaxVer.Rmd
---
output: html_document
---
### RStudio MathJax and the preview window/pane
When $MathJax$ is rendered it should be using
```{r}
Sys.getenv(x = "RMARKDOWN_MATHJAX_PATH")
@Thell
Thell / SpanError.md
Created Jun 22, 2015
Closing span tag parsing error.
View SpanError.md

\begin{equation*} 1 \end{equation*}

View testfn.Rmd
---
title: "testfn"
output: html_document
---
```{r knitr-setup, include=FALSE, echo=FALSE}
library(knitr)
```
```{r insert-fun, echo=FALSE}
@Thell
Thell / SO-Meta-Q.md
Last active Aug 29, 2015
Community Imposed Answer Acceptance
View SO-Meta-Q.md

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 Apr 9, 2014
Pandoc Mathjax Test Doc
View PandocMathTest.Rmd
---
title: "Pandoc MathTest"
author: "Thell"
date: "04/09/2014"
output:
html_document: default
pdf_document:
pandoc_args: --tex-escape-outer-math
---