Not using versioning on your configuration files and editing them with Vim?
Use Vim’s backup option to automatically keep a copy of past versions. To put in your ~/.vimrc:
"Turn on backup option
set backup| import sys | |
| import cv2 | |
| if len(sys.argv) != 3: | |
| print("Usage: python comic_slicer.py input_file output_prefix") | |
| sys.exit(1) | |
| input_file = sys.argv[1] | |
| output_prefix = sys.argv[2] |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <assert.h> | |
| FILE *in; long M[1<<24]={0}, *D, *R, H=0x130000, IP=0, T; | |
| long getu() { long t, h = getc(in); if (h < 0xC0) return h; | |
| t = ((h&0x1F) << 6) | (getc(in) & 0x3F); if (h < 0xE0) return t; | |
| t = ( t << 6) | (getc(in) & 0x3F); if (h < 0xF0) return t; | |
| t = ( t << 6) | (getc(in) & 0x3F); return t & 0x1FFFFF; } | |
| void putu(long c) { if (c < 0x80) { putchar(c); return; } | |
| if (c < 0x7FF) { putchar(0xC0|(c>>6)); } else { |
| Buffer<uint> Input; | |
| RWBuffer<uint> Output; | |
| //returns the index that this value should be moved to to sort the array | |
| uint CuteSort(uint value, uint laneIndex) | |
| { | |
| uint smallerValuesMask = 0; | |
| uint equalValuesMask = ~0; | |
| //don't need to test every bit if your value is constrained to a smaller range |
| // Solve the Poisson equation for a 2D grid using the Gauss-Seidel method | |
| // Gauss-Seidel method: https://en.wikipedia.org/wiki/Gauss–Seidel_method | |
| // The problem used is Example 1 from https://my.ece.utah.edu/~ece6340/LECTURES/Feb1/Nagel%202012%20-%20Solving%20the%20Generalized%20Poisson%20Equation%20using%20FDM.pdf | |
| // A 4x4 grid of electrical values | |
| // - top boundary is Dirichlet boundary fixed at 1.0V | |
| // - bottom boundary is Dirichlet boundary fixed at 0.0V | |
| // - left & right boundaries are Neumann boundaries fixed at derivative 0.0V | |
| package main |
| using Base.Cartesian | |
| function _bifurcated_loop(i, ex, reverse, splits=:splits, half=reverse) | |
| if i == 0 | |
| ex | |
| else | |
| ix = Symbol("x_", i) | |
| iy = Symbol("y_", i) | |
| isize = :(size(dest, $i)) |
| %%----------------------------------------------------------------------- | |
| %% Make your own quadrille, graph, hex, etc paper! | |
| %% Uses the pgf/TikZ package for LaTeX, which should be part of | |
| %% any modern TeX installation. | |
| %% Email: mcnees@gmail.com | |
| %% Twitter: @mcnees | |
| %%----------------------------------------------------------------------- | |
| \documentclass[11pt]{article} |
| """Perlin noise implementation.""" | |
| # Licensed under ISC | |
| from itertools import product | |
| import math | |
| import random | |
| def smoothstep(t): | |
| """Smooth curve with a zero derivative at 0 and 1, making it useful for | |
| interpolating. |
Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.
To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js
(I may be using incorrect terms below, please forgive me)