static class SnippetDB {
static List<S> fields;
static List<List<S>> rows;
*() {}
*(S snippetIDOfGzippedMysqlDump) {
importMySQLDump(gunzipToText(snippetIDOfGzippedMysqlDump));
}
void importMySQLDump(String dump) {
System.out.println("Importing " + dump.length() + " chars.");
Class importer = hotwire("#1000660");
set(importer, "in", dump);
callMain(importer);
Map<String, List> tables = (Map) get(importer, "tables");
Map<String, List> tableFields = (Map) get(importer, "tableFields");
fields = tableFields.get("snippets_public");
rows = tables.get("snippets_public");
}
S getField(List<S> row, S field) {
int i = fields.indexOf(field);
return i < 0 ? null : row.get(i);
}
List<List<S>> rowsOrderedBy(S field) {
final int i = fields.indexOf(field);
List<List<S>> list = new ArrayList<List<S>>(rows);
sort(list, new Comparator<List<S>>() {
public int compare(List<S> rowA, List<S> rowB) {
S a = rowA.get(i), b = rowB.get(i);
return a.compareTo(b);
}
});
return list;
}
public void finalize() {
System.err.println("Note: SnippetDB released from memory.");
}
}Began life as a copy of #1000678
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment