Skip to content

Instantly share code, notes, and snippets.

View dginev's full-sized avatar

Deyan Ginev dginev

View GitHub Profile
@dginev
dginev / node_name_statistics.yml
Last active October 17, 2016 13:38
XML node statistics for the arXMLiv dataset (04.2016)
# XML Node name statistics over 966,801 HTML5 documents generated from arXiv.org TeX sources
# (04.2016 arXMLiv dataset, via LaTeXML 0.8.2)
# Note: <math> and <table> elements were not descended into.
math: 325529684
span: 238605102
p: 87329226
a: 86993142
div: 71187890
table: 35720100
@dginev
dginev / siunits_sources.csv
Created October 26, 2016 12:39
siunits.sty and siuntx.sty arXiv sources (cortex.mathweb.org server)
We can't make this file beautiful and searchable because it's too large.
/arXMLiv/modern/1411/1411.5916/1411.5916.zip
/arXMLiv/modern/1607/1607.00946/1607.00946.zip
/arXMLiv/modern/1507/1507.04203/1507.04203.zip
/arXMLiv/modern/1205/1205.4815/1205.4815.zip
/arXMLiv/modern/1601/1601.03649/1601.03649.zip
/arXMLiv/modern/151
@dginev
dginev / annual_conversion_status.csv
Last active September 18, 2018 20:55
Status report for LaTeXML 0.8.2 run over arXiv upto 10.2016 (in CorTeX)
Year Fatal Errors Warnings No Problems
1991 49 83 152 20
1992 306 1194 1510 222
1993 515 1747 3588 579
1994 593 2127 5326 903
1995 552 2347 6972 1207
1996 775 4171 8632 1732
1997 914 5590 10588 2164
1998 1154 7120 12509 2805
1999 1355 7877 14318 3346
@dginev
dginev / baby_conversion_bench.md
Last active December 17, 2016 08:00
A tiny benchmark example, comparing TeX -> HTML renderers

Example:

\documentclass{article}
\newcommand\world{World}
\newcommand\newworld{New \world}
\begin{document}
Hello \newworld!
\end{document}
@dginev
dginev / annual_missing_files.csv
Last active December 22, 2016 08:06
annual missing_file warnings in arXMLiv
We can't make this file beautiful and searchable because it's too large.
Year,Missing File ,Count
2015,revtex4-1 ,12459
2016,revtex4-1 ,11413
2014,revtex4-1 ,10434
2013,revtex4-1 ,8762
2012,revtex4-1 ,7307
2015,xy ,5720
2011,revtex4-1 ,5661
2014,xy ,5144
2016,enumitem ,4736
@dginev
dginev / new.rs
Last active December 31, 2016 11:20
Rust vs Perl binding syntax example for latexml (12.2016, intermediate)
use package::*;
pub fn load_definitions(state: &mut State) {
SetupBindingMacros!(state);
DefEnvironment!("{alltt}", "<ltx:verbatim font='#font'>#body</ltx:verbatim>",
before_digest => sub!(|stomach, state| {
for c in &['$', '&', '#', '^', '_', '%', '~'] {
AssignCatcode!(*c, Catcode::OTHER, None, state);
}
@dginev
dginev / break_a_forEach.jsx
Created February 7, 2017 15:16
You can't use break inside of .forEach?!
try {
someArray.forEach((content, index) => {
// do stuff with content
if (breaking_condition) {
throw "Table"; // breaks forEach (╯°□°)╯︵ ┻━┻)
}
})
} catch (e) {
// short-circuited forEach ┬──┬◡ノ(°-°ノ)
}
@dginev
dginev / greek.tex
Created October 12, 2017 19:19
Babel locale activation example
\documentclass{article}
\usepackage[greek,english]{babel}
\usepackage[utf8]{inputenc}
\begin{document}
This works well: \selectlanguage{greek}αβγ\selectlanguage{english},
this not so much: αβγ
\end{document}
@dginev
dginev / update-limit.rs
Last active May 21, 2019 07:31
UPDATE with LIMIT (in postgresql) with diesel.rs ?
use diesel::result::Error;
use diesel::{delete, insert_into, update};
use diesel::pg::PgConnection;
use diesel::prelude::*;
use schema::tasks;
use schema::tasks::dsl::{serviceid, status};
//...
let q = update(tasks::table
.filter(serviceid.eq(service.id))