<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5943612685487581451</id><updated>2024-10-25T14:13:06.621+09:00</updated><category term="Data URIs"/><category term="classic asp"/><category term="encoded data"/><category term="javascript"/><category term="javascript injection"/><category term="(gif|jpg|bmp)"/><category term="1025~65535"/><category term="2demension"/><category term="2demension array sort"/><category term="2차원 배열 정렬"/><category term="Abstract Factory pattern"/><category term="Active Mode"/><category term="Attributes(Logical)"/><category term="Chris Coyier"/><category term="Columns(Physical)"/><category term="Composite"/><category term="Composite pattern"/><category term="Composite pattern javascript"/><category term="Dependency-Injection"/><category term="ERwin"/><category term="ERwin R7"/><category term="Extension check javascript"/><category term="Extension funciton"/><category term="FTP"/><category term="FTP란?"/><category term="HTML5 Element"/><category term="Javascript Chaining"/><category term="Javascript Chaining Pattern"/><category term="Logical/Physical 컬럼"/><category term="MAJOR.MINOR.PATCH"/><category term="abstract pattern"/><category term="accordion"/><category term="adjudge Array"/><category term="array join"/><category term="array sort"/><category term="asp array"/><category term="asp replace"/><category term="asp sort"/><category term="asp 배열"/><category term="asp 쌍따옴표"/><category term="base  -64 image"/><category term="builder"/><category term="builder pattern"/><category term="builtin entity"/><category term="case when then order by"/><category term="char"/><category term="chrome flag"/><category term="chrome flag es6"/><category term="client hint"/><category term="command pattern"/><category term="command pattern javascript"/><category term="command 포트"/><category term="data channel"/><category term="data-save"/><category term="data-saver"/><category term="dateformat prototype"/><category term="datepicker"/><category term="datepicker icon"/><category term="datepicker location"/><category term="datepicker 기본셋팅"/><category term="default datepicker"/><category term="ecma6"/><category term="ecmascript"/><category term="ecmascript6 flag"/><category term="error function"/><category term="explorer10"/><category term="flag"/><category term="flash"/><category term="google Project Glass"/><category term="google adsense"/><category term="http://html5shiv.googlecode.com/svn/trunk/html5.js"/><category term="image base-64"/><category term="image find"/><category term="isArray"/><category term="javascript Abstract Factory"/><category term="javascript Amount of paste comma"/><category term="javascript Dependency-Injection"/><category term="javascript Extension"/><category term="javascript abstract pattern"/><category term="javascript antipattern"/><category term="javascript array"/><category term="javascript bubbling"/><category term="javascript builder pattern"/><category term="javascript comma"/><category term="javascript command"/><category term="javascript command pattern"/><category term="javascript dependency injection"/><category term="javascript error"/><category term="javascript harmony"/><category term="javascript hoisting"/><category term="javascript join"/><category term="javascript jquery array join"/><category term="javascript pattern"/><category term="javascript prototype"/><category term="javascript proxy pattern"/><category term="javascript random number"/><category term="javascript scope"/><category term="javascript 날짜형 변환"/><category term="jquery"/><category term="jquery join"/><category term="kakao api"/><category term="layout jquery"/><category term="look and feel"/><category term="match"/><category term="mssql case when then"/><category term="mssql order by"/><category term="old broswer HTML5"/><category term="old broswer HTML5 Element"/><category term="order by"/><category term="passive mode"/><category term="php"/><category term="php 메일"/><category term="php 한글 인코딩"/><category term="php한글깨짐"/><category term="proxy pattern"/><category term="random number"/><category term="rest api"/><category term="save-data"/><category term="save-data header"/><category term="semantic"/><category term="semantic versioning"/><category term="semantic web"/><category term="semver"/><category term="setInterval"/><category term="setInterval antipatterns"/><category term="setInterval bubbling"/><category term="setTimeout"/><category term="setTimeout antipatterns"/><category term="setTimeout bubbling"/><category term="template method pattern"/><category term="text/ecmascript"/><category term="try catch error"/><category term="try catch javascript"/><category term="varchar"/><category term="varchar 차이"/><category term="xml attribute"/><category term="xml builtin entity"/><category term="xml 사용불가 문자"/><category term="구글 애드센스"/><category term="구글 애드센스 동영상"/><category term="나에게 보내기"/><category term="달력 아이콘 위치"/><category term="달력 위치"/><category term="데이타 uri스킴"/><category term="데이타 세이버"/><category term="도메인 권한"/><category term="랜덤 숫자 가져오기"/><category term="룩 앤드 필"/><category term="룩앤필"/><category term="메일"/><category term="배열 join"/><category term="배열 명시적선언 묵시적선언"/><category term="배열 판별"/><category term="배열은 정수나 상수를 필요로 한다"/><category term="비특권포트"/><category term="빌더패턴"/><category term="빌트인 엔티티"/><category term="사용권한이 없습니다"/><category term="슈퍼셋 언어"/><category term="시멘틱"/><category term="시멘틱 웹"/><category term="심버"/><category term="심버(semver)"/><category term="아코디언"/><category term="안티패턴 setInterval"/><category term="애드센스 동영상"/><category term="애드센스 지급"/><category term="에크마스크립트"/><category term="이미지 정규식"/><category term="이미지 찾기"/><category term="익스프로러10 플래시지원"/><category term="익스플로러 10"/><category term="자바스크립트"/><category term="자바스크립트 6"/><category term="자바스크립트 Avoid bubbling"/><category term="자바스크립트 금액 콤마"/><category term="자바스크립트 랜덤 숫자"/><category term="자바스크립트 배열 판별"/><category term="자바스크립트 안티패턴"/><category term="자바스크립트 체이닝 패턴"/><category term="자바스크립트 추상 팩토리"/><category term="자바스크립트 추상 팩토리 패턴"/><category term="자바스크립트 커맨드 패턴"/><category term="자바스크립트 콤마"/><category term="자바스크립트 프록시 패턴"/><category term="자바스크립트 프록시 패턴(proxy pattern )"/><category term="자바스크립트 호이스팅"/><category term="정수"/><category term="체이닝 패턴"/><category term="추상 팩토리 패턴"/><category term="카카오api"/><category term="커맨드 패턴"/><category term="컴포지트 패턴"/><category term="컴포지트 패턴 자바스크립트"/><category term="크롬 flag"/><category term="템플릿메소드 패턴"/><category term="프로토타입 날짜형 변환"/><category term="한글"/><category term="한글 깨짐"/><category term="한글 인코딩"/><category term="한글깨짐"/><category term="함수 선언문 함수 표현식"/><category term="확장자 체크 스크립트"/><title type='text'>ㅋㅋ</title><subtitle type='html'>자바스크립트, jquery, node.js, coffeescript, phonegab 등 개발공유</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>101</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-5473873294708588720</id><published>2018-04-13T10:11:00.001+09:00</published><updated>2018-04-13T10:24:31.613+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="client hint"/><category scheme="http://www.blogger.com/atom/ns#" term="data-save"/><category scheme="http://www.blogger.com/atom/ns#" term="data-saver"/><category scheme="http://www.blogger.com/atom/ns#" term="save-data"/><category scheme="http://www.blogger.com/atom/ns#" term="save-data header"/><category scheme="http://www.blogger.com/atom/ns#" term="데이타 세이버"/><title type='text'>Save-Data Client Hint</title><content type='html'>&lt;h1 class=&quot;_1st9amh&quot; data-key=&quot;7d86fe987a004ac4950514801f1172ec&quot; id=&quot;save-data-client-hint&quot; style=&quot;background-color: white; box-sizing: inherit; color: #242a31; display: flex; font-family: Roboto, sans-serif; margin: 0px 0px 24px; outline: none; position: relative; white-space: pre-wrap;&quot;&gt;
&lt;div class=&quot;_bc4egv&quot; style=&quot;box-sizing: inherit; flex: 1 1 0%; outline: none;&quot;&gt;
&lt;span class=&quot;_1a3b01i&quot; style=&quot;box-sizing: inherit; font-size: 24px; line-height: 1.5; outline: none;&quot;&gt;Save-Data Client Hint&lt;/span&gt;&lt;a class=&quot;_i422ldx&quot; contenteditable=&quot;false&quot; href=&quot;https://pakss3.gitbook.io/http-performance/~/drafts/-L9rAT1qMRYGEpkbkXa7/primary/front/untitled#save-data-client-hint&quot; style=&quot;box-sizing: inherit; color: #242a31; line-height: 1em; opacity: 0; outline: none; padding-left: 4px; transition: opacity 150ms ease; width: 20px;&quot;&gt;&lt;span class=&quot;_15qrizw&quot; style=&quot;box-sizing: inherit; font-size: 16px; outline: none; vertical-align: middle;&quot;&gt;&lt;svg class=&quot;_13gjrqj&quot; fill=&quot;currentColor&quot; height=&quot;1em&quot; preserveaspectratio=&quot;xMidYMid meet&quot; stroke=&quot;none&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;1em&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;g&gt;&lt;path d=&quot;M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z&quot; fill-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/h1&gt;
&lt;div class=&quot;_v011fo&quot; data-key=&quot;821c084060d142bc8f921d6d751fa7f7&quot; style=&quot;background-color: white; box-sizing: inherit; margin-bottom: 24px; outline: none; position: relative;&quot;&gt;
&lt;div style=&quot;color: #3b454e; font-family: roboto, sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt;
&lt;span class=&quot;_1yjweog&quot; style=&quot;box-sizing: inherit; line-height: 1.625; outline: none;&quot;&gt;ilya grigorik은 Client Hint라 하여 웹사이트에서 코드를 구현시에 그에 더 맞게 구현할 수 있도록 헤더 값 등을 통하여 제공해주어야 한다 제안하였다(&lt;/span&gt;&lt;a href=&quot;https://tools.ietf.org/html/draft-ietf-httpbis-client-hints-05#section-6.5&quot; style=&quot;font-family: &amp;quot;Malgun Gothic&amp;quot;; font-size: medium; white-space: normal;&quot;&gt;Client Hint Draft&lt;/a&gt;)&lt;/div&gt;
&lt;div style=&quot;color: #3b454e; font-family: roboto, sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt;
&lt;span class=&quot;_1yjweog&quot; style=&quot;box-sizing: inherit; line-height: 1.625; outline: none;&quot;&gt;그 중 일부 Save-Data(데이터 절약모드 상태) 클라이언트(헤더 값) 힌트를 이용하면 헤더를 통해 선택적으로 컨텐츠를 제공 할 수 있다.
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3b454e; font-family: roboto, sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3b454e; font-family: roboto, sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt;
&lt;span class=&quot;_1yjweog&quot; style=&quot;box-sizing: inherit; line-height: 1.625; outline: none;&quot;&gt;&lt;span style=&quot;color: #242a31; font-size: 20px; font-weight: 700;&quot;&gt;Save-Data 기능 ON&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;color: #3b454e; font-family: roboto, sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt;
&lt;li&gt;직접 Header 값에서 Save-Data : On 이라 제공&lt;/li&gt;
&lt;li&gt;아래 기기들에서 여러가지 모드 설정을 하면 Save-Data 헤더값에 On을 제공한다&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;color: #3b454e; font-family: roboto, sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt;
1. Chrome49+(PC) 브라우저 데이타세이버(Data Saver) 플러그인 사용&lt;/div&gt;
&lt;ul style=&quot;color: #3b454e; font-family: roboto, sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt;
&lt;li&gt;Chrome에서 데이터세이버 설치&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://chrome.google.com/webstore/detail/data-saver/pfmgfdlgomnbgkofeojodiodmgpgmkac&quot;&gt;https://chrome.google.com/webstore/detail/data-saver/pfmgfdlgomnbgkofeojodiodmgpgmkac&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivAVVnBMYuulrEQ4r3K2_C670yEe4FJap1X-06piEob7yWqTTx__KgaBShViu4JFttzZbDLX-CPcfAvtS5L0QRnS2xD4rZSy-vUC3Fha8drhQmHlZDZ7kpj-UDZZ9lnfDrVBBqdk_fpJeH/s1600/%25EC%25BA%25A1%25EC%25B2%2598.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;768&quot; data-original-width=&quot;1219&quot; height=&quot;251&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivAVVnBMYuulrEQ4r3K2_C670yEe4FJap1X-06piEob7yWqTTx__KgaBShViu4JFttzZbDLX-CPcfAvtS5L0QRnS2xD4rZSy-vUC3Fha8drhQmHlZDZ7kpj-UDZZ9lnfDrVBBqdk_fpJeH/s400/%25EC%25BA%25A1%25EC%25B2%2598.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul style=&quot;color: #3b454e; font-family: roboto, sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt;&lt;ul&gt;
&lt;li&gt;설치가 되면 우측 상단에 데이타 세이버가 설치 된 것을 알 수 있다.&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCVgfsiQv85mfZZuC8PuNh7cJ84ODgrxRWb_5Xq5HsB1ZpM_stw6gW4qpAfX6YLSA4IAY-ixWWQb7pNA1Jls8q3VC4q7ji62Tjw52uatTdDn9OrCF4yA4cgp-g3uzJJlmZcOMgptCGWTUE/s1600/%25EC%25BA%25A1%25EC%25B2%25981.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;476&quot; data-original-width=&quot;428&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCVgfsiQv85mfZZuC8PuNh7cJ84ODgrxRWb_5Xq5HsB1ZpM_stw6gW4qpAfX6YLSA4IAY-ixWWQb7pNA1Jls8q3VC4q7ji62Tjw52uatTdDn9OrCF4yA4cgp-g3uzJJlmZcOMgptCGWTUE/s320/%25EC%25BA%25A1%25EC%25B2%25981.PNG&quot; width=&quot;287&quot; /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;div style=&quot;color: #3b454e; font-family: roboto, sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3b454e; font-family: roboto, sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt;
2.  안드로이드 Chrome에서 데이터 절약모드 사용&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3b454e; font-family: roboto, sans-serif;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;     - 태블릿 혹은 스마트폰에서 Chrome 열기
     - 오른쪽 상단 설정 클릭
     - 고급에서 데이터 절약모드 선택&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3b454e; font-family: roboto, sans-serif;&quot;&gt;&lt;span style=&quot;white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3b454e; font-family: roboto, sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt;
3.  &lt;span style=&quot;color: #3b454e; font-family: roboto, sans-serif;&quot;&gt;Opera 35+ 에서 Opera Turbo Mode 사용 시&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3b454e; font-family: roboto, sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt;
4.  Yandex 16.2+ 에서 Turbo Mode 사용 시&lt;/div&gt;
&lt;/div&gt;
&lt;h2 class=&quot;_1r75zq6v&quot; data-key=&quot;1d226422507e4db3b5340cb1d722aa61&quot; id=&quot;save-data&quot; style=&quot;box-sizing: inherit; display: flex; font-family: roboto, sans-serif; margin: 32px 0px 24px; outline: none; position: relative; white-space: pre-wrap;&quot;&gt;
&lt;div class=&quot;_bc4egv&quot; style=&quot;box-sizing: inherit; flex: 1 1 0%; outline: none;&quot;&gt;
&lt;div style=&quot;background-color: white; color: #242a31;&quot;&gt;
&lt;span style=&quot;font-size: 20px;&quot;&gt;Data-Saver ??&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;데이터 절약 모드를 사용하면 웹 리소스가 구글 서버를 거쳐 압축이 이루어져서 &lt;/span&gt;&lt;span class=&quot;_1yjweog&quot; style=&quot;box-sizing: inherit; font-size: 16px; line-height: 1.625; outline: none;&quot;&gt;데이터를 절약할 수 있다. &lt;/span&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;현재 안드로이드, 크롬에서만 사용 가능하며, apple에서도 &lt;/span&gt;&lt;span style=&quot;font-size: 16px;&quot;&gt;추가 할 예정 &lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;/div&gt;
&lt;/h2&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;데이터 압축 프록시 작동 방법&quot; src=&quot;https://developer.chrome.com/multidevice/images/data-compression/compression-proxy.png&quot; style=&quot;border: 1px solid rgb(219, 219, 219); box-sizing: border-box; color: #777777; font-family: &amp;quot;open sans&amp;quot;, arial, &amp;quot;lucida grande&amp;quot;, sans-serif; font-size: 13px; margin: 0px auto; max-width: 100%; padding: 0px; vertical-align: middle;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;출처 : Data-Saver의 동작과정&lt;br /&gt;
(https://developer.chrome.com/multidevice/data-compression)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;이를 이용하여 데이터 절약을 원하는 사람들에게 adaptive하게 리소스를 전달 할 수 있음&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #242a31; font-family: &amp;quot;roboto&amp;quot; , sans-serif; font-size: 20px; font-weight: 700; white-space: pre-wrap;&quot;&gt;Data-Saver 특징 &lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;암호화 되지 않은 상태에서 proxy 동작 후 https 대상에 https로 전달함&lt;/li&gt;
&lt;li&gt;프록시를 통하기 때문에 ip는 X-Forwarded-For 헤더값을 통함&lt;/li&gt;
&lt;li&gt;사이트 소유자의 콘텐츠 옵트아웃(Opt-out : 당사자가 자신의 데이터를 수집을 허용하지 않는다고 명시)에 대해서는 Cache-Control: no-transform 지시자를 존중&lt;br /&gt;데이터를 변형하지 않고 직접 전달&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;clear: both;&quot;&gt;
&lt;h3&gt;
&quot;다시 본론으로 돌아와서 Data-Saver 값이 존재 할 경우 컨텐츠에 대해 적응적으로 압축된 형태의 이미지 혹은 다른 리소스들을 전달해주면 어떨까?&quot;&lt;/h3&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #242a31; font-family: &amp;quot;roboto&amp;quot; , sans-serif; font-size: 20px; font-weight: 700; white-space: pre-wrap;&quot;&gt;Save-Data 구현&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #242a31; font-family: &amp;quot;roboto&amp;quot; , sans-serif; font-size: 20px; font-weight: 700; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #3b454e; font-family: &amp;quot;roboto&amp;quot; , sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt; - Save-Data 구분(PHP)&lt;/span&gt;&lt;/div&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: olive;&quot;&gt;?php&lt;/span&gt;
 &lt;span style=&quot;color: purple;&quot;&gt;header&lt;/span&gt;(&#39;&lt;span style=&quot;color: purple;&quot;&gt;Save-Data: on&lt;/span&gt;&#39;);
 &lt;span style=&quot;color: purple;&quot;&gt;$saveData &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;false&lt;/span&gt;;

 &lt;span style=&quot;color: purple;&quot;&gt;if &lt;/span&gt;(&lt;span style=&quot;color: purple;&quot;&gt;isset&lt;/span&gt;(&lt;span style=&quot;color: purple;&quot;&gt;$_SERVER&lt;/span&gt;[&lt;span style=&quot;color: magenta;&quot;&gt;&quot;HTTP_SAVE_DATA&quot;&lt;/span&gt;]) &amp;amp;&amp;amp; &lt;span style=&quot;color: purple;&quot;&gt;strtolower&lt;/span&gt;(&lt;span style=&quot;color: purple;&quot;&gt;$_SERVER&lt;/span&gt;[&quot;&lt;span style=&quot;color: purple;&quot;&gt;HTTP_SAVE_DATA&lt;/span&gt;&quot;]) &lt;span style=&quot;color: blue;&quot;&gt;=== &lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;on&quot;&lt;/span&gt;) {
   &lt;span style=&quot;color: purple;&quot;&gt;$saveData &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;true&lt;/span&gt;;
 }

&lt;span style=&quot;color: purple;&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt; - Save-Data 구분(JS)&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
   &lt;span style=&quot;color: blue;&quot;&gt;if &lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;connection&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;in &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;navigator&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;) { &lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;if &lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;navigator&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;.connection.saveData === &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;) { &lt;/span&gt;
     
    &lt;span style=&quot;color: maroon;&quot;&gt;}&lt;/span&gt;
   &lt;span style=&quot;color: maroon;&quot;&gt;}&lt;/span&gt;
  
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt; - HTML에서 Save-Data 모드 상태 구분 &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;html &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;&amp;lt;?=$saveData ? &#39;save-data&#39; : &#39;&#39;?&amp;gt;&quot; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;lang&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;ko-kr&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;meta &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;charset&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt; - 이미지를 Save-Data 상태에 따라 제공 &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: olive;&quot;&gt;?php&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;if ($saveData) {
  ?&amp;gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;img &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;aa-100px.jpg&quot; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;alt&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;100픽셀 이미지 퀄리티 조정 ON&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: olive;&quot;&gt;?php&lt;/span&gt;
}
&lt;span style=&quot;color: purple;&quot;&gt;else &lt;/span&gt;{
  &lt;span style=&quot;color: purple;&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&amp;lt;img &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;aa-300px.jpg&quot; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;alt&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;300px 이미지 퀄리티 조정 OFF&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: olive;&quot;&gt;?php&lt;/span&gt;
}
&lt;/span&gt;
&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #242a31; font-family: &amp;quot;roboto&amp;quot; , sans-serif; font-size: 20px; font-weight: 700; white-space: pre-wrap;&quot;&gt;Save-Data 구현 결과&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: white; color: #242a31; font-family: &amp;quot;roboto&amp;quot; , sans-serif; font-size: 20px; font-weight: 700; white-space: pre-wrap;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: white; color: #242a31; font-family: &amp;quot;roboto&amp;quot; , sans-serif; font-size: 20px; font-weight: 700; white-space: pre-wrap;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: black; font-family: &amp;quot;Malgun Gothic&amp;quot;; font-size: medium; font-weight: 400; white-space: normal;&quot;&gt;
&lt;span style=&quot;color: #3b454e; font-family: &amp;quot;roboto&amp;quot; , sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt; - save-data 미 사용시 원본 데이터&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;ul&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFiqOojZf7-nKaz8a2H4DaKb4aBTNRPdt-xdIV_9sFgo8DaPADPWYy6mkli1er8PAX61H7cU49P8Y6NgXcnutvZzf8x0okw0la9HdFVXFeEGDwNkYGeipqYUNDgqw8RrWfrd0DcxVUJGkZ/s1600/save-data-orign.png&quot; imageanchor=&quot;1&quot; style=&quot;font-family: &amp;quot;Malgun Gothic&amp;quot;; margin-left: 1em; margin-right: 1em; text-align: center; white-space: normal;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;955&quot; data-original-width=&quot;1300&quot; height=&quot;470&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFiqOojZf7-nKaz8a2H4DaKb4aBTNRPdt-xdIV_9sFgo8DaPADPWYy6mkli1er8PAX61H7cU49P8Y6NgXcnutvZzf8x0okw0la9HdFVXFeEGDwNkYGeipqYUNDgqw8RrWfrd0DcxVUJGkZ/s640/save-data-orign.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFiqOojZf7-nKaz8a2H4DaKb4aBTNRPdt-xdIV_9sFgo8DaPADPWYy6mkli1er8PAX61H7cU49P8Y6NgXcnutvZzf8x0okw0la9HdFVXFeEGDwNkYGeipqYUNDgqw8RrWfrd0DcxVUJGkZ/s1600/save-data-orign.png&quot; imageanchor=&quot;1&quot; style=&quot;font-family: &amp;quot;Malgun Gothic&amp;quot;; margin-left: 1em; margin-right: 1em; text-align: center; white-space: normal;&quot;&gt;&lt;ul&gt;
&lt;/ul&gt;
&lt;/a&gt;&lt;/ul&gt;
&lt;h3&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt; - save-data 사용시 변형된 퀄리티와 Header값 확인&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7m7M0cNvTm2ALIj8Qqb0o1352de1XW26_0IAQT16m6cCx7dPFT_Z7zZ-CAxXlUOQ8RuWtKwzcK_l67QRLe6hffSxfVvpfyrL6IX1X2vH0MQdQaIYAj0ri4eUjxqU1JerpEoDyrG4cdL-z/s1600/save-data-on.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;964&quot; data-original-width=&quot;1397&quot; height=&quot;440&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7m7M0cNvTm2ALIj8Qqb0o1352de1XW26_0IAQT16m6cCx7dPFT_Z7zZ-CAxXlUOQ8RuWtKwzcK_l67QRLe6hffSxfVvpfyrL6IX1X2vH0MQdQaIYAj0ri4eUjxqU1JerpEoDyrG4cdL-z/s640/save-data-on.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;
&lt;ul&gt;
&lt;/ul&gt;
&lt;/h3&gt;
&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: white; color: #242a31; font-family: &amp;quot;roboto&amp;quot; , sans-serif; font-size: 20px; font-weight: 700; white-space: pre-wrap;&quot;&gt;결론&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;ul style=&quot;font-size: 15.21px;&quot;&gt;
&lt;li&gt;Save-Data의 클라이언트 힌트를 이용하여 적응적으로 이미지를 적용 할 수 있다.&lt;/li&gt;
&lt;li&gt;웹 서버 파일 룰을 이용하여 이미지의 확장자와 header 값을 비교하여 전체적으로 이미지를 적응적으로 보여준다면
훨씬 리소스를 줄여 줄 수 있을 것이다. &lt;/li&gt;
&lt;li&gt;여러 브라우저 밴더사에서 구현에 움직임이 있어 권고안으로 발전하는 것을 기대해 볼 수 있지 않을까 조심스럽게 생각해봅니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;h3&gt;
참고&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tools.ietf.org/html/draft-ietf-httpbis-client-hints-05#section-6.5&quot;&gt;Client Hint Draft&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://support.google.com/chrome/answer/2392284?visit_id=1-636590921684926244-305380268&amp;amp;p=data_saver_off&amp;amp;rd=1&amp;amp;co=GENIE.Platform%3DDesktop&amp;amp;oco=1&quot;&gt;Chrome의 데이터 절약 모드로 데이터 사용량 줄이기&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.chrome.com/multidevice/data-compression&quot;&gt;Data-Saver&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/save-data/&quot;&gt;저장 데이터로 빠르고 가벼운 어플리케이션 제공&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/5473873294708588720/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2018/04/save-data-client-hint_13.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/5473873294708588720'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/5473873294708588720'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2018/04/save-data-client-hint_13.html' title='Save-Data Client Hint'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivAVVnBMYuulrEQ4r3K2_C670yEe4FJap1X-06piEob7yWqTTx__KgaBShViu4JFttzZbDLX-CPcfAvtS5L0QRnS2xD4rZSy-vUC3Fha8drhQmHlZDZ7kpj-UDZZ9lnfDrVBBqdk_fpJeH/s72-c/%25EC%25BA%25A1%25EC%25B2%2598.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-914839539672885587</id><published>2018-03-25T16:00:00.001+09:00</published><updated>2018-03-25T16:00:23.158+09:00</updated><title type='text'>script 태그 동작</title><content type='html'>&lt;span style=&quot;background-color: #f1f1f1; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;br /&gt;


