Skip to content

Instantly share code, notes, and snippets.

DMV Practice Questions (with Correct Answers)


1. When two vehicles enter an intersection from different highways at the same time, which vehicle must yield the right-of-way?

  1. Either one.
  2. Vehicle on the left.
  3. Vehicle on the right.
  4. Neither one.
https://cdn.shopify.com/s/files/1/0317/7116/4804/files/Rasur_Guide_Updated_2022_komprimiert.pdf
"""
Repro for ownership issue with Python stores for torch.distributed.
rm -rf /tmp/store_bug; for i in {0..1}; do python -u store_bug.py $i 2 & done && wait
"""
import os
import datetime
import sys
import time
import os
import sys
import ctypes
ld = ctypes.CDLL(None, use_errno=True)
SPLICE_F_NONBLOCK = getattr(os, "SPLICE_F_NONBLOCK", 0x02)
def tee(fd_in, fd_out, length, flags=SPLICE_F_NONBLOCK):
@heiner
heiner / shm.py
Last active June 20, 2022 16:06 — forked from jakirkham/shm.py
Some Python ctypes-based POSIX shared memory functions
import os
import sys
try:
from _posixshmem import shm_open, shm_unlink
except ImportError:
import ctypes
dllname = None
if sys.platform.startswith("linux"):
@heiner
heiner / README.md
Last active February 14, 2022 14:04

Experiment data from the moolib whitepaper.

import contextlib
import fcntl
import os
import sys
import termios
import tty
@contextlib.contextmanager
def no_echo():
import queue
import threading
import gym
def target(resetqueue, readyqueue):
while True:
env = resetqueue.get()
if env is None:
@heiner
heiner / plot.py
Created September 21, 2021 09:22
#!/usr/bin/env python
"""
Script for plotting results.
```
python plot.py logs.tsv
```
"""
import argparse
import glob