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
Shut down without showing a confirmation dialog: | |
osascript -e 'tell app "System Events" to shut down' | |
Shut down after showing a confirmation dialog: | |
osascript -e 'tell app "loginwindow" to «event aevtrsdn»' | |
Restart without showing a confirmation dialog: | |
osascript -e 'tell app "System Events" to restart' | |
Restart after showing a confirmation dialog: |
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
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
std::copy(vector.begin(), vector.end(), std::inserter(deque, deque.end())); |
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
// if shaper is 1, you get linear output like ofMap. | |
// shaper > 1 means non linear steps weighted towards the start. | |
// 0 < shaper < 1 means non linear steps weighted towards the end. | |
auto shaped_map = [&]( | |
float val, | |
float inMin, float inMax, | |
float outMin, float outMax, | |
float shaper) -> float | |
{ | |
// (1) convert to pct (0-1) |
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
- windowsはオフラインアカウントでセットアップ | |
- ネットワークにつなぐ | |
- 識別されてないネットワーク問題 | |
http://www.projectgroup.info/tips/Windows/comm_0064.html | |
- windowsのライセンス認証 | |
- windowsをアップデートする |
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() |
NewerOlder