Skip to content

Instantly share code, notes, and snippets.

@jtbates
jtbates / keybase.md
Created October 10, 2019 20:57
keybase.md

Keybase proof

I hereby claim:

  • I am jtbates on github.
  • I am jtbates (https://keybase.io/jtbates) on keybase.
  • I have a public key ASByY364uU97m-MfzMHSnaLMFCkPo_lhiCtKXwWKKEYe5Qo

To claim this, I am signing this object:

@jtbates
jtbates / UnicodePoints.java
Created July 6, 2015 18:41
rJava incorrect handling of UTF-16 surrogate pairs
// Compile to jar file with:
// $ javac UnicodePoints.java
// $ jar cf UnicodePoints.jar UnicodePoints.class
class UnicodePoints {
public static String getAstonishedFace() {
return("\uD83D\uDE32");
}
public static String getBug() {
return("\uD83D\uDC1B");
}
@jtbates
jtbates / DD-1_-_DPR_-_9201_-_PAPUA_BARAT.csv
Last active August 29, 2015 14:02
Example Indonesian election results PDF and Tabula output
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 15. in line 1.
Model DD-1 DPRHalaman 1
NO,URAIAN,"",RINCIAN PEROLEHAN SUARA,"","","","","","","","","","",""
I.,DATA PEMILIH DAN PENGGUNAAN HAK PILIH,"",KABUPATENMANOKWARI,KOTASORONG,KABUPATENSORONG,KABUPATENRAJA AMPAT,KABUPATENSORSEL,KABUPATENTAMBRAUW,KABUPATENMAYBRAT,KABUPATENKAIMANA,KABUPATENFAKFAK,KABUPATENTEL. BINTUNI,KABUPATENTEL. WONDAMA,JUMLAH TOTAL
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
A.,DATA PEMILIH,"","","","","","","","","","","","",""
"",Jumlah pemilih terdaftar dalam Daftar Pemilih 1,LK,"92,285","85,714","47,495","20,790","18,099","11,909","14,569","19,437","25,723","27,811","13,040","376,872"
"",""
PR,"82,484","79,536","38,602","17,395","16,796","9,965","14,300","16,500","24,532","21,368","10,751","332,229"
"","",JML,"174,769","165,250","86,097","38,185","34,895","21,874","28,869","35,937","50,255","49,179","23,791","709,101"
"",Jumlah Pemilih terdaftar dalam Daftar Pemilih 2,LK,127,41,25,72,0,82,0,70,33,53,3,506
@jtbates
jtbates / 0_reuse_code.js
Created April 8, 2014 22:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jtbates
jtbates / json
Created April 12, 2012 02:57
Reloader errors
In [1]: import reloader
In [2]: reloader.enable()
In [3]: import json
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
/homes/jtbates/<ipython-input-3-6a72ae4a3c86> in <module>()
----> 1 import json