Skip to content

Instantly share code, notes, and snippets.

View muziyoshiz's full-sized avatar

Masahiro Muzi Yoshizawa muziyoshiz

View GitHub Profile
@muziyoshiz
muziyoshiz / Word2VecModelGenerator.scala
Last active December 3, 2016 23:35
Simple Word2Vec application
package jp.muziyoshiz.word2vec
import org.apache.spark._
import org.apache.spark.rdd._
import org.apache.spark.SparkContext._
import org.apache.spark.mllib.feature.{Word2Vec, Word2VecModel}
object Word2VecModelGenerator {
def main(args: Array[String]) {
@muziyoshiz
muziyoshiz / memo.txt
Last active April 25, 2017 22:59
2017-04-26 kancolle-arcade.net/ac/api の調査メモ
4/26早朝。未プレイの状態での調査結果。
丙作戦、乙作戦は公開されているが、甲作戦は公開されていない。
https://kancolle-arcade.net/ac/api/TcError/dispFlag というURLが増えている。
これは何?
https://kancolle-arcade.net/ac/api/Event/info
URL名はいままでと変わらず。キーが少し増えている。
eneMilitaryGauge2d: "base_sensuikakyuu1"
→ これはボスを表している?
@muziyoshiz
muziyoshiz / active_user.rb
Created September 27, 2017 15:24
Admiral Stats 1周年のユーザデータ解析
# 一時的にログ出力を無効にする
ActiveRecord::Base.logger = nil
base_time = Time.parse('2016-09-03 00:00:00 +09:00')
366.times do |i|
t = base_time + i.day
# 初回ログインしたユーザ数
num_register = Admiral.where('created_at <= ?', t.end_of_day).count
@muziyoshiz
muziyoshiz / ansible_docs_picker.rb
Last active October 5, 2017 15:37
A list of new modules and options in Ansible 2.0
# -*- coding: utf-8 -*-
require 'anemone'
version = ARGV[0] || "2.0"
class ModulePage
attr_accessor :category, :url, :name, :description, :is_extras, :version_added, :options
def to_markdown
s = "* ["
@muziyoshiz
muziyoshiz / example.md
Created December 12, 2017 22:27
Example of `--format markdown-code`

app1

177

app2

84
@muziyoshiz
muziyoshiz / main.yml
Created January 15, 2018 13:50
Example of import_tasks/include_tasks with tags
- name: Task 0
debug: msg="No tag"
- name: Task 1
debug: msg="tag1"
tags: [ tag1 ]
- name: Task 2
debug: msg="tag2"
tags: [ tag2 ]
@muziyoshiz
muziyoshiz / Rakefile
Last active February 8, 2018 14:28
Serverspec Rakefile for creating tasks from Ansible inventory file with server status
require 'rake'
require 'rspec/core/rake_task'
unless ENV['inventory']
print "ERROR: Inventory file must be specified by 'inventory' environment variable\n"
print " e.g.) bundle exec rake inventory=./hosts spec:all\n"
exit
end
groups = {}
@muziyoshiz
muziyoshiz / kekkon_yobigun.sh
Created February 14, 2018 16:13
Admiral Stats のデータから、各艦娘をLv99まで育成済みの提督数を調べる SQL
cat kekkon_yobigun.sql | mysql admiral_stats_development -uroot > kekkon_yobigun.tsv
@muziyoshiz
muziyoshiz / event1.csv
Created November 28, 2018 15:36
艦これアーケード イベント攻略率・周回数の時系列データ
日付 丙 提督数 丙 攻略済み提督数 丙 攻略率 丙 攻略済み周回数(合計) 丙 攻略済み周回数(平均) 丙 攻略済み周回数(分散) 丙 攻略済み周回数(標準偏差) 丙 攻略済み周回数(中央値) 丙 攻略済み周回数(95パーセンタイル) 丙 攻略済み周回数(最大) 乙 提督数 乙 攻略済み提督数 乙 攻略率 乙 攻略済み周回数(合計) 乙 攻略済み周回数(平均) 乙 攻略済み周回数(分散) 乙 攻略済み周回数(標準偏差) 乙 攻略済み周回数(中央値) 乙 攻略済み周回数(95パーセンタイル) 乙 攻略済み周回数(最大)
2016-10-27 2 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 2 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0
2016-10-28 2 1 0.5 1 0.5 0.5 0.71 0.5 1.0 1 2 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0
2016-10-29 2 2 1.0 2 1.0 0.0 0.0 1.0 1.0 1 2 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0
2016-10-30 2 2 1.0 2 1.0 0.0 0.0 1.0 1.0 1 2 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0
2016-10-31 3 3 1.0 3 1.0 0.0 0.0 1.0 1.0 1 3 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0
2016-11-01 4 4 1.0 4 1.0 0.0 0.0 1.0 1.0 1 4 1 0.25 1 0.3 0.25 0.5 0.0 0.8 1
2016-11-02 4 4 1.0 4 1.0 0.0 0.0 1.0 1.0 1 4 2 0.5 2 0.5 0.33 0.58 0.5 1.0 1
2016-11-03 13 13 1.0 27 2.1 1.74 1.32 2.0 4.4 5 13 5 0.385 5 0.4 0.26 0.51 0.0 1.0 1
2016-11-04 20 18 0.9 45 2.3 2.09 1.45 2.0 5.0 5 20 10 0.5 15 0.8 1.78 1.33 0.5 1.3 6
@muziyoshiz
muziyoshiz / mix.exs
Created March 21, 2017 10:27
Sample of GraphQL Relay server on Phoenix
# mix.exs
defmodule PhoenixRelaySample.Mixfile do
use Mix.Project
def project do
[app: :phoenix_relay_sample,
version: "0.0.1",
elixir: "~> 1.2",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,