Skip to content

Instantly share code, notes, and snippets.

@legowerewolf
legowerewolf / readme.md
Last active April 7, 2024 02:13
Tailscale on Steam Deck
@shenwei356
shenwei356 / benchmark-encoding.md
Last active August 13, 2022 17:36
k-mer encoding and decoding

Functions:

# encoding: ACTG

def nuc2int_nochecking(b):
    return (ord(b) >> 1) & 3, True
    
def nuc2int_if(b):
    if b == 'a' or b == 'c' or b == 'g' or b == 't' \

or b == 'A' or b == 'C' or b == 'G' or b == 'T':

@jamestwebber
jamestwebber / cupy_dataloader.py
Created October 31, 2020 20:20
How to use a cupy csr_matrix in PyTorch
import torch
# cupy fails to import when there are no GPUs. This check means that the module can
# still be imported in that case, but of course the classes won't work.
if torch.cuda.is_available():
import cupy
from torch.utils.data import DataLoader, Dataset
from torch.utils.dlpack import from_dlpack
@egasimus
egasimus / Arcan.nix
Last active May 17, 2021 09:39
Building Arcan on NixOS, 2020 version
({ lib, newScope, stdenv, pkgs }: let
# nicer aliases
derive = stdenv.mkDerivation;
concat = builtins.concatStringsSep " ";
# vendored libuvc: don't build, just make sources available
libuvc-src = derive {
name = "libuvc-src";
# using fetchgit instead fetchFromGitHub because
import asyncio
import time
from unsync import unsync
@unsync
async def heartbeat():
while True:
start = time.time()
@hamelsmu
hamelsmu / binder.yaml
Created May 20, 2020 21:37
Label your pull requests with mybinder.org links. This allows collaborators to view your files in a Jupyter Notebook environment with correct dependencies without cloning or building your repo.
name: Binder
on:
pull_request:
types: [opened, reopened]
jobs:
Create-Binder-Badge:
runs-on: ubuntu-latest
steps:

Making Progress Under Uncertainty in SMT Solving, Research, and Life

Abstract

SAT and Satisfiability Modulo Theories (SMT) solvers have many important applications in PL, including verification, testing, type checking and inference, and program analysis – but they are often a mysterious black box to their users, even when those users are PL researchers with lots of solver experience! This talk will be partly a tutorial introduction to the inner workings of SAT and SMT solvers, and partly an extended analogy to navigating life as a researcher: making decisions when you have only incomplete information to go on, learning from decisions that turned out to be bad, and determining when to give up and when to try again. I’ll also highlight a variety of papers in this year’s POPL program that make use of SAT and SMT solving, and discuss why I think it’s worthwhile to learn about solver internals.

Outline

  • Introduction
  • Self-intro
@kytulendu
kytulendu / install-opencl-amd.sh
Last active May 30, 2024 16:27
A shell script to install AMDGPU-PRO OpenCL driver.
#!/bin/bash
# This script will install AMDGPU-PRO OpenCL and Vulkan support.
#
# For Ubuntu and it's flavor, just install the package using this command
# in extracted driver directory instread.
#
# ./amdgpu-pro-install --opencl=legacy,pal --headless --no-dkms
#
# For Arch Linux or Manjaro, use the opencl-amd or rocm-opencl-runtime on AUR instread.
@twiecki
twiecki / dask_sparse_corr.py
Created August 17, 2018 11:26
Compute large, sparse correlation matrices in parallel using dask.
import dask
import dask.array as da
import dask.dataframe as dd
import sparse
@dask.delayed(pure=True)
def corr_on_chunked(chunk1, chunk2, corr_thresh=0.9):
return sparse.COO.from_numpy((np.dot(chunk1, chunk2.T) > corr_thresh))
def chunked_corr_sparse_dask(data, chunksize=5000, corr_thresh=0.9):
@jamesmunns
jamesmunns / arch-linux-install.md
Created July 28, 2018 16:04 — forked from kylemanna/arch-linux-install.md
Minimal instructions for installing arch linux on an UEFI NVMe system with full system encryption using dm-crypt and luks