클라이언트 자바스크립트에 대해 정의할 때 사용&lt;br /&gt;
&lt;br /&gt;
사용방법&lt;br /&gt;
- 태그사이에 statement를 기입하거나 src를 통해 외부 자원을 갖고 오는 방법이 있다.&lt;br /&gt;
&amp;nbsp; -&amp;gt; 외부자원 즉 src 속성을 이용하여 갖고 올 경우, 태그 사이 문은 동작 하지 않음&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; (&lt;a href=&quot;https://www.w3schools.com/tags/tag_script.asp&quot;&gt;https://www.w3schools.com/tags/tag_script.asp&lt;/a&gt;)&lt;br /&gt;
- 스크립트를 이용 할 수 없을 경우 noscript를 태그를 이용하여 자바스크립트에서 표현 하고자 하는 요소를 등록해야 함&lt;br /&gt;
- async 요소를 이용하면 비동기 적으로 외부 스크립트를 가져올 수 있다.&lt;br /&gt;
- defer 요소를 이용하면 페이지 구문 분석이 끝난 후 스크립트 요소를 가져 올 수 있다.&lt;br /&gt;
- async, defer요소가 없을 경우 스크립트는 즉시 실행</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/914839539672885587/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2018/03/script.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/914839539672885587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/914839539672885587'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2018/03/script.html' title='script 태그 동작'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-8156519701464914982</id><published>2018-03-23T16:04:00.002+09:00</published><updated>2018-03-23T16:04:36.596+09:00</updated><title type='text'>throttling(쓰로틀링)</title><content type='html'>&lt;h3&gt;
throttling(쓰로틀링)&amp;nbsp;&lt;/h3&gt;
- 함수, 메서드 등 일정 시간 전에 호출 시 호출이 안되고, 해당 시간이 지나야 처리가 되는 기능&lt;br /&gt;
- ajax와 같이 자주 호출 되는 함수들에 사용&lt;br /&gt;
- 반복되서 사용되는 api 특히 비용이 들어갈 경우 더욱 쓰로틀링이 필요해 보인다.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Code&lt;/h3&gt;
-------------------------------------------------------------------------------------------------&lt;br /&gt;
&amp;lt;a id=&quot;throttling&quot; href=&quot;#aa&quot; &amp;gt;throttling&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
document.querySelector(&quot;#throttling&quot;).onclick = throttling(function(e){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;console.log(&quot;throttling&quot;);&lt;br /&gt;
},1000);&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
// 1초 뒤에 호출 동작&lt;br /&gt;
function throttling(fn, delay){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; let isRunning = false, timeoutFn, nextTime = 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return (...args)=&amp;gt;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; isRunning = (Date.now() - nextTime&amp;nbsp; &amp;gt; delay);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(isRunning){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; let _this = this;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; timeoutFn = setTimeout(function(){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fn.call(_this, ...args);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },delay);&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nextTime = Date.now();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/8156519701464914982/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2018/03/throttling.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/8156519701464914982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/8156519701464914982'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2018/03/throttling.html' title='throttling(쓰로틀링)'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-6237489364018670251</id><published>2018-03-23T14:23:00.002+09:00</published><updated>2018-03-26T09:31:22.284+09:00</updated><title type='text'>debouncing(디바운싱)</title><content type='html'>&lt;h3&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif; font-size: 14px;&quot;&gt;debouncing(디바운싱)&amp;nbsp;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif; font-size: 14px;&quot;&gt;- 연속적인 호출의 메서드, 함수들에 대해 맨 마지막에 호출한 한번의 함수만 실행 하는 것&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif; font-size: 14px;&quot;&gt;- 저장버튼 일 경우 마지막에 누른 한번만 동작 하도록 처리&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;h3&gt;
code&lt;/h3&gt;
&lt;div&gt;
---------------------------------------------------------------------------------------------------&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;&amp;lt;a id=&quot;debouncing&quot;&amp;nbsp; &amp;gt;debouncing&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&amp;lt;script&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;//debouncing 마지막에 실행한 값만 실행&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;document.querySelector(&quot;#debouncing&quot;).onclick = debouncing(function(e,i){&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert(&quot;test&quot;+i);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;}, 200);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;function debouncing(fn, delay){&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; var evt, i = 0;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; return function(e, i){&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.preventDefault();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clearTimeout(evt);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; evt = setTimeout(function(){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fn(e, i);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }, delay);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;nanum barun gothic&amp;quot; , &amp;quot;nanumbarungothic&amp;quot; , , , &amp;quot;noto sans kr&amp;quot; , , &amp;quot;noto sans korean&amp;quot; , &amp;quot;apple sd gothic neo&amp;quot; , &amp;quot;malgun gothic&amp;quot; , &amp;quot;applegothic&amp;quot; , &amp;quot;dotum&amp;quot; , , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/6237489364018670251/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2018/03/debouncing.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/6237489364018670251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/6237489364018670251'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2018/03/debouncing.html' title='debouncing(디바운싱)'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-767156678937722289</id><published>2018-03-02T10:30:00.001+09:00</published><updated>2018-03-02T10:34:42.340+09:00</updated><title type='text'>의존성 주입(dependency injection)</title><content type='html'>&lt;h2&gt;
의존성(dependency)&lt;/h2&gt;
&lt;h3&gt;
- 한국어로 일단 풀이를 해보자&lt;/h3&gt;
&amp;nbsp;=&amp;gt; 의존하다 : 부족한 주체가 도움을 받다. 그래서 도움을 받는 무언가를 신뢰하다.&lt;br /&gt;
이러한 뜻을 갖고 있다.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
더 쉬운 예를 들어보자&lt;/h4&gt;
-&amp;gt; 나는 귀차니즘이 심해서 아침을 안먹는다. 그래서 엄마가 항상 아침을 차려준다.&lt;br /&gt;
==&amp;gt; 이는 나는 엄마에게 &quot;아침밥을 먹다&quot;이라는 목적을 달성하기 위한 의존적이게 된다.&lt;br /&gt;
하지만 나는 아침밥이라는 목적을 달성시켜줄 수 있는것은 엄마만이 될 수 있는것은 아니다.&lt;br /&gt;
아빠가 차려줄 수도 있고 누나가 차려줄 수도 있다.&lt;br /&gt;
&lt;br /&gt;
이러한 의존성을 갖는 클래스(아침밥을 먹다)가 외부의 도움을 받아서 달성, 혹은 변할수 있는 행위(엄마, 아빠, 누나)를 주입(injection) 이라고 한다.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
의사코드로 이를 구성해보면&lt;/h4&gt;
class 아침밥먹다 {&amp;nbsp; //의존성을 갖는 클래스&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public funciton set차려주는사람(대상){ //주입method&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Person target = new 대상();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.차려주는사람 = target;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class 엄마{&lt;br /&gt;
}&lt;br /&gt;
class 누나{&lt;br /&gt;
}&lt;br /&gt;
class 아빠{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;h3&gt;
&lt;br /&gt;위키백과에는&lt;/h3&gt;
&lt;br /&gt;
&lt;b style=&quot;background-color: white; color: #222222; font-family: sans-serif; font-size: 14px;&quot;&gt;의존성 주입&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: sans-serif; font-size: 14px;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;en&quot; style=&quot;background-color: white; color: #222222; font-family: sans-serif; font-size: 14px;&quot; xml:lang=&quot;en&quot;&gt;Dependency Injection&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: sans-serif; font-size: 14px;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: white; color: #222222; font-family: sans-serif; font-size: 14px;&quot;&gt;DI&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: sans-serif; font-size: 14px;&quot;&gt;)은&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;mw-redirect&quot; href=&quot;https://ko.wikipedia.org/wiki/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%B0%8D&quot; style=&quot;background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; text-decoration-line: none;&quot; title=&quot;프로그래밍&quot;&gt;프로그래밍&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: sans-serif; font-size: 14px;&quot;&gt;에서 구성요소간의 의존 관계가&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;mw-redirect&quot; href=&quot;https://ko.wikipedia.org/wiki/%EC%86%8C%EC%8A%A4%EC%BD%94%EB%93%9C&quot; style=&quot;background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; text-decoration-line: none;&quot; title=&quot;소스코드&quot;&gt;소스코드&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;내부가 아닌 외부의 설정파일 등을 통해 정의되게 하는&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://ko.wikipedia.org/wiki/%EB%94%94%EC%9E%90%EC%9D%B8_%ED%8C%A8%ED%84%B4&quot; style=&quot;background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; text-decoration-line: none;&quot; title=&quot;디자인 패턴&quot;&gt;디자인 패턴&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;중의 하나이다.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
장점&lt;/h3&gt;
&lt;ul style=&quot;background-color: white; color: #222222; font-family: sans-serif; font-size: 14px; list-style-image: url(&amp;quot;data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%225%22 height=%2213%22%3E %3Ccircle cx=%222.5%22 cy=%229.5%22 r=%222.5%22 fill=%22%2300528c%22/%3E %3C/svg%3E&amp;quot;); margin: 0.3em 0px 0px 1.6em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;의존 관계 설정이&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;https://ko.wikipedia.org/wiki/%EC%BB%B4%ED%8C%8C%EC%9D%BC&quot; style=&quot;background: none; color: #0b0080; text-decoration-line: none;&quot; title=&quot;컴파일&quot;&gt;컴파일&lt;/a&gt;시가 아닌&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;https://ko.wikipedia.org/wiki/%EC%8B%A4%ED%96%89&quot; style=&quot;background: none; color: #0b0080; text-decoration-line: none;&quot; title=&quot;실행&quot;&gt;실행&lt;/a&gt;시에 이루어져 모듈들간의&amp;nbsp;&lt;a href=&quot;https://ko.wikipedia.org/wiki/%EA%B2%B0%ED%95%A9%EB%8F%84&quot; style=&quot;background: none; color: #0b0080; text-decoration-line: none;&quot; title=&quot;결합도&quot;&gt;결합도&lt;/a&gt;&amp;nbsp;를 낮출 수 있다.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;https://ko.wikipedia.org/wiki/%EC%BD%94%EB%93%9C_%EC%9E%AC%EC%82%AC%EC%9A%A9&quot; style=&quot;background: none; color: #0b0080; text-decoration-line: none;&quot; title=&quot;코드 재사용&quot;&gt;코드 재사용&lt;/a&gt;을 높여서 작성된 모듈을 여러 곳에서 소스코드의 수정 없이 사용할 수 있다.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a href=&quot;https://ko.wikipedia.org/wiki/%EB%AA%A8%EC%9D%98_%EA%B0%9D%EC%B2%B4&quot; style=&quot;background: none; color: #0b0080; text-decoration-line: none;&quot; title=&quot;모의 객체&quot;&gt;모의 객체&lt;/a&gt;&amp;nbsp;등을 이용한&amp;nbsp;&lt;a href=&quot;https://ko.wikipedia.org/wiki/%EC%9C%A0%EB%8B%9B_%ED%85%8C%EC%8A%A4%ED%8A%B8&quot; style=&quot;background: none; color: #0b0080; text-decoration-line: none;&quot; title=&quot;유닛 테스트&quot;&gt;단위 테스트&lt;/a&gt;의 편의성을 높여준다.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: sans-serif; font-size: 14px; line-height: inherit; margin-bottom: 0.5em; margin-top: 0.5em;&quot;&gt;
&lt;a class=&quot;new&quot; href=&quot;https://ko.wikipedia.org/w/index.php?title=%EB%A7%88%ED%8B%B4_%ED%8C%8C%EC%9A%B8%EB%9F%AC&amp;amp;action=edit&amp;amp;redlink=1&quot; style=&quot;background: none; color: #a55858; text-decoration-line: none;&quot; title=&quot;마틴 파울러 (없는 문서)&quot;&gt;마틴 파울러&lt;/a&gt;는 다음과 같은 세 가지의 의존성 주입 패턴을 제시하였다.&amp;nbsp;&lt;/div&gt;
&lt;ul style=&quot;background-color: white; color: #222222; font-family: sans-serif; font-size: 14px; list-style-image: url(&amp;quot;data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%225%22 height=%2213%22%3E %3Ccircle cx=%222.5%22 cy=%229.5%22 r=%222.5%22 fill=%22%2300528c%22/%3E %3C/svg%3E&amp;quot;); margin: 0.3em 0px 0px 1.6em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;생성자 주입&amp;nbsp;: 필요한 의존성을 모두 포함하는 클래스의 생성자를 만들고 그 생성자를 통해 의존성을 주입한다.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;세터(Setter)를 통한 주입&amp;nbsp;: 의존성을 입력받는 세터(Setter) 메소드를 만들고 이를 통해 의존성을 주입한다.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;&lt;a class=&quot;mw-disambig&quot; href=&quot;https://ko.wikipedia.org/wiki/%EC%9D%B8%ED%84%B0%ED%8E%98%EC%9D%B4%EC%8A%A4&quot; style=&quot;background: none; color: #0b0080; text-decoration-line: none;&quot; title=&quot;인터페이스&quot;&gt;인터페이스&lt;/a&gt;(Interface)를 통한 주입&amp;nbsp;: 의존성을 주입하는 함수를 포함한 인터페이스를 작성하고 이 인터페이스를 구현하도록 함으로써&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;https://ko.wikipedia.org/wiki/%EC%8B%A4%ED%96%89&quot; style=&quot;background: none; color: #0b0080; text-decoration-line: none;&quot; title=&quot;실행&quot;&gt;실행&lt;/a&gt;시에 이를 통하여 의존성을 주입한다.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;출처 위키백과 (https://ko.wikipedia.org/wiki/%EC%9D%98%EC%A1%B4%EC%84%B1_%EC%A3%BC%EC%9E%85)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/767156678937722289/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2018/03/dependency-injection.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/767156678937722289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/767156678937722289'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2018/03/dependency-injection.html' title='의존성 주입(dependency injection)'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-3377631317762476758</id><published>2017-12-11T13:48:00.003+09:00</published><updated>2017-12-11T13:48:43.639+09:00</updated><title type='text'>Classic Asp date_format Function </title><content type='html'>&lt;div style=&quot;color: #333333; font-family: Arial, sans-serif; font-size: 14px;&quot;&gt;
언어별로 date_format 라는 함수가 있어 date값에 대해 원하는 string으로 출력해주는데 classic asp에는 없다.&lt;/div&gt;
&lt;div style=&quot;color: #333333; font-family: Arial, sans-serif; font-size: 14px; margin-top: 10px;&quot;&gt;
그래서 다른 date_format 함수의 masking 방법을 빌려서 제작&lt;/div&gt;
&lt;div style=&quot;margin-top: 10px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;a href=&quot;https://github.com/pakss3/dateformat&quot;&gt;https://github.com/pakss3/dateformat&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table class=&quot;confluenceTable&quot; style=&quot;border-collapse: collapse; color: #333333; font-family: Arial, sans-serif; font-size: 14px; margin: 10px 0px 0px; overflow-x: auto;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th class=&quot;confluenceTh&quot; style=&quot;background-color: #f0f0f0; border: 1px solid rgb(221, 221, 221); padding: 7px 10px; text-align: left; vertical-align: top; white-space: pre-wrap;&quot;&gt;format character&lt;/th&gt;&lt;th class=&quot;confluenceTh&quot; style=&quot;background-color: #f0f0f0; border: 1px solid rgb(221, 221, 221); padding: 7px 10px; text-align: left; vertical-align: top; white-space: pre-wrap;&quot;&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;yyyy&lt;/td&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;연도 4자리&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;yy&lt;/td&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;연도 2자리&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;mm&lt;/td&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;월 2자리&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;m&lt;/td&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;월 1자리&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;dd&lt;/td&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;일 2자리&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;d&lt;/td&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;일 1자리&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;hh&lt;/td&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;시 2자리&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;h&lt;/td&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;시 1자리&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;ii&lt;/td&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;분 2자리&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;i&lt;/td&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;분 1자리&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;ss&lt;/td&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;초 2자리&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;s&lt;/td&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;초 1자리&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;W&lt;/td&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;W요일&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;w&lt;/td&gt;&lt;td class=&quot;confluenceTd&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 7px 10px; vertical-align: top; white-space: pre-wrap;&quot;&gt;ex&amp;gt; 금&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;color: #333333; font-family: Arial, sans-serif; font-size: 14px; margin-top: 10px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table class=&quot;wysiwyg-macro&quot; data-macro-body-type=&quot;PLAIN_TEXT&quot; data-macro-name=&quot;code&quot; data-macro-parameters=&quot;collapse=true|firstline=1|language=vb|linenumbers=true|title=date_format 함수 소스&quot; data-mce-style=&quot;background-image: url(&#39;http://sri-wiki.saraminhr.co.kr/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6dGl0bGU9ZGF0ZV9mb3JtYXQg7ZWo7IiYIOyGjOyKpHxsaW5lbnVtYmVycz10cnVlfGxhbmd1YWdlPXZifGZpcnN0bGluZT0xfGNvbGxhcHNlPXRydWV9&amp;amp;locale=ko_KR&amp;amp;version=2&#39;); background-repeat: no-repeat;&quot; style=&quot;background-color: #f0f0f0; background-image: url(&amp;quot;/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6dGl0bGU9ZGF0ZV9mb3JtYXQg7ZWo7IiYIOyGjOyKpHxsaW5lbnVtYmVycz10cnVlfGxhbmd1YWdlPXZifGZpcnN0bGluZT0xfGNvbGxhcHNlPXRydWV9&amp;amp;locale=ko_KR&amp;amp;version=2&amp;quot;); background-position: 0px 0px; background-repeat: no-repeat; border: 1px solid rgb(221, 221, 221); color: #333333; cursor: move; font-family: Arial, sans-serif; font-size: 14px; margin-top: 10px; padding: 24px 2px 2px; width: 1877px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;wysiwyg-macro-body&quot; style=&quot;background-color: white; border: 1px solid rgb(221, 221, 221); cursor: text; margin: 0px; padding: 10px; white-space: pre-wrap;&quot;&gt;&lt;pre style=&quot;tab-size: 4; white-space: pre-wrap;&quot;&gt;&#39;/**
&#39;**/
class DateValueObject
 private dateObj, formatValue
 
 public property let setDate(byval pDate)
  dateObj = cdate(pDate)
 end property
 
 public property get getDate()
  getDate = dateObj
 end property
 public property get getYear()
  getYear = year(dateObj)
 end property
 public property get getMonth()
  getMonth = month(dateObj)
 end property
 public property get getDay()
  getDay = day(dateObj)
 end property
 public property get getHour()
  getHour = hour(dateObj)
 end property
 public property get getMinute()
  getMinute = minute(dateObj)
 end property
 public property get getSecond()
  getSecond = second(dateObj)
 end property
 public property get getWeekDay()
  getWeekDay = Weekdayname(Weekday(dateObj)) &#39;left(&#39;목요일&#39;,1)
 end property
 public property get getWeekDaySimple()
  getWeekDaySimple = left(getWeekDay(),1) &#39;left(&#39;목요일&#39;,1)
 end property
 public property let setFormat(pFormat)
  formatValue = pFormat
 end property
 
 public property get getFormat()
  getFormat = formatValue
 end property
 private function zeroADD(byval pdate)
  dim vDate 
   vDate = pdate
   if len(vDate) = 1 then 
    zeroADD = &quot;0&quot; &amp;amp; vDate   
   else 
    zeroADD = vDate   
   end if 
 end function 
 public function dateParse()
  dim resultDate 
   resultDate = formatValue
   resultDate = replace(resultDate, &quot;yyyy&quot;, getYear())    &#39;연도(2017,1987)
   resultDate = replace(resultDate, &quot;yy&quot;, right(getYear(),2))  &#39;연도(2017,1987)
   resultDate = replace(resultDate, &quot;mm&quot;, zeroADD(getMonth()))  &#39;월(12,01,03)
   resultDate = replace(resultDate, &quot;m&quot;, getMonth())    &#39;월(12,1,3)
   resultDate = replace(resultDate, &quot;dd&quot;, zeroADD(getDay()))  &#39;일(12,01,03)
   resultDate = replace(resultDate, &quot;d&quot;, getDay())     &#39;일(12,1,3)
   resultDate = replace(resultDate, &quot;hh&quot;, zeroADD(getHour()))  &#39;시간(14,06,05)
   resultDate = replace(resultDate, &quot;h&quot;, getHour())    &#39;시간(14,6,5)
   resultDate = replace(resultDate, &quot;ii&quot;, zeroADD(getMinute())) &#39;분(14,06,05)
   resultDate = replace(resultDate, &quot;i&quot;, getMinute())    &#39;분(14,6,5)
   resultDate = replace(resultDate, &quot;ss&quot;, zeroADD(getSecond())) &#39;초(14,06,05)
   resultDate = replace(resultDate, &quot;s&quot;, getSecond())    &#39;초(14,6,5)
   resultDate = replace(resultDate, &quot;W&quot;, getWeekDay())    &#39;금요일
   resultDate = replace(resultDate, &quot;w&quot;, getWeekDaySimple())  &#39;금
   dateParse = resultDate
 end function 
 public function dateParseResult()
  dateParseResult = dateParse()
 end function 
end class
&#39;/**
&#39; @example   : date_format(&#39;2017-11-12 11:06:54&#39;,&#39;mm/dd/yyyy hh시 i분 s초&#39;) -&amp;gt; 11/12/2017 11시 6분 54초
&#39;**/
function date_format(byval pdate, byval dateFormat)
 dim dateCl 
 set dateCl = new DateValueObject
  dateCl.setDate = pdate
  dateCl.setFormat = dateFormat
  
  date_format = dateCl.dateParseResult()
 set dateCl = nothing
end function &lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/3377631317762476758/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2017/12/classic-asp-dateformat-function.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/3377631317762476758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/3377631317762476758'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2017/12/classic-asp-dateformat-function.html' title='Classic Asp date_format Function '/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-5179607010408007217</id><published>2017-11-09T09:33:00.004+09:00</published><updated>2017-11-09T09:33:53.928+09:00</updated><title type='text'>브루스 웹스터 &quot;사해효과&quot;</title><content type='html'>재능 있고 효과적인 IT 엔지니어가 떠날 가능성이 가장 큰 엔지니어 - 증발하는 경우가 발생합니다&lt;br /&gt;
남아있는 경향이있는 것은 &#39;잔여 물&#39;입니다. 이는 가장 재능 있고 효과적인 IT 엔지니어입니다.&amp;nbsp;그들이 직장을 불쾌하다고 생각하더라도, 다른 곳에서 일자리를 찾을 수있는 가능성이 가장 적습니다.&lt;br /&gt;
&lt;br /&gt;
http://brucefwebster.com/2008/04/11/the-wetware-crisis-the-dead-sea-effect/</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/5179607010408007217/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2017/11/blog-post.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/5179607010408007217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/5179607010408007217'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2017/11/blog-post.html' title='브루스 웹스터 &quot;사해효과&quot;'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-6543335477107825111</id><published>2017-09-26T09:08:00.000+09:00</published><updated>2017-09-26T09:08:31.002+09:00</updated><title type='text'>발견적 평가방법</title><content type='html'>제이콥 닐슨의 발견적 평가방법의 10가지 원리&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;background-color: white; color: #222222; font-family: sans-serif; font-size: 14px; list-style-image: none; margin: 0.3em 0px 0px 3.2em; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;시스템 상태의 가시성 유지할 것&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;실제 세상과 시스템의 일치&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;사용자에게 부여하는 조종의 자유를 줄 것&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;일관성과 표준 지킬 것&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;실수를 방지할 것&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;기억보다는 인식하게 할 것&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;유연성을 가지고 사용의 효율성을 가질 것&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;심미적이고 최소의 디자인을 할 것&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;실수로부터 회복이 가능할 것&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.1em;&quot;&gt;도움을 줄 수 있는 문서를 제공할 것&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;http://times.kaist.ac.kr/news/articleView.html?idxno=2072&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/6543335477107825111/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2017/09/blog-post.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/6543335477107825111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/6543335477107825111'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2017/09/blog-post.html' title='발견적 평가방법'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-2031659074983568979</id><published>2017-09-08T11:23:00.002+09:00</published><updated>2017-09-08T11:24:47.190+09:00</updated><title type='text'>php 이미지 글자 인식 (Tesseract OCR)</title><content type='html'>&lt;span style=&quot;background-color: white; color: #24292e; font-family: , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif , &amp;quot;apple color emoji&amp;quot; , &amp;quot;segoe ui emoji&amp;quot; , &amp;quot;segoe ui symbol&amp;quot;; font-size: 16px;&quot;&gt;Tesseract OCR이라는 라이브러리가 있다&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #24292e; font-family: , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif , &amp;quot;apple color emoji&amp;quot; , &amp;quot;segoe ui emoji&amp;quot; , &amp;quot;segoe ui symbol&amp;quot;;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;c++로 작성 되있으며, 다른 언어들도 호환하는데&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #24292e; font-family: , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif , &amp;quot;apple color emoji&amp;quot; , &amp;quot;segoe ui emoji&amp;quot; , &amp;quot;segoe ui symbol&amp;quot;;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;OS에 install 한 후 언어로 연결해주는 형태이다.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #24292e; font-family: , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif , &amp;quot;apple color emoji&amp;quot; , &amp;quot;segoe ui emoji&amp;quot; , &amp;quot;segoe ui symbol&amp;quot;;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #24292e; font-family: , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif , &amp;quot;apple color emoji&amp;quot; , &amp;quot;segoe ui emoji&amp;quot; , &amp;quot;segoe ui symbol&amp;quot;;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;지금 윈도우를 쓰니까 윈도우 기준으로 설치를 진행해보겠다.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #24292e; font-family: , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif , &amp;quot;apple color emoji&amp;quot; , &amp;quot;segoe ui emoji&amp;quot; , &amp;quot;segoe ui symbol&amp;quot;;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #24292e; font-family: , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif , &amp;quot;apple color emoji&amp;quot; , &amp;quot;segoe ui emoji&amp;quot; , &amp;quot;segoe ui symbol&amp;quot;;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;https://github.com/tesseract-ocr/tesseract/wiki/4.0-with-LSTM#400-alpha-for-windows&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #24292e; font-family: , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif , &amp;quot;apple color emoji&amp;quot; , &amp;quot;segoe ui emoji&amp;quot; , &amp;quot;segoe ui symbol&amp;quot;;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;에서&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #24292e; font-family: , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif , &amp;quot;apple color emoji&amp;quot; , &amp;quot;segoe ui emoji&amp;quot; , &amp;quot;segoe ui symbol&amp;quot;;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;ul style=&quot;background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 16px; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;&quot;&gt;
&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;a href=&quot;http://digi.bib.uni-mannheim.de/tesseract/tesseract-ocr-setup-4.00.00dev.exe&quot; style=&quot;background-color: transparent; box-sizing: border-box; color: #0366d6; outline-width: 0px;&quot;&gt;Windows Installer made with MinGW-w64&lt;/a&gt;&amp;nbsp;from&amp;nbsp;&lt;a href=&quot;https://github.com/UB-Mannheim/tesseract/wiki&quot; style=&quot;background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;&quot;&gt;UB Mannheim&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;color: #24292e; font-family: , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif , &amp;quot;apple color emoji&amp;quot; , &amp;quot;segoe ui emoji&amp;quot; , &amp;quot;segoe ui symbol&amp;quot;;&quot;&gt;를 다운-&amp;gt; 설치한다. 언어 셋팅하는게 있는데 난 중국어 일본어 한국어 이거 3개를 추가했다.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #24292e; font-family: , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif , &amp;quot;apple color emoji&amp;quot; , &amp;quot;segoe ui emoji&amp;quot; , &amp;quot;segoe ui symbol&amp;quot;;&quot;&gt;용량이 꽤 크다 . 언어 셋팅하니까 200MB가 더 증가함.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
그다음 소스를 composer로 가져오겠다.&lt;br /&gt;
&lt;br /&gt;
https://github.com/thiagoalessio/tesseract-ocr-for-php&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 1.25em; line-height: 1.25; margin-bottom: 16px; margin-top: 24px;&quot;&gt;
As a&amp;nbsp;&lt;a href=&quot;http://getcomposer.org/&quot; style=&quot;box-sizing: border-box; color: #0366d6; text-decoration-line: none;&quot;&gt;composer&lt;/a&gt;&amp;nbsp;dependency&lt;/h3&gt;
&lt;pre style=&quot;background-color: #f6f8fa; border-radius: 3px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace; font-size: 13.6px; line-height: 1.45; margin-bottom: 16px; overflow: auto; padding: 16px; word-wrap: normal;&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 3px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace; font-size: 13.6px; line-height: inherit; margin: 0px; overflow: visible; padding: 0px; word-break: normal; word-wrap: normal;&quot;&gt;{
    &quot;require&quot;: {
        &quot;thiagoalessio/tesseract_ocr&quot;: &quot;1.1.0&quot;
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #24292e; font-family: , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif , &amp;quot;apple color emoji&amp;quot; , &amp;quot;segoe ui emoji&amp;quot; , &amp;quot;segoe ui symbol&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #24292e; font-family: , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif , &amp;quot;apple color emoji&amp;quot; , &amp;quot;segoe ui emoji&amp;quot; , &amp;quot;segoe ui symbol&amp;quot;;&quot;&gt;기본적으로 테스트 코드를 실행해보려하면&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff; color: green; font-size: 9pt; font-weight: bold;&quot;&gt;tesseract 를 찾을수 없다고&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #24292e; font-family: , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif , &amp;quot;apple color emoji&amp;quot; , &amp;quot;segoe ui emoji&amp;quot; , &amp;quot;segoe ui symbol&amp;quot;;&quot;&gt;오류가 날것이다.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;background-color: white; font-family: 굴림체; font-size: 9pt;&quot;&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;executable(&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff; color: green; font-weight: bold;&quot;&gt;&#39;&quot;D:\ProgramFiles\Tesseract-OCR\tesseract.exe&quot;&#39;&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: 굴림체; font-size: 9pt;&quot;&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: 굴림체; font-size: 9pt;&quot;&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;이런식으로 있는 경로에 대해서 쌍따옴표로 감싸줘서 경로 셋팅 후 &lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: 굴림체; font-size: 9pt;&quot;&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: 굴림체; font-size: 9pt;&quot;&gt;&lt;pre style=&quot;background-color: white; font-family: 굴림체; font-size: 9pt;&quot;&gt;&lt;span style=&quot;background-color: #f7faff; color: navy; font-weight: bold;&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff; color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;TesseractOCR((&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff; color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;__DIR__&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff; color: green; font-weight: bold;&quot;&gt;&#39;\images\admin.bmp&#39;&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;)))&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;-&amp;gt;executable(&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff; color: green; font-weight: bold;&quot;&gt;&#39;&quot;D:\ProgramFiles\Tesseract-OCR\tesseract.exe&quot;&#39;&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;-&amp;gt;lang(&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff; color: green; font-weight: bold;&quot;&gt;&#39;kor&#39;&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;-&amp;gt;run()&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: 굴림체; font-size: 9pt;&quot;&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: 굴림체; font-size: 9pt;&quot;&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;이런식으로 실행해보면 된다. 이미지 경로 지정이야 알것이라 판단하고 lang 는 spread형태로 적어주면 된다.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: 굴림체; font-size: 9pt;&quot;&gt;(&#39;kor&#39;,&#39;eng&#39;,&#39;jpn&#39;) 이러한 형태로 &lt;/pre&gt;
&lt;pre style=&quot;font-family: 굴림체; font-size: 9pt;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: 굴림체; font-size: 9pt;&quot;&gt;만약 오류가 난다면 &lt;/pre&gt;
&lt;pre style=&quot;font-family: 굴림체; font-size: 9pt;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: 굴림체; font-size: 9pt;&quot;&gt;&lt;pre style=&quot;background-color: white; font-family: 굴림체; font-size: 9pt;&quot;&gt;&lt;span style=&quot;background-color: #f7faff; color: navy; font-weight: bold;&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff; color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;TesseractOCR((&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff; color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;__DIR__&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff; color: green; font-weight: bold;&quot;&gt;&#39;\images\admin.bmp&#39;&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;)))&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;-&amp;gt;executable(&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff; color: green; font-weight: bold;&quot;&gt;&#39;&quot;D:\ProgramFiles\Tesseract-OCR\tesseract.exe&quot;&#39;&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;-&amp;gt;lang(&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff; color: green; font-weight: bold;&quot;&gt;&#39;kor&#39;&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;    -&amp;gt;buildCommand()&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: 굴림체; font-size: 9pt;&quot;&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: 굴림체; font-size: 9pt;&quot;&gt;&lt;span style=&quot;background-color: #f7faff;&quot;&gt;이러한 형태로 build 를 해서 cmd 창에서 실행해보면 자세한 오류를 알수 있다. &lt;/span&gt;&lt;/pre&gt;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;pre style=&quot;font-family: 굴림체; font-size: 9pt;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;font-family: 굴림체; font-size: 9pt;&quot;&gt;다른 사람들은 잘 된다는데 난.. 한글이 잘 인식이 안된다...&lt;/pre&gt;
&lt;pre style=&quot;font-family: 굴림체; font-size: 9pt;&quot;&gt;영어는 그럭저럭 인식이 되는거 같다.&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/2031659074983568979/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2017/09/php.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/2031659074983568979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/2031659074983568979'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2017/09/php.html' title='php 이미지 글자 인식 (Tesseract OCR)'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-4051881582891622104</id><published>2017-08-28T10:01:00.002+09:00</published><updated>2017-08-28T10:01:44.212+09:00</updated><title type='text'>논문작성법</title><content type='html'>논문 작성지도 &amp;nbsp;수업정리&lt;br /&gt;
&lt;br /&gt;
1~4장&lt;br /&gt;
=====================================================&lt;br /&gt;
(핵심어&amp;nbsp;+ 핵심어&amp;nbsp;+ 핵심어) 결론&lt;br /&gt;
&lt;br /&gt;
&amp;lt;결론을 제일 먼저 써라&amp;gt;&lt;br /&gt;
과정을 구구절절 모두 적을 필요가 없음&lt;br /&gt;
A실험하다 방향이 틀어져 B가 나오면 A에 대해 언급할 필요가 없음&lt;br /&gt;
고생한 것에 대해 알아달라고 적을 필요가 없음&lt;br /&gt;
&lt;br /&gt;
&amp;lt;결론이 나오면 제목이 정해짐&amp;gt;&lt;br /&gt;
결론을 갖고 제목을 정함, 결론에 가장 잘 도달하도록 작성&lt;br /&gt;
&lt;br /&gt;
&amp;lt;구성은 그림으로 짜라&amp;gt;&lt;br /&gt;
그림의 크기와 위치, 중요한 것은 크고 앞으로 작성&lt;br /&gt;
&lt;br /&gt;
&amp;lt;하나의 그림에는 하나의 결과를 써라&amp;gt;&lt;br /&gt;
그림 설명시 첫번째 문장에는 결론으로 그림에 나온 데이터는 빠짐없이 기입&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;그림이 완성되면 결과를 써라&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;논문 작성은 두괄식으로&amp;gt;&lt;br /&gt;
- 핵심문장 -&amp;gt; 설명1 -&amp;gt; 설명2(점점 구체적으로, 중요한건 앞으로)&lt;br /&gt;
- 핵심문장 -&amp;gt; 결과1-&amp;gt; 결과분석-&amp;gt;결과 부연설명1 -&amp;gt; 결과 부연설명2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;논의(결론)에서 다룰 내용&amp;gt;&lt;br /&gt;
- 이 연구가 왜 중요한지?&lt;br /&gt;
- 새로 알게 된 것은 무엇인지?&lt;br /&gt;
- 이 결과의 어떤 의미인지?&lt;br /&gt;
- 앞으로 뭐가 가능해진다는 것인지?&lt;br /&gt;
- 연구의 한계는 무엇인지?(단점에 대해서 솔직하고 정확하게 써야됨, 안그럼 reviewr가 공격을 함)&lt;br /&gt;
대안/보충 설명으로 보완(장점 강조는 구체적으로 강조,우리 기술들은 이러한 약점이 있으나, 어떻게 하면 아마도 해결이 되 라고 적어주면 됨)&lt;br /&gt;
- 뭐가 새로운지 강조 (구체적이고 기존연구와의 차이점에 대해 설명)&lt;br /&gt;
- 앞으로의 전망&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-tip&lt;br /&gt;
&amp;gt; 쉬운 단어로 쉽게 설명하라&lt;br /&gt;
&amp;gt; 독자의 입장에서 고민하라&lt;br /&gt;
&amp;gt; 비중과 위치로 중요한 부분을 강조&lt;br /&gt;
&amp;gt; 모든 결과를 논문에 다 넣을 필요가 없다&lt;br /&gt;
&lt;br /&gt;
- 논문은 표현은 쉬운데 내용은 깊게 -&lt;br /&gt;
&lt;br /&gt;
5장&lt;br /&gt;
============================================&lt;br /&gt;
서론은 논문의 예고편&lt;br /&gt;
what? ;어떤 주제에 대해 연구해 봤는데,&lt;br /&gt;
why? ; 이 연구가 왜 중요하냐면(지금까지는 어디까지 알려졌는데)&lt;br /&gt;
how? ; 그래서 우리는 어떤 실험을 해봣다&lt;br /&gt;
&lt;br /&gt;
1.&lt;br /&gt;
what?은 강렬하고 짧은 1-2문장으로 쓰는것 추천&lt;br /&gt;
why? 앞에서의 what의 문장을 자연히 받아 구체적으로 풀어 써주면서 왜 이 주제가 흥미로운지, 이 연구가 의의가 중요한 의미가 될수 있다는 점을 시사하는것도 좋은 방법&lt;br /&gt;
&lt;br /&gt;
2. previous work&lt;br /&gt;
- 이 연구가 왜 중요한지 부각시키는 것에 집중&lt;br /&gt;
- 확신적인 표현보다는 완곡한 표현으로&lt;br /&gt;
- 내가 조사를 해봣는데 내가 조사한거에는 없다.&lt;br /&gt;
- 중요한것(직접관련된 내용) 부터 이야기 하고 덜 중요한것(간접 관련된 내용) 나중에 언급&lt;br /&gt;
- 기존 연구들을 언급 한 뒤 , 다시한번 연구의 중요성을 강조하는 것도 좋은 방법&lt;br /&gt;
&lt;br /&gt;
3. HOW&lt;br /&gt;
문단을 바꾸어서 논문의 핵심 방법론 기술&lt;br /&gt;
그 다음 문장에서 구체적으로 실험 방법/내용을 소개&lt;br /&gt;
&lt;br /&gt;
3. abstract&lt;br /&gt;
- intro 한번 더 요약&lt;br /&gt;
- what+ (why) + how&lt;br /&gt;
&lt;br /&gt;
====================================================&lt;br /&gt;
6장&lt;br /&gt;
literature search : how&lt;br /&gt;
왜 논문 조사를 해야하는가?&lt;br /&gt;
- novelty : 기존 이론, 실험결과 등을 파악해야 함&lt;br /&gt;
- methods : 내가 연구에 사용할 수 있는 방법 파악&lt;br /&gt;
- comparision : 내 결과가 타당한지 비교 검토&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://scholar.google.co.kr/ 에서 검색해봄&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====================================================&lt;br /&gt;
7장&lt;br /&gt;
가능한 많은 사람들에게 보여줘라&lt;br /&gt;
- 수정과정에서 논문의 구성을 바꾸는 것을 두려워 하지 말라&lt;br /&gt;
- 가능한 쉽게 써라&lt;br /&gt;
&lt;br /&gt;
checklist: figure&lt;br /&gt;
- scale bar, color bar &amp;amp; units 완벽하게 파악&lt;br /&gt;
- 그림 속의 약어들은 모두 표현 되어야됨&lt;br /&gt;
- 그림 속의 결과들은 모두 본문에 있는지&lt;br /&gt;
&lt;br /&gt;
- 본문에서 그림 호출(fig. 1) 다음에 그림이 배치되었는지&lt;br /&gt;
- 문장 시작할 때는 fig.라는 축약대신 figure라고 다 풀어쓰길&lt;br /&gt;
- 그림에서 subfigure (a)로 표기면 본문에서도 fig. 1(a)로 똑같이 쓰기&lt;br /&gt;
&lt;br /&gt;
checklist: result&lt;br /&gt;
- 결과로 확신 할 수 있는지 주장인지? 다른 가능성은 없는지?(그에 맞게 작성)&lt;br /&gt;
- 쉽게 설명이 되었는지?&lt;br /&gt;
- 논리적인 비약이 없는지?&lt;br /&gt;
&lt;br /&gt;
checklist: text&lt;br /&gt;
약어: 처음에 정의하고 그 이후 통일성 있게 쓰기 ctrl+f 활용&lt;br /&gt;
약어: 3번 이상 사용하는 경우에만 약어 사용&lt;br /&gt;
약어: 초록과 본문은 별개의 문서 = 초록에서 약어 정의 했어도 본문에서 사용한다면 다시 정의해야됨&lt;br /&gt;
숫자+ 단위 사이에는 space: ex&amp;gt; 10%, 10c&lt;br /&gt;
문장을 시작할때 기호로 시작하지 마시오&lt;br /&gt;
&lt;br /&gt;
checklist : refs. etc.&lt;br /&gt;
중복된 참고문헌은 없는지&lt;br /&gt;
issue #, &amp;nbsp;page #, yr등 확인: endnote가 완벽하진 않다.&lt;br /&gt;
be professional : 정확한 기호 표시&lt;br /&gt;
정확한 표현으로 : 10개 정도-&amp;gt; 13개&lt;br /&gt;
&lt;br /&gt;
단어 뜻은 정확히 알고 사용&lt;br /&gt;
강조 표현은 제대로&lt;br /&gt;
부정적인 표현은 덜.. 쓰도록&lt;br /&gt;
&lt;br /&gt;
===============================================&lt;br /&gt;
수강완료</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/4051881582891622104/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2017/08/blog-post_28.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/4051881582891622104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/4051881582891622104'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2017/08/blog-post_28.html' title='논문작성법'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-8253190400308853273</id><published>2017-08-02T12:56:00.002+09:00</published><updated>2017-08-02T12:56:24.540+09:00</updated><title type='text'>자바스크립트에서 csv 파일 생성시 한글 깨짐 문제 해결</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
var data = &quot;홍길동,1,2,3\r\n홍길동2,1,2,3&quot;&lt;br /&gt;
var pom = document.createElement(&#39;a&#39;);&lt;br /&gt;
var blob = new Blob([data], {type: &#39;text/csv;charset=utf-8;&#39;});&lt;br /&gt;
var url = URL.createObjectURL(blob);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;pom.href = url;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;pom.setAttribute(&#39;download&#39;, &#39;파일다운.csv&#39;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;pom.click();&lt;br /&gt;
&lt;br /&gt;
다운로드 받으려 하니 한글이 깨져 문제에 대해 여러 가지를 찾아보았으나 다 되지 않았다.&lt;br /&gt;
&lt;br /&gt;
모든 형태가 utf-8로 되있었는데 한글이 깨져서 나오는 상황이었고&lt;br /&gt;
해결 방법은&lt;br /&gt;
&lt;br /&gt;
var data = &quot;홍길동,1,2,3\r\n홍길동2,1,2,3&quot;&lt;br /&gt;
var pom = document.createElement(&#39;a&#39;);&lt;br /&gt;
var blob = new Blob([&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&quot;\ufeff&quot;&lt;/span&gt;&lt;/b&gt;+data+], {type: &#39;text/csv;charset=utf-8;&#39;});&lt;br /&gt;
var url = URL.createObjectURL(blob);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;pom.href = url;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;pom.setAttribute(&#39;download&#39;, &#39;파일다운.csv&#39;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;pom.click();&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;\ufeff&amp;nbsp;&lt;/span&gt;(utf-8&amp;nbsp;bom 문자열 추가) 하니 깨지지 않음을 확인 할 수 있었습니다.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
참고는&amp;nbsp;&lt;a href=&quot;https://stackoverflow.com/questions/31959487/utf-8-encoidng-issue-when-exporting-csv-file-javascript&quot;&gt;https://stackoverflow.com/questions/31959487/utf-8-encoidng-issue-when-exporting-csv-file-javascript&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/8253190400308853273/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2017/08/csv.html#comment-form' title='2개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/8253190400308853273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/8253190400308853273'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2017/08/csv.html' title='자바스크립트에서 csv 파일 생성시 한글 깨짐 문제 해결'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-3873820664019711401</id><published>2017-08-01T16:52:00.001+09:00</published><updated>2017-08-01T16:53:56.001+09:00</updated><title type='text'>자바스크립트에서의 글자수 체크</title><content type='html'>javascript 에서 textarea에서 엔터값을 넣었을때&lt;br /&gt;
\n(Line Feed) 값으로 표시된다&lt;br /&gt;
&lt;br /&gt;
asp, mysql 에서는 chr(13)&amp;amp;chr(10) 즉 \r\n으로 개행문자가 표현되므로 이 것을 글자수로 체크하면 2자로 표현이 됨&lt;br /&gt;
&lt;br /&gt;
* \r\n은 도스(윈도우즈)/ \n은 유닉스, \r(Carriage Return)은 Mac에서 CR+LF 구실을 합니다.&lt;br /&gt;
&lt;br /&gt;
asp에서&lt;br /&gt;
Carriage Return 은 chr(13)&lt;br /&gt;
Line Feed 는 chr(10)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/3873820664019711401/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2017/08/blog-post.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/3873820664019711401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/3873820664019711401'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2017/08/blog-post.html' title='자바스크립트에서의 글자수 체크'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-1149285242165688085</id><published>2017-04-19T17:00:00.003+09:00</published><updated>2017-04-19T17:00:41.656+09:00</updated><title type='text'>04-19</title><content type='html'>utf-8 ? utf-8 bom? 무슨차이? 왜 오류?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
현상 : 가끔씩 페이지 맨 위에 빈 공백이 생김, 찾아보면 빈 공백만 있음, 크롬으로 찾아보면 &amp;amp;#65279; 문자열이 표시되있음&lt;br /&gt;
&lt;br /&gt;
The character in question &amp;amp;#65279 is the Unicode Character &#39;ZERO WIDTH NO-BREAK SPACE&#39; (U+FEFF) attached to your code on a copy/paste or during a faulty Save its so simple to fix that, just open that file by notepad++ and step follow --&amp;gt; &amp;nbsp;Encoding-&amp;gt;Encode in UTF-8 without BOM. then save that. It work for me as well!&lt;br /&gt;
&lt;br /&gt;
http://stackoverflow.com/questions/15801043/php-include-creates-unwanted-gaps-in-html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
해결책 : UTF-8 BOM으로 되있는 페이지를 UTF-8로 변경&lt;br /&gt;
&lt;br /&gt;
QA 1 : BOM(Byte Order Mark)이란?&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;유니코드가, little-endian 인지 big-endian 인지 아니면 UTF-8 인지 쉽게 알 수 있도록, 유니코드 파일이 시작되는 첫부분에 보이지 않게, 2~3바이트의 문자열을 추가 이것을 BOM이라고 함.&lt;br /&gt;
&lt;br /&gt;
QA 2 : little-endian 인지 big-endian은 무엇인지?&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;MS윈도에서 내부적으로 사용되는 유니코드(UTF-16LE)는 16비트 즉 2바이트로 하나의 글자를 표현합니다. 바이트가 2개니까 이 바이트에 순서가 정해져 있어야 합니다. big-endian 은 있는 순서 그대로 바이트를 자연스럽게 나열하는 것이고, little-endian 은 속도를 빠르게 하기 위해서 거꾸로 나열하는 것입니다.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;MS윈도의 유니코드는 리틀 엔디안 little-endian이 기본값입니다. 빅 엔디안 유니코드는, 울트라에디터 v11 등의 일부 프로그램에서 전혀 인식하지 못했습니다.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;반면 UTF-8 에는 리틀 엔디안이나 빅 엔디안의 구분이 없습니다.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
결론 : UTF-8 BOM으로 되있는 페이지를 UTF-8로 변경</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/1149285242165688085/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2017/04/04-19.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/1149285242165688085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/1149285242165688085'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2017/04/04-19.html' title='04-19'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-3767439509055960625</id><published>2017-04-04T09:18:00.002+09:00</published><updated>2017-04-04T09:19:34.005+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="char"/><category scheme="http://www.blogger.com/atom/ns#" term="varchar"/><category scheme="http://www.blogger.com/atom/ns#" term="varchar 차이"/><category scheme="http://www.blogger.com/atom/ns#" term="한글"/><title type='text'>2017-04-03</title><content type='html'>&lt;h2&gt;
char vs varchar 차이&lt;/h2&gt;
char는 고정길이 데이터&lt;br /&gt;
varchar는 가변길이(고정길이 포함)일 경우 사용&lt;br /&gt;
&lt;br /&gt;
varchar2 블럭분할 발생&lt;br /&gt;
char 데이터가 없어도 빈(null) 데이터를 저장시 미리 공간 할당 하기때문에&lt;br /&gt;
비어있는 데이터를 update 하더라도 미리 할당된 공간 내에서 저장&lt;br /&gt;
&lt;br /&gt;
2개의 블럭 I/O보다&lt;br /&gt;
1개의 블럭 I/O를 읽어오는것이 성능에 더 이득&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://okky.kr/article/217655&quot;&gt;https://okky.kr/article/217655&lt;/a&gt;&amp;nbsp;참고&lt;br /&gt;
&lt;br /&gt;
===================================&lt;br /&gt;
&lt;h2&gt;
varchar(10)이면 한글은 대체 몇자?&lt;/h2&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px;&quot;&gt;mysql , MariaDB&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;memoContent&quot; id=&quot;memoContentDiv72309622&quot; style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0.298039); -webkit-text-stroke-width: 0px; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; line-height: 1.5; margin: 0px; max-width: 100%; orphans: 2; padding: 0px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-size-adjust: none; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; word-wrap: break-word;&quot;&gt;
varchar(10) : 한글10자, 영문,숫자 10자&lt;br /&gt;
&lt;br style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0.298039); box-sizing: border-box;&quot; /&gt;
MS-SQL&lt;br /&gt;
varchar(10) : 한글 5자, 영문,숫자 10자&lt;br /&gt;
nvarchar(10) : 한글 10자, 영문, 숫자 10자&lt;br /&gt;
&lt;br style=&quot;-webkit-tap-highlight-color: rgba(0, 0, 0, 0.298039); box-sizing: border-box;&quot; /&gt;
Oracle&lt;br /&gt;
varchar2(10) : 한글 3자, 영문,숫자 10자&lt;br /&gt;
nvarchar2(10) : 한글 10자, 영문,숫자 10자&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/3767439509055960625/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2017/04/2017-04-03.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/3767439509055960625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/3767439509055960625'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2017/04/2017-04-03.html' title='2017-04-03'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-1548314930786200936</id><published>2017-03-22T17:26:00.003+09:00</published><updated>2017-03-22T17:26:54.187+09:00</updated><title type='text'>라라벨(laravel) 동작정리</title><content type='html'>1. 모든 시작점&lt;br /&gt;
public/index.php&lt;br /&gt;
&lt;br /&gt;
2. apache/nginx 요청&lt;br /&gt;
&lt;br /&gt;
3. include &amp;nbsp;bootstrap/app.php 실행(서비스 컨테이너 인스턴스를 생성);&lt;br /&gt;
&lt;br /&gt;
4. 서비스 컨테이너 인스턴스를 생성&lt;br /&gt;
&lt;br /&gt;
5. 각 요청에 따라 http커널 or console커널로 보냄&lt;br /&gt;
&lt;br /&gt;
5.1. HTTP 커널은 Illuminate\Foundation\Http\Kernel 클래스를 상속하고 있으며, 요청을 실행하기 전에 처리되는 bootstrappers (시작 코드)의 배열을 정의하고 있습니다. 이 시작 코드들은 에러 처리, 로그 설정, 어플리케이션 동작 환경의 감지 등 실제로 요청이 처리되기 전에 수행해야 되는 작업들을 의미합니다.&lt;br /&gt;
&lt;br /&gt;
5.1.1 커널 부팅(부트스트래핑) 과정의 가장 중요한 것 중의 하나는 어플리케이션의 서비스 프로바이더를 로딩하는 것입니다. 어플리케이션의 모든 서비스 프로바이더는 config/app.php 파일의 providers 배열에 설정되어 있습니다. 먼저, 모든 서비스 프로바이더의 register 메소드가 호출되고, 이후에 등록 된 모든 서비스 프로바이더의 boot 메소드가 호출되어 집니다.&lt;br /&gt;
&lt;br /&gt;
서비스 프로바이더는 프레임워크의 데이터베이스, 큐, validation, 라우팅 컴포넌트와 같은 다양한 컴포넌트의 부트스트래핑(부팅과 같은 기초 작업들)의 처리를 책임집니다. 프레임워크가 제공하는 모든 기능을 초기화 하고 설정하는 것으로, 서비스 프로바이더는 라라벨의 부팅(부트스트래핑) 과정에서 가장 중요한 기능이라고 할 수 있습니다.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/1548314930786200936/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2017/03/laravel.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/1548314930786200936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/1548314930786200936'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2017/03/laravel.html' title='라라벨(laravel) 동작정리'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-5167486240657625169</id><published>2017-02-09T10:17:00.003+09:00</published><updated>2017-02-09T10:17:55.706+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="php 메일"/><category scheme="http://www.blogger.com/atom/ns#" term="php 한글 인코딩"/><category scheme="http://www.blogger.com/atom/ns#" term="php한글깨짐"/><category scheme="http://www.blogger.com/atom/ns#" term="메일"/><category scheme="http://www.blogger.com/atom/ns#" term="한글 깨짐"/><category scheme="http://www.blogger.com/atom/ns#" term="한글 인코딩"/><category scheme="http://www.blogger.com/atom/ns#" term="한글깨짐"/><title type='text'>php에서 메일제목 한글이 깨질때 </title><content type='html'>&lt;br /&gt;
&lt;h2&gt;
php에서 한글인코딩을 보낼 경우 한글이깨지는 경우가 발생한다.&lt;/h2&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
상황&lt;/h4&gt;
&lt;div&gt;
- 홈페이지(php, linux, mysql)에서 메일(linux)을 보내는데 한글이 깨짐&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h4&gt;
현상확인&lt;/h4&gt;
&lt;br /&gt;
#그림1&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrXbUTGUSvhQIldrD6gFVjfjaWBQZloNv5ZaORi6JGWYgLf4cVfgnGrxHDj3uydxGDrUr-jrfl0RtqOfWvDvn9mxj0_vr10wyrG0aPyLnirGXH6G1LmLkRFVQRRx84OmBJYsJ5w87B_5vJ/s1600/%25EC%25BA%25A1%25EC%25B2%2598.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;27&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrXbUTGUSvhQIldrD6gFVjfjaWBQZloNv5ZaORi6JGWYgLf4cVfgnGrxHDj3uydxGDrUr-jrfl0RtqOfWvDvn9mxj0_vr10wyrG0aPyLnirGXH6G1LmLkRFVQRRx84OmBJYsJ5w87B_5vJ/s640/%25EC%25BA%25A1%25EC%25B2%2598.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp; (그림1 다음메일)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
그렇다고 모두 그런것은 아니다.&lt;br /&gt;
&lt;br /&gt;
#그림2&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7F7VevArzacl4OF9JRHGn-YzfL0bLEn9iZVCXhVD8dqshCaThuSydFc3AUjRDi_IN9d8eNwlD3slO0XMfKDcN9USEAAk6h51NYMcvGWFzy74W0puf7CpPSZzuWVY20YQDPv4U0RVHFLJw/s1600/%25EC%25BA%25A1%25EC%25B2%25981.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;25&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7F7VevArzacl4OF9JRHGn-YzfL0bLEn9iZVCXhVD8dqshCaThuSydFc3AUjRDi_IN9d8eNwlD3slO0XMfKDcN9USEAAk6h51NYMcvGWFzy74W0puf7CpPSZzuWVY20YQDPv4U0RVHFLJw/s640/%25EC%25BA%25A1%25EC%25B2%25981.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
(그림2.&amp;nbsp;네이버 메일)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
많이 쓰는 메일들에 대해서 테스트 해보았는데&lt;br /&gt;
(gmail, naver, daum or hanmail, nate 그리고 회사메일)&lt;br /&gt;
daum과 회사메일이 그림1과 같은 현상이 발생되었다.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
그럼 원인에 대해서 생각해보자&lt;/h4&gt;
1. 메일서버&lt;br /&gt;
2. 웹서버&lt;br /&gt;
3. DB&lt;br /&gt;
4. backend 언어&lt;br /&gt;
5. etc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
그럼 하나씩 짚고 넘어가보자&lt;br /&gt;
&lt;br /&gt;
1. 메일서버 (x)&lt;br /&gt;
3. DB (x)&lt;br /&gt;
&amp;nbsp; - 기존 언어(asp, mysql) 홈페이지에서 메일(linux)을 보냈을때 정상적으로 발송됨&lt;br /&gt;
&lt;br /&gt;
2. 웹서버의 문제&lt;br /&gt;
&amp;nbsp; - 리눅스서버 설정은 확인하고 조작해보기 힘드므로 마지막순위로 밀겠다&lt;br /&gt;
&lt;br /&gt;
4. backend 언어(php)&lt;br /&gt;
- 남은건 이거 하나&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
해결&lt;/h3&gt;
&lt;div&gt;
1. php한글깨짐을 검색해보면 관련 블로그가 많다&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNskSckc5VZRQhLcX5XkqgwPLvcUyenagB-vkXdXXTfOFzlCRPISVuX7MlnX9h4leoxOs2YBuPT8GtYK7jnqZhQbOOyaO33_XGZPEveipcoe4dRT5kWnE13pkr5HjGKi2nTMHOieThwT1j/s1600/%25EC%25BA%25A1%25EC%25B2%25982.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;506&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNskSckc5VZRQhLcX5XkqgwPLvcUyenagB-vkXdXXTfOFzlCRPISVuX7MlnX9h4leoxOs2YBuPT8GtYK7jnqZhQbOOyaO33_XGZPEveipcoe4dRT5kWnE13pkr5HjGKi2nTMHOieThwT1j/s640/%25EC%25BA%25A1%25EC%25B2%25982.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
내용을 살펴보면 메일을 보낼때 헤더값으로 관련 정보를 넘겨준다.&lt;br /&gt;
넘겨줄때&lt;br /&gt;
&lt;br /&gt;
$subject = &quot;메일제목&quot;;&lt;br /&gt;
&lt;br /&gt;
이럴경우&lt;br /&gt;
&lt;br /&gt;
$subject =&amp;nbsp;&#39;=?UTF-8?B?&#39;.base64_encode( &quot;메일제목&quot; ).&#39;?=&#39;;&lt;br /&gt;
&lt;br /&gt;
으로 utf-8로 메일을 보낸다는것을 명시해주면 된다.&lt;br /&gt;
&lt;br /&gt;
기본적으로 메일을 보낼때 ASCII 문자열로 넘어가기때문에 인코딩에 대한 명시를 해줘야된다 한다.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;이러한 형태로 인코딩을 적용되어 될 부분은 한글이 들어가야되는 부분(보내는이 이름, 받는이 이름) 들도 포함이다.&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
그리고 &lt;b&gt;내용은 하지말아야 한다&lt;/b&gt;.(해보니까 더 깨진다.. 그냥 보내야 정상임)&lt;br /&gt;
이부분에 대해선 더 확인해봐야될듯 하다.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/5167486240657625169/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2017/02/php.html#comment-form' title='1개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/5167486240657625169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/5167486240657625169'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2017/02/php.html' title='php에서 메일제목 한글이 깨질때 '/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrXbUTGUSvhQIldrD6gFVjfjaWBQZloNv5ZaORi6JGWYgLf4cVfgnGrxHDj3uydxGDrUr-jrfl0RtqOfWvDvn9mxj0_vr10wyrG0aPyLnirGXH6G1LmLkRFVQRRx84OmBJYsJ5w87B_5vJ/s72-c/%25EC%25BA%25A1%25EC%25B2%2598.JPG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-8149184490889938004</id><published>2016-12-28T09:49:00.003+09:00</published><updated>2016-12-28T09:49:51.923+09:00</updated><title type='text'>HTTP Referer ?? HTTP Referrer ?? </title><content type='html'>원래 Referrer 라고 써야하지만, 필립 할람-베이커Phillip Hallam-Baker가 HTTP스펙에 필드를 추가로 제안할때 오타로 Referer로 기재함.&lt;br /&gt;
오타가 그대로 표준에 반영되어 RFC-1945 문서에 포함됐고, 현재까지 Referer로 사용하고 있다.</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/8149184490889938004/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2016/12/referer-referrer.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/8149184490889938004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/8149184490889938004'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2016/12/referer-referrer.html' title='HTTP Referer ?? HTTP Referrer ?? '/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-2727508498565383216</id><published>2016-12-27T14:30:00.001+09:00</published><updated>2016-12-27T14:30:02.354+09:00</updated><title type='text'>제로데이 공격(Zero-Day Attack)</title><content type='html'>&lt;b style=&quot;background-color: white; color: #252525; font-family: sans-serif; font-size: 14px;&quot;&gt;제로 데이 공격&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #252525; font-family: sans-serif; font-size: 14px;&quot;&gt;(또는&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: white; color: #252525; font-family: sans-serif; font-size: 14px;&quot;&gt;제로 데이 위협&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #252525; font-family: sans-serif; font-size: 14px;&quot;&gt;, Zero-Day Attack)은&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://ko.wikipedia.org/wiki/%EC%BB%B4%ED%93%A8%ED%84%B0&quot; style=&quot;background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; text-decoration: none;&quot; title=&quot;컴퓨터&quot;&gt;컴퓨터&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #252525; font-family: sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://ko.wikipedia.org/wiki/%EC%86%8C%ED%94%84%ED%8A%B8%EC%9B%A8%EC%96%B4&quot; style=&quot;background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; text-decoration: none;&quot; title=&quot;소프트웨어&quot;&gt;소프트웨어&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #252525; font-family: sans-serif; font-size: 14px;&quot;&gt;의&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;mw-redirect&quot; href=&quot;https://ko.wikipedia.org/wiki/%EC%B7%A8%EC%95%BD%EC%A0%90&quot; style=&quot;background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; text-decoration: none;&quot; title=&quot;취약점&quot;&gt;취약점&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #252525; font-family: sans-serif; font-size: 14px;&quot;&gt;을 공격하는 기술적 위협으로, 해당 취약점에 대한&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;mw-disambig&quot; href=&quot;https://ko.wikipedia.org/wiki/%ED%8C%A8%EC%B9%98&quot; style=&quot;background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; text-decoration: none;&quot; title=&quot;패치&quot;&gt;패치&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #252525; font-family: sans-serif; font-size: 14px;&quot;&gt;가 나오지 않은 시점에서 이루어지는 공격을 말한다. 이러한 시점에서 만들어진&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://ko.wikipedia.org/wiki/%EC%B7%A8%EC%95%BD%EC%A0%90_%EA%B3%B5%EA%B2%A9&quot; style=&quot;background: none rgb(255, 255, 255); color: #0b0080; font-family: sans-serif; font-size: 14px; text-decoration: none;&quot; title=&quot;취약점 공격&quot;&gt;취약점 공격&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #252525; font-family: sans-serif; font-size: 14px;&quot;&gt;(익스플로잇)을&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: white; color: #252525; font-family: sans-serif; font-size: 14px;&quot;&gt;제로 데이 취약점 공격&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #252525; font-family: sans-serif; font-size: 14px;&quot;&gt;이라고도 한다.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/2727508498565383216/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2016/12/zero-day-attack.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/2727508498565383216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/2727508498565383216'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2016/12/zero-day-attack.html' title='제로데이 공격(Zero-Day Attack)'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-8399556777540557052</id><published>2016-12-21T14:38:00.003+09:00</published><updated>2016-12-21T14:38:47.466+09:00</updated><title type='text'>드라이브 바이(drive by), 파밍(pharming) 공격</title><content type='html'>드라이브 바이(drive by)&lt;br /&gt;
~쪽으로 자동차를 운전하다 라는 의미&lt;br /&gt;
온라인 광고업체에서 사용자가 아무런 의심없이 동의버튼을 누르는 버릇을 악용해 광고 콘텐츠 설치 유도(드라이브 바이 인스톨 - drive by install) 또는 한번 클릭하는 선택적 설치(one click opt install)&lt;br /&gt;
사용자의 동의 없이 자동으로 악성코드 다운로드 및 실행하는 현상&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
파밍(pharming)&lt;br /&gt;
악성코드 또는 다른 공격으로 인해 DNS가 변경되어 피싱사이트로 유도하는 공격&lt;br /&gt;
c:\window\system\drivers\etc 에 존재하는 host 파일 조작 혹은 레지스트리를 변조시켜 로컬프락시 설정, 악성코드 자체가 로컬 DNS가 되는 방식도 있다.</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/8399556777540557052/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2016/12/drive-by-pharming.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/8399556777540557052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/8399556777540557052'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2016/12/drive-by-pharming.html' title='드라이브 바이(drive by), 파밍(pharming) 공격'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-5206045448378541027</id><published>2016-11-30T09:46:00.002+09:00</published><updated>2016-11-30T09:46:46.146+09:00</updated><title type='text'>페인트공 알고리즘, 마세라티 문제, 야크 털 깎기</title><content type='html'>페인트공 알고리즘&lt;br /&gt;
&lt;br /&gt;
1. 페인트공이 첫날은 차선 페인트 작업을 300야드 칠함&lt;br /&gt;
2. 둘째날은 150야드 칠함&lt;br /&gt;
3. 셋째날은 30야드 칠함, 첫날은 어떻게 10배를 칠했는지 관리자가 묻자&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&quot;저도 어쩔 수 없었습니다. 매일 페인트 통에서 점점 멀어지니까요.&quot;&lt;br /&gt;
&lt;br /&gt;
- 조엘 스폴스키의 “조엘 온 소프트웨어” 중&lt;br /&gt;
&lt;br /&gt;
--&amp;gt; 일정 이상 규모가 되면 급격히 성능 저하되고 문제를 일으키는 코드&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
마세라티 문제&lt;br /&gt;
&lt;br /&gt;
1. 어떤 마세라티 모델과 색상을 구매할 지 고민하는 것.&lt;br /&gt;
2. 나중에 마세라티 살 능력이 됐을 때 할 고민을 미리 하는 것.&lt;br /&gt;
&lt;br /&gt;
* 돈 많은 금융과 증권계에서는 “boat naming” 이라고 함.&lt;br /&gt;
* 당장 필요하지 않은 기술을 담보되지 않은 미래의 큰 성공에 대비하여 준비하는 것&lt;br /&gt;
* 천만명을 처리할 서비스는 사용자가 10만은 됐을 때 고민&lt;br /&gt;
* 엔지니어만 있는 스타트업에서 자주 발생하는 현상&lt;br /&gt;
&lt;br /&gt;
야크 털깍기(Yak Shaving)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;어떤 목적을 달성하기 위해 전혀 상관없는 연속된 작업을 해야 하는 상황.&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;그중 마지막 작업이 야크 털깍기&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;봄이 와서 세차를 하려는데 호스가 터졌음&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;차로 홈 디포우에 가서 호스를 사려보니 다리를 지나야 하는데 통행 카드가 필요&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;통행카드가 없어서 옆집 Bob 한테 빌리려는데&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;아들이 캠핑가려고 Bob 한테 베개를 빌린 후에 안 갖다 줌&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;그런데 베개에 있는 야크털이 많이 빠져서 지금 베개를 갖다 줄 수 없음&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;그래서 세차를 하기 위해 동물원에 가서 야크 털을 깍는중&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - 세스 고딘의 “이제는 작은 것이 큰 것이다“ 중&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;* 야크 털깍기로 배우는 것도 많지만 문제는 일정&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;* 예정보다 많은 시간이 소요된다면 잠시 멈출 것&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;* 하려고 했던게 무엇인지 떠올려 보고 야크털깍기라 생각되면 했던 일을 과감히 중지</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/5206045448378541027/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2016/11/blog-post.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/5206045448378541027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/5206045448378541027'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2016/11/blog-post.html' title='페인트공 알고리즘, 마세라티 문제, 야크 털 깎기'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-1079816070169321626</id><published>2016-09-09T09:30:00.004+09:00</published><updated>2016-09-09T09:30:54.154+09:00</updated><title type='text'>datepicker 삭제 버튼(firefox 오류수정 버전)</title><content type='html'>jquery datepicker를 사용 할 경우 해당 input text를 삭제버튼으로 한번에 내용을 제거 하고 싶을때가 있다.&lt;br /&gt;
&lt;br /&gt;
1.&lt;br /&gt;
그래서 얼마전까지 사용했던 방법은 jquery 초기화 옵션중에&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: D2Coding;&quot;&gt;
            showButtonPanel: &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;, &lt;span style=&quot;color: green;&quot;&gt;// 캘린더 하단에 버튼 패널을 표시한다. &lt;/span&gt;
&lt;/span&gt;
&lt;/pre&gt;
showButtonPanel 옵션을 true로 주면&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjuph5ECe7OgtYMoFRKiM7_4P1DbO-yHulgcxqHCM7MJyQPgL9_hQYvpkmgXsPEC130zr9I9M8u_JAD24YyIz2F4yUa2v6QE-Yq2X_ZwTa6-CCch1TCefx8uCFRUgSn1DpEUaYx7_ywL_2/s1600/%25EB%258B%25AC%25EB%25A0%25A5%25EC%2599%2584%25EC%25A0%2584+%25EC%25B5%259C%25EC%25B4%2588.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjuph5ECe7OgtYMoFRKiM7_4P1DbO-yHulgcxqHCM7MJyQPgL9_hQYvpkmgXsPEC130zr9I9M8u_JAD24YyIz2F4yUa2v6QE-Yq2X_ZwTa6-CCch1TCefx8uCFRUgSn1DpEUaYx7_ywL_2/s1600/%25EB%258B%25AC%25EB%25A0%25A5%25EC%2599%2584%25EC%25A0%2584+%25EC%25B5%259C%25EC%25B4%2588.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
이렇게 [오늘날짜]와 [닫기] 버튼이 최초에 생긴다.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 이 닫기 버튼의 이름을 clear로 변경&lt;br /&gt;
3. 닫기 버튼을 눌렀을때 해당 input text를 clear해주는 이벤트를 bind 해준다.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: D2Coding;&quot;&gt;
 closeText: &lt;span style=&quot;color: magenta;&quot;&gt;&#39;clear&#39;&lt;/span&gt;
 ,onClose: &lt;span style=&quot;color: blue;&quot;&gt;function &lt;/span&gt;(dateText, inst) {
   &lt;span style=&quot;color: blue;&quot;&gt;if &lt;/span&gt;($(&lt;span style=&quot;color: red;&quot;&gt;window&lt;/span&gt;.event.srcElement).hasClass(&lt;span style=&quot;color: magenta;&quot;&gt;&#39;ui-datepicker-close&#39;&lt;/span&gt;))
   {
     &lt;span style=&quot;color: red;&quot;&gt;document&lt;/span&gt;.getElementById(&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.id).value = &lt;span style=&quot;color: magenta;&quot;&gt;&#39;&#39;&lt;/span&gt;;
   }
 }
&lt;/span&gt;
&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;Malgun Gothic&amp;quot;; white-space: normal;&quot;&gt;이렇게 하면 ~ie엣지, 크롬에선 정상적으로 동작한다.&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;문제는 firefox에서는&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvtNv7Doq0bXPJU24r1jS4KjsLqfbVPlel9VkqSI8fTXoUuE9ve55wNHQh9J0B4Uab88n61yxfACEu-owUCov38Y8N3XEa4AGPcfGktmKNjJp2fkyl1AfzbO1xcZTGEOqw-eCVW7hqAo2d/s1600/%25EB%258B%25AC%25EB%25A0%25A5+%25EC%2588%2598%25EC%25A0%2595%25EC%25A0%2584+%25EC%2597%2590%25EB%259F%25AC+.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;40&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvtNv7Doq0bXPJU24r1jS4KjsLqfbVPlel9VkqSI8fTXoUuE9ve55wNHQh9J0B4Uab88n61yxfACEu-owUCov38Y8N3XEa4AGPcfGktmKNjJp2fkyl1AfzbO1xcZTGEOqw-eCVW7hqAo2d/s640/%25EB%258B%25AC%25EB%25A0%25A5+%25EC%2588%2598%25EC%25A0%2595%25EC%25A0%2584+%25EC%2597%2590%25EB%259F%25AC+.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;라 에러가 생김&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;기존에 onClose 안에 준 이벤트 자체가 현재 이벤트가 일어나는 엘리먼트의 클래스를 여부를 판단하는것인다. window.event 자체가 firefox에서는 존재 하지 않아 해당라인에서 error발생&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;구글링 후 가장 깔끔하게 처리되는것은&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre&gt;&lt;pre&gt;&lt;span style=&quot;font-family: D2Coding;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;function &lt;/span&gt;cleanDatepicker(){

  &lt;span style=&quot;color: blue;&quot;&gt;var &lt;/span&gt;old_fn = $.datepicker._updateDatepicker;

  $.datepicker._updateDatepicker = &lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt;(inst) {
   old_fn.call(&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;, inst);

   &lt;span style=&quot;color: blue;&quot;&gt;var &lt;/span&gt;buttonPane = $(&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;).datepicker(&lt;span style=&quot;color: magenta;&quot;&gt;&quot;widget&quot;&lt;/span&gt;).find(&lt;span style=&quot;color: magenta;&quot;&gt;&quot;.ui-datepicker-buttonpane&quot;&lt;/span&gt;);

   $(&lt;span style=&quot;color: magenta;&quot;&gt;&quot;&amp;lt;button type=&#39;button&#39; class=&#39;ui-datepicker-clean ui-state-default ui-priority-primary ui-corner-all&#39;&amp;gt;clear&amp;lt;/button&amp;gt;&quot;&lt;/span&gt;).appendTo(buttonPane).click(&lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt;(ev) {
    $.datepicker._clearDate(inst.input);
   }) ;
  }
 }
&lt;/span&gt;
&lt;/pre&gt;
&lt;pre&gt;
&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;위 함수를 선언 후 datepicker init 하기전에 한번 실행해주는 것이 가장 브라우저도 안타고 잘 동작하게 해결하는 방법이었습니다.&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;4. 해당 함수를 실행하고&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;5. 기존에 clear버튼을 &quot;닫기&quot; 버튼으로 변경&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;6. onClose에 bind했던 함수는 제거하면&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp;아래와 같이 버튼 3개가 생기고 각 버튼들이 잘 동작 하는걸 확인 할 수 있다.&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;
&lt;/pre&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-787YodPXEYopBvsFDNfnSqO4RmdOutGjefmFHKpwVR9oHsu7fNLUNi2IiO4Q5rPwo5p6oN5JdF0GvkK9R2FfUAuTG35KRuSh0ZvAsdSRAvXQhM3Ds178IIqxhqZuCAR5t_0bYwKxTiEb/s1600/%25EB%258B%25AC%25EB%25A0%25A5%25EC%2588%2598%25EC%25A0%2595.JPG&quot; imageanchor=&quot;1&quot; style=&quot;font-family: &amp;quot;Malgun Gothic&amp;quot;; margin-left: 1em; margin-right: 1em; text-align: center; white-space: normal;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-787YodPXEYopBvsFDNfnSqO4RmdOutGjefmFHKpwVR9oHsu7fNLUNi2IiO4Q5rPwo5p6oN5JdF0GvkK9R2FfUAuTG35KRuSh0ZvAsdSRAvXQhM3Ds178IIqxhqZuCAR5t_0bYwKxTiEb/s1600/%25EB%258B%25AC%25EB%25A0%25A5%25EC%2588%2598%25EC%25A0%2595.JPG&quot; /&gt;&lt;/a&gt;&lt;/pre&gt;
&lt;pre&gt;
&lt;/pre&gt;
&lt;pre&gt;
&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Malgun Gothic;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/1079816070169321626/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2016/09/datepicker-firefox.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/1079816070169321626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/1079816070169321626'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2016/09/datepicker-firefox.html' title='datepicker 삭제 버튼(firefox 오류수정 버전)'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjuph5ECe7OgtYMoFRKiM7_4P1DbO-yHulgcxqHCM7MJyQPgL9_hQYvpkmgXsPEC130zr9I9M8u_JAD24YyIz2F4yUa2v6QE-Yq2X_ZwTa6-CCch1TCefx8uCFRUgSn1DpEUaYx7_ywL_2/s72-c/%25EB%258B%25AC%25EB%25A0%25A5%25EC%2599%2584%25EC%25A0%2584+%25EC%25B5%259C%25EC%25B4%2588.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-5331871427245072752</id><published>2016-08-10T11:23:00.002+09:00</published><updated>2016-08-10T11:29:27.410+09:00</updated><title type='text'>Laravel 5 optimization commands</title><content type='html'>Laravel 5 optimization commands&lt;br /&gt;
&lt;br /&gt;
============================&lt;br /&gt;
php artisan optimize&lt;br /&gt;
php artisan config:cache&lt;br /&gt;
php artisan route:cache&lt;br /&gt;
============================&lt;br /&gt;
&lt;br /&gt;
1. storage paths optimize&lt;br /&gt;
optimize 명령을 사용하면 &quot;bootstrap/cache/&quot; 폴더 안에 컴파일 된 파일 기록&lt;br /&gt;
&lt;br /&gt;
2. artisan optimize&lt;br /&gt;
php artisan optimize 명령어를 실행하면 &quot;bootstrap/cache/compiled.php&quot; 형태로 저장 하거나 덮어쓴다.&lt;br /&gt;
더 컴파일 하고 싶은 class가 있을경우 config/compile.php 에서 추가 할 수 있다.&lt;br /&gt;
--force 옵션을 사용하면 컴파일 되는 것을 피할 수 있다.&lt;br /&gt;
&lt;br /&gt;
service provider는 &amp;nbsp;&quot;bootstrap/cache/services.php&quot; 파일 생성(json) 경로를 등록해두고 최적화를 시도한다.&lt;br /&gt;
&lt;br /&gt;
php artisan clear-compiled 명령을 하면 compile된 파일 캐시를 지움&lt;br /&gt;
&lt;br /&gt;
artisan optimize는 &quot;config/app.php&quot;의 설정에 따라 달라질수 있다.&lt;br /&gt;
배포중에도 php artisan config:cache 명령으로 캐시 클리어 가능&lt;br /&gt;
&lt;br /&gt;
3. artisan config:cache&lt;br /&gt;
config 파일 들에 대한 캐싱을 진행&lt;br /&gt;
bootstrap/cache/config.php 라는 파일명으로 생성된다.&lt;br /&gt;
기존에 생성되 있을경우 덮어쓴다.&lt;br /&gt;
삭제 하는 방법은 php artisan config:clear&lt;br /&gt;
&lt;br /&gt;
4. artisan route:cache&lt;br /&gt;
route에 대한 정보도 cache로 등록.&lt;br /&gt;
bootstrap/cache/routes.php 라는 파일명으로 생성된다.&lt;br /&gt;
기존에 생성되 있을경우 덮어쓴다.&lt;br /&gt;
&lt;br /&gt;
삭제 하는 방법은 php artisan route:clear&lt;br /&gt;
&lt;br /&gt;
5. artisan view:clear&lt;br /&gt;
프레임워크를 통해 최초 렌더링 되는 파일을 해당 경로(storage/framework/views) 에 (MD5).php파일 형태로 컴파일 됨&lt;br /&gt;
캐시를 없애고 싶으면 artisan view:clear&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Laravel 5.0&lt;br /&gt;
&lt;br /&gt;
5.1 버전 이전에는 artisan 명령을 사용하면 vendor 폴더에 기록됨&lt;br /&gt;
경로를 storage/framework/ 바꾸고 싶을 경우 bootstrap/app.php안에 $app-&amp;gt;useStoragePathForOptimizations(true);&lt;br /&gt;
&lt;br /&gt;
출처 : http://sentinelstand.com/article/laravel-5-optimization-commands</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/5331871427245072752/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2016/08/laravel-5-optimization-commands.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/5331871427245072752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/5331871427245072752'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2016/08/laravel-5-optimization-commands.html' title='Laravel 5 optimization commands'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-5099896434471136526</id><published>2016-07-22T18:24:00.004+09:00</published><updated>2016-08-16T16:02:30.303+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="classic asp"/><category scheme="http://www.blogger.com/atom/ns#" term="kakao api"/><category scheme="http://www.blogger.com/atom/ns#" term="rest api"/><category scheme="http://www.blogger.com/atom/ns#" term="나에게 보내기"/><category scheme="http://www.blogger.com/atom/ns#" term="카카오api"/><title type='text'>카카오api 나에게 보내기 (REST API)  classic asp </title><content type='html'>카카오api 주소 (https://developers.kakao.com/)&lt;br /&gt;
&lt;br /&gt;
예제 소스는 classic asp로 구현했습니다.&lt;br /&gt;
&lt;br /&gt;
&lt;h4 id=&quot;나에게-보내기&quot; style=&quot;background-color: #fbfbfb; box-sizing: content-box; color: #222222; font-family: &amp;quot;Noto Sans Medium&amp;quot;, &amp;quot;Malgun gothic&amp;quot;, &amp;quot;맑은 고딕&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, sans-serif; font-size: 20px; font-weight: 500; letter-spacing: -2px; line-height: 1.1; margin: -86px 0px 20px; padding: 112px 0px 0px;&quot;&gt;
나에게 보내기&lt;a class=&quot;copy-url zeroclipboard-is-hover&quot; data-clipboard-text=&quot;https://developers.kakao.com/docs/restapi#카카오톡-나에게-보내기&quot; href=&quot;https://www.blogger.com/null&quot; style=&quot;background: url(&amp;quot;/assets/img/docs/icon_urlcopy.png&amp;quot;); box-sizing: border-box; color: transparent; display: inline-block; height: 19px; margin-left: 7px; vertical-align: middle; width: 51px;&quot;&gt;Copy URL&lt;/a&gt;&lt;/h4&gt;
&lt;div style=&quot;background-color: #fbfbfb; box-sizing: border-box; color: #4e5665; font-family: &amp;quot;Noto Sans Light&amp;quot;, &amp;quot;Malgun gothic&amp;quot;, &amp;quot;맑은 고딕&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, sans-serif; font-size: 14px; line-height: 20px; margin-top: 7px; padding: 0px;&quot;&gt;
카카오톡 나에게 보내기는 사용자 중에서 &lt;u&gt;&lt;b&gt;카카오계정에 연결한 카카오톡 사용자에 한해 카카오톡 나와의 챗팅방으로 메시지를 보낼 수 있는 기능입니다&lt;/b&gt;&lt;/u&gt;. 해당 기능을 사용하기 위해서는 성공적인 로그인 후에 얻을 수 있는 사용자 토큰이 필요합니다.&lt;/div&gt;
(https://developers.kakao.com/docs/restapi#카카오톡-나에게-보내기)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. 카카오 개발자 등록&lt;br /&gt;
https://accounts.kakao.com/login?continue=https://developers.kakao.com/login&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKWg4cjs5938cCKq248xaRyeU-ntkUdQlP4ZKo-J8PYGZA73xUqFomFJ6pGyf85zEpQH5LTR3c3NwOXzhocpvnH6LT7lSY9RyPxc5QR0882UVwzNXjbNGzltAp_X375ehRmZHaG7LVmtxb/s1600/1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;294&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKWg4cjs5938cCKq248xaRyeU-ntkUdQlP4ZKo-J8PYGZA73xUqFomFJ6pGyf85zEpQH5LTR3c3NwOXzhocpvnH6LT7lSY9RyPxc5QR0882UVwzNXjbNGzltAp_X375ehRmZHaG7LVmtxb/s640/1.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 내 애플리케이션 추가작업&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEdJpzI-BqsoBdZ9dBOZuO20cOyu4RyY3uIP4QytUzwkErjcD1YOIIBcIST9M_g2b6bRkUe5-3na39tnF5Rqi5tf7edGcK89z39TbS3IGUzXQOl_qrCPCzrocpJtTi29HERBYRrwEfyDtg/s1600/2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;314&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEdJpzI-BqsoBdZ9dBOZuO20cOyu4RyY3uIP4QytUzwkErjcD1YOIIBcIST9M_g2b6bRkUe5-3na39tnF5Rqi5tf7edGcK89z39TbS3IGUzXQOl_qrCPCzrocpJtTi29HERBYRrwEfyDtg/s640/2.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
3. 사용자관리 설정&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt_VuPUKjBE4Dch3lBNJLNZDJjmM-BrB4K16JifSSOOHiJ8R-bP7fZiGIQIYlXK4q5VFmEfD0xYT2CdCnud6NVgTTjTesUP9RkdzVJY9fDmfEyHhKe-OIISnXH1e0e70h3KfhepD_AsMv8/s1600/3.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt_VuPUKjBE4Dch3lBNJLNZDJjmM-BrB4K16JifSSOOHiJ8R-bP7fZiGIQIYlXK4q5VFmEfD0xYT2CdCnud6NVgTTjTesUP9RkdzVJY9fDmfEyHhKe-OIISnXH1e0e70h3KfhepD_AsMv8/s640/3.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr_C63vvorlFXhxEwYacsCwd8RoFbfoOnmH-YwsS-l9jiwe4O1GAx46hojgCbrLbEvNbbLZrxMg6i7wyn7qfctTdk-y4xUZx1JQ0un1sP4-vyQPBAGLWg39x_-C-p1yy0qQe8bwec6m6Dg/s1600/10.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;408&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr_C63vvorlFXhxEwYacsCwd8RoFbfoOnmH-YwsS-l9jiwe4O1GAx46hojgCbrLbEvNbbLZrxMg6i7wyn7qfctTdk-y4xUZx1JQ0un1sP4-vyQPBAGLWg39x_-C-p1yy0qQe8bwec6m6Dg/s640/10.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
일반을 클릭하면 rest api 키를 얻을수 있습니다. 밑에 소스에서 client_id 변수에 이 값을 넣어주셔야됩니다.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 템플릿 추가&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM_KgEYNZr8OToT0PtZ8_AloZr-slHbYUckjZ7HPVy-8T6m_RZprblaY633Vhk_R94VPkN2p-3zej_fmWz-8wr9bD39G8Pt347csA4mWctoo1ZeTKS1N_ql8qMRVfTWalbXsnxqg4wDWAY/s1600/4.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;270&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM_KgEYNZr8OToT0PtZ8_AloZr-slHbYUckjZ7HPVy-8T6m_RZprblaY633Vhk_R94VPkN2p-3zej_fmWz-8wr9bD39G8Pt347csA4mWctoo1ZeTKS1N_ql8qMRVfTWalbXsnxqg4wDWAY/s640/4.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
5. restapi key 확인 및 도메인 등록&lt;br /&gt;
내어플리케이션 &amp;gt; &amp;nbsp;설정 &amp;gt; 일반 &amp;gt; REST API 키 확인, 사이트 도메인 등록, path 등록&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiVPonKKtvPEgbVYJnoI4HhKwozEGqNfridrJGanz1sCgO26Mi7S4_bNyLoL0RvTeGlIv6JK5iQmf7vab3oattLRJGkcj3NePBRhxh_lkR7-t0tvnTaigdV8S9ZyhzLvCNSOzmNBiVjKXb/s1600/5.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;344&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiVPonKKtvPEgbVYJnoI4HhKwozEGqNfridrJGanz1sCgO26Mi7S4_bNyLoL0RvTeGlIv6JK5iQmf7vab3oattLRJGkcj3NePBRhxh_lkR7-t0tvnTaigdV8S9ZyhzLvCNSOzmNBiVjKXb/s640/5.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 로그인 처리&lt;br /&gt;
&lt;a href=&quot;https://developers.kakao.com/docs/restapi#사용자-관리-로그인&quot;&gt;https://developers.kakao.com/docs/restapi#사용자-관리-로그인&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
ex&amp;gt;&lt;br /&gt;
https://kauth.kakao.com/oauth/authorize?client_id={client_id}&amp;amp;redirect_uri={등록한 path}&amp;amp;response_type=code&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. 토큰받기 처리 및 나에게 메시지 전송&lt;br /&gt;
등록한 path 페이지에서 code라는 request 값을 받는다.&lt;br /&gt;
받은 code값을 이용하여 token 값을 요청&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;

&lt;/span&gt;
&lt;/pre&gt;
&lt;br /&gt;
[aaa.asp 페이지]&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;
&lt;span style=&quot;color: green;&quot;&gt;&#39;async 함수&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Function &lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;postFormData(url, headerArr, data)&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;Dim &lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;xhr, i &lt;/span&gt;
 &lt;span style=&quot;color: blue;&quot;&gt;Set &lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;xhr = Server.CreateObject(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;MSXML2.ServerXMLHTTP.3.0&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;)&lt;/span&gt;
  &lt;span style=&quot;color: maroon;&quot;&gt;xhr.open &lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;POST&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;, url, &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;

 &lt;span style=&quot;color: blue;&quot;&gt;for &lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;i = &lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;0 &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;to &lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ubound(headerArr)&lt;/span&gt;
     &lt;span style=&quot;color: maroon;&quot;&gt;xhr.setRequestHeader headerArr(i)(&lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;), headerArr(i)(&lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;)&lt;/span&gt;
 &lt;span style=&quot;color: blue;&quot;&gt;next&lt;/span&gt;
  &lt;span style=&quot;color: maroon;&quot;&gt;xhr.send data&lt;/span&gt;

    &lt;span style=&quot;color: blue;&quot;&gt;If &lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;(xhr.Status = &lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;200&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;then&lt;/span&gt;
       &lt;span style=&quot;color: maroon;&quot;&gt;postFormData = xhr.ResponseText&lt;/span&gt;
    &lt;span style=&quot;color: red;&quot;&gt;response&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;.write postFormData&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;Else&lt;/span&gt;
 &lt;span style=&quot;color: red;&quot;&gt;Err&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;.Raise &lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;1001&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;postFormData&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;Post to &quot; &lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&amp;amp; url &amp;amp; &lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot; failed with &quot; &lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&amp;amp; xhr.Status&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot; message &quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&amp;amp;xhr.responseText&lt;/span&gt;
    &lt;span style=&quot;color: blue;&quot;&gt;End If&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;End Function&lt;/span&gt;
&lt;/span&gt;
&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;

 &lt;span style=&quot;color: maroon;&quot;&gt;client_id = &lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;38c9*********************8&quot; &lt;/span&gt;
 &lt;span style=&quot;color: maroon;&quot;&gt;url = &lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;https://주소.co.kr/index22.asp&quot;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;        &lt;span style=&quot;color: maroon;&quot;&gt;code = request(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;code&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;
  &lt;span style=&quot;color: green;&quot;&gt;&#39;토큰 요청 값 받기 &lt;/span&gt;
  &lt;span style=&quot;color: green;&quot;&gt;&#39;최초 요청을 보냈을시 access_token, refresh_token&lt;/span&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;set &lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;tokenObj = JSON.parse(&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;                  postFormData(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;https://kauth.kakao.com/oauth/token&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;                  array(array(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;application/x-www-form-urlencoded&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;)),&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;&lt;span style=&quot;color: magenta;&quot;&gt;                  &quot;grant_type=authorization_code&amp;amp;client_id=&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&amp;amp;client_id&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;&amp;amp;redirect_uri=&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&amp;amp;url&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;&amp;amp;code=&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&amp;amp;code))&lt;/span&gt;
  
  &lt;span style=&quot;color: maroon;&quot;&gt;access_token = tokenObj.access_token  &lt;/span&gt;
  &lt;span style=&quot;color: maroon;&quot;&gt;refresh_token = tokenObj.refresh_token&lt;/span&gt;

  &lt;span style=&quot;color: green;&quot;&gt;&#39;refresh token 요청 값 받기  &lt;/span&gt;
  &lt;span style=&quot;color: green;&quot;&gt;&#39;refresh_token은 기본 12시간~24시간이 아닌 더 긴 시간을 유지할수 있는 token임 &lt;/span&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;set &lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;refreshTokenObj = JSON.parse(&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;                        postFormData(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;https://kauth.kakao.com/oauth/token&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;                        array(array(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;application/x-www-form-urlencoded&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;)),&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;&lt;span style=&quot;color: magenta;&quot;&gt;                        &quot;grant_type=refresh_token&amp;amp;client_id=&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&amp;amp;client_id&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;&amp;amp;redirect_uri=&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&amp;amp;url&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;&amp;amp;refresh_token=&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&amp;amp;refresh_token))&lt;/span&gt;

  &lt;span style=&quot;color: green;&quot;&gt;&#39;refresh token 요청시 access_token만 넘어옴 &lt;/span&gt;
  &lt;span style=&quot;color: maroon;&quot;&gt;access_token = refreshTokenObj.access_token&lt;/span&gt;

  &lt;span style=&quot;color: green;&quot;&gt;&#39;access_token 값을 이용하여 message 보내기&lt;/span&gt;
  &lt;span style=&quot;color: red;&quot;&gt;response&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;.write postFormData(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;https://kapi.kakao.com/v1/api/talk/memo/send?template_id=828&amp;amp;args=&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;                 Server.URLEncode(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;{&quot;&quot;${message}&quot;&quot;:&quot;&quot;테스트적용완료&quot;&quot;,&quot;&quot;${subject}&quot;&quot;:&quot;&quot;적용완료&quot;&quot;}&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;),&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;d2coding&amp;quot;;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;                 array(array(&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;Authorization&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;Bearer &quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&amp;amp; access_token)),&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;)&lt;/span&gt;
&lt;/span&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFfRlXzyGTraJwR181EuioYzOqqtWYo9-P7nQtAXUZe-xmJ2BX0Sd5QLKwexdWE-KZkArfPatPBxShnfdcqJZoDmEN2H9s_Ba7NS6Aw6tCXYx8iLYsQShSkVmVG0Dgc8-BcrLfsqoTzX3z/s1600/6.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFfRlXzyGTraJwR181EuioYzOqqtWYo9-P7nQtAXUZe-xmJ2BX0Sd5QLKwexdWE-KZkArfPatPBxShnfdcqJZoDmEN2H9s_Ba7NS6Aw6tCXYx8iLYsQShSkVmVG0Dgc8-BcrLfsqoTzX3z/s1600/6.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBqM-VV01Gevr_yErcrBb5dtP4ere_mIJIpxeylEOIxXuM-OQYyBaqHgobfxqBWRyaEm0oUv1TDWDH8_gLVlH4LyyNZaCm-6KJyiLYGW4_IVI7ufC364sj6RTxEF8MVJc6vuUWt_oYC-6A/s1600/7.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBqM-VV01Gevr_yErcrBb5dtP4ere_mIJIpxeylEOIxXuM-OQYyBaqHgobfxqBWRyaEm0oUv1TDWDH8_gLVlH4LyyNZaCm-6KJyiLYGW4_IVI7ufC364sj6RTxEF8MVJc6vuUWt_oYC-6A/s1600/7.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
위와 같이 나에게 메시지가 옴&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
- 나에게 보낸다는 서비스이기때문에 광범위하게 사용하기에 제약사항이 좀 있습니다.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
구현하시서 생각해보시길..&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/5099896434471136526/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2016/07/api-rest-api.html#comment-form' title='6개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/5099896434471136526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/5099896434471136526'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2016/07/api-rest-api.html' title='카카오api 나에게 보내기 (REST API)  classic asp '/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKWg4cjs5938cCKq248xaRyeU-ntkUdQlP4ZKo-J8PYGZA73xUqFomFJ6pGyf85zEpQH5LTR3c3NwOXzhocpvnH6LT7lSY9RyPxc5QR0882UVwzNXjbNGzltAp_X375ehRmZHaG7LVmtxb/s72-c/1.JPG" height="72" width="72"/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-11977931586798359</id><published>2016-06-20T16:35:00.003+09:00</published><updated>2016-08-05T11:29:52.344+09:00</updated><title type='text'> flyweight 패턴 </title><content type='html'>■ 정의&lt;br /&gt;
&lt;br /&gt;
[GOF]&lt;br /&gt;
&amp;nbsp;- 공유를 통한 많은 수의 소립 객체들을 효과적으로 지원&lt;br /&gt;
&lt;br /&gt;
[ 실용주의 디자인패턴 ]&lt;br /&gt;
- 메모리 사용량을 줄이기 위해 외부 상태(상태정보 저장, 계산)를 사용하거나&lt;br /&gt;
&amp;nbsp; 공유(객체의 복사본 대신 단일 객체에 대한 다중 참조를 이용)한다.&lt;br /&gt;
- 무엇을 하느냐에 의해 정의, 즉 메소드에 의해 정의됨&lt;br /&gt;
&lt;br /&gt;
▶ 즉 공유하는 객체를 이용하되 상태 정보를 외부 객체가 따로 관리&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
■&amp;nbsp;사용 예&lt;br /&gt;
- game of life를 단순하게 구현할때 &#39;셀&#39;이 살아있는가?는 주변 상태를 참조를 지니고 있어야된다. 1024*1024를 표현하려해도 40mb가 필요함&lt;br /&gt;
flywieght를 사용하면 동일한 상태를 지닌 객체가 단 하나의 객체를 통해 표현&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
■ 장/단점&lt;br /&gt;
- 장점 : flyweight를 사용하지 않으면 객체지향적으로 구현하기가 힘듬&lt;br /&gt;
- 장점 : flyweight 풀을 이용하면 자바의 == 연산자로 객체의동일성 여부를 결정 할 수 있다.&lt;br /&gt;
&lt;br /&gt;
- 단점 : 외부상태가 계산되는 값이라면(매번 데이터베이스에 접근) 하면 접근이 느릴 수 있다.&lt;br /&gt;
- 단점 : 코드가 복잡해짐, 유지보수를 어렵게하고 코드가 커질 수 있음&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
■ 코드 예제&lt;br /&gt;
쉬운 예&amp;gt;&lt;br /&gt;
ElementStyle e = new ElementStyle;&lt;br /&gt;
e.setMargin(ElementStyleFactory.createMargin(10,10,20,10));&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;-&amp;gt; 객체는 공유하되 외부 객체가 따로 관리 되도록&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
게임프로그래밍 패턴예제(js로 구현)&amp;gt;&lt;/div&gt;
[origin]&lt;br /&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;html &lt;/span&gt;lang=&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;en&quot;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;head&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;meta &lt;/span&gt;charset=&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;title&lt;/span&gt;&amp;gt;flyweight origin&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;title&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;head&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;body&lt;/span&gt;&amp;gt;
경량패턴??&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;br&lt;/span&gt;&amp;gt;
어떤 객체의 수가 너무 많아 좀 가볍게 만들고 싶을때 사용&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;br&lt;/span&gt;&amp;gt;
고유상태와 외부상태로 나눔&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;br&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;br&lt;/span&gt;&amp;gt;
예제 : 지형 만들기&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;br&lt;/span&gt;&amp;gt;
타일(고유상태)과 각 타일들이 갖고 있는 정보(외부상태)&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;br&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;script&lt;/span&gt;&amp;gt;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Terrain&lt;/span&gt;(kind){
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;{
            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;TERRAIN_CLASS&quot; &lt;/span&gt;: &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;TERRAIN_CLASS&quot;&lt;/span&gt;,
            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;TERRAIN_HILL&quot; &lt;/span&gt;: &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;TERRAIN_HILL&quot;&lt;/span&gt;,
            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;TERRAIN_RIVER&quot; &lt;/span&gt;: &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;TERRAIN_RIVER&quot;&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;        &lt;/span&gt;}[kind];
    }

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;World&lt;/span&gt;(){
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles &lt;/span&gt;= {};
    }
    &lt;span style=&quot;font-style: italic;&quot;&gt;World&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;prototype&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;getMovementCost &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(x,y){
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;{
            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;TERRAIN_CLASS&quot; &lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;,
            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;TERRAIN_HILL&quot; &lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;2&lt;/span&gt;,
            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;TERRAIN_RIVER&quot; &lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;        &lt;/span&gt;}[&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles&lt;/span&gt;[x][y]];
    };

    &lt;span style=&quot;font-style: italic;&quot;&gt;World&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;prototype&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;getIsWater &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(x,y){
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;{
            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;TERRAIN_CLASS&quot; &lt;/span&gt;: &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;false&lt;/span&gt;,
            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;TERRAIN_HILL&quot; &lt;/span&gt;: &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;false&lt;/span&gt;,
            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;TERRAIN_RIVER&quot; &lt;/span&gt;: &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;        &lt;/span&gt;}[&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles&lt;/span&gt;[x][y]];
    };

    &lt;span style=&quot;font-style: italic;&quot;&gt;World&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;prototype&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;setTile &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(x,y, value){
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles&lt;/span&gt;||{};

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles&lt;/span&gt;[x] = &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles&lt;/span&gt;[x]||{};
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles&lt;/span&gt;[x][y] = &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles&lt;/span&gt;[x][y]||&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;&quot;&lt;/span&gt;;
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles&lt;/span&gt;[x][y] = value;

    };


    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Main&lt;/span&gt;(){
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;world &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;World&lt;/span&gt;;
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;terrain_class &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;Terrain&lt;/span&gt;(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;TERRAIN_CLASS&quot;&lt;/span&gt;);
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;terrain_hill &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;Terrain&lt;/span&gt;(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;TERRAIN_HILL&quot;&lt;/span&gt;);
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;terrain_river &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;Terrain&lt;/span&gt;(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;TERRAIN_RIVER&quot;&lt;/span&gt;);

        &lt;span style=&quot;color: #458383;&quot;&gt;world&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;setTile&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: #458383;&quot;&gt;terrain_class&lt;/span&gt;) ;
        &lt;span style=&quot;color: #458383;&quot;&gt;world&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;setTile&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: #458383;&quot;&gt;terrain_hill&lt;/span&gt;) ;
        &lt;span style=&quot;color: #458383;&quot;&gt;world&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;setTile&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt;3&lt;/span&gt;,&lt;span style=&quot;color: #458383;&quot;&gt;terrain_river&lt;/span&gt;) ;

        &lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;console&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;log&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;world&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;getIsWater&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt;3&lt;/span&gt;));
        &lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;console&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;log&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;world&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;getMovementCost&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt;2&lt;/span&gt;));
    }

    &lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;window&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;onload &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
        &lt;span style=&quot;font-style: italic;&quot;&gt;Main&lt;/span&gt;();
    }
&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;script&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;body&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;html&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;[fly weight]&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;html &lt;/span&gt;lang=&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;en&quot;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;head&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;meta &lt;/span&gt;charset=&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;title&lt;/span&gt;&amp;gt;flyweight &amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;title&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;head&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;body&lt;/span&gt;&amp;gt;
경량패턴??&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;br&lt;/span&gt;&amp;gt;
어떤 객체의 수가 너무 많아 좀 가볍게 만들고 싶을때 사용&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;br&lt;/span&gt;&amp;gt;
고유상태와 외부상태로 나눔&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;br&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;br&lt;/span&gt;&amp;gt;
예제 : 지형 만들기&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;br&lt;/span&gt;&amp;gt;
타일(고유상태)과 각 타일들이 갖고 있는 정보(외부상태)&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;br&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;script&lt;/span&gt;&amp;gt;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Terrain&lt;/span&gt;(movementCost, isWater, texture){

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;movementCost_&lt;/span&gt;;
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;isWater_&lt;/span&gt;;
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;texture_&lt;/span&gt;;

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_Terrain&lt;/span&gt;(){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;movementCost_ &lt;/span&gt;= movementCost;
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;isWater_ &lt;/span&gt;= isWater;
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;texture_ &lt;/span&gt;= texture;

        }

        &lt;span style=&quot;font-style: italic;&quot;&gt;_Terrain&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;prototype&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;getMovementCost &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;movementCost_&lt;/span&gt;;
        };
        &lt;span style=&quot;font-style: italic;&quot;&gt;_Terrain&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;prototype&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;isWater &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;isWater_&lt;/span&gt;;
        };
        &lt;span style=&quot;font-style: italic;&quot;&gt;_Terrain&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;prototype&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;getTexture &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;texture_&lt;/span&gt;;
        };


        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if&lt;/span&gt;(!(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this instanceof &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_Terrain &lt;/span&gt;)){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return new &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_Terrain&lt;/span&gt;();
        }

    }

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;CONST_GLASS_TEXTURE &lt;/span&gt;= &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;GLASS_TEXTURE&quot;&lt;/span&gt;;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;CONST_HILL_TEXTURE &lt;/span&gt;= &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;HILL_TEXTURE&quot;&lt;/span&gt;;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;CONST_RIVER_TEXTURE &lt;/span&gt;= &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;RIVER_TEXTURE&quot;&lt;/span&gt;;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;CONST_WIDTH &lt;/span&gt;= &lt;span style=&quot;color: blue;&quot;&gt;10&lt;/span&gt;;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;CONST_HEIGHT &lt;/span&gt;= &lt;span style=&quot;color: blue;&quot;&gt;12&lt;/span&gt;;

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;World&lt;/span&gt;(){

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;tiles &lt;/span&gt;= {};


        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_World&lt;/span&gt;(){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;glassTerrain_ &lt;/span&gt;= [&lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;false&lt;/span&gt;,&lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;CONST_GLASS_TEXTURE&lt;/span&gt;];
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;hillTerrain_ &lt;/span&gt;= [&lt;span style=&quot;color: blue;&quot;&gt;2&lt;/span&gt;,&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;false&lt;/span&gt;,&lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;CONST_HILL_TEXTURE&lt;/span&gt;];
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;riverTerrain_ &lt;/span&gt;= [&lt;span style=&quot;color: blue;&quot;&gt;3&lt;/span&gt;,&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;true&lt;/span&gt;,&lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;CONST_RIVER_TEXTURE&lt;/span&gt;];
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles &lt;/span&gt;= &lt;span style=&quot;color: #458383;&quot;&gt;tiles&lt;/span&gt;;

        }

        &lt;span style=&quot;font-style: italic;&quot;&gt;_World&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;prototype&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;setTile &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(x,y, value){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles&lt;/span&gt;||{};

            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles&lt;/span&gt;[x] = &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles&lt;/span&gt;[x]||{};
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles&lt;/span&gt;[x][y] = &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles&lt;/span&gt;[x][y]||&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;&quot;&lt;/span&gt;;
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles&lt;/span&gt;[x][y] = value;

        };

        &lt;span style=&quot;font-style: italic;&quot;&gt;_World&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;prototype&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;getTile &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(x,y){

            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Terrain&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;apply&lt;/span&gt;(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;, &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;tiles&lt;/span&gt;[x][y]);
        };


        &lt;span style=&quot;font-style: italic;&quot;&gt;_World&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;prototype&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;generateTerrain &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;x&lt;/span&gt;=&lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;; &lt;span style=&quot;color: #458383;&quot;&gt;x &lt;/span&gt;&amp;lt; &lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;CONST_WIDTH&lt;/span&gt;; &lt;span style=&quot;color: #458383;&quot;&gt;x&lt;/span&gt;++) {
                &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;for&lt;/span&gt;(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;y&lt;/span&gt;=&lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;; &lt;span style=&quot;color: #458383;&quot;&gt;y &lt;/span&gt;&amp;lt; &lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;CONST_HEIGHT&lt;/span&gt;; &lt;span style=&quot;color: #458383;&quot;&gt;y&lt;/span&gt;++){
                    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;x &lt;/span&gt;% &lt;span style=&quot;color: blue;&quot;&gt;2 &lt;/span&gt;== &lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;){
                        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;setTile&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;apply&lt;/span&gt;(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;, [&lt;span style=&quot;color: #458383;&quot;&gt;x&lt;/span&gt;,&lt;span style=&quot;color: #458383;&quot;&gt;y&lt;/span&gt;,&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;glassTerrain_&lt;/span&gt;]);
                    }&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;else&lt;/span&gt;{
                        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;setTile&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;apply&lt;/span&gt;(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;, [&lt;span style=&quot;color: #458383;&quot;&gt;x&lt;/span&gt;,&lt;span style=&quot;color: #458383;&quot;&gt;y&lt;/span&gt;,&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;hillTerrain_&lt;/span&gt;]);
                    }
                    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;y &lt;/span&gt;% &lt;span style=&quot;color: blue;&quot;&gt;3 &lt;/span&gt;== &lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;){
                        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;setTile&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;apply&lt;/span&gt;(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;, [&lt;span style=&quot;color: #458383;&quot;&gt;x&lt;/span&gt;,&lt;span style=&quot;color: #458383;&quot;&gt;y&lt;/span&gt;,&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;riverTerrain_&lt;/span&gt;]);
                    }
                }
            }
        };

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if&lt;/span&gt;(!(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this instanceof &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_World &lt;/span&gt;)){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return new &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_World&lt;/span&gt;();
        }

    }



    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Main&lt;/span&gt;(){
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;world &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;World&lt;/span&gt;();
        &lt;span style=&quot;color: #458383;&quot;&gt;world&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;generateTerrain&lt;/span&gt;();
        &lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;console&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;dir&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;world&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;getTile&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;).&lt;span style=&quot;color: #7a7a43;&quot;&gt;getMovementCost&lt;/span&gt;());

    }

    &lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;window&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;onload &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
        &lt;span style=&quot;font-style: italic;&quot;&gt;Main&lt;/span&gt;();
    }
&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;script&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;body&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;html&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/11977931586798359/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2016/06/flyweight-javascript.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/11977931586798359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/11977931586798359'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2016/06/flyweight-javascript.html' title=' flyweight 패턴 '/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5943612685487581451.post-6131079721815436331</id><published>2016-06-19T19:47:00.003+09:00</published><updated>2016-06-20T16:35:46.255+09:00</updated><title type='text'>게임프로그래밍 패턴 - 커맨드패턴을 이용한 이동키로 화면 움직이기 구현</title><content type='html'>&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;아래는 원본 함수&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;handleInput에 if문으로 각각의 함수를 호출 &lt;/span&gt;&lt;/pre&gt;
&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;html &lt;/span&gt;lang=&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;en&quot;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;head&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;meta &lt;/span&gt;charset=&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;title&lt;/span&gt;&amp;gt;command pattern&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;title&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;style&lt;/span&gt;&amp;gt;
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;#unit &lt;/span&gt;{
            position: &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;absolute&lt;/span&gt;;
            background-color: &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;olivedrab&lt;/span&gt;;
            top:&lt;span style=&quot;color: blue;&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;px&lt;/span&gt;;
            left:&lt;span style=&quot;color: blue;&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;px&lt;/span&gt;;
            display:&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;block&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;        &lt;/span&gt;}
    &amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;style&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;head&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;body&lt;/span&gt;&amp;gt;
원본소스
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;div &lt;/span&gt;id=&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;unit&quot;&lt;/span&gt;&amp;gt;
    unit
&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;div&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;script&lt;/span&gt;&amp;gt;
    &lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;document&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;addEventListener&lt;/span&gt;(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;keydown&quot;&lt;/span&gt;, &lt;span style=&quot;font-style: italic;&quot;&gt;handleInput&lt;/span&gt;, &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;false&lt;/span&gt;);
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;handleInput&lt;/span&gt;(e){
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;keyCode &lt;/span&gt;= e.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;keyCode&lt;/span&gt;;
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;keyCode &lt;/span&gt;== &lt;span style=&quot;color: blue;&quot;&gt;38&lt;/span&gt;){
            &lt;span style=&quot;font-style: italic;&quot;&gt;up&lt;/span&gt;();
        }&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;else if&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;keyCode &lt;/span&gt;== &lt;span style=&quot;color: blue;&quot;&gt;40&lt;/span&gt;){
            &lt;span style=&quot;font-style: italic;&quot;&gt;down&lt;/span&gt;();
        }&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;else if&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;keyCode &lt;/span&gt;== &lt;span style=&quot;color: blue;&quot;&gt;37&lt;/span&gt;){
            &lt;span style=&quot;font-style: italic;&quot;&gt;left&lt;/span&gt;();
        }&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;else if&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;keyCode &lt;/span&gt;== &lt;span style=&quot;color: blue;&quot;&gt;39&lt;/span&gt;){
            &lt;span style=&quot;font-style: italic;&quot;&gt;right&lt;/span&gt;();
        }
    };


    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;(){
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;target &lt;/span&gt;= &lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;document&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;getElementById&lt;/span&gt;(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&#39;unit&#39;&lt;/span&gt;);

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;{
            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;x&quot; &lt;/span&gt;: &lt;span style=&quot;color: #7a7a43;&quot;&gt;parseInt&lt;/span&gt;(&lt;span style=&quot;font-style: italic;&quot;&gt;getStyle&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;target&lt;/span&gt;,&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;left&quot;&lt;/span&gt;),&lt;span style=&quot;color: blue;&quot;&gt;10&lt;/span&gt;),
            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;y&quot; &lt;/span&gt;: &lt;span style=&quot;color: #7a7a43;&quot;&gt;parseInt&lt;/span&gt;(&lt;span style=&quot;font-style: italic;&quot;&gt;getStyle&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;target&lt;/span&gt;,&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;top&quot;&lt;/span&gt;),&lt;span style=&quot;color: blue;&quot;&gt;10&lt;/span&gt;),
            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;body&quot; &lt;/span&gt;: &lt;span style=&quot;color: #458383;&quot;&gt;target&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;        &lt;/span&gt;};
    }
&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;window&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;onload&lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
    &lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;console&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;log&lt;/span&gt;(&lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;x&lt;/span&gt;);
};


&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;script&lt;/span&gt;&amp;gt;

&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;script&lt;/span&gt;&amp;gt;


    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;getStyle&lt;/span&gt;(el, styleProp) {
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;value&lt;/span&gt;, &lt;span style=&quot;color: #458383;&quot;&gt;defaultView &lt;/span&gt;= (el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;ownerDocument &lt;/span&gt;|| &lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;document&lt;/span&gt;).&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;defaultView&lt;/span&gt;;
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// W3C standard way:&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if &lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;defaultView &lt;/span&gt;&amp;amp;&amp;amp; &lt;span style=&quot;color: #458383;&quot;&gt;defaultView&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;getComputedStyle&lt;/span&gt;) {
            &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// sanitize property name to css notation&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            // (hypen separated words eg. font-Size)&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            &lt;/span&gt;styleProp = styleProp.&lt;span style=&quot;color: #7a7a43;&quot;&gt;replace&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;/([A-Z])/g&lt;/span&gt;, &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;-$1&quot;&lt;/span&gt;).&lt;span style=&quot;color: #7a7a43;&quot;&gt;toLowerCase&lt;/span&gt;();
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;defaultView&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;getComputedStyle&lt;/span&gt;(el, &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;null&lt;/span&gt;).&lt;span style=&quot;color: #7a7a43;&quot;&gt;getPropertyValue&lt;/span&gt;(styleProp);
        } &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;else if &lt;/span&gt;(el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;currentStyle&lt;/span&gt;) { &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// IE&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            // sanitize property name to camelCase&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            &lt;/span&gt;styleProp = styleProp.&lt;span style=&quot;color: #7a7a43;&quot;&gt;replace&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;/\-(\w)/g&lt;/span&gt;, &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(str, letter) {
                &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;letter.&lt;span style=&quot;color: #7a7a43;&quot;&gt;toUpperCase&lt;/span&gt;();
            });
            &lt;span style=&quot;color: #458383;&quot;&gt;value &lt;/span&gt;= el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;currentStyle&lt;/span&gt;[styleProp];
            &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// convert other units to pixels on IE&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if &lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;/^\d+(em|pt|%|ex)?$/i&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;test&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;value&lt;/span&gt;)) {
                &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(value) {
                    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;oldLeft &lt;/span&gt;= el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;style&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left&lt;/span&gt;, &lt;span style=&quot;color: #458383;&quot;&gt;oldRsLeft &lt;/span&gt;= el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;runtimeStyle&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left&lt;/span&gt;;
                    el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;runtimeStyle&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left &lt;/span&gt;= el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;currentStyle&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left&lt;/span&gt;;
                    el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;style&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left &lt;/span&gt;= value || &lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;;
                    value = el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;style&lt;/span&gt;.pixelLeft + &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;px&quot;&lt;/span&gt;;
                    el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;style&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left &lt;/span&gt;= &lt;span style=&quot;color: #458383;&quot;&gt;oldLeft&lt;/span&gt;;
                    el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;runtimeStyle&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left &lt;/span&gt;= &lt;span style=&quot;color: #458383;&quot;&gt;oldRsLeft&lt;/span&gt;;
                    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;value;
                })(&lt;span style=&quot;color: #458383;&quot;&gt;value&lt;/span&gt;);
            }
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;value&lt;/span&gt;;
        }
    }

