Skip to content

Instantly share code, notes, and snippets.

View private-yusuke's full-sized avatar
💤

private-yusuke

💤
View GitHub Profile
@private-yusuke
private-yusuke / GCDSolver.swift
Created August 14, 2017 14:59
最大公約数を一瞬で出すクラス
import Foundation
class GCDSolver {
static func solve(_ a: Int, _ b: Int) -> Int {
if a == 0 || b == 0 {
fatalError("Fount zero value in the arguments")
}
var i = a, j = b
if i < j {
@private-yusuke
private-yusuke / BenchTime.swift
Created August 14, 2017 14:17
かんたんに処理時間を計測できるクラス
import Foundation
class BenchTime {
private var elapsedTime_: Double = 0
init(block: () -> ()) {
let start = Date()
block()
elapsedTime_ = Date().timeIntervalSince(start)
}
Inductive major (A B C:Prop) : Prop :=
| ab: A->B->major A B C
| bc: B->C->major A B C
| ca: C->A->major A B C.
Theorem majmaj:
forall A B C: Prop,
major A B C -> ~major (~A) (~B) (~C).
Proof.
unfold not.
@private-yusuke
private-yusuke / weather-cui.d
Last active July 23, 2017 13:58
郵便番号を入れると現在の天気とか出してくれるすごいやつ
import std.stdio, std.string, std.json, std.net.curl, std.conv;
const string URL = "http://api.openweathermap.org/data/2.5/weather";
const string APPID = "TYPE YOUR APPID HERE";
void main(string[] args) {
if (args.length != 2) {
writeln("The arguments are too less or too much");
return;
}