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
;; Exploration of the letter-counting function for Russian language. | |
;; Inspired by Matt Parker's https://youtu.be/LYKn0yUTIU4 | |
(defvar t-prims | |
'((1 . "один") | |
(2 . "два") | |
(3 . "три") | |
(4 . "четыре") | |
(5 . "пять") | |
(6 . "шесть") |
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
#include "rep.cpp" | |
#include <stdio.h> | |
int main(void) { | |
unsigned num = 0; | |
// Repeat the block 1011_2 = 11 times. | |
REP4(1, 0, 1, 1, { | |
printf("%u\n", num++); | |
}) |
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
#include <Cello.h> | |
/* | |
* `Eval' is a type class that describes a node that can be evaluated. | |
*/ | |
struct Eval { | |
var (*eval)(var); | |
}; |
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
function w $add(w %a, w %b) { # Define a function add | |
@start | |
%c =w add %a, %b # Adds the 2 arguments | |
ret %c # Return the result | |
} | |
function w $sum(w %n) { | |
@entry | |
%s =w add 0, 0 |
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/bash | |
# -*- mode: shell-script; indent-tabs-mode: t; tab-width: 4; -*- | |
set -euo pipefail | |
IFS=$'\n' | |
function help { | |
cat <<-EOF | |
Usage: $0 <input.pdf> <output-file-or-directory> |
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 | |
""" | |
Execution time splitter for flame graphs. | |
The script takes a flame graph SVG [1] and splits the samples by execution | |
time: a sample can be either compile time, or a run time. Useful for profiling | |
VMs employing JIT compilation. | |
Currently, functions with names starting with "llvm::" are compile time, |
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/sed -rf | |
# | |
# Simple non-breaking space fixer for Russian language. | |
# | |
# Usage: nbsp-ru FILE_IN > FILE_OUT | |
# | |
s:\b(без|безо|в|во|для|до|за|из|из-за|из-под|изо|к|ко|на|над|о|об|от|ото|по|под|подо|при|про|ради|с|со|у) :\1 :gI |
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
-[:*_:_*:]- |
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
<@,+1!',k9" |
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
Q=$(info Q=$(value Q))$(info $$(call Q)) | |
$(call Q) |
NewerOlder