&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;up&lt;/span&gt;(){
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;target &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;y&lt;/span&gt;;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;body&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;top &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;suffixValue&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;target&lt;/span&gt;, -&lt;span style=&quot;color: blue;&quot;&gt;3&lt;/span&gt;);
}

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;down&lt;/span&gt;(){
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;target &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;y&lt;/span&gt;;
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;body&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;top &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;suffixValue&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;target&lt;/span&gt;, +&lt;span style=&quot;color: blue;&quot;&gt;3&lt;/span&gt;);
    }

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;left&lt;/span&gt;(){
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;target &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;x&lt;/span&gt;;
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;body&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;suffixValue&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;target&lt;/span&gt;, -&lt;span style=&quot;color: blue;&quot;&gt;3&lt;/span&gt;);
    }

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;right&lt;/span&gt;(){
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;target &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;x&lt;/span&gt;;
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;body&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;suffixValue&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;target&lt;/span&gt;, +&lt;span style=&quot;color: blue;&quot;&gt;3&lt;/span&gt;);
    }

&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;suffixValue&lt;/span&gt;(target, value){
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;suffix &lt;/span&gt;= &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;px&quot;&lt;/span&gt;;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;(target + value)+&lt;span style=&quot;color: #458383;&quot;&gt;suffix&lt;/span&gt;;
}

