SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
CODE
     Ch.1 ~ Ch.2
     chois79




13년 1월 13일 일요일
Ch.1 친한 친구와의 대화




13년 1월 13일 일요일
아 심심.. 잠도 안오고..
                 옆집 여자친구랑 놀구 싶은데..




13년 1월 13일 일요일
전화를 하면?

                   아 심심.. 잠도 안오고..
                 옆집 여자친구랑 놀구 싶은데..




13년 1월 13일 일요일
전화를 하면?

                   아 심심.. 잠도 안오고..
                 옆집 여자친구랑 놀구 싶은데..




13년 1월 13일 일요일
전화를 하면?

                   아 심심.. 잠도 안오고..
                 옆집 여자친구랑 놀구 싶은데..




                                      그러고 보니 어제본 만화에서




13년 1월 13일 일요일
전화를 하면?

                   아 심심.. 잠도 안오고..
                 옆집 여자친구랑 놀구 싶은데..




                                      그러고 보니 어제본 만화에서




13년 1월 13일 일요일
이해하기가 쉽지 않다!
          영화에선 이렇게 안하던데!


13년 1월 13일 일요일
깜박임으로 해결해 보자
                 • 깜박임의 횟수로 글자를 표현
                 • 글자 사이 간격은 시간을 두어서 표현

                  A     1번
                  B     2번    “How are you?”는?
                  C     3번      131번 깜박임이 필요
                                  ‘?’는 어떻하지?
                  D     4번
                      ...
                  Z     26번


13년 1월 13일 일요일
how to “write” all the letters of the alphabet.
                    Here’s the difference: In the system you invented, every letter of the al-
                 phabet is a certain number of blinks, from 1 blink for A to 26 blinks for Z.
                 In Morse code, you have two kinds of blinks—short blinks and long blinks.

                                         모스 부호
                 This makes Morse code more complicated, of course, but in actual use it
                 turns out to be much more efficient. The sentence “How are you?” now
                 requires only 32 blinks (some short, some long) rather than 131, and that’s
                 including a code for the question mark.
                    When discussing how Morse code works, people don’t talk about “short
                 blinks” and짧은 blinks.” Instead, they refer to “dots” and “dashes” be-
                              “long 깜박임과 긴 깜빡임으로 표현
                 cause that’s a convenient way of showing the codes on the printed page. In
                                 • 짧은 깜박임: alphabet corresponds to a short series of
                 Morse code, every letter of the 점
                 dots and dashes, 긴 깜박임: see in the following table.
                                    as you can 선
                                •
                            A       A           J      J            S      S
                            B       b           K      K            T      T
                            C                   L                  U
                                    C                  L                   U
                            D       D          M       M           V       V
                            E       E           N      N           W       W
                            F       F           O      O           X       X
                            G       G           P      P           Y       Y
                            H       H           Q      Q           Z       Z
                            I       I           R      R


13년 1월 13일 일요일
부호(Code) 란?

     • 이 책에서는


          • 일반적으로 사람과 컴퓨터 간에 정보를 전달하는 체계


          • 즉, 의사소통을 가능하게 하는 것


     • 이 책의 개념에서..


          • 고양이, 사과 등등 의 단어도 부호의 일종


          • 의사소통을 위해서 수 많은 부호들이 사용되고 있다.


                 • 음성 언어(말), 글, 점자 ...


          • 이러한 많은 부호가 있는 이유는 몇몇 부호들이 특정 측면에 더 적합하기 때문


                 • 모스 부호: 어두운 곳에서 소리내지 않고 멀리 떨어진 위치에서 의사 소통하는데 적합


                 • 컴퓨터는 사람과 다르기 때문에 인간이 사용하는 부호를 사용하는 것은 불가능




13년 1월 13일 일요일
모스 부호의 점과 선의 구성

     • 점과 선을 이용한 표현


          • 선: 점과 구분하기 위해 약 3배정도 오래 불빛을 유지


                 • 점이 1초라면 선은 3초


          • 점과 선 사이의 구분: 점의 길이 만큼 불빛을 꺼둔채 유지


                 • 점이 1초라면 선과 점사이 1초간 점멸


          • 글자 사이의 구분: 선의 길이 만큼 불빛을 꺼둔채 유지


                 • 선이 3초라면 글자 사이에는 3초간 점멸


          • 손전등을 켜거나 꺼두는 시간은 점을 표현하는 시간을 기준으로 상대적으로 표현



13년 1월 13일 일요일
breviation for anything—it’s simply an easy-to-remember Morse code s
                                                quence. During the Second World War, the British Broadcasting Corporatio
                                                prefaced some radio broadcasts with the beginning of Beethoven’s Fifth Sym
                                                phony—BAH, BAH, BAH, BAHMMMMM—which Ludwig didn’t know

