This file contains hidden or 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
cd llvm-project | |
# bazel | |
cd utils/bazel | |
bazel build @llvm-project//mlir/... # --action_env=BAZEL_CXXOPTS='-std=c++17' | |
# cmake - see https://mlir.llvm.org/getting_started/ | |
mkdir build | |
cd build | |
cmake -G Ninja ../llvm \ |
This file contains hidden or 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 python | |
# -*- encoding: UTF-8 -*- | |
# example: | |
# | |
# python mp3tag.py --title-pattern '[0-9]+ - (.*)\.mp3' --artist "王菲" --album "王菲(2001)" --genre "" ~/Downloads/王菲.-.\[王菲2001\].专辑.\(MP3\)/*.mp3 | |
import argparse | |
import taglib | |
import chardet |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am wecing on github. | |
* I am misa (https://keybase.io/misa) on keybase. | |
* I have a public key whose fingerprint is DDF4 38E9 8898 16A4 9E3D C1A5 3CFB 0D43 4E35 CA91 | |
To claim this, I am signing this object: |
This file contains hidden or 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
// scala | |
for ( p <- e1 ) yield e2 | |
// translation | |
e1 map { case p => e2 } | |
// haskell | |
(\p -> e2) <$> e1 // i.e. "fmap (\p -> e2) e1" | |
// aka | |
do p <- e1 | |
e2 |
This file contains hidden or 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 <iostream> | |
#include <cstdlib> | |
#include <memory> | |
#include <vector> | |
#include <string> | |
template<typename M, typename T> | |
class SemiGroup { | |
protected: | |
T m_t; |
This file contains hidden or 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
# because here pd == pd[(addr & M1) >> S1], | |
# now the original load() code is equivalent to: | |
def load(addr): | |
pt = pd[(addr & M2) >> S2] | |
pg = pt[addr & M3] | |
return pg |
This file contains hidden or 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
pd[(uvpt & M1) >> S1] = pd |
This file contains hidden or 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
// UVPT maps the env's own page table read-only. | |
// Permissions: kernel R, user R | |
e->env_pgdir[PDX(UVPT)] = PADDR(e->env_pgdir) | PTE_P | PTE_U; |
This file contains hidden or 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
def load(addr): | |
pt = pd[(addr & M1) >> S1] | |
pg = pt[(addr & M2) >> S2] | |
v = pg[addr & M3] | |
return v |
This file contains hidden or 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 "f" | |
$-2 "k" | |
$-3 "display" | |
$-4 "x" | |
$-5 "y" | |
$-6 "n" | |
$-7 "+" | |
$0 <- lambda 0 0 { | |
$2 <- lambda 1 0 $-1 { |
NewerOlder