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
# before | |
def my_decorator(f): | |
def wrapper(*args, **kwds): | |
print('Calling decorated function') | |
return f(*args, **kwds) | |
return wrapper | |
# but why not | |
def my_decorator(f)(*args, **kwds): | |
print('Calling decorated function') |
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
import pty | |
import time | |
import os | |
import termios | |
import signal | |
import sys | |
import traceback | |
import threading | |
if len(sys.argv) > 1: |
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
/* | |
* $ gcc -m32 -fPIC -shared -o regdump.so regdump.c | |
* $ LD_PRELOAD=$(pwd)/regdump.so ./test | |
* | |
* Dump register state with 'ud2a' (0F 0B) | |
*/ | |
#define _GNU_SOURCE | |
#include <signal.h> | |
#include <stdlib.h> |
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
package main | |
var x interface{ f() } | |
type A struct { | |
fp func() | |
} | |
func (a A) f() { a.fp() } |
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 python | |
import os | |
import time | |
import torch | |
import torch.distributed as dist | |
import torch.multiprocessing as mp | |
INTERVAL = 1 | |
COMM_SIZE = (10,) |
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
{ | |
"Parameters": { | |
"ObjectStoreBucket": { | |
"Type": "String", | |
"Description": "A pre-existing S3 bucket to use for llama's object store" | |
}, | |
"ObjectStorePrefix": { | |
"Type": "String", | |
"Description": "A prefix in $ObjectStoreBucket under which to store objects", | |
"Default": "/", |
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
# BoringSSL build times, Pixelbook | |
# `make -j5`, local compiler | |
real 2m40.180s | |
user 8m37.189s | |
sys 1m21.565s | |
# `ninja -j6`, local | |
real 2m35.987s | |
user 7m53.337s | |
sys 1m14.439s |
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
b1: | |
%x1 = 1 | |
jmp b3 | |
b2: | |
%x2 = 2 | |
jmp b3 | |
b3: | |
%x3 = phi [b1, %x1], [b2, %x2] |
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 <stdio.h> | |
int main() { | |
printf("Hello, World from C!\n"); | |
return 0; | |
} | |
#if 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
/target |
NewerOlder