This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NB: This is just a proof of concept, use at your own risk. You must have the videos page open for it to work. | |
// This helped a lot: https://javascript.info/promise-chaining | |
// find all chats | |
function parseScore(score) { | |
//console.log(`parsing score ${score}`) | |
var calcscore = parseFloat(score.replace('K', 'e3').replace('M', 'e6').replace(',', '')) | |
//console.log(`= ${calcscore}`) | |
return calcscore | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In his seminal article "C4.5. Programs for Machine Learning." Quinlan uses a criterion U_CF for determining error limits in nodes of decision trees. This criterion is important as it drives the tree pruning heuristic. Problem is, no clear formula is provided in the article. However, the formula can be found in the source code for C4.5 and C5.0: | |
U_CF(E, N) ≡ RawExtraErrs(N, E)/N, with RawExtraErrs defined in pruning.c | |
To verify the article results, you can insert the following line into main() or whatever: | |
#define U_CF(E, N, expectation) printf("U_CF(%d, %d) = %0.3f (expected to be " #expectation ")\n", E, N, RawExtraErrs(N, E)/N) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (let e of document.getElementsByTagName('*')) | |
{ | |
let rndc = () => Math.floor(Math.random()*255).toString() | |
let funkify = function(e) { | |
this.style.color="rgb(" + rndc() + ',' + rndc() + ',' + rndc()+")" | |
e.stopPropagation() | |
}.bind(e) | |
e.addEventListener('click', funkify) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cat thoughts.dot | mono fold_labels.exe 40 | unflatten | dot -Tpdf > thoughts.pdf && open thoughts.pdf | |
// unflatten makes the graph less... flat | |
using System; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
class Fold | |
{ | |
static void FoldTillQuotes (StringBuilder s, int i, int maxlen) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<root> | |
<name>My, ehm, stuff.</name> | |
<replacementdef> | |
<replacementname>WEIRDOAPPS</replacementname> | |
<replacementvalue><![CDATA[<only>EMACS, TERMINAL, X11, VIRTUALMACHINE</only>]]></replacementvalue> | |
</replacementdef> | |
<item> | |
<name>Command_R to Option_R (only in Emacs, Terminal, X11)</name> | |
<identifier>sitagi.cr_to_or</identifier> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# My crazy layout... | |
# command <=> alt | |
# control <=> capslock | |
# enter becomes "control" when not released instantly | |
# Should be as close to my osx/karabiner config as possible... | |
# Because XFCE is not cool, it resets the settings when calling xkbmap. | |
# So putting this into .xinitrc won't cut it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
HEX="0x[0-9a-f]+" | |
convert () { | |
gunzip -cS '' $1 | grep -v _gc_ | | |
sed -E "s/^\\[$HEX: [0-9.]* [0-9]*\\] //" | | |
sed -E "s/$HEX//g" | | |
sed -E "s/TRUE:/result=/g" | | |
head -$2 > $1_$2 |