Load network block device module:
# modprobe nbd max_part=8
Poweroff machine:
# virsh destroy virtual-machine
import sympy as sym | |
import numpy as np | |
import matplotlib.pyplot as plt | |
sym.init_printing() | |
# Integral calculation constants | |
a = 0 | |
b = 20 | |
h = 0.4 |
import torch | |
from collections import OrderedDict | |
def rename_state_dict_keys(source, key_transformation, target=None): | |
""" | |
source -> Path to the saved state dict. | |
key_transformation -> Function that accepts the old key names of the state | |
dict as the only argument and returns the new key name. | |
target (optional) -> Path at which the new state dict should be saved |
plugins: | |
... | |
- convertDimensions | |
... |
Hi there! Since this post was originally written, nvm
has gained some new tools, and some people have suggested alternative (and potentially better) approaches for modern systems. Make sure to have a look at the comments to this article, before following this guide!
Trickier than it seems.
from collections import defaultdict, deque | |
class Graph(object): | |
def __init__(self): | |
self.nodes = set() | |
self.edges = defaultdict(list) | |
self.distances = {} | |
def add_node(self, value): |
from numpy import dot,array,empty_like
from matplotlib.path import Path
def make_path(x1,y1,x2,y2):
return Path([[x1,y1],[x1,y2],[x2,y2],[x2,y1]])
def perp( a ) :
b = empty_like(a)
b[0] = -a[1]
#!/bin/sh | |
# check for how many uncommitted changes we have | |
# stash changes | |
# run grunt task | |
# restore stashed files if anything was stashed | |
# exit with error if grunt fails | |
NAME=$(git branch | grep '*' | sed 's/* //') |
""" | |
Grammar: | |
======== | |
Expression --> AndTerm { OR AndTerm}+ | |
AndTerm --> Condition { AND Condition}+ | |
Condition --> Terminal (>,<,>=,<=,==) Terminal | (Expression) | |
Terminal --> Number or String or Variable | |
Usage: | |
====== |