ends
       모스 부호의 규칙                                the time he composed the music is the Morse code V, for Victory.
                                                   One drawback of Morse code is that it makes no differentiation betwe
                                                                               7
                                                uppercase and lowercase letters. But in addition to representing letters, Mor
                                                code also includes codes for numbers by using a series of five dots and dashe
       • 알파벳의 표현의 편리를 위해 자주 Three dots, three 짧게 표현
 t everyone knows a little Morse code.사용되는 단어를 좀더dashes, and
 s represent SOS, the international distress signal. SOS isn’t an 1  ab- 1              6
                                                                                                6
 n for anything—it’s simply an easy-to-remember더 긴 부호를 사용
          • ex) E, T의 경우 짧은 부호를 Q, Z의 경우 좀 Morse code 2se- 2                            7      7
During the Second World War, the British Broadcasting Corporation    3                  8
                                                                           3                   8
some radio broadcasts with the beginning of Beethoven’s Fifth Sym-
          • SOS(국제 조난신호): 약어가 아니라 쉽게 기억할수 있는 모스4 부호의 4
BAH, BAH, BAH, BAHMMMMM—which Ludwig didn’t know at                         조합          9
                                                                                              9
                                                                     5      5           0    0
he composed the music is the Morse code V, for Victory.
rawback of Morse code is that it makes no differentiation between
              • 점 3번, 선 3번, 점 3번
e and lowercase letters. But in addition to representing letters, Morse a little more orderly than the letter codes. Mo
                                                These codes, at least, are
                                                punctuation marks use five, six, or seven dots and dashes:
 includes codes for numbers by using a series of five dots and dashes:
       • 숫자의 경우 영문자 보다 의미 있게 구성                                    특수문자

               1                  6                                  .                   '
                    1                   6                                  .                   '
                                                                     ,     ,             (     (
               2    2             7     7                            ?     ?             )     )
               3    3             8     8                            :                   =
               4                  9
                                                                           :                   =
                    4                   9                            ;     ;             +     +
               5    5             0     0                            -     -             $     $
                                                                     /     /             ¶     ¶
des, at least, are a little more orderly than the letter codes. Most
                                                                 "
                                                                           "             _
ion marks use five, six, or seven dots and dashes:
  13년 1월 13일 일요일                                Additional codes are defined for accented letters of some European languag
두가지 형태의 모음으로 모든 형태의
                     정보를 전달 가능하다
                       ex) 모스 부호




13년 1월 13일 일요일
Ch.2 부호와 조합




13년 1월 13일 일요일
모스 부호를 사용해서
                 부호와 조합간의 관계를 파악하자




13년 1월 13일 일요일
M 부호는 메시지를 보내는 것이
                             orse code was invented by Samuel Finley Breese Morse (1791–1872),
                 모스          whom we shall meet more properly later in this book. The inven-
                             tion of Morse code goes hand in hand with the invention of the
                 telegraph, which we’ll also examine in more detail. Just as Morse code pro-
                                     받는 것보다 쉽다
                 vides a good introduction to the nature of codes, the telegraph provides a
                 good introduction to the hardware of the computer.
                                (문자 -> 모스부호의 점과 선)
                    Most people find Morse code easier to send than to receive. Even if you
                 don’t have Morse code memorized, you can simply use this table, conve-
                 niently arranged in alphabetical order:

                            A       A           J      J            S      S
                            B       b           K      K            T      T
                            C                   L                  U
                                    C                  L                   U
                            D       D          M       M           V       V
                            E       E           N      N           W       W
                            F       F           O      O           X       X
                            G       G           P      P           Y       Y
                            H       H           Q      Q           Z       Z
                            I       I           R      R


                                                                                                 9




13년 1월 13일 일요일
tages of learning Morse code, such a table would certainly be
estable that lets all go example, a Morse construct it. There’s contains
But it’s not at us obvious how we could code sequence that
a they have. For backward:
 ose dots anddash can representput into letters, which are E and T:
  dot or one dashes that we can only two
code dots and dashes ¡ Alphabetical letter alphabetical order.
rget about alphabetical order. Perhaps a better approach to
 e learning Morse code, suchthem depending on how many dots
 f codes might be to group a table would certainly be
hey have. For example,weMorse construct it. There’s contains
  not at all obvious how a could code sequence that
                                      E
             모스부호의 점과 선을 문자로 만드는 표를 만들어보자
 ts and dashes that we can put
                              E into alphabetical order.
t or one dash can represent only two letters, which are E and T:
                T                     T
