Skip to content

Instantly share code, notes, and snippets.

@mia-0032
mia-0032 / Form1.cs
Created April 6, 2013 12:31
C#勉強会で作ったオセロゲーム。元々のソースは https://gist.github.com/7shi/5031182 です。少し自分でもいじってみました。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
#include <Wio3GforArduino.h>
#include <MMA7660.h>
#define INTERVAL (1000)
#define RECEIVE_TIMEOUT (10000)
Wio3G Wio;
MMA7660 accelemeter;
void setup() {
@mia-0032
mia-0032 / 01_aggregation.py
Last active August 24, 2018 13:35
Pythonで基本的な統計量を出力してみる
# -*- coding:utf-8 -*-
import numpy
from scipy import stats
n = 200
#正規分布にあてはまる乱数を生成
score_x = numpy.random.normal(171.77, 5.54, n)
score_y = numpy.random.normal(62.49, 7.89, n)
@mia-0032
mia-0032 / duel.R
Last active May 2, 2018 07:13
MtGの対戦成績にロジスティック回帰をかけるスクリプト
library(readr)
library(dplyr)
library(rpart)
library(rpart.plot)
library(randomForest)
library(kernlab)
taisen <- read_csv(
"~/Downloads/taisen.csv",
col_types = cols(Date = col_date(format = "%Y/%m/%d"))
@mia-0032
mia-0032 / 02_graph.py
Created August 23, 2013 17:13
Pythonでヒストグラムと箱ひげ図を描く
# -*- coding:utf-8 -*-
import numpy
import pylab
#データの生成
n = 200
score_x = numpy.random.normal(171.77, 5.54, n)
score_y = numpy.random.normal(62.49, 7.89, n)
<div class="share">
<ul>
<!-- はてなブックマーク -->
<li class="share-hatena">
<a href="http://b.hatena.ne.jp/add?mode=confirm&url={Permalink}&title={Title}" target="_blank"><i class=" blogicon-bookmark"></i></a>
</li>
<!-- Twitter -->
<li class="share-twitter">
<a href="https://twitter.com/intent/tweet?text={Title}&url={Permalink}&hashtags=はてなブログ" target="_blank"><i class="fa fa-twitter-square" aria-hidden="true"></i></a>
</li>
@mia-0032
mia-0032 / error.log
Created September 11, 2016 15:27
fluentd v0.14のエラーログ
/path/to/fluent-plugin-gcloud-pubsub/vendor/bundle/ruby/2.3.0/gems/fluentd-0.14.6/lib/fluent/plugin/storage_local.rb:59:in `configure': implement this feature later with system_config (NotImplementedError)
from /path/to/fluent-plugin-gcloud-pubsub/vendor/bundle/ruby/2.3.0/gems/fluentd-0.14.6/lib/fluent/plugin_helper/storage.rb:62:in `storage_create'
from /path/to/fluent-plugin-gcloud-pubsub/vendor/bundle/ruby/2.3.0/gems/fluentd-0.14.6/lib/fluent/plugin/in_dummy.rb:67:in `configure'
from /path/to/fluent-plugin-gcloud-pubsub/vendor/bundle/ruby/2.3.0/gems/fluentd-0.14.6/lib/fluent/root_agent.rb:237:in `add_source'
from /path/to/fluent-plugin-gcloud-pubsub/vendor/bundle/ruby/2.3.0/gems/fluentd-0.14.6/lib/fluent/root_agent.rb:95:in `block in configure'
from /path/to/fluent-plugin-gcloud-pubsub/vendor/bundle/ruby/2.3.0/gems/fluentd-0.14.6/lib/fluent/root_agent.rb:92:in `each'
from /path/to/fluent-plugin-gcloud-pubsub/vendor/bundle/ruby/2.3.0/gems/fluentd-0.14.6/lib/fl
@mia-0032
mia-0032 / 03_linear.py
Last active February 29, 2016 06:28
Pythonとsklearnで単回帰分析
# -*- coding:utf-8 -*-
import numpy
import pylab
#import statsmodels.api
from sklearn import linear_model
n = 200
#データの生成
@mia-0032
mia-0032 / datetime_test.php
Created December 23, 2013 14:47
DateTimeクラスを触ってみた
<?php
//現在時刻を取得
$now = new DateTime('now');
//Mysqlのdatetime形式で出力してみたり
echo $now->format('Y-m-d H:i:s');
echo "<hr><br>";
//UNIXタイムでインスタンスを作るときは@をつける
@mia-0032
mia-0032 / file_get_contents_options.php
Last active January 1, 2016 05:19
file_get_contentsのちょっとしたオプション
<?php
$url = '適当なURL';
$data = array(
'hoge' => 'foo'
);
//file_get_contentsの設定
$options = array(