Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.
| import Image | |
| import sys | |
| import glob | |
| import ImageOps | |
| # Trim all png images with white background in a folder | |
| # Usage "python PNGWhiteTrim.py ../someFolder" | |
| try: | |
| folderName = sys.argv[1] |
- Star this gist to see the talk at ReactiveConf 2016.
- Retweet to spread the word.
- Have a look at this blog post to see other proposals.
- Try elm-search to see what this is all about.
Elm is a statically typed functional language that compiles to JavaScript. It's well-known for its developer experience: the compiler provides nice error messages, the package system enforces semantic versioning for all published packages and makes sure every exposed value or type has some documentation and type annotations.
Here's a simple implementation of bilinear interpolation on tensors using PyTorch.
I wrote this up since I ended up learning a lot about options for interpolation in both the numpy and PyTorch ecosystems. More generally than just interpolation, too, it's also a nice case study in how PyTorch magically can put very numpy-like code on the GPU (and by the way, do autodiff for you too).
For interpolation in PyTorch, this open issue calls for more interpolation features. There is now a nn.functional.grid_sample() feature but at least at first this didn't look like what I needed (but we'll come back to this later).
In particular I wanted to take an image, W x H x C, and sample it many times at different random locations. Note also that this is different than upsampling which exhaustively samples and also doesn't give us fle
| /* eslint-disable */ | |
| const common = require('../jest-config.common'); | |
| module.exports = Object.assign({}, common, { | |
| "coverageDirectory": "<rootDir>/coverage/browser", | |
| "testMatch": [ | |
| "**/test/browser/**/*.test.js" | |
| ], | |
| "setupFiles": [ | |
| "<rootDir>/src/test/browser/setup.js" | |
| ] |
on linux 4.19, I get
error creating new backup file '/var/lib/dpkg/status-old': Invalid cross-device link
when trying to install stuff on a ubuntu docker container. this seems to be an issue with metacopy https://www.spinics.net/lists/linux-unionfs/msg06109.html
issue can be worked around by running
| # I used the commands below not only on the command line, but also set up the aliased commands as global keyboard shortcuts. | |
| # This can be useful if you have a keyboard that lacks media keys, or if the media keys don't behave exactly as you want them to. | |
| # Everything below assumes PulseAudio on top of ALSA. | |
| alias volup="amixer set 'Master' 10%+" # Using amixer because pacmd/pactl can increase beyond 100% volume, which I don't want. | |
| alias voldn="amixer set 'Master' 10%-" | |
| # This assumes sink port #1 and the naming of these ports. Check `pacmd list-sinks` and make adjustments if necessary. | |
| alias outsp='pacmd "set-sink-port 1 analog-output;output-speaker' # output to speakers | |
| alias outhp='pacmd "set-sink-port 1 analog-output;output-headphones-1' # output to headphones |
| import numpy as np | |
| import math | |
| import torch | |
| from torchvision import datasets | |
| import cv2 # OpenCV, this is only used for visualization, see bottom of file | |
| def rotation_matrix(axis, theta): | |
| """ | |
| Generalized 3d rotation via Euler-Rodriguez formula, https://www.wikiwand.com/en/Euler%E2%80%93Rodrigues_formula |
| using PyFenicsAD | |
| using Zygote | |
| using PyCall | |
| using Turing | |
| import LinearAlgebra: norm | |
| using Random, Distributions | |
| fenics = pyimport("fenics") | |
| fenics.set_log_level(fenics.LogLevel.ERROR) | |
| fa = pyimport("fenics_adjoint") |