Skip to content

Instantly share code, notes, and snippets.

UPDATE edges SET parent_id = NULL WHERE parent_id in (
SELECT id FROM edges WHERE
destination_run_id = '9f2c45d4eac84a8f89ee46820a99b0e7');
DELETE FROM edges WHERE
destination_run_id = '9f2c45d4eac84a8f89ee46820a99b0e7';
UPDATE edges SET parent_id = NULL WHERE parent_id in (
SELECT id FROM edges WHERE
destination_run_id = 'a715b3f4f7e74d96bc8ee6859c257082');
DELETE FROM edges WHERE
@augray
augray / checkpoint_example.py
Last active June 21, 2023 13:17
Possible API for Sematic Checkpoints
from sematic import load_checkpoint, store_checkpoint
class MyCheckpoint:
# ... can be anything you like
@sematic.func
def do_something_really_long(some_val: TheInput) -> TheOutput:
# Load the checkpoint. It will be None if there is no checkpoint
# that has been stored. This means that it's impossible to distinguish
# between a checkpoint whose value is `None`, and an unset checkpoint.
@augray
augray / config.toml
Last active November 8, 2023 21:13
Preferred Helix Config (https://helix-editor.com/)
theme = "onedark"
[editor]
true-color = true
[editor.file-picker]
hidden = false
# Note: can use .git/info/exclude to hide things from finder
git-ignore = false
#!/bin/bash
set -euoxv pipefail
VENV="$HOME/venvs/test_wheel"
MAKE_WHEEL_VENV="$HOME/venvs/dev39"
PYTHON_VERSION=3.9
SEMATIC_DIR="$HOME/code/sematic"
TEMP_DIR="$HOME/tmp"
SETTINGS_DIR="$HOME/.sematic"
BACKUP_SETTINGS_DIR="$HOME/.sematic.bak"
apiVersion: ray.io/v1alpha1
kind: RayCluster
metadata:
labels:
controller-tools.k8s.io: "1.0"
# A unique identifier for the head node and workers of this cluster.
name: raycluster-complete
spec:
rayVersion: '2.1.0'
######################headGroupSpec#################################
from functools import lru_cache
@lru_cache
def a(n):
import math
def S(m):
return [j * j for j in range(1, int(math.sqrt(m)) + 1)]
if n == 0:
return 0
possible_moves = [n - s for s in S(n)]
from typing import List
import math
def game_lengths(n: int) -> List[int]:
"""Optimal game lengths for subtract-a-square for starting positions <=n
Parameters
----------
n:
The maximum starting position to return
Returns
@augray
augray / openBlasHangStack.txt
Created February 22, 2018 19:37
OpenBLAS deadlock stack trace
Thread 9 (Thread 0x7fa1a0fd0700 (LWP 9548)):
#0 0x00007fa1af535945 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fa1a19d44fb in blas_thread_server ()
from /home/ec2-user/.pex/install/opex_bootstrap-0.1-py2-none-any.whl.209932c20db9504e85e98c54000d21ffb8d0274d/opex_bootstrap-0.1-py2-none-any.whl/opex_bootstrap/native/libopenblas.so.0
#2 0x00007fa1af531e25 in start_thread () from /lib64/libpthread.so.0
#3 0x00007fa1aeb5634d in clone () from /lib64/libc.so.6
Thread 8 (Thread 0x7fa18d2b7700 (LWP 9549)):
#0 0x00007fa1af537a0b in do_futex_wait.constprop.1 () from /lib64/libpthread.so.0
#1 0x00007fa1af537a9f in __new_sem_wait_slow.constprop.0 () from /lib64/libpthread.so.0