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
static const std::map<string, string> ISO_2_TO_3_MAP = { | |
{"AF", "AFG"}, | |
{"AL", "ALB"}, | |
{"DZ", "DZA"}, | |
{"AS", "ASM"}, | |
{"AD", "AND"}, | |
{"AO", "AGO"}, | |
{"AI", "AIA"}, | |
{"AQ", "ATA"}, | |
{"AG", "ATG"}, |
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
static bool comp_dates_before_1970_epoch(const std::tm& dt1, const std::tm& dt2) | |
{ | |
if (dt1.tm_year != dt2.tm_year) return dt1.tm_year < dt2.tm_year; | |
if (dt1.tm_mon != dt2.tm_mon) return dt1.tm_mon < dt2.tm_mon; | |
if (dt1.tm_mday != dt2.tm_mday) return dt1.tm_mday < dt2.tm_mday; | |
if (dt1.tm_hour != dt2.tm_hour) return dt1.tm_hour < dt2.tm_hour; | |
if (dt1.tm_min != dt2.tm_min) return dt1.tm_min < dt2.tm_min; | |
return dt1.tm_sec < dt2.tm_sec; | |
} |
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
#version 150 | |
uniform sampler2DRect tex; | |
uniform float r_for_hlg; | |
in vec2 texCoordVarying; | |
out vec4 outputColor; | |
// HLG OETF | |
vec3 hlg_oetf(vec3 E) |
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
static string prepend_0(const int i, const int n_zero) | |
{ | |
return std::string(n_zero - std::min(n_zero, (int)ofToString(i).length()), '0') + ofToString(i); | |
} | |
auto prepend_0 = [&](const int i, const int n_zero) -> string | |
{ | |
return std::string(n_zero - std::min(n_zero, (int)ofToString(i).length()), '0') + ofToString(i); | |
}; |
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
from tensorflow.python.client import device_lib | |
print(tf.__version__) | |
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU'))) | |
device_lib.list_local_devices() |
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 bash | |
# | |
# OpenCV | |
# library of programming functions mainly aimed at real-time computer vision | |
# http://opencv.org | |
# | |
# uses a CMake build system | |
FORMULA_TYPES=( "osx" "ios" "tvos" "vs" "android" "emscripten" ) |
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
https://www.msys2.org/ | |
http://www.gaia-gis.it/gaia-sins/mingw64_how_to.html | |
https://github.com/git-for-windows/git/wiki/Install-inside-MSYS2-proper | |
pacman -S --needed base-devel | |
pacman -S --needed mingw-w64-i686-toolchain | |
pacman -S --needed mingw-w64-x86_64-toolchain | |
pacman -S --needed mingw-w64-i686-cmake mingw-w64-x86_64-cmake |
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
ffmpeg -i a.mp4 -vf "fps=10,scale=1280:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif | |
normal | |
ffmpeg -i input.mov -r 10 -vf scale=640:-1 -f gif output.gif | |
mid | |
ffmpeg -i input.mov -filter_complex "[0:v] fps=10,scale=640:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" output-palette.gif | |
high | |
ffmpeg -i input.mov -filter_complex "[0:v] fps=10,scale=w=640:h=-1,split [a][b];[a] palettegen=stats_mode=single [p];[b][p] paletteuse=new=1" output-multiple-palette.gif |
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
let sum = 0; | |
let numbers = [2, 4, 6, 10, 16]; | |
for (let i = 0; i < numbers.length; i++) { | |
numbers[i] = numbers[i] - 1; | |
if (numbers[i] % 3 === 0) { | |
sum += numbers[i]; | |
} | |
} | |
console.log("0", sum); |
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
// curried functions, a.k.a HOC | |
const witha = (extra) => (component) => (props) => { | |
console.log("witha", extra); | |
console.log("witha", component); | |
console.log("witha", props); | |
return () => component(props); | |
}; | |
const withb = (extra) => (component) => (props) => { | |
console.log("withb", extra); | |
console.log("withb", component); |
NewerOlder