Skip to content

Instantly share code, notes, and snippets.

View penguinco's full-sized avatar

genta kaneyama penguinco

View GitHub Profile
import numpy as np
from matplotlib import pylab as plt
#from mpltools import style # uncomment for prettier plots
#style.use(['ggplot'])
# generate all bernoulli rewards ahead of time
def generate_bernoulli_bandit_data(num_samples,K):
CTRs_that_generated_data = np.tile(np.random.rand(K),(num_samples,1))
true_rewards = np.random.rand(num_samples,K) < CTRs_that_generated_data
return true_rewards,CTRs_that_generated_data
@matope
matope / NoSQLデータモデリング技法.markdown
Created April 16, 2012 03:35
NoSQLデータモデリング技法

#NoSQLデータモデリング技法

原文:NoSQL Data Modeling Techniques « Highly Scalable Blog

I translated this article for study. contact matope[dot]ono[gmail] if any problem.

NoSQLデータベースはスケーラビリティ、パフォーマンス、一貫性といった様々な非機能要件から比較される。NoSQLのこの側面は実践と理論の両面からよく研究されている。ある種の非機能特性はNoSQLを利用する主な動機であり、NoSQLシステムによく適用されるCAP定理がそうであるように分散システムの基本的原則だからだ。一方で、NoSQLデータモデリングはあまり研究されておらず、リレーショナルデータベースに見られるようなシステマティックな理論に欠けている。本稿で、私はデータモデリングの視点からのNoSQLシステムファミリーの短い比較といくつかの共通するモデリングテクニックの要約を解説したい。

本稿をレビューして文法を清書してくれたDaniel Kirkdorfferに感謝したいと思う

@rajraj
rajraj / es.sh
Created January 3, 2012 20:07 — forked from aaronshaf/es.sh
Install ElasticSearch on CentOS 6
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@penguinco
penguinco / readme.txt
Created April 29, 2011 17:09
yats japanese user_ids api
You can get twitter user_ids who speak japanese.
MySQL dump file:deprecated.
JSON interface:
Query:
http://yats-data.com/yats/user_ids?id_autoinc=1260000&page=1
Params:
@mizchi
mizchi / faview.py
Created March 24, 2011 13:39
favoriteみる
#/usr/bin/python
#-*- encoding:utf-8 -*-
myname = "mizchi"
ckey = ""
csecret = ""
atoken =""
atoken_secret = ""
# encoding: utf-8
import re
from lxml import html
import datetime
class UnexpectedStructureError(Exception):
pass
def find(n, path):
retval = n.xpath(path)
Common subdirectories: elastic-mapreduce-ruby/amazon and elastic-mapreduce-ruby-multiple-jobconf/amazon
diff -cN elastic-mapreduce-ruby/commands.rb elastic-mapreduce-ruby-multiple-jobconf/commands.rb
*** elastic-mapreduce-ruby/commands.rb 2011-02-14 14:35:14.000000000 +0900
--- elastic-mapreduce-ruby-multiple-jobconf/commands.rb 2011-02-23 10:01:37.000000000 +0900
***************
*** 525,531 ****
end
for jc in get_field(:jobconf, []) do
! stream_options << "-jobconf" << jc
diff -x .git -Naru rspec.orig/lib/spec/runner/formatter/progress_bar_formatter.rb rspec/lib/spec/runner/formatter/progress_bar_formatter.rb
--- rspec.orig/lib/spec/runner/formatter/progress_bar_formatter.rb 2010-10-15 11:55:45.000000000 +0900
+++ rspec/lib/spec/runner/formatter/progress_bar_formatter.rb 2010-10-15 11:52:21.000000000 +0900
@@ -8,18 +8,18 @@
include NOOPMethodMissing
def example_failed(example, counter, failure)
- @output.print colorize_failure('F', failure)
+ @output.print colorize_failure('\(^o^)/', failure)
@output.flush