• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
TDDBC お題
 

TDDBC お題

on

  • 5,581 views

TDDBC のお題です

TDDBC のお題です

Statistics

Views

Total Views
5,581
Views on SlideShare
5,568
Embed Views
13

Actions

Likes
9
Downloads
36
Comments
0

6 Embeds 13

http://us-w1.rockmelt.com 4
http://clipin.me 3
https://twitter.com 2
https://t.co 2
http://slideclip.b-prep.com 1
http://paper.li 1

Accessibility

Upload Details

Uploaded via SlideShare as Adobe PDF

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

TDDBC お題 TDDBC お題 Presentation Transcript

  • Write a program that prints the numbers from 1 to 100. But formultiples of three print “Fizz” instead of the number and for themultiples of five print “Buzz”. For numbers which are multiples ofboth three and five print “FizzBuzz”.1 1003 Fizz 5 Buzz 3 5 FizzBuzz http://tickletux.wordpress.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/ http://www.aoky.net/articles/jeff_atwood/why_cant_programmers_program.htm
  • http://www.cs.is.saga-u.ac.jp/~nakayama07/sotsuken.html
  • Map Last Recently Used (LRU) Cache Map
  • #lru.put(“a”, “dataA”);lru.put(“b”, “dataB”);lru.put(“c”, “dataC”);lru.get(“a”); #=> null# getlru.put(“a”, “dataA”);lru.put(“b”, “dataB”);lru.get(“a”); #=> “dataA”lru.put(“c”, “dataC”);lru.get(“b”); #=> null
  • LRU Cache ?( …)
  • LRU Cache ?( …)
  • LRU Cache( …)
  • s = FileStore.news.set(“foo”, “hoge”)s.get(“foo”) #=> “hoge”s.dump #=> “foo:hoge¥n”s.set(“bar”, “fuga”)s.dump #=> “foo:hoge¥nbar:fuga¥n”s.get(“toto”) #=> nils.set(nil, “momo”) # nils.set(“”, “gogo”) #s.dump #=> “foo:hoge¥nbar:fuga¥n”s.set(“foo”, “piyo”)s.dump #=> “bar:fuga¥nfoo:piyo¥n”
  • FileStore ? ( …)void : set_multi(Map)Map : get_multi(Array)s.set_multi({‘foo’ => ‘hoge’, ‘bar’ => ‘fuga’})s.get_multi([‘foo’, ‘bar’, ‘baz’]) #=> {‘foo’ => ‘hoge’, ‘bar’ => ‘fuga’}
  • FileStore ? ( …)s.set(“foo”, “${now}”) #=> ${now}s.get(“foo”) #=> “2010-07-10 14:19:12”
  • FileStore ( …)set(key, val, second) ( )set(key, val, Time) ( )
  • # 1s.set_multi({‘foo’ => ‘hoge’, ‘bar’ => ‘fuga’})s.get_multi([‘foo’, ‘bar’, ‘baz’]) #=> {‘foo’ => ‘hoge’, ‘bar’ => ‘fuga’}# 2s.set(“foo”, “${now}”) #=> ${now}s.get(“foo”) #=> “2010-07-10 14:19:12” #=> dump ?# 3set(key, val, second=nil) ( )set(key, val, Time=nil) ( )
  • FileStore( …)
  • #“ : ”filter = WordFilter.new(‘Arsenal’)# detect #=> true/falsefilter.detect(“t_wada: Arsenal vs Chelsea !”) #=> true;filter.detect(“t_wada: ManU vs Liverpool ”) #=> false;# censor #=> Stringfilter.censor(“t_wada: Arsenal vs Chelsea !”) #=> “t_wada: <censored> vs Chelsea !”
  • WordFilter ?( …) NG
  • WordFilter ? … ( …) <censored>…
  • WordFilter ? … ( …) <censored>…
  • WordFilter ?( …) ( )
  • WordFilter( …)
  • #1 NGfilter = WordFilter.new(‘Arsenal’, ‘t_wada’)#2 ( OK)filter.censor(“t_wada: Arsenal!!”) #=> “t_wada: <XXX>!!”;#3filter.censor(“t_wada: t_wada ”) #=> “t_wada: <censored> ”;#4 : < (OS OK)> : < (OS OK)>