bout alphabetical order. Perhaps a better approach to
 s might be to group them depending on how many dots
ve. For example, a Morse code sequence that contains
                       E E
 ationcan represent only two letters, which are E and T:four more letters—
e dash  of exactly two dots or dashes gives us
                            T
nd M: •               T
            점과 선 하나로만 표현할 수 있는 문자 (2)

                     E
on of exactlyE
             two dots or dashes gives us four more letters—
                          I
M:           T I  T
                                N N
        •   2개의 점과 선의 조합을 사용하는 경우 (4) M
                         A
                    A               M
xactly two dots or dashes gives us four more letters—
                   I
            I           N N
            A A M M
 of three dots or dashes gives us eight more letters:
      I
        •   3개의 점과 선을 조합하는 경우 (8)
              I
                  N N                                                             점과 선의 수   부호의 수
three dots or A
              dashes gives M eight more letters:
      A         s M us      S
                                   d            D
                                                                                     1       2^1
                           U
                 uusSeight more letters:D           K
dots or dashes gives
            s               d k                                                      2       2^2
                           R                        G
           u rU
nd Combinations             k g         K
                                                                             11
     s r wR    S
                     d W D og           G           O                                3       2^3
             U                K
     u • w 점과 선을 조합하는 경우 (16) O
                    W
           4개의
             R
                    k o
                              G
                                                                                     4       2^4
 y (if we want to stop this exercise before dealing with numbers and
     r              g
                            HO                   B
fonw to stop this exercise four dots and dashes give us 16 more
  we marks),W h
      want    sequences of before dealing with numbers and
                    o                b
 marks), sequences of four dots and x give X 16 more
s:             v           V        dashes us
ant to stop this exercise before dealing with numbers and
                f                F     c                C              표현할 수 있는 부호의 수 = 2 ^ 점과 선의 수
), sequences of four dots and dashes give us 16 more
                                 Ü                      Y
                Ü                      y
                l              L       z                Z
                               Ä                        Q
                Ä                      q
                p              P       Ö                Ö
                               J
                j                      •

gether, these four tables contain 2 plus 4 plus 8 plus 16 codes for a
 13년 1월 13일 일요일
ower of the number of dots and dashes. We might summarize the table data
n this simple formula:
                  number of codes = 2number of dots and dashes

 owers of 2 tend to show up a lot in codes, and we’ll see another example
n the next chapter.
                                 모스 부호를 문자로 변환하는 표
  To make the process of decoding Morse code even easier, we might want
o draw something like the big treelike table shown here.




                                                                            5개의 점과 선을 사용할 경우
                                                                             2 + 4 + 8+ 16+ 32 =62

                                                                 모스부호는 강조 문자를 위해 6개의 점과 선을 사용
                                                                      즉, 표현할 수 있는 부호의 수

                                                                      2 + 4 + 8 + 16 + 32 + 64 = 126개




 13년 1월 13일 일요일
undefined used in this context refers to a code that doesn’t stand for any-
                 thing. If you were receiving Morse code and you got an undefined code,
                 you could be pretty sure that somebody made a mistake.
                    Because we were clever enough to develop this little formula,
                                    number of codes = 2number of dots and dashes
                         점과 선의 수와 부호의 수의 관계
                 we could continue figuring out how many codes we get from using longer
                 sequences of dots and dashes:
                                Number of
                              Dots and Dashes                Number of Codes
                                      1                           21 = 2
                                      2                           22 = 4
                                      3                           23 = 8
                                      4                          24 = 16
                                      5                          25 = 32
                                      6                          26 = 64
                                      7                         27 = 128
                                      8                         28 = 256
                                      9                         29 = 512
                                     10                        210 = 1024



13년 1월 13일 일요일

Más contenido relacionado

Destacado

자바 병렬 프로그래밍 ch9
자바 병렬 프로그래밍 ch9자바 병렬 프로그래밍 ch9
자바 병렬 프로그래밍 ch9HyeonSeok Choi
 
Domain driven design ch9
Domain driven design ch9Domain driven design ch9
Domain driven design ch9HyeonSeok Choi
 
Domain driven design ch1
Domain driven design ch1Domain driven design ch1
Domain driven design ch1HyeonSeok Choi
 
자바 병렬 프로그래밍 1&2
자바 병렬 프로그래밍 1&2자바 병렬 프로그래밍 1&2
자바 병렬 프로그래밍 1&2HyeonSeok Choi
 
컴퓨터 프로그램 구조와 해석 3.5
컴퓨터 프로그램 구조와 해석 3.5컴퓨터 프로그램 구조와 해석 3.5
컴퓨터 프로그램 구조와 해석 3.5HyeonSeok Choi
 
