Skip to content

Instantly share code, notes, and snippets.

@kota
kota / sample.clj
Last active December 15, 2015 23:09
;基本
(+ 1 1)
(mod 5 4)
(< 1 2 3 4)
;if
(if true (println "True it is."))
;リスト
(list 1 2 3)
@kota
kota / .vimrc
Last active August 29, 2015 14:06
if has('vim_starting')
set nocompatible " Be iMproved
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
" Required:
call neobundle#begin(expand('~/.vim/bundle/'))
https://github.com/kishikawakatsumi/BuildNumber
@kota
kota / ai.rb
Created December 9, 2014 04:03
SamurAICoding2014
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 = []
# 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
# encoding: utf-8
#
# usage: ChatworkAPI.new.assign_task_to_all_members('room_id','task body')
#
require 'net/https'
require 'uri'
require 'json'
class ChatworkAPI
require 'rubygems'
require 'plist'
TEST_LOG_PATH = "./TestOutput/Logs/Test/"
module XCTestSummaryParser
class TestableSummary
attr_accessor :tests
def initialize(dict)
#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