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 <cub/cub.cuh> | |
#include <thrust/device_vector.h> | |
#include <algorithm> | |
#include <chrono> | |
#include <random> | |
struct SumCountRet { |
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
""" | |
A directive for including a matplotlib plot in a Sphinx document. | |
By default, in HTML output, `plot` will include a .png file with a | |
link to a high-res .png and .pdf. In LaTeX output, it will include a | |
.pdf. | |
The source code for the plot may be included in one of three ways: | |
1. **A path to a source file** as the argument to the directive:: |
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
""" | |
Interactive tool to draw mask on an image or image-like array. | |
Adapted from matplotlib/examples/event_handling/poly_editor.py | |
""" | |
import numpy as np | |
# import matplotlib as mpl | |
# mpl.use('tkagg') | |
import matplotlib.pyplot as plt |
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
package bob | |
import Modelica.Constants; | |
function mu | |
input Real t; | |
output Real y; | |
algorithm | |
y := 2.4*abs(cos(Constants.pi/12*t)); | |
end mu; |
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/ruby | |
require 'digest' | |
#This function takes an input string, a desired hash length, and an attempt | |
#number. It returns a hash of the specified length encoded in an alphabet which | |
#is unambiguous in both upper and lower case. The attempt number should | |
#initially be 0. If the hash is found to conflict with a previous result, then | |
#the attempt number should be incremented and the function called again with the | |
#same input string and hashlen. If you have incremened attempt number an |