This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ガチャコンプまでの金額計算機 | |
# 作った経緯など http://blog.livedoor.jp/tattyamm/archives/3840157.html | |
# 例:コンプ対象カードの出現確率5%のガチャを8枚コンプするまで300円ガチャを回した場合、いくらでコンプできるか1万人でシミュレート。 | |
# 計算結果:http://twitpic.com/8hwbyx | |
# 例:コンプ対象カードの出現確率3%のガチャを10枚コンプするまで300円ガチャを回した場合、いくらでコンプできるか1万人でシミュレート。 | |
# 計算結果:http://twitpic.com/8hwv9d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ガチャコンプまでの金額計算機2 | |
#@gigir様のこちらに触発され作りました。http://www.ani-ban.info/aimas/comp_sim/ | |
#この前書いた https://gist.github.com/1787103 を「アイドルマスターシンデレラガールズコンプガチャシミュレーター」向けに書き直したものです。プログラムとしてちょっと強引です。 | |
#実行結果 例 | |
#http://blog.livedoor.jp/tattyamm/archives/3841998.html | |
#このプログラムはtattyammが書きました | |
#連絡先 https://twitter.com/#!/tattyamm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#こちらの記事で使ったコードです | |
# Google AnalyticsのデータをRで解析する - えんたつの記録 | |
# http://blog.livedoor.jp/tattyamm/archives/4018354.html | |
#ライブラリ読み込み | |
source("RGoogleAnalytics.R") | |
source("QueryBuilder.R") | |
library(lattice) #levelplot関数に必要 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class Hoge(index:Int ,name:String) | |
object main { | |
def main(args: Array[String]) { | |
val hogeList = List(Hoge(0, "hoge1"), Hoge(2, "hoge2"), Hoge(0, "hoge3"), Hoge(0, "hoge6"), Hoge(1, "hoge9")) | |
println(hogeList) | |
val hogeListSorted1 = hogeList.sortWith{ (o1,o2)=> | |
//println(o1,o2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 末尾再帰サンプル | |
*/ | |
object sample { | |
def main(args: Array[String]) { | |
println(sumByTailCall(100)) | |
} | |
@scala.annotation.tailrec //これをつけると、末尾再帰でないメソッドをコンパイルエラーにしてくれる。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# シェル操作課題 (cut, sort, uniq などで集計を行う) 設問編 - Yamashiro0217の日記 | |
# http://d.hatena.ne.jp/Yamashiro0217/20120727/1343371036 | |
# 問1 | |
echo "---問1---" | |
cat Log.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# 緑色で出力 | |
greenEcho() | |
{ | |
GREEN_STR="\033[0;32m" | |
COLOR_END="\033[0m" | |
echo "${GREEN_STR}$1${COLOR_END}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://git-scm.com/book/ja/Git-%E3%81%AE%E5%9F%BA%E6%9C%AC-%E3%82%BF%E3%82%B0 | |
タグを作る | |
$ git tag -a v1.4 -m 'my version 1.4' | |
http://blog.s21g.com/articles/1359 | |
ローカルのtagをサーバーにpush | |
$ git push --tags | |
http://blog.appling.jp/archives/1332 | |
タグの削除(ローカルとリモート) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl 'http://www.google.co.jp' -w "\nstatus:%{http_code}" 2>/dev/null | fgrep 'status:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sortByKeyLengthDesc($arr){ | |
$keys = array_map('strlen', array_keys($arr)); | |
array_multisort($keys, SORT_DESC, $arr); | |
return $arr; | |
} |
OlderNewer