Skip to content

Instantly share code, notes, and snippets.

View kun432's full-sized avatar

Kuniaki Shimizu kun432

View GitHub Profile
@kun432
kun432 / 隊列パース.ipynb
Last active January 11, 2023 16:11
隊列パース.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kun432
kun432 / kol_sei2_to_csv.rb
Created December 22, 2022 04:37
競馬道オンラインの成績データ(kol_sei2.kd3)をCSVに変換する
#!/usr/bin/env ruby
fields = [0,2,6,8,10,12,20,22,23,25,27,34,64,66,67,69,109,129,149,150,153,156,159,162,167,199,207,208,210,215,216,217,222,254,262,264,265,266,267,269,274,276,278,280,281,282,286,288,289,292,295,298,300,302,304,306,307,308,316,324,330,332,334,340,346,352,358,364,370,376,377,383,384,424,432,436,598]
puts "開催場所コード,開催年,開催回次,開催日次,レース番号,年月日,曜日コード,枠番,馬番,ゲート,馬コード,カナ馬名,馬記号,性別,年齢,馬主名,短縮馬主名,予備フィールド,ブリンカー,斤量,馬体重,増減,レコード指数,騎手コード,騎手名,短縮騎手名,騎手東西別,騎手所属場所コード,騎手所属厩舎コード,見習い区分,乗り替り,厩舎コード,厩舎名,短縮厩舎名,厩舎所属場所コード,厩舎栗北南別,出馬表の予想印,予想(本紙),人気,オッズ,確定着順,着順附加,入線着順,取消種別,レコード認識,タイム,着差1,着差2,タイム差,前半3F,後半3F,通過順位1,通過順位2,通過順位3,通過順位4,4角位置取り,調教フラグ,調教 騎乗者,年月日,場所,コース,馬場,8F(1哩),7F,6F,5F,4F(半哩),3F,1F,回った位置,脚色,調教矢印,調教例外,データ作成年月日,生年,予備フィールド"
ARGF.each do |line|
str = Array.new()
for i in 0...fields.size
str.push(line.byteslice(fields[i]...fields[i+1]).encode('utf-8', 'cp932').strip)
@kun432
kun432 / lipsurf-plugin-development-5min-quick-start.ipynb
Created November 30, 2022 16:52
lipsurf-plugin-development-5min-quick-start
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kun432
kun432 / parrot.vf
Last active November 14, 2022 08:02
Voiceflow Webサイトチャットのサンプル
{
"_version": "1.2",
"project": {
"_id": "6371f3dafb75130007eb36a5",
"name": "オウム返し",
"teamID": "4DjZPGaEmb",
"devVersion": "6371f3da4d8f24d475913cd8",
"type": "chat",
"platform": "webchat",
"platformData": {
@kun432
kun432 / get_baba.py
Created November 8, 2022 19:10
JRAのホームページから馬場情報を拾ってくるseleniumのサンプル
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.alert import Alert
import time
import textwrap
@kun432
kun432 / getWindInfo.sh
Created November 1, 2022 06:22
気象庁のJSONから特定地点の風向き・風速を取得するサンプル
#!/usr/bin/env bash
function usage() {
echo "$0 POINT_NAME"
exit 1
}
if [ $# != 1 ]; then
usage
fi
@kun432
kun432 / sharevox_sample_c.ipynb
Created October 20, 2022 09:21
sharevox_sample_c++.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kun432
kun432 / sharevox_sample_c.ipynb
Created October 19, 2022 13:40
sharevox_sample_c++.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kun432
kun432 / コード.gs
Last active September 18, 2022 23:38
3,4コーナーの位置取りから隊列を可視化する
function createTairetsu() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
sheet.insertColumnBefore(14);
sheet.insertColumnBefore(16);
sheet.getRange('N1').activate();
sheet.getCurrentCell().setValue('前走:3コーナー推定隊列');
sheet.getRange('N2').activate();
sheet.getCurrentCell().setFormula('=IFERROR(CONCATENATE(REPT(" ",M2-1),CHAR(M2+CODE("①")-1),REPT(" ",18-M2)),REPT("―",18))');
sheet.getActiveRange().autoFill(sheet.getRange(2,14,ss.getLastRow() - 1, 1), SpreadsheetApp.AutoFillSeries.DEFAULT_SERIES);
@kun432
kun432 / config.json
Last active February 6, 2022 14:21
CWAgentのサンプル
{
"agent": {
"metrics_collection_interval": 60,
"run_as_user": "root"
},
"metrics": {
"append_dimensions": {
"AutoScalingGroupName": "${aws:AutoScalingGroupName}",
"ImageId": "${aws:ImageId}",
"InstanceId": "${aws:InstanceId}",