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
/** | |
* 任意の桁数の答えをランダムに生成します | |
* | |
* @param size | |
* 答えの桁数(1~10) | |
* @return 答え | |
*/ | |
private List<Integer> generateAnswer(int size) { | |
assert (1 <= size && size <= 10); |
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
public class MainStudents { | |
public static void main(String[] args) { | |
Students students = new Students(); | |
students.add(new Student("小貫", 82, 70)); | |
students.add(new Student("鈴木", 85, 74)); | |
students.add(new Student("山田", 74, 88)); | |
students.add(new Student("後藤", 90, 74)); | |
students.add(new Student("池田", 70, 82)); |
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 | |
@INPUT = ARGV[0].to_i | |
if @INPUT == nil then | |
puts '[usage] ex) ruby prime.rb 5' | |
exit | |
end | |
(2..Math.sqrt(@INPUT)).each do |i| | |
if @INPUT % i == 0 then |
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
# 自分の実装のあまりの酷さに絶望し、 | |
# kumagi様の実装を参考に実装しなおして冗長にコメントつけてみる | |
# https://gist.github.com/3047253 | |
# boardはqueenがあるcolの配列, rowは新規にqueenを置く行 | |
def find_rest board, row | |
# 終了条件 | |
return if row == 7 | |
# 各列についてqueenを(置けたら)置く |
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 'bbs2ch' | |
menu = BBS2ch::Menu.new | |
board = menu.boards(/犬猫大好き/).first | |
threads = board.threads(/猫画像/) | |
threads.each do |thr| | |
thr.responses.each do |res| | |
res.images.each do |img| |
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 'fileutils' | |
require 'bbs2ch' | |
require 'yaml' | |
menu = BBS2ch::Menu.new | |
boards = menu.boards(/犬猫大好き/) | |
boards.each do |board| | |
threads = board.threads(/猫画像/) |
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 | |
Dir::chdir(File.dirname(__FILE__)) | |
post_title = ARGV[0] | |
result = `rake new_post["#{post_title}"]` | |
result =~ /Creating new post: (.*)$/ | |
`subl #{$&}` |
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
puts 'Hello' |
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
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Control+[ to EISUU+Escape</name> | |
<identifier>remap.controlLeftbracket2eisuuAndEscape</identifier> | |
<autogen> | |
--KeyToKey-- | |
KeyCode::BRACKET_LEFT, VK_CONTROL, | |
KeyCode::JIS_EISUU, KeyCode::ESCAPE | |
</autogen> |
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
<dict> | |
<key>name</key> | |
<string>Markup: List</string> | |
<key>scope</key> | |
<string>markup.list</string> | |
<key>settings</key> | |
<dict> | |
<key>foreground</key> | |
<string>#ccffff</string> | |
</dict> |