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
public class JapaneseCalendar { | |
private String era; | |
private String eto; | |
private final String [] ETO_A = {"子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"}; | |
private final String [] ETO_B = {"甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"}; | |
public JapaneseCalendar(int year) { | |
setEra(year); | |
setEto(year); | |
} |
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 Integer | |
def ! | |
(1..self).inject(1, :+) | |
end | |
end | |
puts 3.! # => 6 | |
puts 0.! # => 1 |
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
module TakePrintLn ( | |
takePrintLn | |
) where | |
takePrintLn :: Int -> [String] -> IO () | |
takePrintLn n = putStrLn . unlines . take n |
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
object Fact { | |
implicit class RichInt(val n : Int) { | |
def ! : Int = (1 to n).product | |
} | |
} |
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
puts "ほのうみことりんぱなまきえりのぞにこ".scan(/.{1,2}/).combination(2).map(&:join).shuffle |
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
use std::iter::range_inclusive; | |
fn main() { | |
let fact = |n: uint| { range_inclusive(1, n).fold(1, |a, b| a * b) }; | |
let nums = [3, 5, 0]; | |
for num in nums.iter() { println!("{}", fact(*num)) } | |
} |
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
@counter-style em-decimal { | |
system : numeric; | |
symbols : "\FF10" "\FF11" "\FF12" "\FF13" "\FF14" "\FF15" "\FF16" "\FF17" "\FF18" "\FF19"; | |
} |
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
@function gcd($a, $b) { | |
@if $b == 0 { | |
@return $a; | |
} @else { | |
@return gcd($b, $a % $b); | |
} | |
} | |
@function lcm($a, $b) { | |
@return $a * $b / gcd($a, $b); |
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
> gem install sqlite3 --platform=ruby -- --with-sqlite3-include=C:/temp/sqlite3 --with-sqlite3-lib=C:/temp/sqlite3 | |
> gem install sqlite3 |
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
import java.util.stream.IntStream; | |
import java.util.List; | |
import java.time.MonthDay; | |
import java.time.Year; | |
import java.time.DayOfWeek; | |
import java.time.LocalDate; | |
import static java.util.Arrays.asList; | |
import static java.time.Month.APRIL; | |
import static java.time.DayOfWeek.SATURDAY; |
OlderNewer