&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;script&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;body&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;html&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;커맨드 패턴을 이용하여 각각의 메서드 호출을 실체화 함, and undo, redo 구현&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;html &lt;/span&gt;lang=&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;en&quot;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;head&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;meta &lt;/span&gt;charset=&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;title&lt;/span&gt;&amp;gt;command pattern&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;title&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;style&lt;/span&gt;&amp;gt;
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;#unit &lt;/span&gt;{
            position: &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;absolute&lt;/span&gt;;
            background-color: &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;olivedrab&lt;/span&gt;;
            top:&lt;span style=&quot;color: blue;&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;px&lt;/span&gt;;
            left:&lt;span style=&quot;color: blue;&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;px&lt;/span&gt;;
            display:&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;block&lt;/span&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;        &lt;/span&gt;}
    &amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;style&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;head&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;body&lt;/span&gt;&amp;gt;
메서드의 호출을 실체화 함
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;div &lt;/span&gt;id=&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;unit&quot;&lt;/span&gt;&amp;gt;
    unit
&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;div&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;script&lt;/span&gt;&amp;gt;

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;getStyle&lt;/span&gt;(el, styleProp) {
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;value&lt;/span&gt;, &lt;span style=&quot;color: #458383;&quot;&gt;defaultView &lt;/span&gt;= (el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;ownerDocument &lt;/span&gt;|| &lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;document&lt;/span&gt;).&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;defaultView&lt;/span&gt;;
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// W3C standard way:&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if &lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;defaultView &lt;/span&gt;&amp;amp;&amp;amp; &lt;span style=&quot;color: #458383;&quot;&gt;defaultView&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;getComputedStyle&lt;/span&gt;) {
            &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// sanitize property name to css notation&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            // (hypen separated words eg. font-Size)&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            &lt;/span&gt;styleProp = styleProp.&lt;span style=&quot;color: #7a7a43;&quot;&gt;replace&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;/([A-Z])/g&lt;/span&gt;, &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;-$1&quot;&lt;/span&gt;).&lt;span style=&quot;color: #7a7a43;&quot;&gt;toLowerCase&lt;/span&gt;();
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;defaultView&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;getComputedStyle&lt;/span&gt;(el, &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;null&lt;/span&gt;).&lt;span style=&quot;color: #7a7a43;&quot;&gt;getPropertyValue&lt;/span&gt;(styleProp);
        } &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;else if &lt;/span&gt;(el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;currentStyle&lt;/span&gt;) { &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// IE&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            // sanitize property name to camelCase&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            &lt;/span&gt;styleProp = styleProp.&lt;span style=&quot;color: #7a7a43;&quot;&gt;replace&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;/\-(\w)/g&lt;/span&gt;, &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(str, letter) {
                &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;letter.&lt;span style=&quot;color: #7a7a43;&quot;&gt;toUpperCase&lt;/span&gt;();
            });
            &lt;span style=&quot;color: #458383;&quot;&gt;value &lt;/span&gt;= el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;currentStyle&lt;/span&gt;[styleProp];
            &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// convert other units to pixels on IE&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if &lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;/^\d+(em|pt|%|ex)?$/i&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;test&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;value&lt;/span&gt;)) {
                &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(value) {
                    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;oldLeft &lt;/span&gt;= el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;style&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left&lt;/span&gt;, &lt;span style=&quot;color: #458383;&quot;&gt;oldRsLeft &lt;/span&gt;= el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;runtimeStyle&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left&lt;/span&gt;;
                    el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;runtimeStyle&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left &lt;/span&gt;= el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;currentStyle&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left&lt;/span&gt;;
                    el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;style&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left &lt;/span&gt;= value || &lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;;
                    value = el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;style&lt;/span&gt;.pixelLeft + &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;px&quot;&lt;/span&gt;;
                    el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;style&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left &lt;/span&gt;= &lt;span style=&quot;color: #458383;&quot;&gt;oldLeft&lt;/span&gt;;
                    el.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;runtimeStyle&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left &lt;/span&gt;= &lt;span style=&quot;color: #458383;&quot;&gt;oldRsLeft&lt;/span&gt;;
                    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;value;
                })(&lt;span style=&quot;color: #458383;&quot;&gt;value&lt;/span&gt;);
            }
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;value&lt;/span&gt;;
        }
    }
    &lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;document&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;addEventListener&lt;/span&gt;(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;keydown&quot;&lt;/span&gt;, &lt;span style=&quot;font-style: italic;&quot;&gt;handleInput&lt;/span&gt;, &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;false&lt;/span&gt;);
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;handleInput&lt;/span&gt;(e){          //메인함수
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;keyCode &lt;/span&gt;= e.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;keyCode&lt;/span&gt;;

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;pressDispatcher &lt;/span&gt;= {       &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//command dispatcher&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;37 &lt;/span&gt;: &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;LeftCommand&lt;/span&gt;,
            &lt;span style=&quot;color: blue;&quot;&gt;38 &lt;/span&gt;: &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;UpCommand&lt;/span&gt;,
            &lt;span style=&quot;color: blue;&quot;&gt;39 &lt;/span&gt;: &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;RightCommand&lt;/span&gt;,
            &lt;span style=&quot;color: blue;&quot;&gt;40 &lt;/span&gt;: &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;DownCommand&lt;/span&gt;,
            &lt;span style=&quot;color: blue;&quot;&gt;89 &lt;/span&gt;: &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;RedoCommand&lt;/span&gt;,
            &lt;span style=&quot;color: blue;&quot;&gt;90 &lt;/span&gt;: &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;UndoCommand&lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;        &lt;/span&gt;};

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;button &lt;/span&gt;= &lt;span style=&quot;color: #458383;&quot;&gt;pressDispatcher&lt;/span&gt;[&lt;span style=&quot;color: #458383;&quot;&gt;keyCode&lt;/span&gt;];
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;isPress &lt;/span&gt;= (&lt;span style=&quot;color: #458383;&quot;&gt;keyCode &lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;in &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;pressDispatcher&lt;/span&gt;);
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;isPress&lt;/span&gt;) &lt;span style=&quot;color: #458383;&quot;&gt;button&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;execute&lt;/span&gt;();


    };

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;Command &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;x &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;x&lt;/span&gt;, &lt;span style=&quot;color: #458383;&quot;&gt;y &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;y&lt;/span&gt;;
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;{
                &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;execute&quot; &lt;/span&gt;: &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){

                    &lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;console&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;log&lt;/span&gt;(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;origin command execute&quot;&lt;/span&gt;);
                },
                &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;undo&quot; &lt;/span&gt;: &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
                    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if&lt;/span&gt;(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;beforeLocation&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;length &lt;/span&gt;&amp;gt; &lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;){
                        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;locationData &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;beforeLocation&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;pop&lt;/span&gt;();
                            &lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #7a7a43;&quot;&gt;move&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;locationData&lt;/span&gt;);
                            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;redoHistoryWrite&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;locationData&lt;/span&gt;);
                    }
                },

                &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;redo&quot; &lt;/span&gt;: &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
                    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if&lt;/span&gt;(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;afterLocation&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;length &lt;/span&gt;&amp;gt; &lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;){
                        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;locationData &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;afterLocation&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;pop&lt;/span&gt;();
                        &lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #7a7a43;&quot;&gt;move&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;locationData&lt;/span&gt;);
                        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;undoHistoryWrite&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;locationData&lt;/span&gt;);
                    }
                },
                &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&#39;beforeLocation&#39; &lt;/span&gt;: [],
                &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;undoHistoryWrite&quot; &lt;/span&gt;: &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){

                    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;beforeLocation&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;push&lt;/span&gt;([&lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;x&lt;/span&gt;,&lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;y&lt;/span&gt;]);
                },

                &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&#39;afterLocation&#39; &lt;/span&gt;: [],
                &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;redoHistoryWrite&quot; &lt;/span&gt;: &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){

                    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;afterLocation&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;push&lt;/span&gt;([&lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;x&lt;/span&gt;,&lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;y&lt;/span&gt;]);
                }
            };
    }();


    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;RedoCommand&lt;/span&gt;(){

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_RedoCommand&lt;/span&gt;(){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;execute &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
                &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;redo&lt;/span&gt;();
            };

        }
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//@extends&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_RedoCommand&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;prototype &lt;/span&gt;= &lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;Command&lt;/span&gt;;

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if&lt;/span&gt;(!(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this instanceof &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_RedoCommand &lt;/span&gt;)){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return new &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_RedoCommand&lt;/span&gt;();
        }
    }


    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;UndoCommand&lt;/span&gt;(){

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_UndoCommand&lt;/span&gt;(){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;execute &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
                &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;undo&lt;/span&gt;();
            };

        }
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//@extends&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_UndoCommand&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;prototype &lt;/span&gt;= &lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;Command&lt;/span&gt;;

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if&lt;/span&gt;(!(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this instanceof &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_UndoCommand &lt;/span&gt;)){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return new &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_UndoCommand&lt;/span&gt;();
        }
    }

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;UpCommand&lt;/span&gt;(){

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_UpCommand&lt;/span&gt;(){

            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;execute &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
                &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;undoHistoryWrite&lt;/span&gt;();
                &lt;span style=&quot;font-style: italic;&quot;&gt;up&lt;/span&gt;();
            };

        }
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//@extends&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_UpCommand&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;prototype &lt;/span&gt;= &lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;Command&lt;/span&gt;;

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if&lt;/span&gt;(!(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this instanceof &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_UpCommand &lt;/span&gt;)){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return new &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_UpCommand&lt;/span&gt;();
        }
    }


    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;DownCommand&lt;/span&gt;(){

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_DownCommand&lt;/span&gt;(){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;execute &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
                &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;undoHistoryWrite&lt;/span&gt;();
                &lt;span style=&quot;font-style: italic;&quot;&gt;down&lt;/span&gt;();
            }
        }
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//@extends&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_DownCommand&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;prototype &lt;/span&gt;= &lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;Command&lt;/span&gt;;

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if&lt;/span&gt;(!(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this instanceof &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_DownCommand &lt;/span&gt;)){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return new &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_DownCommand&lt;/span&gt;();
        }
    }


    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;LeftCommand&lt;/span&gt;(){

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_LeftCommand&lt;/span&gt;(){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;execute &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
                &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;undoHistoryWrite&lt;/span&gt;();
                &lt;span style=&quot;font-style: italic;&quot;&gt;left&lt;/span&gt;();
            }
        }
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//@extends&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_LeftCommand&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;prototype &lt;/span&gt;= &lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;Command&lt;/span&gt;;

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if&lt;/span&gt;(!(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this instanceof &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_LeftCommand &lt;/span&gt;)){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return new &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_LeftCommand&lt;/span&gt;();
        }
    }


    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;RightCommand&lt;/span&gt;(){

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_RightCommand&lt;/span&gt;(){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;execute &lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
                &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;undoHistoryWrite&lt;/span&gt;();
                &lt;span style=&quot;font-style: italic;&quot;&gt;right&lt;/span&gt;();
            }
        }
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//@extends&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_RightCommand&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;prototype &lt;/span&gt;= &lt;span style=&quot;color: #660e7a; font-style: italic; font-weight: bold;&quot;&gt;Command&lt;/span&gt;;

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if&lt;/span&gt;(!(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this instanceof &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_RightCommand &lt;/span&gt;)){
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return new &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;_RightCommand&lt;/span&gt;();
        }
    }


    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;(){
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;target &lt;/span&gt;= &lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;document&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;getElementById&lt;/span&gt;(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&#39;unit&#39;&lt;/span&gt;);

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;{
            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;x&quot; &lt;/span&gt;: &lt;span style=&quot;color: #7a7a43;&quot;&gt;parseInt&lt;/span&gt;(&lt;span style=&quot;font-style: italic;&quot;&gt;getStyle&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;target&lt;/span&gt;,&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;left&quot;&lt;/span&gt;),&lt;span style=&quot;color: blue;&quot;&gt;10&lt;/span&gt;),
            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;y&quot; &lt;/span&gt;: &lt;span style=&quot;color: #7a7a43;&quot;&gt;parseInt&lt;/span&gt;(&lt;span style=&quot;font-style: italic;&quot;&gt;getStyle&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;target&lt;/span&gt;,&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;top&quot;&lt;/span&gt;),&lt;span style=&quot;color: blue;&quot;&gt;10&lt;/span&gt;),
            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;body&quot; &lt;/span&gt;: &lt;span style=&quot;color: #458383;&quot;&gt;target&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;style&lt;/span&gt;,
            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;move&quot; &lt;/span&gt;: &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(arr){
                &lt;span style=&quot;color: #458383;&quot;&gt;target&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;style&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left &lt;/span&gt;= arr[&lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;]+&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;px&quot;&lt;/span&gt;;
                &lt;span style=&quot;color: #458383;&quot;&gt;target&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;style&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;top &lt;/span&gt;= arr[&lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;]+&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;px&quot;&lt;/span&gt;;

            }
        };
    }
&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;window&lt;/span&gt;.&lt;span style=&quot;color: #7a7a43;&quot;&gt;onload&lt;/span&gt;= &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function&lt;/span&gt;(){
    &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;/*console.log(unit().x);*/&lt;/span&gt;};


