Skip to content

Instantly share code, notes, and snippets.

View longcw's full-sized avatar

Long Chen longcw

View GitHub Profile
@longcw
longcw / bip_solver.py
Created December 16, 2020 03:54
BIP Solver for Tracking
import itertools
from collections import defaultdict
import numpy as np
from cvxopt import glpk, matrix, spmatrix
glpk.options = {"msg_lev": "GLP_MSG_ERR"}
FROZEN_POS_EDGE = -1
waking=$(acpitool -w |grep enabled |awk '{print $2}')
for dev in $waking; do
echo "$dev" > /proc/acpi/wakeup
done
sudo acpitool -w
systemctl suspend
@longcw
longcw / mnist.py
Created September 4, 2017 12:53
Pytorch cannot train without GPU0
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
# Training settings
@longcw
longcw / tmux.md
Created November 15, 2016 08:55 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a