Skip to content

Instantly share code, notes, and snippets.

@hecomi
hecomi / rec.cpp
Last active August 24, 2023 09:10
#include <fstream>
#include <cstdio>
#include <string>
#include <memory>
#include <complex>
#include <vector>
#include <cmath>
#include <sndfile.h>
#include <fftw3.h>
#include <portaudio.h>
@hecomi
hecomi / read.cpp
Last active December 27, 2015 21:49
リップシンクのための 1st ステップとして wav からの入力であいうえお判別しました。
#include <fstream>
#include <cstdio>
#include <string>
#include <memory>
#include <complex>
#include <vector>
#include <cmath>
#include <sndfile.h>
#include <fftw3.h>
#include <boost/format.hpp>
@hecomi
hecomi / .vimrc
Created September 15, 2013 08:34
" ---------------------------------------------------------------------------------------------------
" ____ ____
" | | | |
" | |_____| |
" | | _ _ _
" | ・ ・ | | |__ ___ ___ ___ _ __ ___ (_) __ __(_) _ __ ___ _ __ ___
" | _________ | | '_ \ / _ \ / __| / _ \ | '_ ` _ \ | | \ \ / /| || '_ ` _ \ | '__| / __|
" | |_________| | | | | || __/| (__ | (_) || | | | | || | _ \ V / | || | | | | || | | (__
" |_______________| |_| |_| \___| \___| \___/ |_| |_| |_||_|(_) \_/ |_||_| |_| |_||_| \___|
"
@hecomi
hecomi / .vimrc
Created September 15, 2013 08:02
if !exists('g:lightline')
let g:lightline = {
\ 'colorscheme': 'tsubakumi',
\ 'active' : {
\ 'left' : [
\ [ 'mode' ],
\ [ 'paste', 'fugitive', 'filename', 'gitgutter', 'quickrun' ],
\ ],
\ 'right' : [
\ [ 'percent' ],
@hecomi
hecomi / .vimrc
Created September 15, 2013 07:09
" ---------------------------------------------------------------------------------------------------
" ____ ____
" | | | |
" | |_____| |
" | | _ _ _
" | ・ ・ | | |__ ___ ___ ___ _ __ ___ (_) __ __(_) _ __ ___ _ __ ___
" | _________ | | '_ \ / _ \ / __| / _ \ | '_ ` _ \ | | \ \ / /| || '_ ` _ \ | '__| / __|
" | |_________| | | | | || __/| (__ | (_) || | | | | || | _ \ V / | || | | | | || | | (__
" |_______________| |_| |_| \___| \___| \___/ |_| |_| |_||_|(_) \_/ |_||_| |_| |_||_| \___|
"
#include <iostream>
#include <opencv2/opencv.hpp>
int main(int argc, char* argv[])
{
// 画像読み込み
auto img = cv::imread("dummy_input.png");
if (!img.data) return -1;
// グレースケール化
@hecomi
hecomi / gist:6329461
Created August 24, 2013 17:52
vim-automatic のエラー
Error detected while processing function gift#uniq_winnr..gift#window#uniq_nr:
line 3:
E118: Too many arguments for function: gettabwinvar
E15: Invalid expression: gettabwinvar(tabnr, winnr, "gift_uniq_winnr", -1)
line 4:
E121: Undefined variable: uniq_nr
E15: Invalid expression: uniq_nr == -1
line 7:
E121: Undefined variable: uniq_nr
@hecomi
hecomi / .vimrc
Last active December 21, 2015 02:58
\ {
\ 'match' : {
\ 'filetype' : ['html', 'javascript', 'typescript'],
\ },
\ 'NeoBundleSource' : [
\ 'vim-nodejs-complete',
\ 'vim-node',
\ 'jscomplete-vim',
\ 'typescript-vim',
\ 'simple-javascript-indenter',
@hecomi
hecomi / kana2romaji.js
Last active December 18, 2015 19:09
日本語をローマ字にするヤツ for @arnelceledonio
// install mecab by "sudo apt-get install mecab libmecab-dev mecab-naist-jdic"
// (this install command is for Ubuntu)
// install mecab-async module by "npm install mecab-async"
var MeCab = require('mecab-async');
var mecab = new MeCab();
var escape_strings = [
'"', '「', '」', '。', '、', ',', '・', '"'
];
@hecomi
hecomi / cexpr.cpp
Last active December 18, 2015 18:18
#include <iostream>
#include <sprout/math.hpp>
#include <cmath>
int main(int argc, char* argv[])
{
// auto sin45 = std::sin();
// std::cout << sin45_2 << std::endl;
constexpr auto sin45 = sprout::sin(sprout::math::pi<double>()/4);
std::cout << sin45 << std::endl;