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
| #MAX = 10000000 | |
| #n = 10 | |
| #m = rand(MAX) | |
| #k = [rand(MAX)] * n | |
| m = 10 | |
| k = [1,2,3,4,5,6,7,8,9] | |
| k.combination(4) do |k1,k2,k3,k4| | |
| if k1 + k2 + k3 + k4 == m | |
| puts "YES" | |
| exit |
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 'rubygems' | |
| require 'plist' | |
| TEST_LOG_PATH = "./TestOutput/Logs/Test/" | |
| module XCTestSummaryParser | |
| class TestableSummary | |
| attr_accessor :tests | |
| def initialize(dict) |
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
| # encoding: utf-8 | |
| # | |
| # usage: ChatworkAPI.new.assign_task_to_all_members('room_id','task body') | |
| # | |
| require 'net/https' | |
| require 'uri' | |
| require 'json' | |
| class ChatworkAPI |
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
| # usage: ruby insert_property_annotation.rb < file | |
| lines = STDIN.readlines | |
| lines.each do |line| | |
| if !(line =~ / class /) && line =~ /(\s+?)(public|private) (.+?) (.+?)[\s;]/ | |
| puts %W(#{$1}@property("#{$4.underscore}")) | |
| puts line | |
| else | |
| puts line | |
| end |
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
| class SamuraiAi | |
| def read_game_info | |
| @total_turns,@num_daimyos,@num_lords = self.read_integers | |
| @military_strength = self.read_integers | |
| end | |
| def read_turn_info | |
| @turn,@time = STDIN.gets.split(' ') | |
| @turn = @turn.to_i | |
| @ints = [] |
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
| https://github.com/kishikawakatsumi/BuildNumber |
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
| if has('vim_starting') | |
| set nocompatible " Be iMproved | |
| " Required: | |
| set runtimepath+=~/.vim/bundle/neobundle.vim/ | |
| endif | |
| " Required: | |
| call neobundle#begin(expand('~/.vim/bundle/')) |
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
| ;基本 | |
| (+ 1 1) | |
| (mod 5 4) | |
| (< 1 2 3 4) | |
| ;if | |
| (if true (println "True it is.")) | |
| ;リスト | |
| (list 1 2 3) |
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
| class LazyProgrammer | |
| attr_accessor :delegate_programmer | |
| def initialize(programmer) | |
| @delegate_programmer = programmer | |
| end | |
| def work | |
| @delegate_programmer.work | |
| end | |
| end |
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
| hardstatus alwayslastline "%{= wk} %-w%{=bu dr}%n %t%{-}%+w %= %{=b wb}%y/%m/%d %{=b wb}%c" | |
| escape ^Tt | |
| defscrollback 10000 | |
| multiuser on | |
| acladd guest |
NewerOlder