&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;script&lt;/span&gt;&amp;gt;

&amp;lt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;script&lt;/span&gt;&amp;gt;



&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;up&lt;/span&gt;(){
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;target &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;y&lt;/span&gt;;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;body&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;top &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;suffixValue&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;target&lt;/span&gt;, -&lt;span style=&quot;color: blue;&quot;&gt;3&lt;/span&gt;);
}

&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;down&lt;/span&gt;(){
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;target &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;y&lt;/span&gt;;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;body&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;top &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;suffixValue&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;target&lt;/span&gt;, +&lt;span style=&quot;color: blue;&quot;&gt;3&lt;/span&gt;);
}

&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;left&lt;/span&gt;(){
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;target &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;x&lt;/span&gt;;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;body&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;suffixValue&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;target&lt;/span&gt;, -&lt;span style=&quot;color: blue;&quot;&gt;3&lt;/span&gt;);
}

&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;right&lt;/span&gt;(){
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;target &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;x&lt;/span&gt;;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;unit&lt;/span&gt;().&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;body&lt;/span&gt;.&lt;span style=&quot;color: #660e7a; font-weight: bold;&quot;&gt;left &lt;/span&gt;= &lt;span style=&quot;font-style: italic;&quot;&gt;suffixValue&lt;/span&gt;(&lt;span style=&quot;color: #458383;&quot;&gt;target&lt;/span&gt;, +&lt;span style=&quot;color: blue;&quot;&gt;3&lt;/span&gt;);
}

&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;suffixValue&lt;/span&gt;(target, value){
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;var &lt;/span&gt;&lt;span style=&quot;color: #458383;&quot;&gt;suffix &lt;/span&gt;= &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;px&quot;&lt;/span&gt;;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;(target + value)+&lt;span style=&quot;color: #458383;&quot;&gt;suffix&lt;/span&gt;;
}

&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;script&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;body&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;html&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://pakss328.blogspot.com/feeds/6131079721815436331/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://pakss328.blogspot.com/2016/06/blog-post_65.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/6131079721815436331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5943612685487581451/posts/default/6131079721815436331'/><link rel='alternate' type='text/html' href='http://pakss328.blogspot.com/2016/06/blog-post_65.html' title='게임프로그래밍 패턴 - 커맨드패턴을 이용한 이동키로 화면 움직이기 구현'/><author><name>stevePaks</name><uri>http://www.blogger.com/profile/07452508245080471986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>