Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from collections import Counter | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import regex as re | |
from shiny import App, reactive, render, ui | |
mpl.rcParams.update( | |
{ |
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
// Some instances of E0499 ("cannot borrow X as mutable more than once | |
// at a time") are straightforward to understand, but some can be | |
// tricky. Among the latter ones (at least for me) are those related to | |
// the way a function potentially extends the lifetime of a borrow by | |
// tying it to another value. | |
// | |
// For instance, this function: https://github.com/benhoyt/countwords/blob/5318b1acdd5bd313039d480af535cf79565c2e62/rust/optimized-unsafe/main.rs#L72 | |
// | |
// Try changing it so that it accepts a &'a mut Vec<u8> instead of a | |
// &'a Cell<Vec<u8>>. You'll get the following error: |
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
diff -ru a/src/main/java/mpi/eudico/client/annotator/player/VLCJMediaPlayer.java b/src/main/java/mpi/eudico/client/annotator/player/VLCJMediaPlayer.java | |
--- a/src/main/java/mpi/eudico/client/annotator/player/VLCJMediaPlayer.java 2016-01-14 16:44:42.000000000 +0100 | |
+++ b/src/main/java/mpi/eudico/client/annotator/player/VLCJMediaPlayer.java 2019-04-08 16:39:56.894874290 +0200 | |
@@ -597,6 +597,7 @@ | |
public void setOffset(long offset) { | |
logger.log(Level.FINE, "set offset {0}", offset); | |
this.timeOffset = offset; | |
+ mediaDescriptor.timeOrigin = offset; | |
} | |
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
#!/usr/bin/env python3 | |
"""Usage: {} AUTHOR_SUBSTRING INPUT.DOCX OUTPUT.DOCX | |
Remove date metadata from Word document for authors matching | |
AUTHOR_SUBSTRING. Handy if you don't want other people to know when | |
exactly you found time to work on their document ;) | |
In more detail: Read INPUT.DOCX, extract the comments and tracked edits, | |
manipulate them (cf. functions `modify_comments()` and | |
`modify_tracked_edits()` -- by default, they remove date metadata |
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
#!/usr/bin/env python3 | |
"""List packages explicitly installed with pacman or pacaur.""" | |
import re | |
from collections import namedtuple | |
from subprocess import check_output | |
Package = namedtuple("Package", "date name") |
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
// ==UserScript== | |
// @name CNC Toolbar Links | |
// @namespace https://trnka.korpus.cz/~lukes | |
// @version 0.2 | |
// @description Make CNC toolbar links open in new windows / tabs. | |
// @author David Lukeš | |
// @match http*://*.korpus.cz/* | |
// @match http*://korpus.cz/* | |
// @grant none | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js |
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
#!/usr/bin/env python3 | |
import time | |
import subprocess as sp | |
import concurrent.futures as cf | |
start = time.time() | |
with cf.ThreadPoolExecutor() as e: | |
futures = [e.submit(sp.check_output, f"sleep 2s && echo Done {i}.", shell=True) for i in range(3)] |
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
/* With regular functions, `this` is bound purely depending on how the function is called. If it's | |
* bound to an object (either explicitly or via the `instance.funcName()` sugar), `this` refers to | |
* that object. Otherwise, it's `undefined` (or `window`, depending on your exact environment and | |
* whether `"use strict";` is in effect). | |
* | |
* In particular, it doesn't matter whether the function is attached to the object itself as a | |
* property, i.e. each instance has its own version of the function created during initialization, | |
* (see `Class2`), or whether it exists on the object's `prototype` as a method and all instances | |
* share it (see `Class1`). `this` is always resolved dynamically, i.e. depending on the call site. | |
* Neither of these is well suited for yanking out of the context of the original object and using |
NewerOlder