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 cv2, matplotlib | |
import numpy as np | |
import matplotlib.pyplot as plt | |
bgr_img = cv2.imread('images/landscape.jpg') | |
img = cv2.cvtColor(bgr_img, cv2.COLOR_BGR2HSV) | |
blue_min = np.array([100, 0, 0], np.uint8) | |
blue_max = np.array([140, 255, 255], np.uint8) | |
wh_min = np.array([0, 0, 180], np.uint8) | |
wh_max = np.array([180, 60, 255], np.uint8) |
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 audio.m4a -filter 'silenceremove=0:0:0:-1:3:-90dB' tmp.m4a |
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 <stdio.h> | |
#include <stdbool.h> | |
typedef int (*Operator)(int a, int b); | |
int add(int a, int b) { | |
return(a + b); | |
} | |
int mult(int a, int b) { |
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
; maps layout JIS -> Sun Type3 | |
; https://autohotkey.com/download/ahk-install.exe | |
; The keyboard hook monitors keystrokes for the purpose of activating hotstrings | |
; and any keyboard hotkeys not supported by RegisterHotkey | |
; (which is a function built into the operating system). | |
; It also supports a few other features such as the Input command. | |
#UseHook | |
sc03a:: |
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
require 'rubygems' | |
require 'bundler' | |
Bundler.require | |
require 'open-uri' | |
aozora_uri = 'http://www.aozora.gr.jp/cards/000148/files/789_14547.html' | |
file = 'sample.txt' | |
unless File.exist?(file) | |
html = open(aozora_uri, 'r:Shift_JIS').read.encode('utf-8', universal_newline: true) | |
text = Oga.parse_html(html).css('.main_text').text.gsub(/(.*?)/, '') |
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
variable "db_username" {} | |
variable "db_password" {} | |
variable "aws_key_name" {} | |
provider "aws" { | |
region = "ap-northeast-1" | |
shared_credentials_file = "$HOME/.aws/credentials" | |
profile = "default" | |
} |
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
[ | |
"audioend", | |
"audiostart", | |
"end", | |
"error", | |
"nomatch", | |
"result", | |
"soundend", | |
"soundstart", | |
"speechend", |
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 alt-from-char {\U 1 \D -1}) | |
(defn ending-valley? [step alt] | |
(and (= alt -1) (= step \U))) | |
(defn countingValleys [n s] | |
(:cnt | |
(reduce | |
(fn [acc step] | |
(let [{:keys [cnt alt]} acc] |
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
#!/bin/bash -eu | |
# Dependencies: | |
# npm install -g svg-term-cli | |
# pip3 install asciinema | |
cast_filename=$(mktemp -u) | |
asciinema rec ${cast_filename} | |
out_filename=$(mktemp -u) | |
svg-term --in ${cast_filename} --out ${out_filename}.svg |
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
var _require = function _require(cond) { | |
if (!cond) { | |
factor(-Infinity); | |
} | |
} | |
// Class attendance model. | |
var attendance = function(i_pl, i_stats, busy) { | |
var attendance = function (interest, busy) { | |
if (interest) { |
OlderNewer