This file contains 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Sample</title> | |
<script type="text/javascript" src="jquery-1.12.0.min.js"></script> | |
<script type="text/javascript"> | |
$(function(){ | |
$('#button').click(function(){ | |
var list1 = $('#list1').val(); |
This file contains 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
< White > | |
Kor Duelist | |
Arrest | |
Apostle's Blessing x2 | |
Skyhunter Skirmisher | |
Oblivion Ring | |
Court Homunculus x2 | |
Sunlance | |
Taj-Nar Swordsmith | |
Terashi's Grasp |
This file contains 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 "minitest/autorun" | |
module InsertDummy | |
def self.insert_dummy(a) | |
dummy = "d" | |
if a.length < 2 | |
a + [dummy].cycle(3).to_a | |
else | |
case a.length % 4 | |
when 0 then a |
This file contains 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
def is_rect?(pt1, pt2, ours) | |
ours.include?({x: pt1[:x], y: pt2[:y]}) && ours.include?({x: pt2[:x], y: pt1[:y]}) && (pt1[:x] < pt2[:x]) && (pt1[:y] < pt2[:y]) | |
end | |
def is_valid_rect?(pt1, pt2, theirs) | |
theirs.none? { |their_pt| (their_pt[:x] >= pt1[:x] && their_pt[:x] <= pt2[:x]) && (their_pt[:y] >= pt1[:y] && their_pt[:y] <= pt2[:y]) } | |
end | |
def area(pt1, pt2) | |
(pt2[:x].ord - pt1[:x].ord) * (pt2[:y] - pt1[:y]) |
This file contains 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
defmodule DoukakuE08 do | |
# combination | |
# http://stackoverflow.com/questions/30585697/how-to-rewrite-erlang-combinations-algorithm-in-elixir | |
defp comb(0, _), do: [[]] | |
defp comb(_, []), do: [] | |
defp comb(n, [x | xs]) do | |
(for y <- comb(n - 1, xs), do: [x | y]) ++ comb(n, xs) | |
end | |
defp is_rect({x1, y1}, {x2, y2}, ours) do |
This file contains 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
c = 1 | |
File.open(ARGV[0]) do |f| | |
while l = f.gets | |
la = l.split("\"") | |
arg1 = la[1] | |
arg2 = la[3] | |
puts "test(#{c}, \"#{arg1}\", \"#{arg2}\")" |
This file contains 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
Karabiner | |
Do not remap internal keyboard | |
back-quote to kana/eisuu toggle | |
Seil | |
Change caps lock key -> 59(Left Ctrl) | |
Enable NFER -> 102(JIS eisuu) | |
Enable XFER -> 104(JIS kana) | |
Enable KATAKANA -> 54(Right Command) |
This file contains 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 Array | |
def x | |
self[0] | |
end | |
def y | |
self[1] | |
end | |
end |
This file contains 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
def calculate(actions) | |
if actions.all?{ |c| c == 'O'} | |
return 2 ** (actions.count + 2) - 4 | |
elsif actions.all?{ |c| c == 'X'} | |
if actions.count == 1 | |
return 5 | |
else | |
return 4 ** (actions.count - 1) + 1 | |
end | |
else |
This file contains 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
X,5 | |
O,4 | |
OX,10 | |
OO,12 | |
OXX,21 | |
OXO,18 | |
OOX,30 | |
OOO,28 | |
OXXX,81 | |
OXXO,29 |
OlderNewer