Skip to content

Instantly share code, notes, and snippets.

Avatar

koyo koyo-miyamura

View GitHub Profile
@koyo-miyamura
koyo-miyamura / Viterbi.cpp
Last active Oct 20, 2017
ビタビ複号を行うプログラム
View Viterbi.cpp
/*
Viterbi.cpp : ビタビ複号を行うプログラム
author : Koyo Miyamura
*/
#include <stdio.h>
#include <math.h>
#include <string.h>
// 確保する配列の長さ(とりあえず多めに)
@koyo-miyamura
koyo-miyamura / fft_conv_corr.cpp
Last active Oct 20, 2017
高速フーリエ変換、畳み込み和、自己相関を求めるプログラム
View fft_conv_corr.cpp
/*
fft_conv_corr.cpp : 高速フーリエ変換、畳み込み和、自己相関を求めるプログラム
author : Koyo Miyamura
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <climits>
#include <iostream>
@koyo-miyamura
koyo-miyamura / Angle_average.java
Last active Dec 25, 2017
角度平均を求めるプログラム(-180.0 ~ 180.0)
View Angle_average.java
// 構造体使用ver
import java.lang.Math;
public class Angle_average{
public static void main(String[] args){
final class vector{
double x;
double y;
View leadtime.py
from flask import Flask, request, redirect, url_for
import mysql.connector
import numpy as np
import json
import datetime
from datetime import timedelta
import sys
# pip install python-dateutil
from dateutil.relativedelta import relativedelta
@koyo-miyamura
koyo-miyamura / look_that_way.py
Created Aug 30, 2018
pythonであっちむいてほい
View look_that_way.py
import random
hand = {0:"グー", 1:"チョキ", 2:"パー"}
judge = {0:"負け", 1:"あいこ", 2:"勝ち"}
direction = {0:"↑", 1:"→", 2:"↓", 3:"←"}
# じゃんけんをする
# 勝ち 2
# あいこ 1
# 負け 0
def rock_paper_scissors(player_hand):
@koyo-miyamura
koyo-miyamura / mick_sample.sql
Last active Apr 7, 2019
達人に学ぶDB設計演習問題用テーブル定義
View mick_sample.sql
DROP DATABASE `mick_sample`;
CREATE DATABASE IF NOT EXISTS `mick_sample` DEFAULT CHARACTER SET utf8mb4;
USE mick_sample;
CREATE TABLE IF NOT EXISTS `sisya` (
sisya_code VARCHAR(191),
sisya_name VARCHAR(191),
PRIMARY KEY (sisya_code)
);
View hoge.csv
id name age
1 koyo 24
2 maimai 23
3 tomozo 20
View server.go
package main
import (
"fmt"
"log"
"net/http"
)
// type app struct {
// Name string
View hoge.go
package add
// Add add two integer
func Add(a int, b int) int {
return a + b
}
@koyo-miyamura
koyo-miyamura / main.go
Last active May 4, 2019
goでテンプレートのサンプル
View main.go
package main
import (
"log"
"os"
"text/template"
"time"
)
func main() {