ll golf

102
LL GOLF - HOLE 3 解説: Yugui 2008830日土曜日

Upload: yuki-sonoda

Post on 27-May-2015

1.052 views

Category:

Technology


1 download

DESCRIPTION

LL Golf Hole 3 and 7 at LL Future (20080830)

TRANSCRIPT

Page 1: LL Golf

LL GOLF - HOLE 3解説: Yugui

2008年8月30日土曜日

Page 2: LL Golf

自己紹介

2008年8月30日土曜日

Page 3: LL Golf

Yugui2008年8月30日土曜日

Page 4: LL Golf

リリースマネージャー

2008年8月30日土曜日

Page 5: LL Golf

初めてのRuby

2008年8月30日土曜日

Page 6: LL Golf

2008年8月30日土曜日

Page 7: LL Golf

本題2008年8月30日土曜日

Page 8: LL Golf

Hole32008年8月30日土曜日

Page 9: LL Golf

13日2008年8月30日土曜日

Page 10: LL Golf

金曜2008年8月30日土曜日

Page 11: LL Golf

2013-12-31

2008年8月30日土曜日

Page 12: LL Golf

回数2008年8月30日土曜日

Page 13: LL Golf

表彰2008年8月30日土曜日

Page 14: LL Golf

実直で賞

2008年8月30日土曜日

Page 15: LL Golf

匿名さん

2008年8月30日土曜日

Page 16: LL Golf

840B2008年8月30日土曜日

Page 17: LL Golf

import java.util.*;import static java.util.Calendar.*;public class Count13Friday {

public static void main(String[] args) { Calendar to = new GregorianCalendar(2013, 12, 31); Calendar current = new GregorianCalendar();

int currentDate = current.get(DATE); if (currentDate != 13) { current.set(DATE, 13); if (13 < currentDate) { current.add(MONTH, 1); } }

List<Date> fridays = new ArrayList<Date>(); while (current.compareTo(to) <= 0) { if (current.get(DAY_OF_WEEK) == FRIDAY) { fridays.add(current.getTime()); } current.add(MONTH, 1); } System.out.println("Fridays = " + fridays); System.out.println("Fridays count = " + fridays.size()); }

}

2008年8月30日土曜日

Page 18: LL Golf

質実剛健

2008年8月30日土曜日

Page 19: LL Golf

難点2008年8月30日土曜日

Page 20: LL Golf

import2008年8月30日土曜日

Page 21: LL Golf

