Slide 1

Slide 1 text

ࠓ೔ͷ”Ͳ͏ॻ͘”໰୊ͷ ΞϧΰϦζϜྫ 2019/08/28 #nagoyaphp @ttskch

Slide 2

Slide 2 text

๻ʹ͍ͭͯ

Slide 3

Slide 3 text

͖ͨͭͪʢ໊͋ͩʣ • (ג)ΧϧςοτίϛϡχέʔγϣϯζCTO • WebΤϯδχΞྺ7೥ɺPHPྺ7೥ • #nagoyaphpʊ • #symfony_meetup

Slide 4

Slide 4 text

͖ͨͭͪʢ໊͋ͩʣ • ͓ख఻͍ͨ͠ຊʢ2015/12ʣ • Schooߨࢣʢ2018/04ʣ ʮGitHubΛ࢖ͬͨσϓϩΠࣗಈԽ࣮ફʯ ʮجຊ͔Β͔ͬ͠ΓֶͿ Symfony2ೖ໳ʯ

Slide 5

Slide 5 text

ͨ ͭ ͖ ͪ twitter.com/ttskch ͋͞ɺ͋ͳͨ΋ࠓ͙͢ϑΥϩʔ͠Α͏!!! ׬શແྉ ·͞ʹ໊ݴ੡଄ػ ਓੜͰେ੾ͳ͜ͱ͸ɺ͢΂ͯ ͖͔ͨͭͪΒڭΘͬͨ ͖ͨͭͪΛϑΥϩʔͨ͠Β
 ࠊ௧͕࣏Γ·ͨ͠ 100% φϯτʂ ϑΥϩϫʔ͔Βͷࢧ࣋཰ 100% ͍ͯ͠Δ ͍ͯ͠ͳ͍ ϑΥϩϫʔ͞Μ100ਓʹฉ͖·ͨ͠ ͖ͨͭͪΛϑΥϩʔ͍ͯ͠Δʁ

Slide 6

Slide 6 text

ձࣾʹ͍ͭͯ

Slide 7

Slide 7 text

(ג)Χϧςοτίϛϡχέʔγϣϯζ https://quartet-communications.com

Slide 8

Slide 8 text

(ג)Χϧςοτίϛϡχέʔγϣϯζ https://www.google.co.jp/search?q=Χʔςϯ

Slide 9

Slide 9 text

(ג)Χϧςοτίϛϡχέʔγϣϯζ https://lisket.jp

Slide 10

Slide 10 text

We are hiring!ʢϚδͰʣ • PHPer/JSerઈࢍେืूதʂʢϦϞʔτ΍όΠτ΋Մʣ • Symfony+AngularͰɺWeb޿ࠂۀքΛ
 ϗϫΠτʹ͢Δ࢓૊ΈΛ࡞ͬͯ·͢ • ܦӦϏδϣϯ͸ʮੈքҰޮ཰తͳ୅ཧళʯ

Slide 11

Slide 11 text

We are hiring!ʢϚδͰʣ • ࣗࣾαʔϏεʮLisketʯͰࣗࣾͷۀ຿΋ޮ཰Խ • શࣾһͷฏۉ࢒ۀ͕࣌ؒ5h/݄͙Β͍Ͱ͢ ಛผ৆ड৆

Slide 12

Slide 12 text

We are hiring!ʢϚδͰʣ ΤϯδχΞͷಇ͖΍͢͞௒େࣄʹͯ͠·͢✨

Slide 13

Slide 13 text

We are hiring!ʢϚδͰʣ ·ͣ͸͓࿩͚ͩͰ΋ʂؾܰʹ੠͔͚͍ͯͩ͘͞

Slide 14

Slide 14 text

/30 We are hiring!ʢϚδͰʣ ࠾༻αΠτ΋͋Γ·͢ʂͥͻ೷͍ͯΈ͍ͯͩ͘͞ 14 https://quartetcom.co.jp/recruit/engineer/

