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 "opencv2/objdetect/objdetect.hpp" | |
#include "opencv2/highgui/highgui.hpp" | |
#include "opencv2/imgproc/imgproc.hpp" | |
int main(int argc, char *argv[]) { | |
cv::String faceCascadeFileName = "./cascade.xml"; | |
cv::String windowName = "Face detection"; | |
cv::String imageFileName = "./lenna.png"; |
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 'opencv' | |
include OpenCV | |
w1 = GUI::Window.new("All") | |
w2 = GUI::Window.new("Removed") | |
# https://github.com/ruby-opencv/ruby-opencv/blob/master/examples/contours/rotated-boxes.jpg | |
out1 = CvMat.load("rotated-boxes.jpg", 1) | |
out2 = out1.clone | |
gray = out1.BGR2GRAY.threshold(200, 255, :binary) |
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
for f1 in `ls * | sort`; do for f2 in `ls * | grep -v $f1`; do echo $f1 $f2; done; done | awk '{if(TABLE[$1$2]!=1&&TABLE[$2$1]!=1) { TABLE[$1$2]=1; TABLE[$2$1]=1; print $0} }' |
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 main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"strings" | |
"time" | |
"io/ioutil" | |
"strconv" |
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 | |
# | |
# memcached manipulator | |
# | |
MEMCACHED_SERVER=localhost:11211 | |
# echo CMD | memcached_send_cmd | |
memcached_send_cmd() { | |
if [ -p /dev/stdin ]; then |
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
# http://paiza.jp/poh/ec-campaign/result/56d00e8d56e2c7b998e1f766a04e9acf | |
data = $stdin.read.split(/\s/).map(&:to_i) | |
num_items, campaign_days = data.shift, data.shift | |
item_prices, target_prices = data.shift(num_items).sort!, data | |
target_prices.each { |target_price| | |
h = 0 | |
l = num_items - 1 | |
nearest_price = 0 | |
while h < l | |
s = item_prices[h] + item_prices[l] |
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://paiza.jp/poh/enkoi-second/a19c27e5 | |
s = 0 | |
gets | |
s += $_.to_i while gets | |
puts s |
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
;; -*- mode: lisp; coding: utf-8 -*- | |
;; -------------------------------------------------------------------------------- | |
;; 問題: | |
;; 210 = 2×3×5×7 | |
;; 整数を素因数分解したとき、上のような、元の数の「各桁の和」と | |
;; 素因数分解した「×の個数」が等しくなる整数を求めるプログラムを | |
;; 書いてください | |
;; https://codeiq.jp/ace/joboffer_apli/q1237?dspn=RHuDm3lalVgWKiDtlJz7oTn0beWgAuPxV4vDWcWiBCBKvMnuVBMQcJTdHL8vKXSh | |
;; -------------------------------------------------------------------------------- |
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
// -*- mode: c; coding: utf-8 -*- | |
/* | |
* リンクリストの練習 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
/* | |
* リストの要素型 |
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 'uri' | |
require 'net/http' | |
username = "<YOUR API KEY>" | |
password = "<PASSWORD>" | |
file = 'TEST.wav' | |
response = nil | |
url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?model=ja-JP_BroadbandModel' |
OlderNewer