실무로 배우는 시스템 성능 최적화 Ch6
실무로 배우는 시스템 성능 최적화 Ch6실무로 배우는 시스템 성능 최적화 Ch6
실무로 배우는 시스템 성능 최적화 Ch6HyeonSeok Choi
 
실무로 배우는 시스템 성능 최적화 Ch7
실무로 배우는 시스템 성능 최적화 Ch7실무로 배우는 시스템 성능 최적화 Ch7
실무로 배우는 시스템 성능 최적화 Ch7HyeonSeok Choi
 
서버인프라를지탱하는기술2_1-2
서버인프라를지탱하는기술2_1-2서버인프라를지탱하는기술2_1-2
서버인프라를지탱하는기술2_1-2HyeonSeok Choi
 
HTTP 완벽가이드 16장
HTTP 완벽가이드 16장HTTP 완벽가이드 16장
HTTP 완벽가이드 16장HyeonSeok Choi
 
Abstract factory petterns
Abstract factory petternsAbstract factory petterns
Abstract factory petternsHyeonSeok Choi
 
Mining the social web ch1
Mining the social web ch1Mining the social web ch1
Mining the social web ch1HyeonSeok Choi
 
Head first statistics14
Head first statistics14Head first statistics14
Head first statistics14HyeonSeok Choi
 
C++ API 디자인 - 확장성
C++ API 디자인 - 확장성C++ API 디자인 - 확장성
C++ API 디자인 - 확장성HyeonSeok Choi
 
실무로 배우는 시스템 성능 최적화 10부. 네트워크 모니터링
실무로 배우는 시스템 성능 최적화   10부. 네트워크 모니터링실무로 배우는 시스템 성능 최적화   10부. 네트워크 모니터링
실무로 배우는 시스템 성능 최적화 10부. 네트워크 모니터링Hyunsoo Jung
 
실무로 배우는 시스템 성능 최적화 Ch8
실무로 배우는 시스템 성능 최적화 Ch8실무로 배우는 시스템 성능 최적화 Ch8
실무로 배우는 시스템 성능 최적화 Ch8HyeonSeok Choi
 
서버를 위한 동시성 모델과 Staged eventdrivenarchitecture
서버를 위한 동시성 모델과 Staged eventdrivenarchitecture서버를 위한 동시성 모델과 Staged eventdrivenarchitecture
서버를 위한 동시성 모델과 Staged eventdrivenarchitectureHyeonSeok Choi
 

Destacado (20)

자바 병렬 프로그래밍 ch9
자바 병렬 프로그래밍 ch9자바 병렬 프로그래밍 ch9
자바 병렬 프로그래밍 ch9
 
Domain driven design ch9
Domain driven design ch9Domain driven design ch9
Domain driven design ch9
 
Domain driven design ch1
Domain driven design ch1Domain driven design ch1
Domain driven design ch1
 
C++ api design 품질
C++ api design 품질C++ api design 품질
C++ api design 품질
 
자바 병렬 프로그래밍 1&2
자바 병렬 프로그래밍 1&2자바 병렬 프로그래밍 1&2
자바 병렬 프로그래밍 1&2
 
컴퓨터 프로그램 구조와 해석 3.5
컴퓨터 프로그램 구조와 해석 3.5컴퓨터 프로그램 구조와 해석 3.5
컴퓨터 프로그램 구조와 해석 3.5
 
실무로 배우는 시스템 성능 최적화 Ch6
실무로 배우는 시스템 성능 최적화 Ch6실무로 배우는 시스템 성능 최적화 Ch6
실무로 배우는 시스템 성능 최적화 Ch6
 
HTTPS
HTTPSHTTPS
HTTPS
 
실무로 배우는 시스템 성능 최적화 Ch7
실무로 배우는 시스템 성능 최적화 Ch7실무로 배우는 시스템 성능 최적화 Ch7
실무로 배우는 시스템 성능 최적화 Ch7
 
서버인프라를지탱하는기술2_1-2
서버인프라를지탱하는기술2_1-2서버인프라를지탱하는기술2_1-2
서버인프라를지탱하는기술2_1-2
 
HTTP 완벽가이드 16장
HTTP 완벽가이드 16장HTTP 완벽가이드 16장
HTTP 완벽가이드 16장
 
Abstract factory petterns
Abstract factory petternsAbstract factory petterns
Abstract factory petterns
 
Mining the social web ch1
Mining the social web ch1Mining the social web ch1
Mining the social web ch1
 
Head first statistics14
Head first statistics14Head first statistics14
Head first statistics14
 
