Skip to content

Instantly share code, notes, and snippets.

View shuheilocale's full-sized avatar
🏠
Working from home

shuhei yamamoto shuheilocale

🏠
Working from home
View GitHub Profile
@shuheilocale
shuheilocale / pre-processing.ipynb
Created October 2, 2021 14:48
pre-processing.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shuheilocale
shuheilocale / espnet2_tts.ipynb
Created June 27, 2021 06:17
espnet2_tts.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shuheilocale
shuheilocale / ocr_tesseract.ipynb
Created June 27, 2021 05:34
ocr_tesseract.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shuheilocale
shuheilocale / file1.js
Last active March 10, 2017 11:04
Windowsユーザなら、JScriptに一度は触れてみて ref: http://qiita.com/shuheilocale@github/items/001c1dec163df534ed4f
// エクセルオブジェクト生成
var excel = new ActiveXObject("Excel.Application");
// ワークブック新規作成
var book = excel.Workbooks.Add();
// シート
var sheet = book.WorkSheets(1); // 1シート目(1オリジン!)
@shuheilocale
shuheilocale / file0.txt
Last active March 10, 2017 15:15
ADLとusingではどっちが優先されるか調べてみた ref: http://qiita.com/shuheilocale@github/items/85522005703debd1529c
namespace hoge{
struct X{
int a[100];
};
int * begin(X& x) {
std::cout << "hoge::begin()" << std::endl;
return x.a;
}
@shuheilocale
shuheilocale / 5に近い順でソート(ラムダ式2)
Last active March 9, 2017 04:49
ラムダ式を使えば、簡単にコールバック関数に引数を渡せる ref: http://qiita.com/shuheilocale@github/items/39fb56b1deea4342b356
int main(int argc, _TCHAR* argv[])
{
std::vector<int> numbers3 = { -1, 10, 2, 5, 6, -5, -10, 9, 8, 5 };
int ref = 5;
auto absDist = [&ref](int l, int r) -> bool{
return abs(l - ref) < abs(r - ref);
};
std::sort(std::begin(numbers3), std::end(numbers3),absDist);
print(numbers3); // 5, 5, 6, 2, 8, 9, 10, -1, -5, -10
return 0;
request = require "request";
fs = require "fs";
ahe = ['m01.jpg','m02.jpg','m03.jpg','m04.jpg']
module.exports = (robot) ->
robot.hear /かお/i, (msg) ->
file_name = msg.random ahe
file = fs.createWriteStream file_name
api_url = 'https://slack.com/api/'
channel = msg.message.room
@shuheilocale
shuheilocale / table.md
Last active July 8, 2016 00:50
table test
Left align Right align Center align
This This This
column column column
will will will
be be be
left right center
aligned aligned aligned
template<typename T>
class classF;
class classA
{
public:
classA();
~classA();
private:
classF<int> *objF;
};
@shuheilocale
shuheilocale / file0.php
Last active April 12, 2016 05:59
【LINE Bot】 bluemixとFaceAPIを使った年齢性別推定Bot ref: http://qiita.com/shuheilocale@github/items/da6ecdeced3c00acc6f8
// 画像データを取得する
function api_get_message_content_request($message_id) {
$url = "https://trialbot-api.line.me/v1/bot/message/{$message_id}/content";
$headers = array(
"X-Line-ChannelID: {$GLOBALS['CHANNEL_ID']}",
"X-Line-ChannelSecret: {$GLOBALS['CHANNEL_SECRET']}",
"X-Line-Trusted-User-With-ACL: {$GLOBALS['MID']}"
);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);