Slide 15

Slide 15 text

ࠓ೔ͷ”Ͳ͏ॻ͘”໰୊ͷ ΞϧΰϦζϜྫ 2019/08/28 #nagoyaphp @ttskch

Slide 16

Slide 16 text

http://nabetani.sakura.ne.jp/hena/orde16nontri/

Slide 17

Slide 17 text

ී௨ʹ΍Δͱ

Slide 18

Slide 18 text

public function run(string $input) : string { $dec = intval($input); while (true) { $bin = decbin(strval(++$dec)); if (strpos($bin, '000') === false && strpos($bin, '111') === false) { return strval($dec); } } } 1૿΍͠ͳ͕Βɺஞ࣍ʮඇࡾ࿈਺͔ʁʯΛνΣοΫ͢Δ

Slide 19

Slide 19 text

public function run(string $input) : string { $dec = intval($input); while (true) { $bin = decbin(strval(++$dec)); if (strpos($bin, '000') === false && strpos($bin, '111') === false) { return strval($dec); } } } 1૿΍͠ͳ͕Βɺஞ࣍ʮඇࡾ࿈਺͔ʁʯΛνΣοΫ͢Δ ೖྗ஋ͱظ଴஋ͷࠩʹൺྫͯ͠ ܭࢉྔ͕૿͑Δ

Slide 20

Slide 20 text

public function run(string $input) : string { $dec = intval($input); while (true) { $bin = decbin(strval(++$dec)); if (strpos($bin, '000') === false && strpos($bin, '111') === false) { return strval($dec); } } } 1૿΍͠ͳ͕Βɺஞ࣍ʮඇࡾ࿈਺͔ʁʯΛνΣοΫ͢Δ ೖྗ஋ͱظ଴஋ͷࠩʹൺྫͯ͠ ܭࢉྔ͕૿͑Δ 100000000000000 (2) ͱ͔Λೖྗ͞ΕΔͱϠόΠ

Slide 21

Slide 21 text

޻෉ͯ͠ΈΔ

Slide 22

Slide 22 text

ྫ୊ᶃ 22

Slide 23

Slide 23 text

ྫ୊ᶃ 23 100010110001

Slide 24

Slide 24 text

24 100010110001 ࠷ॳͷ 000 Λݟ͚ͭΔ ྫ୊ᶃ

Slide 25

Slide 25 text

25 100110110001 ͦΕΛ 001 ʹஔ͖׵͑Δ ྫ୊ᶃ

Slide 26

Slide 26 text

26 100110110001 ଓ͖Λ͢΂ͯ 001001... Ͱஔ͖׵͑Δ ྫ୊ᶃ

Slide 27

Slide 27 text

27 100100100100 ଓ͖Λ͢΂ͯ 001001... Ͱஔ͖׵͑Δ ྫ୊ᶃ

Slide 28

Slide 28 text

28 100100100100 ׬੒ ྫ୊ᶃ

Slide 29

Slide 29 text

ྫ୊ᶄ 29

Slide 30

Slide 30 text

ྫ୊ᶄ 30 101110101101

Slide 31

Slide 31 text

31 101110101101 ࠷ॳͷ 0111 Λݟ͚ͭΔ ྫ୊ᶄ

Slide 32

Slide 32 text

32 110010101101 ͦΕΛ 1001 ʹஔ͖׵͑Δ ྫ୊ᶄ

Slide 33

Slide 33 text

33 110010101101 ଓ͖Λ͢΂ͯ 001001... Ͱஔ͖׵͑Δ ྫ୊ᶄ

Slide 34

Slide 34 text

34 110010010010 ଓ͖Λ͢΂ͯ 001001... Ͱஔ͖׵͑Δ ྫ୊ᶄ

Slide 35

Slide 35 text

35 110010010010 ׬੒ ྫ୊ᶄ