MutiCore 19-20
MutiCore 19-20MutiCore 19-20
MutiCore 19-20
 
Hadoop overview
Hadoop overviewHadoop overview
Hadoop overview
 
C++ API 디자인 - 확장성
C++ API 디자인 - 확장성C++ API 디자인 - 확장성
C++ API 디자인 - 확장성
 
실무로 배우는 시스템 성능 최적화 10부. 네트워크 모니터링
실무로 배우는 시스템 성능 최적화   10부. 네트워크 모니터링실무로 배우는 시스템 성능 최적화   10부. 네트워크 모니터링
실무로 배우는 시스템 성능 최적화 10부. 네트워크 모니터링
 
실무로 배우는 시스템 성능 최적화 Ch8
실무로 배우는 시스템 성능 최적화 Ch8실무로 배우는 시스템 성능 최적화 Ch8
실무로 배우는 시스템 성능 최적화 Ch8
 
서버를 위한 동시성 모델과 Staged eventdrivenarchitecture
서버를 위한 동시성 모델과 Staged eventdrivenarchitecture서버를 위한 동시성 모델과 Staged eventdrivenarchitecture
서버를 위한 동시성 모델과 Staged eventdrivenarchitecture
 

Más de HyeonSeok Choi

밑바닥부터시작하는딥러닝 Ch05
밑바닥부터시작하는딥러닝 Ch05밑바닥부터시작하는딥러닝 Ch05
밑바닥부터시작하는딥러닝 Ch05HyeonSeok Choi
 
밑바닥부터시작하는딥러닝 Ch2
밑바닥부터시작하는딥러닝 Ch2밑바닥부터시작하는딥러닝 Ch2
밑바닥부터시작하는딥러닝 Ch2HyeonSeok Choi
 
프로그래머를위한선형대수학1.2
프로그래머를위한선형대수학1.2프로그래머를위한선형대수학1.2
프로그래머를위한선형대수학1.2HyeonSeok Choi
 
알고리즘 중심의 머신러닝 가이드 Ch04
알고리즘 중심의 머신러닝 가이드 Ch04알고리즘 중심의 머신러닝 가이드 Ch04
알고리즘 중심의 머신러닝 가이드 Ch04HyeonSeok Choi
 
딥러닝 제대로시작하기 Ch04
딥러닝 제대로시작하기 Ch04딥러닝 제대로시작하기 Ch04
딥러닝 제대로시작하기 Ch04HyeonSeok Choi
 
밑바닥부터시작하는딥러닝 Ch05
밑바닥부터시작하는딥러닝 Ch05밑바닥부터시작하는딥러닝 Ch05
밑바닥부터시작하는딥러닝 Ch05HyeonSeok Choi
 
7가지 동시성 모델 - 데이터 병렬성
7가지 동시성 모델 - 데이터 병렬성7가지 동시성 모델 - 데이터 병렬성
7가지 동시성 모델 - 데이터 병렬성HyeonSeok Choi
 
7가지 동시성 모델 4장
7가지 동시성 모델 4장7가지 동시성 모델 4장
7가지 동시성 모델 4장HyeonSeok Choi
 
Logstash, ElasticSearch, Kibana
Logstash, ElasticSearch, KibanaLogstash, ElasticSearch, Kibana
Logstash, ElasticSearch, KibanaHyeonSeok Choi
 
실무로배우는시스템성능최적화 Ch1
실무로배우는시스템성능최적화 Ch1실무로배우는시스템성능최적화 Ch1
실무로배우는시스템성능최적화 Ch1HyeonSeok Choi
 
HTTP 완벽가이드 21장
HTTP 완벽가이드 21장HTTP 완벽가이드 21장
HTTP 완벽가이드 21장HyeonSeok Choi
 
HTTP 완벽가이드 6장.
HTTP 완벽가이드 6장.HTTP 완벽가이드 6장.
HTTP 완벽가이드 6장.HyeonSeok Choi
 
HTTP 완벽가이드 1장.
HTTP 완벽가이드 1장.HTTP 완벽가이드 1장.
HTTP 완벽가이드 1장.HyeonSeok Choi
 

Más de HyeonSeok Choi (20)

밑바닥부터시작하는딥러닝 Ch05
밑바닥부터시작하는딥러닝 Ch05밑바닥부터시작하는딥러닝 Ch05
밑바닥부터시작하는딥러닝 Ch05
 
밑바닥부터시작하는딥러닝 Ch2
밑바닥부터시작하는딥러닝 Ch2밑바닥부터시작하는딥러닝 Ch2
밑바닥부터시작하는딥러닝 Ch2
 
프로그래머를위한선형대수학1.2
프로그래머를위한선형대수학1.2프로그래머를위한선형대수학1.2
프로그래머를위한선형대수학1.2
 
