How to get a job in the Silicon Valley?

Motivation I have sometimes been asked how to get a job or internship in the Silicon Valley from my Japanese friends. I answered that question with the same answer. I summarize my thought here. How to get an internship in Cisco? I joined C…

Python intensive dictionary introduction

Constructors d = {} # dict literal notation d = dict() d = {'one': 1, 'two': 2} # dict literal d = dict([('one', 1), ('two', 2)]) # list of tuples d = dict(one=1, two=2) # keyword arguments Dictionary from key value pair >>> keys = "one tw…

Python str.format

str.format Pro: flexible format Con: this is not common interface for programmer who is familiar with other language Eg >>> "{0} is good. {1} is better! {2} is awesomeXDDDD".format('foo', 'bar', 'baz') 'foo is good. bar is better! baz is a…

Magic method

http://www.rafekettler.com/magicmethods.html

for else

for ... else statement else is executed only for is finished all range. Pro: Flag can be omitted.Eg1 for i in range(1, 10): print i if i == 11: break else: print "do else" out put >>> ================================ RESTART ==============…

Change default open application in Mac

open file information change open with click change All... ref http://creazy.net/2009/04/mac_default_application.html

Remote Desk from Mac OS to Windows

Mac

Jump Desktop is better than other RDP clients. presumption my Mac Mac OS X 10.8.4 my Windows (Remote) Virtual Machine Windows 8 Microsoft Remote Desktop Connection Client for Mac Microsoft Remote Desktop Connection Client for Mac (RDC) all…

gitignore

git

ignore file which is already registered. http://nooopes.blogspot.tw/2011/10/gitignore.html

NEGI

Environment OS: Debian squeeze Library zlib libpqxx libpcap PostgreSQL setup $su - postgres $psql psql# create user YourDBUserName psql# create database YourDBName psql# grant all privileges on database YourDBName to YourDBUserName psql# \…

Git rest

git

http://d.hatena.ne.jp/mrgoofy33/20100910/1284069468git reset --hardgit reset --soft

The difference between git fetch and pull

git

fetch is just to get repository git fetch <repository> <refspec>pull = fetch and merge git pull ref http://transitive.info/article/git/command/fetch/</refspec></repository>

めも

http://blog.scimpr.com/2013/01/30/rails3%E3%81%A7ajax%E3%81%A7dd%E3%81%A7%E3%81%BE%E3%81%A8%E3%82%81%E3%81%A6%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%A2%E3%83%83%E3%83%97%E3%83%AD%E3%83%BC%E3%83%89%E3%82%92%E3%82%B9%E3%82%AF/Rails3でajax…

grep で再帰的に検索する http://d.hatena.ne.jp/imagawa_yakata/20110913/1315921917

Code document 制作

doxygen+graphviz http://momijiame.tumblr.com/post/23166110981/doxygen-graphvizdoxygen http://blog.s21g.com/articles/1305

git

git

git delete branch http://sessan.hatenablog.com/entry/2012/11/28/103741 リモートのブランチを取得http://wadslab.net/2009/10/git%E3%81%A7%E3%83%AA%E3%83%A2%E3%83%BC%E3%83%88%E3%81%AE%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%E3%81%8B%E3%82…

memo

ImageMagick brew install imagemagickRMagick install gem install rmagick --no-rdoc --no-riref http://blog.ruedap.com/entry/20110320/mac_ruby_imagemagick_rmagick_install .gitignore ingnore 設定 http://dev.classmethod.jp/etc/git-gitignor/ Rub…

Create DB for Rails application

Create DB for Rails application Connect to DB mysql -u root -pCreate DB and User create database test_development default character set utf8 collate utf8_unicode_ci; grant all on test_development.* to 'test'@'localhost'; set password for '…

Ruby on Rails development with Mac OS X Mountain Lion

Most developers like to spend a bit of time setting up their workspace. I've been experimenting Ruby on Rails for some time now and this is still my preferred setup. My core criteria is simple:Unobtrusive, no modifying core files Flexibili…

Rails schemの値を変更する

type, all は予約語 ref http://d.hatena.ne.jp/zucay/20110120/1295492571 rails generate controller controller_name indexその後 config/route. で resrouce controller_name を書く必要がある 作ったモデル、コントローラの取り消しhttp://shinodogg.co…

Rails 多対多

PostとCategoryの多対多の関係を作成する modelの作成 rails generate scaffold Post title:string content:text rails generate scaffold Category value:string modelの制作 rails generate model モデル名 カラム名:データ型 カラム名:データ型 rails gen…

Mac + unicorn + nginx + Rails 

環境 Mac OSX 10.8.3 Rails 3.2.13 Ruby 2.0.0-p0 Homebew は導入済みとする Unicorn Install gem install unicorn 設定 /config/unicorn.rb を作成 # ワーカーの数 worker_processes 2 # ソケット経由で通信する listen File.expand_path('tmp/sockets/unic…

Hadoop on Mountain Lion

Environment Mac OSX 10.8.3 Homebrew Java 6 Hadoop 1.1.2 Setting up SSH for public key login generate public key in order to login to localhost without password. #ssh-keygen #cd ~/.ssh #cat "id_rsa.pub" >> authorized_keys2 #ssh localhost Se…

Node.jsとWebSocket.IOでチャットアプリを作る

ref http://mawatari.jp/archives/make-a-chat-application-in-node-js-and-websocket-io

Capistrano WP

https://github.com/williamn/wp-cap-example

CakePHP search

ref http://mawatari.jp/archives/introduction-of-cakedc-search-plugin-for-cakephp

MAMPでのmysql操作の仕方

move directry cd /Applications/MAMP/Library/bin Access to mysql ./mysql -u root -p However, it is an inefficient way to type "cd path". Path should be written in zshrc. zshrc export PATH=$PATH:/Applications/MAMP/Library/bin ref http://blog…

Wordpressでステップメールを機能を実現する Autoresponder エラーfix

Autoresponder 4.04http://wordpress.org/extend/plugins/wp-responder-email-autoresponder-and-newsletter-plugin/このプラグインを導入するとワードプレスにステップメール機能が追加されます。 のはずでしたが、 プラグインを有効にした途端、wordpress…

Install Kyototycoon on Debian wheezy

Kyoto Tycoon is a remote client for Kyoto Cabinet and support Leveldb, memcached protcol. Kyoto Cabinet/Tycoon are like memcached but provide permanent data. Now days enterprise use Kyoto products because they enable permanent store and ar…

scp

使いかたは簡単で、送る先のサーバでsshdが動いていれば後はssh接続の応用です。scp ファイル名 IPアドレス:ファイル名 /tmp/file1を192.168.1.1のマシンの/tmp/内に送る場合なら、scp /tmp/file1 192.168.1.1:/tmp/ 192.168.1.1のtmpの中にfile1が移動され…

tar

compress tar zcvf backup.tar.gz file1 file2 uncompress tar zxvf filename