Slide 36

Slide 36 text

·ͱΊΔͱ 36

Slide 37

Slide 37 text

37 000͕ઌʹ ͋Δ৔߹ ࠷ॳͷ000Λ001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ 0111͕ઌʹ ͋Δ৔߹ ࠷ॳͷ0111Λ1001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ

Slide 38

Slide 38 text

38 000͕ઌʹ ͋Δ৔߹ ࠷ॳͷ000Λ001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ 0111͕ઌʹ ͋Δ৔߹ ࠷ॳͷ0111Λ1001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ

Slide 39

Slide 39 text

39 000͕ઌʹ ͋Δ৔߹ ࠷ॳͷ000Λ001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ 0111͕ઌʹ ͋Δ৔߹ ࠷ॳͷ0111Λ1001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ ઌ಄͕111ͩͬͨΒʁ

Slide 40

Slide 40 text

40 000͕ઌʹ ͋Δ৔߹ ࠷ॳͷ000Λ001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ 0111͕ઌʹ ͋Δ৔߹ ࠷ॳͷ0111Λ1001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ

Slide 41

Slide 41 text

41 000͕ઌʹ ͋Δ৔߹ ࠷ॳͷ000Λ001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ 0111͕ઌʹ ͋Δ৔߹ ࠷ॳͷ0111Λ1001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ ͋Β͔͡Ίઌ಄ʹ0Λ෇༩্͓͍ͯͨ͠Ͱ

Slide 42

Slide 42 text

42 000͕ઌʹ ͋Δ৔߹ ࠷ॳͷ000Λ001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ 0111͕ઌʹ ͋Δ৔߹ ࠷ॳͷ0111Λ1001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ ͋Β͔͡Ίઌ಄ʹ0Λ෇༩্͓͍ͯͨ͠Ͱ ͞Βʹͻͱ޻෉…

Slide 43

Slide 43 text

43 1000͕ઌʹ ͋Δ৔߹ ࠷ॳͷ1000Λ1001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ 0111͕ઌʹ ͋Δ৔߹ ࠷ॳͷ0111Λ1001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ ͋Β͔͡Ίઌ಄ʹ0Λ෇༩্͓͍ͯͨ͠Ͱ

Slide 44

Slide 44 text

44 1000͕ઌʹ ͋Δ৔߹ ࠷ॳͷ1000Λ1001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ 0111͕ઌʹ ͋Δ৔߹ ࠷ॳͷ0111Λ1001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ ͋Β͔͡Ίઌ಄ʹ0Λ෇༩্͓͍ͯͨ͠Ͱ

Slide 45

Slide 45 text

45 1000͕ઌʹ ͋Δ৔߹ ࠷ॳͷ1000Λ1001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ 0111͕ઌʹ ͋Δ৔߹ ࠷ॳͷ0111Λ1001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ ͋Β͔͡Ίઌ಄ʹ0Λ෇༩্͓͍ͯͨ͠Ͱ

Slide 46

Slide 46 text

46 1000͕ઌʹ ͋Δ৔߹ ࠷ॳͷ1000·ͨ͸0111Λ 1001ʹஔ׵ͯ͠ ࢒ΓΛ001ͷ॥؀ͰຒΊΔ 0111͕ઌʹ ͋Δ৔߹ ͋Β͔͡Ίઌ಄ʹ0Λ෇༩্͓͍ͯͨ͠Ͱ

Slide 47

Slide 47 text

ྫ୊ᶅ 47

Slide 48

Slide 48 text

ྫ୊ᶅ 48 110111010110

Slide 49

Slide 49 text

ྫ୊ᶅ 49 01101110101100 ઌ಄ʹ 0 Λ෇༩͢Δ

Slide 50

Slide 50 text

50 01101110101100 ࠷ॳͷ 0111 Λݟ͚ͭΔ ྫ୊ᶅ

Slide 51

Slide 51 text