알고리즘 중심의 머신러닝 가이드 Ch04
알고리즘 중심의 머신러닝 가이드 Ch04알고리즘 중심의 머신러닝 가이드 Ch04
알고리즘 중심의 머신러닝 가이드 Ch04
 
딥러닝 제대로시작하기 Ch04
딥러닝 제대로시작하기 Ch04딥러닝 제대로시작하기 Ch04
딥러닝 제대로시작하기 Ch04
 
밑바닥부터시작하는딥러닝 Ch05
밑바닥부터시작하는딥러닝 Ch05밑바닥부터시작하는딥러닝 Ch05
밑바닥부터시작하는딥러닝 Ch05
 
함수적 사고 2장
함수적 사고 2장함수적 사고 2장
함수적 사고 2장
 
7가지 동시성 모델 - 데이터 병렬성
7가지 동시성 모델 - 데이터 병렬성7가지 동시성 모델 - 데이터 병렬성
7가지 동시성 모델 - 데이터 병렬성
 
7가지 동시성 모델 4장
7가지 동시성 모델 4장7가지 동시성 모델 4장
7가지 동시성 모델 4장
 
Bounded Context
Bounded ContextBounded Context
Bounded Context
 
DDD Repository
DDD RepositoryDDD Repository
DDD Repository
 
DDD Start Ch#3
DDD Start Ch#3DDD Start Ch#3
DDD Start Ch#3
 
Logstash, ElasticSearch, Kibana
Logstash, ElasticSearch, KibanaLogstash, ElasticSearch, Kibana
Logstash, ElasticSearch, Kibana
 
실무로배우는시스템성능최적화 Ch1
실무로배우는시스템성능최적화 Ch1실무로배우는시스템성능최적화 Ch1
실무로배우는시스템성능최적화 Ch1
 
HTTP 완벽가이드 21장
HTTP 완벽가이드 21장HTTP 완벽가이드 21장
HTTP 완벽가이드 21장
 
HTTP 완벽가이드 6장.
HTTP 완벽가이드 6장.HTTP 완벽가이드 6장.
HTTP 완벽가이드 6장.
 
HTTP 완벽가이드 1장.
HTTP 완벽가이드 1장.HTTP 완벽가이드 1장.
HTTP 완벽가이드 1장.
 
Cluster - spark
Cluster - sparkCluster - spark
Cluster - spark
 
Pair RDD - Spark
Pair RDD - SparkPair RDD - Spark
Pair RDD - Spark
 
Learning spark ch1-2
Learning spark ch1-2Learning spark ch1-2
Learning spark ch1-2
 