- import java.util.*;+ import java.util.ArrayList;+ import java.util.Calendar;+ import java.util.Date;+ import java.util.GregorianCalendar;+ import java.util.List; import static java.util.Calendar.*; public class Count13Friday {

2008年8月30日土曜日

Page 22: LL Golf

次2008年8月30日土曜日

Page 23: LL Golf

AI賞2008年8月30日土曜日

Page 24: LL Golf

koguroさん

2008年8月30日土曜日

Page 25: LL Golf

1292B2008年8月30日土曜日

Page 26: LL Golf

#!/usr/bin/env gosh

(use gauche.process)

(let* ((now (sys-localtime (sys-time))) (lst '())) (do ((y #0=(+ 1900 (ref now 'year)) (+ y 1))) ((<= 2014 y) (dolist (elem (reverse lst)) (apply format #t "~d/~d/13~%" elem)) (format #t "==> ~d~%" (length lst))) (do ((m 0 (+ m 1))) ((<= 12 m)) (unless (and (= #0# y) (or (< m #1=(ref now 'mon)) (and (= #1# m) (< 13 (ref now 'mday))))) (let ((l (process-output->string-list `(cal ,(+ m 1) ,y)))) (let loop ((ans (find #/8 9 10 11 12 13 14/ l))) (for-each print l) (print "この月に13日の金曜日は含まれますか?\n含まれる場合は y, 疲れたときは g, それ以外のときはリターンキーを押してください: ") (case (string->symbol (read-line)) ((y Y) (if ans (push! lst (list y (+ m 1))) #2=(begin (print "\n*** 本当ですか? もう一度よく確認してみてください ***\n") (loop ans)))) ((g G) (error "out of patience, aborting ...")) (else (when ans #2#)))))))))

2008年8月30日土曜日

Page 27: LL Golf

無駄遣い

2008年8月30日土曜日

Page 28: LL Golf

ネタ精神

2008年8月30日土曜日

Page 29: LL Golf

次2008年8月30日土曜日

Page 30: LL Golf

フィルター賞

2008年8月30日土曜日

Page 31: LL Golf

関数2008年8月30日土曜日

Page 32: LL Golf

あにすさん

2008年8月30日土曜日

Page 33: LL Golf

358B2008年8月30日土曜日

Page 34: LL Golf

using System;using System.Collections.Generic;using System.Linq;class C{static void Main(){List<DateTime>l=new List<DateTime>();for(DateTime d=DateTime.Now;d<=new DateTime(2013,12,31);d=d.AddDays(1)){l.Add(d);}var v=from f in l where(int)(f.DayOfWeek)==5&f.Day==13select f.Date;foreach(var d in v){Console.WriteLine(d);}Console.Write(v.Count<DateTime>());}}

2008年8月30日土曜日

Page 35: LL Golf

LINQ2008年8月30日土曜日

Page 36: LL Golf

using System;using System.Collections.Generic;using System.Linq;class C { static void Main(){ List<DateTime> l = new List<DateTime>(); for (DateTime d = DateTime.Now; d <= new DateTime(2013,12,31); d = d.AddDays(1)) { l.Add(d); } var v = from f in l where (int)(f.DayOfWeek) == 5 & f.Day==13 select f.Date;

foreach (var d in v) { Console.WriteLine(d); } Console.Write(v.Count<DateTime>()); }}

2008年8月30日土曜日

Page 37: LL Golf

次2008年8月30日土曜日

Page 38: LL Golf

goruby賞

2008年8月30日土曜日

Page 39: LL Golf

shimakumaさん

2008年8月30日土曜日

Page 40: LL Golf

56B2008年8月30日土曜日

Page 41: LL Golf

実は最短

2008年8月30日土曜日

Page 42: LL Golf

rq'date'a=De.y.up(De.w 2014).s{|d|d.d*d.w==65}s a,a.sz

2008年8月30日土曜日

Page 43: LL Golf

プロの犯行

2008年8月30日土曜日

Page 44: LL Golf

展開2008年8月30日土曜日

Page 45: LL Golf

rq'date'a=De.y.up(De.w 2014).s{|d|d.d*d.w==65}s a,a.sz

2008年8月30日土曜日

Page 46: LL Golf

rq'date'a=De.y.up(De.w 2014).s{|d|d.d*d.w==65}s a,a.sz

2008年8月30日土曜日

Page 47: LL Golf

require 'date'a=Date.today.upto(Date.new 2014).select{|d| d.day*d.wday==65}puts a,a.size

rq'date'a=De.y.up(De.w 2014).s{|d|d.d*d.w==65}s a,a.sz

2008年8月30日土曜日

Page 48: LL Golf

これはひどい

2008年8月30日土曜日

Page 49: LL Golf

アルゴリズム

2008年8月30日土曜日

Page 50: LL Golf

d.day * d.wday == 65

2008年8月30日土曜日

Page 51: LL Golf

d.day * d.wday == 65

13

2008年8月30日土曜日

Page 52: LL Golf

d.day * d.wday == 65

13 5

2008年8月30日土曜日

Page 53: LL Golf

素数2008年8月30日土曜日

Page 54: LL Golf

初等整数論の基本定理

2008年8月30日土曜日

Page 55: LL Golf

由来2008年8月30日土曜日

Page 56: LL Golf

==652008年8月30日土曜日

Page 57: LL Golf

アルゴリズム賞

2008年8月30日土曜日

Page 58: LL Golf

[1..100]>>=penさん

2008年8月30日土曜日

Page 59: LL Golf

require'date'i=0Date.today.upto(Date.new(2014)-1){|d| puts d.strftime'%Y-%m-%d' if d.mday*d.wday==65 && i+=1}puts i

2008年8月30日土曜日

Page 60: LL Golf

次2008年8月30日土曜日

Page 61: LL Golf

短いで賞

2008年8月30日土曜日

Page 62: LL Golf

kkobayashiさん

2008年8月30日土曜日

Page 63: LL Golf

75B2008年8月30日土曜日

Page 64: LL Golf

l=Sys.Date():16070;class(l)="Date";length(print(l[format(l,"%d%w")==135]))

2008年8月30日土曜日

Page 65: LL Golf

了2008年8月30日土曜日

Page 66: LL Golf

LL GOLF - HOLE 7

2008年8月30日土曜日

Page 67: LL Golf

バイト数

2008年8月30日土曜日

Page 68: LL Golf

Human Readable

2008年8月30日土曜日

Page 69: LL Golf

1 => 11290 => 1.2K

2008年8月30日土曜日

Page 70: LL Golf

表彰2008年8月30日土曜日

Page 71: LL Golf

CPAN賞

2008年8月30日土曜日

Page 72: LL Golf

turuginaさん

2008年8月30日土曜日

Page 73: LL Golf

65B2008年8月30日土曜日

Page 74: LL Golf

perl -MNumber::Bytes::Human=format_bytes-ple'$_=format_bytes$_'

2008年8月30日土曜日

Page 75: LL Golf

CPAN2008年8月30日土曜日

Page 76: LL Golf

正攻法2008年8月30日土曜日

Page 77: LL Golf

短い2008年8月30日土曜日

Page 78: LL Golf

次2008年8月30日土曜日

Page 79: LL Golf

フクロウ賞

2008年8月30日土曜日

Page 80: LL Golf

emasakaさん

2008年8月30日土曜日

Page 81: LL Golf

81B2008年8月30日土曜日

Page 82: LL Golf

/^..\?.\?$/bs/$/.0kMGT/:as/\(.\)\(.\)..\...\(.\)/\1.\2\3/tas/\(\...\).*/\1/

2008年8月30日土曜日

Page 83: LL Golf

正規表現

2008年8月30日土曜日

Page 84: LL Golf

C++ is a (functional) LL

2008年8月30日土曜日

Page 85: LL Golf

1239B2008年8月30日土曜日

Page 86: LL Golf

#include <iostream>

template <bool b, class T, class S> struct Choice { typedef T Result; };template <class T, class S> struct Choice<false, T, S> { typedef S Result; };

struct None {enum{ symbol = ' ', base = 1LL };};struct Kilo {enum{ symbol = 'K', base = 1000LL };};struct Mega {enum{ symbol = 'M', base = 1000000LL };};struct Giga {enum{ symbol = 'G', base = 1000000000LL };}; struct Tera {enum{ symbol = 'T', base = 1000000000000LL };}; template <long long n> struct SIPrefix{ typedef typename Choice< n < Kilo::base, None, typename Choice< n < Mega::base, Kilo, typename Choice< n < Giga::base, Mega, typename Choice< n < Tera::base, Giga, Tera >::Result>::Result>::Result>::Result Result;};

template <long long n> struct HumanReadable{private: typedef typename SIPrefix<n>::Result prefix; friend std::ostream& operator << (std::ostream& os, struct HumanReadable<n>) { return os << static_cast<double>(n)/prefix::base << static_cast<char>(prefix::symbol); }};

int main(){ std::cout << HumanReadable<123456789012345LL>() << std::endl; return 0;};

2008年8月30日土曜日

Page 87: LL Golf

副作用(ほとんど)なし

2008年8月30日土曜日

Page 88: LL Golf

Haskell方言

2008年8月30日土曜日

Page 89: LL Golf

次2008年8月30日土曜日

Page 90: LL Golf

おばふろ賞

2008年8月30日土曜日

Page 91: LL Golf

quabbinさん

2008年8月30日土曜日

Page 92: LL Golf

63B2008年8月30日土曜日

Page 93: LL Golf

s=$*[0];l=s.size-1;x=l%3+1p s[0,x]+"."+s[x,1]+" kMGTPE"[l/3,1]

2008年8月30日土曜日

Page 94: LL Golf

Overflow

2008年8月30日土曜日

Page 95: LL Golf

ruby overflow.rb 123456789012345689012345#=> "123.4"

2008年8月30日土曜日

Page 96: LL Golf

残念な思い

2008年8月30日土曜日

Page 97: LL Golf

次2008年8月30日土曜日

Page 98: LL Golf

またお前か賞

2008年8月30日土曜日

Page 99: LL Golf

emasakaさん

2008年8月30日土曜日

Page 100: LL Golf

80B2008年8月30日土曜日

Page 101: LL Golf

dd if=/dev/zero of=.$$ bs=$1 count=1 2>/dev/nullls -lh .$$|cut -d\ -f 5rm .$$

2008年8月30日土曜日

Page 102: LL Golf

完2008年8月30日土曜日