51 01110010101100 ͦΕΛ 1001 ʹஔ͖׵͑Δ ྫ୊ᶅ

Slide 52

Slide 52 text

52 01110010101100 ଓ͖Λ͢΂ͯ 001001... Ͱஔ͖׵͑Δ ྫ୊ᶅ

Slide 53

Slide 53 text

53 01110010010010 ଓ͖Λ͢΂ͯ 001001... Ͱஔ͖׵͑Δ ྫ୊ᶅ

Slide 54

Slide 54 text

54 111001001001 ׬੒ʁ ྫ୊ᶅ

Slide 55

Slide 55 text

55 111001001001 ൱ʂ ྫ୊ᶅ

Slide 56

Slide 56 text

མͱ݀͠ 56 • 0111Λ1001ʹஔ׵ͨ͜͠ͱͰɺ
 111͕৽ͨʹ࡞ΒΕͯ͠·͏৔߹͕͋Δ • ಉ͡ૢ࡞Λ܁Γฦ͢ඞཁ͕͋Δʂ

Slide 57

Slide 57 text

݁࿦ 57

Slide 58

Slide 58 text

58 • ͋Β͔͡Ίઌ಄ʹ0Λ෇༩্͓͍ͯͨ͠Ͱ • ࠷ॳͷ1000·ͨ͸0111Λ1001ʹஔ׵ͯ͠ • ࢒ΓΛ001ͷ॥؀ͰຒΊΔ • ઌ಄ͷ0ΛऔΓআ͘ • …ͱ͍͏ૢ࡞Λඇࡾ࿈਺ʹͳΔ·Ͱ܁Γฦ͢

Slide 59

Slide 59 text

59 • ͋Β͔͡Ίઌ಄ʹ0Λ෇༩্͓͍ͯͨ͠Ͱ • ࠷ॳͷ1000·ͨ͸0111Λ1001ʹஔ׵ͯ͠ • ࢒ΓΛ001ͷ॥؀ͰຒΊΔ • ઌ಄ͷ0ΛऔΓআ͘ • …ͱ͍͏ૢ࡞Λඇࡾ࿈਺ʹͳΔ·Ͱ܁Γฦ͢

Slide 60

Slide 60 text

࣮૷ྫ

Slide 61

Slide 61 text

public function run(string $input) : string { $dec = intval($input) + 1; while (true) { $bin = '0' . decbin($dec); preg_match('/(.*?)(1000|0111)(.*)/', $bin, $m); if (empty($m)) { return strval($dec); } $head = ltrim($m[1], '0'); $tailLength = strlen($m[3]); $tail = substr( str_repeat('001', intval(floor($tailLength / 3)) + 1), 0, $tailLength); $dec = strval(bindec($head . '1001' . $tail)); } }

Slide 62

Slide 62 text

public function run(string $input) : string { $dec = intval($input) + 1; while (true) { $bin = '0' . decbin($dec); preg_match('/(.*?)(1000|0111)(.*)/', $bin, $m); if (empty($m)) { return strval($dec); } $head = ltrim($m[1], '0'); $tailLength = strlen($m[3]); $tail = substr( str_repeat('001', intval(floor($tailLength / 3)) + 1), 0, $tailLength); $dec = strval(bindec($head . '1001' . $tail)); } } Ұ࿈ͷॲཧΛ܁Γฦ͢

Slide 63

Slide 63 text

public function run(string $input) : string { $dec = intval($input) + 1; while (true) { $bin = '0' . decbin($dec); preg_match('/(.*?)(1000|0111)(.*)/', $bin, $m); if (empty($m)) { return strval($dec); } $head = ltrim($m[1], '0'); $tailLength = strlen($m[3]); $tail = substr( str_repeat('001', intval(floor($tailLength / 3)) + 1), 0, $tailLength); $dec = strval(bindec($head . '1001' . $tail)); } } 2ਐ਺ʹม׵ͯ͠ઌ಄ʹ0Λ෇༩