Code1_2

  • 1. CODE Ch.1 ~ Ch.2 chois79 13년 1월 13일 일요일
  • 2. Ch.1 친한 친구와의 대화 13년 1월 13일 일요일
  • 3. 아 심심.. 잠도 안오고.. 옆집 여자친구랑 놀구 싶은데.. 13년 1월 13일 일요일
  • 4. 전화를 하면? 아 심심.. 잠도 안오고.. 옆집 여자친구랑 놀구 싶은데.. 13년 1월 13일 일요일
  • 5. 전화를 하면? 아 심심.. 잠도 안오고.. 옆집 여자친구랑 놀구 싶은데.. 13년 1월 13일 일요일
  • 6. 전화를 하면? 아 심심.. 잠도 안오고.. 옆집 여자친구랑 놀구 싶은데.. 그러고 보니 어제본 만화에서 13년 1월 13일 일요일
  • 7. 전화를 하면? 아 심심.. 잠도 안오고.. 옆집 여자친구랑 놀구 싶은데.. 그러고 보니 어제본 만화에서 13년 1월 13일 일요일
  • 8. 이해하기가 쉽지 않다! 영화에선 이렇게 안하던데! 13년 1월 13일 일요일
  • 9. 깜박임으로 해결해 보자 • 깜박임의 횟수로 글자를 표현 • 글자 사이 간격은 시간을 두어서 표현 A 1번 B 2번 “How are you?”는? C 3번 131번 깜박임이 필요 ‘?’는 어떻하지? D 4번 ... Z 26번 13년 1월 13일 일요일
  • 10. how to “write” all the letters of the alphabet. Here’s the difference: In the system you invented, every letter of the al- phabet is a certain number of blinks, from 1 blink for A to 26 blinks for Z. In Morse code, you have two kinds of blinks—short blinks and long blinks. 모스 부호 This makes Morse code more complicated, of course, but in actual use it turns out to be much more efficient. The sentence “How are you?” now requires only 32 blinks (some short, some long) rather than 131, and that’s including a code for the question mark. When discussing how Morse code works, people don’t talk about “short blinks” and짧은 blinks.” Instead, they refer to “dots” and “dashes” be- “long 깜박임과 긴 깜빡임으로 표현 cause that’s a convenient way of showing the codes on the printed page. In • 짧은 깜박임: alphabet corresponds to a short series of Morse code, every letter of the 점 dots and dashes, 긴 깜박임: see in the following table. as you can 선 • A A J J S S B b K K T T C L U C L U D D M M V V E E N N W W F F O O X X G G P P Y Y H H Q Q Z Z I I R R 13년 1월 13일 일요일
  • 11. 부호(Code) 란? • 이 책에서는 • 일반적으로 사람과 컴퓨터 간에 정보를 전달하는 체계 • 즉, 의사소통을 가능하게 하는 것 • 이 책의 개념에서.. • 고양이, 사과 등등 의 단어도 부호의 일종 • 의사소통을 위해서 수 많은 부호들이 사용되고 있다. • 음성 언어(말), 글, 점자 ... • 이러한 많은 부호가 있는 이유는 몇몇 부호들이 특정 측면에 더 적합하기 때문 • 모스 부호: 어두운 곳에서 소리내지 않고 멀리 떨어진 위치에서 의사 소통하는데 적합 • 컴퓨터는 사람과 다르기 때문에 인간이 사용하는 부호를 사용하는 것은 불가능 13년 1월 13일 일요일
  • 12. 모스 부호의 점과 선의 구성 • 점과 선을 이용한 표현 • 선: 점과 구분하기 위해 약 3배정도 오래 불빛을 유지 • 점이 1초라면 선은 3초 • 점과 선 사이의 구분: 점의 길이 만큼 불빛을 꺼둔채 유지 • 점이 1초라면 선과 점사이 1초간 점멸 • 글자 사이의 구분: 선의 길이 만큼 불빛을 꺼둔채 유지 • 선이 3초라면 글자 사이에는 3초간 점멸 • 손전등을 켜거나 꺼두는 시간은 점을 표현하는 시간을 기준으로 상대적으로 표현 13년 1월 13일 일요일
  • 13. breviation for anything—it’s simply an easy-to-remember Morse code s quence. During the Second World War, the British Broadcasting Corporatio prefaced some radio broadcasts with the beginning of Beethoven’s Fifth Sym phony—BAH, BAH, BAH, BAHMMMMM—which Ludwig didn’t know ends 모스 부호의 규칙 the time he composed the music is the Morse code V, for Victory. One drawback of Morse code is that it makes no differentiation betwe 7 uppercase and lowercase letters. But in addition to representing letters, Mor code also includes codes for numbers by using a series of five dots and dashe • 알파벳의 표현의 편리를 위해 자주 Three dots, three 짧게 표현 t everyone knows a little Morse code.사용되는 단어를 좀더dashes, and s represent SOS, the international distress signal. SOS isn’t an 1 ab- 1 6 6 n for anything—it’s simply an easy-to-remember더 긴 부호를 사용 • ex) E, T의 경우 짧은 부호를 Q, Z의 경우 좀 Morse code 2se- 2 7 7 During the Second World War, the British Broadcasting Corporation 3 8 3 8 some radio broadcasts with the beginning of Beethoven’s Fifth Sym- • SOS(국제 조난신호): 약어가 아니라 쉽게 기억할수 있는 모스4 부호의 4 BAH, BAH, BAH, BAHMMMMM—which Ludwig didn’t know at 조합 9 9 5 5 0 0 he composed the music is the Morse code V, for Victory. rawback of Morse code is that it makes no differentiation between • 점 3번, 선 3번, 점 3번 e and lowercase letters. But in addition to representing letters, Morse a little more orderly than the letter codes. Mo These codes, at least, are punctuation marks use five, six, or seven dots and dashes: includes codes for numbers by using a series of five dots and dashes: • 숫자의 경우 영문자 보다 의미 있게 구성 특수문자 1 6 . ' 1 6 . ' , , ( ( 2 2 7 7 ? ? ) ) 3 3 8 8 : = 4 9 : = 4 9 ; ; + + 5 5 0 0 - - $ $ / / ¶ ¶ des, at least, are a little more orderly than the letter codes. Most " " _ ion marks use five, six, or seven dots and dashes: 13년 1월 13일 일요일 Additional codes are defined for accented letters of some European languag
  • 14. 두가지 형태의 모음으로 모든 형태의 정보를 전달 가능하다 ex) 모스 부호 13년 1월 13일 일요일
  • 15. Ch.2 부호와 조합 13년 1월 13일 일요일
  • 16. 모스 부호를 사용해서 부호와 조합간의 관계를 파악하자 13년 1월 13일 일요일
  • 17. M 부호는 메시지를 보내는 것이 orse code was invented by Samuel Finley Breese Morse (1791–1872), 모스 whom we shall meet more properly later in this book. The inven- tion of Morse code goes hand in hand with the invention of the telegraph, which we’ll also examine in more detail. Just as Morse code pro- 받는 것보다 쉽다 vides a good introduction to the nature of codes, the telegraph provides a good introduction to the hardware of the computer. (문자 -> 모스부호의 점과 선) Most people find Morse code easier to send than to receive. Even if you don’t have Morse code memorized, you can simply use this table, conve- niently arranged in alphabetical order: A A J J S S B b K K T T C L U C L U D D M M V V E E N N W W F F O O X X G G P P Y Y H H Q Q Z Z I I R R 9 13년 1월 13일 일요일
  • 18. tages of learning Morse code, such a table would certainly be estable that lets all go example, a Morse construct it. There’s contains But it’s not at us obvious how we could code sequence that a they have. For backward: ose dots anddash can representput into letters, which are E and T: dot or one dashes that we can only two code dots and dashes ¡ Alphabetical letter alphabetical order. rget about alphabetical order. Perhaps a better approach to e learning Morse code, suchthem depending on how many dots f codes might be to group a table would certainly be hey have. For example,weMorse construct it. There’s contains not at all obvious how a could code sequence that E 모스부호의 점과 선을 문자로 만드는 표를 만들어보자 ts and dashes that we can put E into alphabetical order. t or one dash can represent only two letters, which are E and T: T T bout alphabetical order. Perhaps a better approach to s might be to group them depending on how many dots ve. For example, a Morse code sequence that contains E E ationcan represent only two letters, which are E and T:four more letters— e dash of exactly two dots or dashes gives us T nd M: • T 점과 선 하나로만 표현할 수 있는 문자 (2) E on of exactlyE two dots or dashes gives us four more letters— I M: T I T N N • 2개의 점과 선의 조합을 사용하는 경우 (4) M A A M xactly two dots or dashes gives us four more letters— I I N N A A M M of three dots or dashes gives us eight more letters: I • 3개의 점과 선을 조합하는 경우 (8) I N N 점과 선의 수 부호의 수 three dots or A dashes gives M eight more letters: A s M us S d D 1 2^1 U uusSeight more letters:D K dots or dashes gives s d k 2 2^2 R G u rU nd Combinations k g K 11 s r wR S d W D og G O 3 2^3 U K u • w 점과 선을 조합하는 경우 (16) O W 4개의 R k o G 4 2^4 y (if we want to stop this exercise before dealing with numbers and r g HO B fonw to stop this exercise four dots and dashes give us 16 more we marks),W h want sequences of before dealing with numbers and o b marks), sequences of four dots and x give X 16 more s: v V dashes us ant to stop this exercise before dealing with numbers and f F c C 표현할 수 있는 부호의 수 = 2 ^ 점과 선의 수 ), sequences of four dots and dashes give us 16 more Ü Y Ü y l L z Z Ä Q Ä q p P Ö Ö J j • gether, these four tables contain 2 plus 4 plus 8 plus 16 codes for a 13년 1월 13일 일요일
  • 19. ower of the number of dots and dashes. We might summarize the table data n this simple formula: number of codes = 2number of dots and dashes owers of 2 tend to show up a lot in codes, and we’ll see another example n the next chapter. 모스 부호를 문자로 변환하는 표 To make the process of decoding Morse code even easier, we might want o draw something like the big treelike table shown here. 5개의 점과 선을 사용할 경우 2 + 4 + 8+ 16+ 32 =62 모스부호는 강조 문자를 위해 6개의 점과 선을 사용 즉, 표현할 수 있는 부호의 수 2 + 4 + 8 + 16 + 32 + 64 = 126개 13년 1월 13일 일요일
  • 20. undefined used in this context refers to a code that doesn’t stand for any- thing. If you were receiving Morse code and you got an undefined code, you could be pretty sure that somebody made a mistake. Because we were clever enough to develop this little formula, number of codes = 2number of dots and dashes 점과 선의 수와 부호의 수의 관계 we could continue figuring out how many codes we get from using longer sequences of dots and dashes: Number of Dots and Dashes Number of Codes 1 21 = 2 2 22 = 4 3 23 = 8 4 24 = 16 5 25 = 32 6 26 = 64 7 27 = 128 8 28 = 256 9 29 = 512 10 210 = 1024 13년 1월 13일 일요일