Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <chrono> | |
namespace user { | |
namespace chrono = std::chrono; | |
using std::chrono::duration_cast; | |
using std::chrono::steady_clock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# coding: utf-8 | |
import contextlib | |
import os | |
import sys | |
from inotify.adapters import Inotify | |
from inotify.constants import IN_DELETE, IN_MODIFY, IN_MOVED_TO | |
import notify2 as notify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib as mpl | |
mpl.use('wxAgg') | |
import numpy as np | |
import wx | |
from copy import copy | |
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Canvas | |
from matplotlib.figure import Figure, SubplotParams | |
from numpy import random as rand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib as mpl | |
mpl.use('wxAgg') | |
from collections import Iterable | |
from copy import copy | |
from matplotlib import pyplot | |
import numpy as np | |
from scipy import interpolate | |
from skimage import color | |
from matplotlib.colors import LinearSegmentedColormap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib as mpl | |
mpl.use('wxAgg') | |
import numpy as np | |
import wx | |
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Canvas | |
from matplotlib.figure import Figure | |
from numpy import random as rand | |
from scipy import interpolate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib as mpl | |
mpl.use('wxAgg') | |
import numpy as np | |
import wx | |
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Canvas | |
from matplotlib.figure import Figure | |
from numpy import random as rand | |
from scipy import interpolate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This function produces an image that can be used to | |
quickly determine the perceptual linearity of a colormap. | |
The idea behind this came from Peter Kovesi and | |
explained very well on his website: | |
http://peterkovesi.com/projects/colourmaps/ | |
CET Perceptually Uniform Colour Maps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def accordion_shift(value, mask): | |
x = 0 | |
to_bit = 0 | |
for from_bit in range(len(bin(mask)) - 2): | |
if (1 << from_bit) & mask: | |
if (1 << from_bit) & value: | |
x |= 1 << to_bit | |
to_bit += 1 | |
return x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* g++ -std=c++14 quick_sort_mt.cpp -pthread && ./a.out 10000 1 1 | |
* | |
* | |
* This works: | |
* ./a.out 10000 1 1 | |
* | |
* This fails (unpredictably!): | |
* ./a.out 100000 1 1 | |
**/ |
NewerOlder