Skip to content

Instantly share code, notes, and snippets.

// Stolen from http://bjoern.hoehrmann.de/utf-8/decoder/dfa/
const UTF8_ACCEPT=0;
const UTF8_REJECT=1;
const utf8d: array[0..399] of Byte = (
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 00..1f
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 20..3f
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 40..5f
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 60..7f
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, // 80..9f
@svip
svip / gist:3333521
Created August 12, 2012 18:11
Why does this yield append not used?!
mixtypes := []MixType{}
for key, value := range(mixAnalysis) {
if value > 15 {
append(mixtypes, key)
}
}