Code
ActiveRecord::Base.connection_pool.instance_eval { @size }
Example
ActiveRecord::Base.connection_pool.instance_eval { @size }
Code
ActiveRecord::Base.connection_pool.instance_eval { @size }
Example
ActiveRecord::Base.connection_pool.instance_eval { @size }
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
import numpy as np | |
import cPickle as pickle | |
import gym | |
# hyperparameters | |
H = 200 # number of hidden layer neurons | |
batch_size = 10 # every how many episodes to do a param update? | |
learning_rate = 1e-4 | |
gamma = 0.99 # discount factor for reward |
<%# Put this code snippet between the <head></head>-tags in your application layout and %> | |
<%# replace 'UA-XXXXXXXX-X' with your own unique Google Analytics Tracking ID %> | |
<%# ... %> | |
<head> | |
<%# ... %> | |
<% if Rails.env.production? %> | |
<script type="text/javascript"> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
# urlが変更されるまで待つ
# 登録ボタンをクリックして登録処理が完了すると画面遷移する場合などで画面遷移するまで待つようにできる
# 例) wait_for_url_change { click_on '登録' }
# 登録して画面遷移が終わるまでwait_for_url_changeでsleepされる
def wait_for_url_change(timeout_sec = 3)
current_path = page.current_path
yield
# -*- coding: utf-8 -*- | |
""" | |
given a word and visualize near words | |
original source code is https://github.com/nishio/mycorpus/blob/master/vis.py | |
""" | |
import word2vec_boostpython as w2v | |
from sklearn.decomposition import PCA | |
import matplotlib.pyplot as plt | |
import matplotlib.font_manager |
tl;dr IdotabaのGemfileは"全プレ"になりました。ご笑納ください。→ Gemfile
rebuild.fmのep36でお知らせさせていただきました、Idobataの最新版Gemfileプレゼントをお届けいたします。 過日はIdobata会議01への多数のご参加ありがとうございました。おかげさまで盛況なミートアップとなりました。 (当日会場を提供いただいたEngine Yardさまのブログにて、Idobata会議01当日の様子がまとめられています。ありがとうございます!)
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import csv | |
import codecs | |
import numpy as np | |
import MeCab | |
from sklearn.feature_extraction.text import TfidfVectorizer | |
from sklearn.cluster import KMeans, MiniBatchKMeans |
# encoding: utf-8 | |
module TelSplitter | |
MAP = { | |
# 市外局番 , 市内局番の桁数のマップ | |
# http://www.soumu.go.jp/main_sosiki/joho_tsusin/top/tel_number/number_shitei.html のデータを利用 | |
# 固定電話以外の桁数は適当です... | |
'050' => 4, # IP電話 | |
'070' => 4, # 携帯電話/PHS | |
'080' => 4, # 携帯電話 |
#SOURCE https://gist.github.com/orzccc/3104030 | |
ja: | |
devise: | |
confirmations: | |
confirmed: 'アカウントを登録しました。' | |
# confirmed: 'Your account was successfully confirmed. You are now signed in.' | |
send_instructions: '登録方法を数分以内にメールでご連絡します。' | |
# send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.' | |
send_paranoid_instructions: 'もしあなたのEメールアドレスが見つかった場合、本人確認についてのメールが数分以内に送られます。' |
"------------------------------------ | |
" Unite-rails.vim | |
"------------------------------------ | |
"{{{ | |
function! UniteRailsSetting() | |
nnoremap <buffer><C-H><C-H><C-H> :<C-U>Unite rails/view<CR> | |
nnoremap <buffer><C-H><C-H> :<C-U>Unite rails/model<CR> | |
nnoremap <buffer><C-H> :<C-U>Unite rails/controller<CR> | |
nnoremap <buffer><C-H>c :<C-U>Unite rails/config<CR> |