This file contains hidden or 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
| -module(recursive). | |
| -export([split/2]). | |
| -export([fib/1]). | |
| split(D, L) -> split(D, L, [], []). | |
| split(_, [] , R, W) -> [lists:reverse(X) || X <- lists:reverse([W|R])]; | |
| split(D, [D|T], R, W) -> split(D, T, [W|R], []); | |
| split(D, [H|T], R, W) -> split(D, T, R, [H|W]). | |
| fib(0) -> 0; |
This file contains hidden or 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
| $ sw_vers | |
| ProductName: Mac OS X | |
| ProductVersion: 10.9.3 | |
| BuildVersion: 13D65 |
This file contains hidden or 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
| kerl build R15B01 r15b01-01 |
This file contains hidden or 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://ja.wikipedia.org/wiki/%E3%82%B3%E3%83%94%E3%83%BC%E3%83%BB%E3%82%A2%E3%83%B3%E3%83%89%E3%83%BB%E3%83%9A%E3%83%BC%E3%82%B9%E3%83%88 |
This file contains hidden or 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
| % mongo test --eval "db.d1.drop(); db.d1.insert({no: 1, d: new Date()})" && mongoexport -d test -c d1 | |
| MongoDB shell version: 2.4.6 | |
| connecting to: test | |
| connected to: 127.0.0.1 | |
| { "_id" : { "$oid" : "534e0af8532dbdbaa7c05783" }, "no" : 1, "d" : { "$date" : 1397623544193 } } | |
| exported 1 records |
This file contains hidden or 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
| % mongo test | |
| MongoDB shell version: 2.4.6 | |
| connecting to: test | |
| > | |
| > db.t1.drop(); | |
| false | |
| > db.createCollection("t1", {}); | |
| { "ok" : 1 } | |
| > db.t1.ensureIndex({f1: 1}, {uniq: true}); | |
| > db.t1.ensureIndex({f1: 1}, {}); |
This file contains hidden or 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
| インストールしたもの | |
| Emacs-24.3-universal-10.6.8.dmg | |
| GitX-L_v0.8.4.zip | |
| googlechrome.dmg | |
| GoogleJapaneseInput.dmg | |
| Skype_6.8.60.351.dmg | |
| xcode462_cltools_10_86938259a.dmg | |
| xcode4630916281a.dmg |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| base_dir = File.expand_path(".") | |
| base_stat = File.stat(base_dir) | |
| base_dir_permission = base_stat.mode & 0o777 | |
| base_file_permission = (base_stat.mode ^ 0o111) & 0o777 | |
| f = lambda do |confirmation| | |
| confirmation.puts "current directory: #{base_dir}" | |
| confirmation.puts "base_dir_permission : %o" % base_dir_permission |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| require "rubygems" | |
| require "amqp" # requires version >= 0.8.0.RC14 | |
| puts "=> Example of automatic AMQP channel and queues recovery" | |
| puts | |
| AMQP.start(:host => "localhost") do |connection, open_ok| | |
| puts "AMQP.start block runs" | |
| # on_open, on_closedに渡されたブロックは、何度再接続をしても最初の一度だけしか呼び出されないが、 |
This file contains hidden or 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
| require 'fileutils' | |
| FileUtils.cp("config/database.yml", "config/database.yml.example") | |
| File.open(".gitignore", "a") do |f| | |
| f.puts "Gemfile.lock" | |
| f.puts ".rvmrc" | |
| end | |
| File.open("config/.gitignore", "a"){|f| f.puts("*.example")} | |
| gem 'factory_girl_rails', :group => [:development, :test] |