Skip to content

Instantly share code, notes, and snippets.

@SymbolixAU
SymbolixAU / RecyclerViewAdapter.java
Created September 18, 2016 21:16 — forked from slidenerd/RecyclerViewAdapter.java
A single adapter that supports Cursor + an optional header + optional footer
import android.database.Cursor;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
public abstract class RecyclerCursorAdapter<U, V extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements OnSwipeListener {
//The number of headers to be displayed by default if child classes want a header
public static final int HEADER_COUNT = 1;
//The number of footers to be displated by default if child classes want a footer
@SymbolixAU
SymbolixAU / stemCompletion.R
Last active February 15, 2018 04:50
debugging the `tm::stemCompletion` function
## Identifying the differences between using a Corpus dictionary, and a vector of strings.
## ---------
## Using a Corpus dictionary
## and type == "prevalent"
tm::stemCompletion(x = stemDocument(w),
dictionary = Corpus(x = VectorSource(x = w)),
type = "prevalent")
# intersect intersect intersect intersect
@SymbolixAU
SymbolixAU / distance_benchmarks.R
Last active September 22, 2020 05:52
benchmarks for distance calculations
library(data.table)
library(dplyr)
library(sp)
library(rgeos)
library(UScensus2000tract)
library(geosphere)
library(geodist)