Slide 64

Slide 64 text

public function run(string $input) : string { $dec = intval($input) + 1; while (true) { $bin = '0' . decbin($dec); preg_match('/(.*?)(1000|0111)(.*)/', $bin, $m); if (empty($m)) { return strval($dec); } $head = ltrim($m[1], '0'); $tailLength = strlen($m[3]); $tail = substr( str_repeat('001', intval(floor($tailLength / 3)) + 1), 0, $tailLength); $dec = strval(bindec($head . '1001' . $tail)); } } ࠷ॳͷ1000·ͨ͸0111Λ୳͢

Slide 65

Slide 65 text

public function run(string $input) : string { $dec = intval($input) + 1; while (true) { $bin = '0' . decbin($dec); preg_match('/(.*?)(1000|0111)(.*)/', $bin, $m); if (empty($m)) { return strval($dec); } $head = ltrim($m[1], '0'); $tailLength = strlen($m[3]); $tail = substr( str_repeat('001', intval(floor($tailLength / 3)) + 1), 0, $tailLength); $dec = strval(bindec($head . '1001' . $tail)); } } ݟ͔ͭΒͳ͚Ε͹ඇࡾ࿈਺ͷ׬੒

Slide 66

Slide 66 text

public function run(string $input) : string { $dec = intval($input) + 1; while (true) { $bin = '0' . decbin($dec); preg_match('/(.*?)(1000|0111)(.*)/', $bin, $m); if (empty($m)) { return strval($dec); } $head = ltrim($m[1], '0'); $tailLength = strlen($m[3]); $tail = substr( str_repeat('001', intval(floor($tailLength / 3)) + 1), 0, $tailLength); $dec = strval(bindec($head . '1001' . $tail)); } } ઌ಄ͷ0ΛऔΓআ͖ͭͭ (1000|0111)ΑΓલͷ෦෼Λୀආ

Slide 67

Slide 67 text

public function run(string $input) : string { $dec = intval($input) + 1; while (true) { $bin = '0' . decbin($dec); preg_match('/(.*?)(1000|0111)(.*)/', $bin, $m); if (empty($m)) { return strval($dec); } $head = ltrim($m[1], '0'); $tailLength = strlen($m[3]); $tail = substr( str_repeat('001', intval(floor($tailLength / 3)) + 1), 0, $tailLength); $dec = strval(bindec($head . '1001' . $tail)); } } (1000|0111)ΑΓޙͷ෦෼Λ001...Ͱஔ׵

Slide 68

Slide 68 text

public function run(string $input) : string { $dec = intval($input) + 1; while (true) { $bin = '0' . decbin($dec); preg_match('/(.*?)(1000|0111)(.*)/', $bin, $m); if (empty($m)) { return strval($dec); } $head = ltrim($m[1], '0'); $tailLength = strlen($m[3]); $tail = substr( str_repeat('001', intval(floor($tailLength / 3)) + 1), 0, $tailLength); $dec = strval(bindec($head . '1001' . $tail)); } } ʮલʴ1001ʴޙʯͱ࿈݁ͯ͠10ਐ਺ʹ

Slide 69

Slide 69 text

public function run(string $input) : string { $dec = intval($input) + 1; while (true) { $bin = '0' . decbin($dec); preg_match('/(.*?)(1000|0111)(.*)/', $bin, $m); if (empty($m)) { return strval($dec); } $head = ltrim($m[1], '0'); $tailLength = strlen($m[3]); $tail = substr( str_repeat('001', intval(floor($tailLength / 3)) + 1), 0, $tailLength); $dec = strval(bindec($head . '1001' . $tail)); } }

Slide 70

Slide 70 text

https://github.com/ ttskch/nagoyaphp17

Slide 71

Slide 71 text

@ttskch ʘThanks!ʗ