<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>nicepro</title>
    <link>https://nicepro.tistory.com/</link>
    <description>각종 프로그래밍 정보를 다루는 블로그입니다.</description>
    <language>ko</language>
    <pubDate>Sat, 13 Jun 2026 12:17:43 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>nicepro</managingEditor>
    <image>
      <title>nicepro</title>
      <url>https://tistory1.daumcdn.net/tistory/4241362/attach/7c0b8b7d822c41cfb901d5b65ece4b0e</url>
      <link>https://nicepro.tistory.com</link>
    </image>
    <item>
      <title>파일 변경시 Docker 컨테이너 다시 빌드</title>
      <link>https://nicepro.tistory.com/2700</link>
      <description>&lt;h2&gt;&lt;span&gt;&lt;span&gt;파일 변경시 Docker 컨테이너 다시 빌드&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;ASP.NET Core 애플리케이션을 실행하기 위해 애플리케이션을 빌드하고 Jenkins를 사용하여 Git에서 가져온 소스 코드를 컨테이너에 복사하는 dockerfile을 생성했습니다. &lt;/span&gt;&lt;span&gt;따라서 내 작업 공간에서 dockerfile에서 다음을 수행합니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;dockerfile&quot;&gt;&lt;code&gt;WORKDIR /app COPY src src &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;Jenkins는 Git을 사용하여 호스트의 파일을 올바르게 업데이트하지만 Docker는 이것을 내 이미지에 적용하지 않습니다. &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;빌드를위한 기본 스크립트 :&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;arcade&quot;&gt;&lt;code&gt;#!/bin/bash imageName=xx:my-image containerName=my-container  docker build -t $imageName -f Dockerfile .  containerRunning=$(docker inspect --format=&quot;{{ .State.Running }}&quot; $containerName 2&amp;gt; /dev/null)  if [ &quot;$containerRunning&quot; == &quot;true&quot; ]; then docker stop $containerName docker start $containerName else docker run -d -p 5000:5000 --name $containerName $imageName fi &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;새 &lt;/span&gt;&lt;span&gt;컨테이너 &lt;/span&gt;&lt;span&gt;가 빌드 &lt;/span&gt;&lt;i&gt;&lt;span&gt;되기 전에&lt;/span&gt;&lt;/i&gt;&lt;span&gt; 컨테이너 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--rm&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;및 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--no-cache&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;매개 변수 &lt;/span&gt;&lt;span&gt;와 같은 다른 작업을 시도 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;docker run&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;하고 컨테이너 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;span&gt;&lt;span&gt;를&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 중지 / 제거했습니다 &lt;/span&gt;&lt;span&gt;. &lt;/span&gt;&lt;span&gt;내가 여기서 뭘 잘못하고 있는지 잘 모르겠습니다. &lt;/span&gt;&lt;span&gt;을 호출 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;COPY src src&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;하면 레이어 ID가 발생하고 캐시 호출이 발생하지 않으므로도 &lt;/span&gt;&lt;span&gt;커가 이미지를 올바르게 업데이트하는 것 같습니다 &lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;ada&quot;&gt;&lt;code&gt;Step 6 : COPY src src ---&amp;gt; 382ef210d8fd &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;컨테이너를 업데이트하는 데 권장되는 방법은 무엇입니까? &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;내 일반적인 시나리오는 다음과 같습니다. 애플리케이션이 Docker 컨테이너의 서버에서 실행 중입니다. &lt;/span&gt;&lt;span&gt;이제 앱의 일부가 업데이트됩니다 (예 : 파일 수정). &lt;/span&gt;&lt;span&gt;이제 컨테이너가 새 버전을 실행해야합니다. &lt;/span&gt;&lt;span&gt;Docker는 기존 컨테이너를 수정하는 대신 새 이미지 빌드를 권장하는 것 같아서 일반적인 재 빌드 방법이 옳다고 생각하지만 구현의 일부 세부 사항을 개선해야합니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;몇 가지 연구와 테스트를 거친 후 Docker 컨테이너의 수명에 대해 오해가 있음을 발견했습니다. &lt;/span&gt;&lt;span&gt;컨테이너를 다시 시작한다고해서 그 동안 이미지가 다시 빌드되었을 때 Docker가 새 이미지를 사용하지는 않습니다. &lt;/span&gt;&lt;span&gt;대신 Docker는 &lt;/span&gt;&lt;span&gt;컨테이너 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;span&gt;&lt;span&gt;를&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 실행 &lt;/span&gt;&lt;i&gt;&lt;span&gt;하기 전에&lt;/span&gt;&lt;/i&gt;&lt;span&gt; 만 이미지를 가져옵니다 &lt;/span&gt;&lt;span&gt;. &lt;/span&gt;&lt;span&gt;따라서 컨테이너를 실행 한 후의 상태는 지속적입니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;&lt;span&gt;&lt;span&gt;제거가 필요한 이유&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;따라서 다시 빌드하고 다시 시작하는 것만으로는 충분하지 않습니다. &lt;/span&gt;&lt;span&gt;컨테이너가 서비스처럼 작동한다고 생각했습니다. 서비스를 중지하고 변경 한 다음 다시 시작하면 적용됩니다. &lt;/span&gt;&lt;span&gt;그것은 내 가장 큰 실수였습니다.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;컨테이너는 영구적이므로 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;docker rm &amp;lt;ContainerName&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;먼저 &lt;/span&gt;&lt;span&gt;사용하여 제거해야합니다 &lt;/span&gt;&lt;span&gt;. &lt;/span&gt;&lt;span&gt;컨테이너가 제거 된 후에는 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;docker start&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;. &lt;/span&gt;&lt;span&gt;이것은 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div id=&quot;cpp_banner&quot;&gt;
&lt;p&gt;
&lt;script src=&quot;https://ads-partners.coupang.com/g.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;new PartnersCoupang.G({'id':405897,'subId':null});&lt;/script&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;docker run&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;새로운 컨테이너 인스턴스를 생성하기 위해 최신 이미지를 사용 &lt;/span&gt;&lt;span&gt;하는를 사용하여 수행되어야 &lt;/span&gt;&lt;span&gt;합니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;&lt;span&gt;&lt;span&gt;컨테이너는 가능한 한 독립적이어야합니다.&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;이 지식이 있으면 컨테이너에 데이터를 저장하는 &lt;/span&gt;&lt;span&gt;것이 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://developers.redhat.com/blog/2016/02/24/10-things-to-avoid-in-docker-containers/&quot; rel=&quot;noreferrer&quot;&gt;&lt;span&gt;&lt;span&gt;나쁜 관행으로 인정되는&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 이유를 이해할 수 &lt;/span&gt;&lt;span&gt;있으며 Docker는 &lt;/span&gt;&lt;span&gt;대신 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://docs.docker.com/engine/tutorials/dockervolumes/&quot; rel=&quot;noreferrer&quot;&gt;&lt;span&gt;&lt;span&gt;데이터 볼륨 / 마운트 호스트 디렉터리&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 를 &lt;/span&gt;&lt;span&gt;권장 &lt;/span&gt;&lt;a href=&quot;https://docs.docker.com/engine/tutorials/dockervolumes/&quot; rel=&quot;noreferrer&quot;&gt;&lt;span&gt;합니다&lt;/span&gt;&lt;/a&gt;&lt;span&gt; . 애플리케이션을 업데이트하려면 컨테이너를 파괴해야하므로 내부에 저장된 데이터도 손실됩니다. &lt;/span&gt;&lt;span&gt;이로 인해 서비스 종료, 데이터 백업 등에 대한 추가 작업이 발생합니다.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;따라서 컨테이너에서 이러한 데이터를 완전히 제외하는 것이 현명한 솔루션입니다. 데이터가 호스트에 안전하게 저장되고 컨테이너가 애플리케이션 자체 만 보유 할 때 데이터에 대해 걱정할 필요가 없습니다. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;-rf&lt;/code&gt;&lt;span&gt;&lt;span&gt;정말 도움이되지 않는 &lt;/span&gt;&lt;span&gt;이유&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;이 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;docker run&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;명령에는라는 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;span&gt;&lt;span&gt;정리&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 스위치가 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;-rf&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;있습니다. &lt;/span&gt;&lt;span&gt;Docker 컨테이너를 영구적으로 유지하는 동작을 중지합니다. &lt;/span&gt;&lt;span&gt;를 사용 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;-rf&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;하면 Docker는 컨테이너가 종료 된 후이를 파괴합니다. &lt;/span&gt;&lt;span&gt;그러나이 스위치에는 두 가지 문제가 있습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;Docker는 또한 컨테이너와 연결된 이름이없는 볼륨을 제거하여 데이터를 죽일 수 있습니다.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;이 옵션을 사용하면 &lt;/span&gt;&lt;/span&gt;&lt;code&gt;-d&lt;/code&gt;&lt;span&gt;&lt;span&gt;스위치를 &lt;/span&gt;&lt;span&gt;사용하여 백그라운드에서 컨테이너를 실행할 수 없습니다.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;-rf&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;스위치는 빠른 테스트를 위해 개발 중에 작업을 저장하는 좋은 옵션 &lt;/span&gt;&lt;span&gt;이지만 &lt;/span&gt;&lt;span&gt;프로덕션에는 적합하지 않습니다. &lt;/span&gt;&lt;span&gt;특히 백그라운드에서 컨테이너를 실행하는 옵션이 없기 때문에 대부분 필요합니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;&lt;span&gt;&lt;span&gt;컨테이너를 제거하는 방법&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;컨테이너를 간단히 제거하여 이러한 제한을 우회 할 수 있습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;ada&quot;&gt;&lt;code&gt;docker rm --force &amp;lt;ContainerName&amp;gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;--force&lt;/code&gt; (or &lt;code&gt;-f&lt;/code&gt;) switch which use SIGKILL on running containers. Instead, you could also stop the container before:&lt;/p&gt;
&lt;pre class=&quot;vim&quot;&gt;&lt;code&gt;docker stop &amp;lt;ContainerName&amp;gt; docker rm &amp;lt;ContainerName&amp;gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Both are equal. &lt;code&gt;docker stop&lt;/code&gt; is also using &lt;a href=&quot;https://docs.docker.com/engine/reference/commandline/stop/&quot; rel=&quot;noreferrer&quot;&gt;SIGTERM&lt;/a&gt;. But using &lt;code&gt;--force&lt;/code&gt; switch will shorten your script, especially when using CI servers: &lt;code&gt;docker stop&lt;/code&gt; throws an error if the container is not running. This would cause Jenkins and many other CI servers to consider the build wrongly as failed. To fix this, you have to check first if the container is running as I did in the question (see &lt;code&gt;containerRunning&lt;/code&gt; variable).&lt;/p&gt;
&lt;h3&gt;Full script for rebuilding a Docker container&lt;/h3&gt;
&lt;p&gt;According to this new knowledge, I fixed my script in the following way:&lt;/p&gt;
&lt;pre class=&quot;mel&quot;&gt;&lt;code&gt;#!/bin/bash imageName=xx:my-image containerName=my-container  docker build -t $imageName -f Dockerfile .  echo Delete old container... docker rm -f $containerName  echo Run new container... docker run -d -p 5000:5000 --name $containerName $imageName &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This works perfectly :)&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;Whenever changes are made in dockerfile or compose or requirements , re-Run it using &lt;code&gt;docker-compose up --build&lt;/code&gt; . So that images get rebuild and refreshed&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/41322541/rebuild-docker-container-on-file-changes&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/41322541/rebuild-docker-container-on-file-changes&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2700</guid>
      <comments>https://nicepro.tistory.com/2700#entry2700comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:58:11 +0900</pubDate>
    </item>
    <item>
      <title>javax.servlet은 어디에 있습니까?</title>
      <link>https://nicepro.tistory.com/2699</link>
      <description>&lt;h2&gt;&lt;span&gt;&lt;span&gt;javax.servlet은 어디에 있습니까?&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;나는 한 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;jdk1.6.0_13&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;설치,하지만 난 찾을 때 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;javax.servlet&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;패키지를 누르거나 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;+ &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;kbd&gt;Space&lt;/kbd&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;이클립스를 한 후 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Servlet&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;난 아무것도 얻을 수 없습니다. &lt;/span&gt;&lt;span&gt;이 패키지는 어디에서 다운로드 할 수 있으며 개발자 용 표준 배포에 포함되지 않는 이유는 무엇입니까?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;code&gt;javax.servlet&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;Java EE (Java Enterprise Edition)의 일부인 패키지입니다. &lt;/span&gt;&lt;span&gt;Java SE 용 JDK (Java Standard Edition)가 있습니다.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;예를 들어 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://java.sun.com/javaee/downloads/?intcmp=1282&quot; rel=&quot;noreferrer&quot;&gt;&lt;span&gt;&lt;span&gt;Java EE SDK&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 를 &lt;/span&gt;&lt;span&gt;사용할 수 있습니다 &lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;또는 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://tomcat.apache.org/&quot; rel=&quot;noreferrer&quot;&gt;&lt;span&gt;&lt;span&gt;Apache Tomcat&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 과 같은 간단한 서블릿 컨테이너 &lt;/span&gt;&lt;span&gt;도이 API와 함께 제공됩니다 ( &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;servlet-api.jar&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;).&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;Joachim Sauer의 답변에 대한 자세한 내용은 다음과 같습니다.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;적어도 우분투에서 메타 패키지는 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;tomcat6&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;메타 패키지에 따라 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;tomcat6-common&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;메타 패키지에 따라 달라집니다 (및 기타), &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;libtomcat6-java&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;패키지에 따라, &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;code&gt;libservlet2.5-java&lt;/code&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;(및 기타). &lt;/span&gt;&lt;span&gt;그것은 다른 사람의 파일들 포함 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/usr/share/java/servlet-api-2.5.jar&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;하고 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/usr/share/java/jsp-api-2.1.jar&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;서블릿 그리고 JSP는 당신이 필요로하는 라이브러리. &lt;/span&gt;&lt;span&gt;따라서 apt-get 또는 Ubuntu Software Center를 통해 Tomcat 6을 설치 한 경우 이미 라이브러리가 있습니다. &lt;/span&gt;&lt;span&gt;남은 것은 Tomcat이 프로젝트에서 사용하도록하는 것입니다.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;다음 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/usr/share/java/servlet-api-2.5.jar&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;과 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/usr/share/java/jsp-api-2.1.jar&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;같이 &lt;/span&gt;&lt;span&gt;라이브러리 &lt;/span&gt;&lt;span&gt;와 &lt;/span&gt;&lt;span&gt;클래스 경로에 배치하십시오.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;모든 프로젝트의 경우 창-&amp;gt; 환경 설정-&amp;gt; Java-&amp;gt; 설치된 JRE를 선택한 다음 사용중인 JRE를 선택하고 편집을 누른 다음 외부 JAR 추가를 누른 다음 위에 제공된 위치에서 파일을 선택하여 Eclipse를 구성합니다. .&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;한 프로젝트의 경우 프로젝트 탐색기 창에서 프로젝트를 마우스 오른쪽 단추로 클릭하고 속성-&amp;gt; Java 빌드 경로를 선택한 다음 외부 JAR 추가를 누른 다음 위에 제공된 위치에서 파일을 선택합니다.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;추가 참고 1 : Tomcat 6에서 사용하기위한 올바른 버전의 라이브러리입니다. &lt;/span&gt;&lt;span&gt;다른 Tomcat 버전의 경우 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://tomcat.apache.org/whichversion.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;span&gt;&lt;span&gt;http://tomcat.apache.org/whichversion.html&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div id=&quot;cpp_banner&quot;&gt;
&lt;p&gt;
&lt;script src=&quot;https://ads-partners.coupang.com/g.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;new PartnersCoupang.G({'id':405897,'subId':null});&lt;/script&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 페이지의 표를 참조하세요 &lt;/span&gt;&lt;span&gt;.하지만 각 Tomcat 버전에 적절한 라이브러리 버전이 포함되어 있다고 가정합니다.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;추가 참고 2 : 패키지 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;libservlet2.5-java&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;설명 ( &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;dpkg-query -s libservlet2.5-java&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;)은 다음과 같이 말합니다. 'Apache Tomcat &lt;/span&gt;&lt;span&gt;은 Sun Microsystems &lt;/span&gt;&lt;span&gt;의 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;span&gt;&lt;span&gt;Java Servlet 및 JSP (JavaServer Pages)&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 사양을 구현하고 Java 코드 실행을위한 &quot;순수 Java&quot;HTTP 웹 서버 환경을 제공합니다. &lt;/span&gt;&lt;span&gt;이 패키지에는 Java Servlet 및 JSP 라이브러리가 포함되어 있습니다. '&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;당신은 instaled 적이 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://java.sun.com/javaee/&quot; rel=&quot;noreferrer&quot;&gt;&lt;span&gt;&lt;span&gt;J2EE를&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; ? &lt;/span&gt;&lt;span&gt;표준 (J2SE) 만 설치했다면 찾을 수 없습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;Eclipse 및 Java EE 웹 애플리케이션의 일반적인 절차는 서블릿 컨테이너 (Tomcat, Jetty 등) 또는 애플리케이션 서버 (Glassfish ( &quot;Sun Java EE&quot;다운로드에 번들로 제공됨), JBoss AS, WebSphere, Weblogic 등)을 설치하는 것입니다. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;span&gt;&lt;span&gt;서버&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 보기 &lt;/span&gt;&lt;span&gt;에서 (내장) 플러그인을 사용하여 Eclipse에 통합합니다 &lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;새 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;span&gt;&lt;span&gt;동적 웹 프로젝트&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 작성 마법사 중에 &lt;/span&gt;&lt;span&gt;목록에서 통합 서버를 선택할 수 있습니다. &lt;/span&gt;&lt;span&gt;서버가없는 &lt;/span&gt;&lt;span&gt;기존 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;span&gt;&lt;span&gt;동적 웹 프로젝트가&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 있거나 연결된 &lt;/span&gt;&lt;i&gt;&lt;span&gt;프로젝트&lt;/span&gt;&lt;/i&gt;&lt;span&gt; 를 변경하려는 &lt;/span&gt;&lt;span&gt;경우 프로젝트 속성 &lt;/span&gt;&lt;span&gt;의 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;span&gt;&lt;span&gt;대상 Rutimes&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 섹션 &lt;/span&gt;&lt;span&gt;에서 수정해야 &lt;/span&gt;&lt;span&gt;합니다.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;어느 쪽이든 Eclipse는 프로젝트의 클래스 경로 (빌드 경로)에 필요한 서버 별 라이브러리를 자동으로 배치합니다.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;당신은 절대적으로해야한다 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;span&gt;&lt;span&gt;어떠한 방식으로의&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 추출물로 서버 별 라이브러리를 복사 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/WEB-INF/lib&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;하거나 악화 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;JRE/lib&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;자신 이클립스에서 컴파일 오류 &quot;수정&quot;로 설정합니다. &lt;/span&gt;&lt;span&gt;웹 애플리케이션이 특정 서버에 연결되어 완전히 이식 할 수 없게됩니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;Glassfish와 함께 Java EE JDK가있는 경우 glassfish3 / glassfish / modules / javax.servlet-api.jar에 있습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;이러한 클래스는 일반적으로 servlet.jar &lt;/span&gt;&lt;a href=&quot;http://www.java2s.com/Code/Jar/wsit/Downloadservletjar.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;span&gt;http://www.java2s.com/Code/Jar/wsit/Downloadservletjar.htm의&lt;/span&gt;&lt;/a&gt;&lt;span&gt; 일부입니다 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;a href=&quot;http://www.java2s.com/Code/Jar/wsit/Downloadservletjar.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;참조 URL : &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/860022/wheres-javax-servlet&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span&gt;&lt;span&gt;https://stackoverflow.com/questions/860022/wheres-javax-servlet&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2699</guid>
      <comments>https://nicepro.tistory.com/2699#entry2699comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:58:02 +0900</pubDate>
    </item>
    <item>
      <title>일반 인터페이스</title>
      <link>https://nicepro.tistory.com/2698</link>
      <description>&lt;h2&gt;&lt;span&gt;&lt;span&gt;일반 인터페이스&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;원격 서비스에 대한 호출을 나타내는 인터페이스를 정의하고 싶다고 가정 해 보겠습니다. &lt;/span&gt;&lt;span&gt;이제 원격 서비스에 대한 호출은 일반적으로 무언가를 반환하지만 입력 매개 변수도 포함 할 수 있습니다. &lt;/span&gt;&lt;span&gt;구현 클래스가 일반적으로 하나의 서비스 메소드 만 구현한다고 가정하십시오. &lt;/span&gt;&lt;span&gt;위의 정보를 감안할 때 다음은 잘못된 디자인입니다 (정답이 아닙니다).&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;public interface IExecutesService&amp;lt;A,B&amp;gt; { public A executeService(); public A executeService(B inputParameter); } &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;이제 입력 매개 변수로 원격 서비스를 실행하는 클래스로이 인터페이스를 구현한다고 가정 해 보겠습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;public class ServiceA implements IExecutesService&amp;lt;String,String&amp;gt; { public String executeService() { //This service call should not be executed by this class throw new IllegalStateException(&quot;This method should not be called for this class...blabla&quot;); }  public String executeService(String inputParameter) { //execute some service } &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;위와 관련하여 두 가지 질문이 있습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;IExecutesService&amp;lt;A,B&amp;gt;&lt;/code&gt;&lt;span&gt;&lt;span&gt;인터페이스 메소드에 대해 다른 입력 매개 변수와 리턴 유형이 필요한 서브 클래스를 제공하려는 경우 &lt;/span&gt;&lt;span&gt;제네릭 인터페이스 ( &lt;/span&gt;&lt;span&gt;)를 사용하는 것이 좋습니까?&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;위 사항을 어떻게 더 잘 수행 할 수 있습니까? &lt;/span&gt;&lt;span&gt;즉, 공통 인터페이스 ( &lt;/span&gt;&lt;/span&gt;&lt;code&gt;IExecutesService&lt;/code&gt;&lt;span&gt;&lt;span&gt;) &lt;/span&gt;&lt;span&gt;아래에 서비스 실행기를 그룹화하고 싶습니다 &lt;/span&gt;&lt;span&gt;. &lt;/span&gt;&lt;span&gt;그러나 구현 클래스는 일반적으로 메소드 중 하나만 구현하며 IllegalStateException을 사용하는 것은 정말 추한 느낌입니다. &lt;/span&gt;&lt;span&gt;또한의 B 유형 매개 변수는 &lt;/span&gt;&lt;/span&gt;&lt;code&gt;IExecutesService&amp;lt;A,B&amp;gt;&lt;/code&gt;&lt;span&gt;&lt;span&gt;입력 매개 변수없이 서비스를 호출하는 구현 클래스에 대해 중복됩니다. &lt;/span&gt;&lt;span&gt;또한 두 개의 다른 서비스 호출에 대해 두 개의 별도 인터페이스를 만드는 것은 과도하게 보입니다.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;다음은 한 가지 제안입니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;public interface Service&amp;lt;T,U&amp;gt; { T executeService(U... args); }  public class MyService implements Service&amp;lt;String, Integer&amp;gt; { @Override public String executeService(Integer... args) { // do stuff return null; } } &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;유형 삭제로 인해 모든 클래스는 이들 중 하나만 구현할 수 있습니다. &lt;/span&gt;&lt;span&gt;이것은 적어도 중복 방법을 제거합니다.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;당신이 제안하는 것은 비합리적인 인터페이스는 아니지만 그것이 어떤 가치를 더하는지 100 % 확신하지 못합니다. &lt;/span&gt;&lt;span&gt;표준 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/Callable.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;Callable&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;인터페이스 &lt;/span&gt;&lt;span&gt;를 사용하고 싶을 수도 있습니다 &lt;/span&gt;&lt;span&gt;. &lt;/span&gt;&lt;span&gt;인수를 지원하지 않지만 인터페이스의 해당 부분이 최소값 (imho)을 갖습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;다음은 또 다른 제안입니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;public interface Service&amp;lt;T&amp;gt; { T execute(); } &lt;/code&gt;&lt;/pre&gt;
&lt;div id=&quot;cpp_banner&quot;&gt;
&lt;p&gt;
&lt;script src=&quot;https://ads-partners.coupang.com/g.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;new PartnersCoupang.G({'id':405897,'subId':null});&lt;/script&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;이 간단한 인터페이스 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;span&gt;&lt;span&gt;를&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 사용 &lt;/span&gt;&lt;span&gt;하여 구체적인 서비스 클래스의 &lt;/span&gt;&lt;b&gt;&lt;span&gt;생성자&lt;/span&gt;&lt;/b&gt;&lt;span&gt; 를 &lt;/span&gt;&lt;b&gt;&lt;span&gt;통해 인수를 전달할 수&lt;/span&gt;&lt;/b&gt;&lt;span&gt; 있습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;arduino&quot;&gt;&lt;code&gt;public class FooService implements Service&amp;lt;String&amp;gt; {  private final String input1; private final int input2;  public FooService(String input1, int input2) { this.input1 = input1; this.input2 = input2; }  @Override public String execute() { return String.format(&quot;'%s%d'&quot;, input1, input2); } } &lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;나는 두 가지 다른 인터페이스를 사용합니다. &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;당신은 말했다 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;span&gt;&lt;span&gt;'나는 공통 인터페이스에서 내 서비스 집행 ... 그것은 또한 과잉 두 개의 서로 다른 서비스 호출에 두 개의 인터페이스를 만드는 것 ... 클래스는 이러한 인터페이스 중 하나를 구현할 그룹에 원하는'&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;It's not clear what is the reason to have a single interface then. If you want to use it as a marker, you can just exploit annotations instead.&lt;/p&gt;
&lt;p&gt;Another point is that there is a possible case that your requirements change and method(s) with another signature appears at the interface. Of course it's possible to use Adapter pattern then but it would be rather strange to see that particular class implements interface with, say, three methods where two of them trow UnsupportedOperationException. It's possible that the forth method appears etc.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;As an answer strictly in line with your question, I support cleytus's proposal.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;You could also use a marker interface (with no method), say &lt;code&gt;DistantCall&lt;/code&gt;, with several several sub-interfaces that have the precise signatures you want.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The general interface would serve to mark all of them, in case you want to write some generic code for all of them.&lt;/li&gt;
&lt;li&gt;The number of specific interfaces can be reduced by using cleytus's generic signature.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Examples of 'reusable' interfaces:&lt;/p&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt; public interface DistantCall { }  public interface TUDistantCall&amp;lt;T,U&amp;gt; extends DistantCall { T execute(U... us); }  public interface UDistantCall&amp;lt;U&amp;gt; extends DistantCall { void execute(U... us); }  public interface TDistantCall&amp;lt;T&amp;gt; extends DistantCall { T execute(); }  public interface TUVDistantCall&amp;lt;T, U, V&amp;gt; extends DistantCall { T execute(U u, V... vs); } .... &lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;b&gt;UPDATED&lt;/b&gt; in response to OP comment&lt;/p&gt;
&lt;p&gt;I wasn't thinking of any &lt;i&gt;instanceof&lt;/i&gt; in the calling. I was thinking your calling code knew what it was calling, and you just needed to assemble several distant call in a common interface for some generic code (&lt;i&gt;for example, auditing all distant calls, for performance reasons&lt;/i&gt;). In your question, I have seen no mention that the calling code is generic :-(&lt;/p&gt;
&lt;p&gt;If so, I suggest you have only one interface, only one signature. Having several would only bring more complexity, for nothing.&lt;/p&gt;
&lt;p&gt;However, you need to ask yourself some broader questions :&lt;br /&gt;&lt;b&gt;how you will ensure that caller and callee do communicate correctly?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;That could be a follow-up on this question, or a different question...&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;If I understand correctly, you want to have one class implement multiple of those interfaces with different input/output parameters? This will not work in Java, because the generics are implemented via erasure.&lt;/p&gt;
&lt;p&gt;The problem with the Java generics is that the generics are in fact nothing but compiler magic. At runtime, the classes do not keep any information about the types used for generic stuff (class type parameters, method type parameters, interface type parameters). Therefore, even though you could have overloads of specific methods, you cannot bind those to multiple interface implementations which differ in their generic type parameters only.&lt;/p&gt;
&lt;p&gt;In general, I can see why you think that this code has a smell. However, in order to provide you with a better solution, it would be necessary to know a little more about your requirements. Why do you want to use a generic interface in the first place?&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/1623480/generic-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/1623480/generic-interface&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2698</guid>
      <comments>https://nicepro.tistory.com/2698#entry2698comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:57:54 +0900</pubDate>
    </item>
    <item>
      <title>C 표준 라이브러리의 어떤 함수가 일반적으로 나쁜 습관을 유발합니까?</title>
      <link>https://nicepro.tistory.com/2697</link>
      <description>&lt;h2&gt;&lt;span&gt;&lt;span&gt;C 표준 라이브러리의 어떤 함수가 일반적으로 나쁜 습관을 유발합니까?&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;이것은 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/4580329/string-handling-practices-in-c&quot;&gt;&lt;span&gt;&lt;span&gt;이 질문&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 과 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;strncpy&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;C에서 매우 안전한 문자열 처리 기능이 아니며 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;n&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;내가 알지 못했던 것에 &lt;/span&gt;&lt;span&gt;도달 할 때까지 0을 채운다는 &lt;/span&gt;&lt;span&gt;것을 알게 된 특정 답변에 대한 의견에서 &lt;/span&gt;&lt;span&gt;영감을 얻었 &lt;/span&gt;&lt;span&gt;습니다 &lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;특히 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/users/379897/r&quot;&gt;&lt;span&gt;&lt;span&gt;R ..&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;span&gt;&lt;span&gt;strncpy는 null로 종료되지 않으며 대상 버퍼의 나머지 전체를 null로 채 웁니다. 이는 엄청난 시간 낭비입니다. &lt;/span&gt;&lt;span&gt;자신의 널 패딩을 추가하여 전자를 해결할 수 있지만 후자는 아닙니다. &lt;/span&gt;&lt;span&gt;&quot;안전한 문자열 처리&quot;함수로 사용하기위한 것이 아니라 Unix 디렉토리 테이블 및 데이터베이스 파일에서 고정 크기 필드로 작업하기위한 것입니다. &lt;/span&gt;&lt;span&gt;snprintf (dest, n, &quot;% s&quot;, src)는 표준 C에서 유일하게 올바른 &quot;안전한 strcpy&quot;이지만 훨씬 느릴 수 있습니다. &lt;/span&gt;&lt;span&gt;그건 그렇고, 잘림 자체는 주요 버그가 될 수 있으며 경우에 따라 권한 상승 또는 DoS로 이어질 수 있으므로 문제에서 출력을 자르는 &quot;안전한&quot;문자열 함수를 던지는 것은 &quot;안전&quot;또는 &quot; 안전한&quot;. &lt;/span&gt;&lt;span&gt;대신&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;그리고 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/users/15168/jonathan-leffler&quot;&gt;&lt;span&gt;&lt;span&gt;Jonathan Leffler에서&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;span&gt;&lt;span&gt;strncat ()은 strncpy ()보다 인터페이스에서 훨씬 더 혼란 스럽습니다-정확히 길이 인수는 무엇입니까? &lt;/span&gt;&lt;span&gt;strncpy () 등을 제공하는 것에 기반하여 예상 한 것이 아니므로 strncpy ()보다 오류가 발생하기 쉽습니다. &lt;/span&gt;&lt;span&gt;문자열을 복사 할 때 항상 모든 크기를 미리 알고 미리 충분한 공간이 있는지 확인하기 때문에 memmove () 만 필요하다는 강력한 주장이 있다는 의견이 점점 커지고 있습니다. &lt;/span&gt;&lt;span&gt;strcpy (), strcat (), strncpy (), strncat (), memcpy () 중 하나보다 선호하는 memmove ()를 사용하십시오.&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;그래서 저는 C 표준 라이브러리에서 분명히 약간 녹슬 었습니다. &lt;/span&gt;&lt;span&gt;따라서 질문을하고 싶습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;span&gt;&lt;span&gt;어떤 C 표준 라이브러리 함수가 부적절하게 사용되거나 보안 문제 / 코드 결함 / 비효율을 유발할 수있는 방식으로 사용됩니까?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;객관성 측면에서 답변에 대한 여러 기준이 있습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;가능하다면 문제의 기능 뒤에있는 디자인 이유, 즉 의도 된 목적을 인용하십시오.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;현재 코드가있는 오용을 강조하십시오.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;오용으로 인해 문제가 발생할 수있는 이유를 설명하십시오. &lt;/span&gt;&lt;span&gt;나는 그것이 명백해야한다는 것을 알고 있지만 그것은 부드러운 대답을 방해합니다.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;피하십시오 :&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;함수의 이름 지정 규칙에 대한 토론 (이로 인해 혼란이 발생하는 경우 제외).&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;&quot;나는 y보다 x를 선호합니다&quot;-선호도는 괜찮습니다. 우리 모두가 가지고 있지만 실제 예상치 못한 부작용과이를 방지하는 방법에 관심이 있습니다.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;이것은 주관적인 것으로 간주 될 가능성이 있고 명확한 답변이 없기 때문에 즉시 커뮤니티 위키에 플래그를 지정합니다.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;나는 또한 C99에 따라 일하고 있습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;이 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;strtok()&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;함수 &lt;/span&gt;&lt;span&gt;의 일반적인 함정 &lt;/span&gt;&lt;span&gt;은 구문 분석 된 문자열이 변경되지 않은 상태로 남아 있다고 가정하고 실제로 구분 문자를 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;'\0'&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;또한 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;strtok()&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;전체 문자열이 토큰 화 될 때까지 후속 호출을 수행하는 데 사용됩니다. &lt;/span&gt;&lt;span&gt;일부 라이브러리 구현은 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;strtok()&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;의 내부 상태를 전역 변수에 &lt;/span&gt;&lt;span&gt;저장 &lt;/span&gt;&lt;span&gt;합니다. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;strtok()&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;이 &lt;/span&gt;&lt;span&gt;경우 &lt;/span&gt;&lt;span&gt;여러 스레드에서 동시에 호출 &lt;/span&gt;&lt;span&gt;되면 약간의 깜짝 놀라게 할 수 있습니다 &lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.securecoding.cert.org/confluence/display/c/SEI+CERT+C+Coding+Standard&quot; rel=&quot;noreferrer&quot;&gt;&lt;span&gt;&lt;span&gt;CERT C 표준 코딩 보안&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 이에 대한 질문이 함정의 많은 목록을.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;blockquote&gt;&lt;span&gt;&lt;span&gt;어떤 C 표준 라이브러리 함수가 부적절하게 / 보안 문제 / 코드 결함 / 비효율을 유발 / 유발할 수있는 방식으로 사용됩니까?&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;나는 명백한 것으로 갈 것입니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;cpp&quot;&gt;&lt;code&gt;char *gets(char *s); &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;적절하게 사용하는 것이 단순히 불가능하다는 놀라운 특수성으로.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;거의 모든 경우에를 사용 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;atoi()&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;해서는 안됩니다 ( &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div id=&quot;cpp_banner&quot;&gt;
&lt;p&gt;
&lt;script src=&quot;https://ads-partners.coupang.com/g.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;new PartnersCoupang.G({'id':405897,'subId':null});&lt;/script&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;atof()&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;, &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;atol()&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;및 &lt;/span&gt;&lt;span&gt;에도 적용됨 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;atoll()&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;).&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;이는 이러한 함수가 범위를 벗어난 오류를 전혀 감지하지 못하기 때문입니다. 표준은 단순히 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;span&gt;&lt;span&gt;&quot;결과 값을 표현할 수없는 경우 동작이 정의되지 않은 것&quot;이라고 말합니다. &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;. &lt;/span&gt;&lt;span&gt;따라서 안전하게 사용할 수있는 유일한 시간은 입력이 확실히 범위 내에 있다는 것을 증명할 수있는 경우입니다 (예를 들어 길이가 4 이하인 문자열을에 전달하면 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;atoi()&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;범위를 벗어날 수 없음).&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;대신 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;strtol()&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;기능 군 &lt;/span&gt;&lt;span&gt;중 하나를 사용하십시오 &lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;더 넓은 의미에서 인터페이스에 대한 질문을 확장 해 보겠습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;errno&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;기술적으로 변수, 매크로, 암시 적 함수 호출이 무엇인지 명확하지 않습니까? &lt;/span&gt;&lt;span&gt;실제로 현대 시스템에서는 대부분 스레드 특정 오류 상태를 갖도록 함수 호출로 변환되는 매크로입니다. &lt;/span&gt;&lt;span&gt;그것은 악하다 :&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;호출자가 값에 액세스하여 &quot;오류&quot;(예외 이벤트 일 수 있음)를 확인하는 오버 헤드가 발생할 수 있기 때문입니다.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;호출자가 라이브러리 호출을하기 전에이 &quot;변수&quot;를 지우도록 일부 장소에서 부과하기 때문에 &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;span&gt;라이브러리의 전역 상태를 설정하여 간단한 오류 반환을 구현하기 때문입니다.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;다가오는 표준은 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;errno&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;좀 더 솔직한 &lt;/span&gt;&lt;span&gt;정의를 얻지 &lt;/span&gt;&lt;span&gt;만 이러한 추함은 여전히 ​​남아 있습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;종종 strtok_r이 있습니다.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;realloc의 경우 이전 포인터를 사용해야하는 경우 다른 변수를 사용하는 것이 그렇게 어렵지 않습니다. &lt;/span&gt;&lt;span&gt;프로그램이 할당 오류로 실패하면 이전 포인터를 정리할 필요가없는 경우가 많습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;나는 둘 것입니다 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;printf&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;및 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;scanf&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;이 목록에 꽤 높은 최대. &lt;/span&gt;&lt;span&gt;형식 지정자를 정확히 맞아야한다는 사실은 이러한 함수를 사용하기 까다 롭고 잘못하기 매우 쉽게 만듭니다. &lt;/span&gt;&lt;span&gt;데이터를 읽을 때 버퍼 오버런을 피하는 것도 매우 어렵습니다. &lt;/span&gt;&lt;span&gt;더욱이 &quot;printf 형식 문자열 취약성&quot;은 선의의 프로그래머가 클라이언트 지정 문자열을 printf에 대한 첫 번째 인수로 지정했을 때 수많은 보안 허점을 일으켰을 때 스택이 부숴지고 보안이 수년 동안 손상되었음을 발견 할뿐입니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;Any of the functions that manipulate global state, like &lt;code&gt;gmtime()&lt;/code&gt; or &lt;code&gt;localtime()&lt;/code&gt;. These functions simply can't be used safely in multiple threads.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;EDIT:&lt;/b&gt; &lt;code&gt;rand()&lt;/code&gt; is in the same category it would seem. At least there are no guarantees of thread-safety, and on my Linux system the man page warns that it is non-reentrant and non-threadsafe.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;One of my b&amp;ecirc;tes noire is &lt;a href=&quot;https://stackoverflow.com/questions/4547570/tokenizing-a-string-in-c&quot;&gt;&lt;code&gt;strtok()&lt;/code&gt;&lt;/a&gt;, because it is non-reentrant and because it hacks the string it is processing into pieces, inserting NUL at the end of each token it isolates. The problems with this are legion; it is distressingly often touted as a solution to a problem, but is as often a problem itself. Not always - it can be used safely. But only if you are careful. The same is true of most functions, with the notable exception of &lt;code&gt;gets()&lt;/code&gt; which cannot be used safely.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;There's already one answer about &lt;code&gt;realloc&lt;/code&gt;, but I have a different take on it. A lot of time, I've seen people write &lt;code&gt;realloc&lt;/code&gt; when they mean &lt;code&gt;free&lt;/code&gt;; &lt;code&gt;malloc&lt;/code&gt; - in other words, when they have a buffer full of trash that needs to change size before storing new data. This of course leads to potentially-large, cache-thrashing &lt;code&gt;memcpy&lt;/code&gt; of trash that's about to be overwritten.&lt;/p&gt;
&lt;p&gt;If used correctly with growing data (in a way that avoids worst-case &lt;code&gt;O(n^2)&lt;/code&gt; performance for growing an object to size &lt;code&gt;n&lt;/code&gt;, i.e. growing the buffer geometrically instead of linearly when you run out of space), &lt;code&gt;realloc&lt;/code&gt; has doubtful benefit over simply doing your own new &lt;code&gt;malloc&lt;/code&gt;, &lt;code&gt;memcpy&lt;/code&gt;, and &lt;code&gt;free&lt;/code&gt; cycle. The only way &lt;code&gt;realloc&lt;/code&gt; can ever avoid doing this internally is when you're working with a single object at the top of the heap.&lt;/p&gt;
&lt;p&gt;If you like to zero-fill new objects with &lt;code&gt;calloc&lt;/code&gt;, it's easy to forget that &lt;code&gt;realloc&lt;/code&gt; won't zero-fill the new part.&lt;/p&gt;
&lt;p&gt;And finally, one more common use of &lt;code&gt;realloc&lt;/code&gt; is to allocate more than you need, then resize the allocated object down to just the required size. But this can actually be harmful (additional allocation and &lt;code&gt;memcpy&lt;/code&gt;) on implementations that strictly segregate chunks by size, and in other cases might increase fragmentation (by splitting off part of a large free chunk to store a new small object, instead of using an existing small free chunk).&lt;/p&gt;
&lt;p&gt;I'm not sure if I'd say &lt;code&gt;realloc&lt;/code&gt; &lt;i&gt;encourages&lt;/i&gt; bad practice, but it's a function I'd watch out for.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;How about the &lt;code&gt;malloc&lt;/code&gt; family in general? The vast majority of large, long-lived programs I've seen use dynamic memory allocation all over the place as if it were free. Of course real-time developers know this is a myth, and careless use of dynamic allocation can lead to catastrophic blow-up of memory usage and/or fragmentation of address space to the point of memory exhaustion.&lt;/p&gt;
&lt;p&gt;In some higher-level languages without machine-level pointers, dynamic allocation is not so bad because the implementation can move objects and defragment memory during the program's lifetime, as long as it can keep references to these objects up-to-date. A non-conventional C implementation could do this too, but working out the details is non-trivial and it would incur a very significant cost in all pointer dereferences and make pointers rather large, so for practical purposes, it's not possible in C.&lt;/p&gt;
&lt;p&gt;My suspicion is that the correct solution is usually for long-lived programs to perform their small routine allocations as usual with &lt;code&gt;malloc&lt;/code&gt;, but to keep large, long-lived data structures in a form where they can be reconstructed and replaced periodically to fight fragmentation, or as large &lt;code&gt;malloc&lt;/code&gt; blocks containing a number of structures that make up a single large unit of data in the application (like a whole web page presentation in a browser), or on-disk with a fixed-size in-memory cache or memory-mapped files.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;On a wholly different tack, I've never really understood the benefits of &lt;code&gt;atan()&lt;/code&gt; when there is &lt;code&gt;atan2()&lt;/code&gt;. The difference is that &lt;code&gt;atan2()&lt;/code&gt; takes two arguments, and returns an angle anywhere in the range -&amp;pi;..+&amp;pi;. Further, it avoids divide by zero errors and loss of precision errors (dividing a very small number by a very large number, or vice versa). By contrast, the &lt;code&gt;atan()&lt;/code&gt; function only returns a value in the range -&amp;pi;/2..+&amp;pi;/2, and you have to do the division beforehand (I don't recall a scenario where &lt;code&gt;atan()&lt;/code&gt; could be used without there being a division, short of simply generating a table of arctangents). Providing 1.0 as the divisor for &lt;code&gt;atan2()&lt;/code&gt; when given a simple value is not pushing the limits.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;Another answer, since these are not really related, &lt;code&gt;rand&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;it is of unspecified random quality&lt;/li&gt;
&lt;li&gt;it is not re-entrant&lt;/li&gt;
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;Some of this functions are modifying some global state. (In windows) this state is shared per single thread - you can get unexpected result. For example, the first call of &lt;code&gt;rand&lt;/code&gt; in every thread will give the same result, and it requires some care to make it pseudorandom, but deterministic (for debug purposes).&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;code&gt;basename()&lt;/code&gt; and &lt;code&gt;dirname()&lt;/code&gt; aren't threadsafe.&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/4588581/which-functions-in-the-c-standard-library-commonly-encourage-bad-practice&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/4588581/which-functions-in-the-c-standard-library-commonly-encourage-bad-practice&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2697</guid>
      <comments>https://nicepro.tistory.com/2697#entry2697comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:57:44 +0900</pubDate>
    </item>
    <item>
      <title>Android에서 Spinner 비활성화</title>
      <link>https://nicepro.tistory.com/2696</link>
      <description>&lt;h2&gt;&lt;span&gt;&lt;span&gt;Android에서 Spinner 비활성화&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;사용할 때이 문제가 발생 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;android:enabled=&quot;false&quot;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;그렇지 않아, &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;span&gt;&lt;span&gt;사용하지 &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;span&gt;&lt;span&gt;구성 요소&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt; 가 A의 경우 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;spinner&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;. &lt;/span&gt;&lt;span&gt;관련성이 있는지는 모르지만 .NET Framework의 일부인 레이아웃에 속합니다 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;viewflipper&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;힌트 또는 해결 방법이 있습니까?&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;감사&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;어댑터를 설정하기 전에 비활성화하거나 활성화하십시오.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;reasonml&quot;&gt;&lt;code&gt;yourSpinner.setEnabled(false);  yourSpinner.setClickable(false);  yourSpinner.setAdapter(typeAdapter); &lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;XML에서 Spinner를 활성화 / 비활성화 할 수 없습니다 (아직). &lt;/span&gt;&lt;span&gt;그렇게하려면 코드에서해야합니다.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;예를 들면 다음과 같습니다.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div id=&quot;cpp_banner&quot;&gt;
&lt;p&gt;
&lt;script src=&quot;https://ads-partners.coupang.com/g.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;new PartnersCoupang.G({'id':405897,'subId':null});&lt;/script&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;pre class=&quot;reasonml&quot;&gt;&lt;code&gt;Spinner spinner = (Spinner) findViewById(R.id.mySpinner); spinner.setEnabled(false); &lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;당신은 설정할 수 있습니다 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;android:clickable=&quot;false&quot;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;에서 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;xml&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;(가) 비활성화 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;spinner&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;를 클릭하십시오 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;event&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot; /&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;당신은 대신에의 자바 코드 자체에서이를 설정할 수 있습니다 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;XML&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;(가) 때문에, &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Spinner&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;구현해야합니다 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;setEnabled(boolean)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;에서 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;View&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;참조 URL : &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/5986130/disabling-spinner-in-android&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span&gt;&lt;span&gt;https://stackoverflow.com/questions/5986130/disabling-spinner-in-android&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2696</guid>
      <comments>https://nicepro.tistory.com/2696#entry2696comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:57:35 +0900</pubDate>
    </item>
    <item>
      <title>iframe src를 동적으로 설정</title>
      <link>https://nicepro.tistory.com/2695</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;iframe src를 동적으로 설정&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;페이지를로드하기 위해 iframe src를 동적으로 설정하는 프로그램이 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;완전히로드 된 페이지에 대한 이벤트 처리기를 연결해야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내가 어떻게 해? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;감사!&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
function iframeDidLoad() {&lt;font&gt;&lt;/font&gt;
    alert('Done');&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
function newSite() {&lt;font&gt;&lt;/font&gt;
    var sites = ['http://getprismatic.com',&lt;font&gt;&lt;/font&gt;
                 'http://gizmodo.com/',&lt;font&gt;&lt;/font&gt;
                 'http://lifehacker.com/']&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    document.getElementById('myIframe').src = sites[Math.floor(Math.random() * sites.length)];&lt;font&gt;&lt;/font&gt;
}    &lt;font&gt;&lt;/font&gt;
&amp;lt;/script&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;input type=&quot;button&quot; value=&quot;Change site&quot; onClick=&quot;newSite()&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;iframe id=&quot;myIframe&quot; src=&quot;http://getprismatic.com/&quot; onLoad=&quot;iframeDidLoad();&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;a href=&quot;http://jsfiddle.net/MALuP/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://jsfiddle.net/MALuP/의&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 예&lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://jsfiddle.net/MALuP/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 시도...&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;function urlChange(url) {&lt;font&gt;&lt;/font&gt;
    var site = url+'?toolbar=0&amp;amp;amp;navpanes=0&amp;amp;amp;scrollbar=0';&lt;font&gt;&lt;/font&gt;
    document.getElementById('iFrameName').src = site;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&amp;lt;a href=&quot;javascript:void(0);&quot; onClick=&quot;urlChange('www.mypdf.com/test.pdf')&quot;&amp;gt;TEST &amp;lt;/a&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 시도:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;top.document.getElementById('AppFrame').setAttribute(&quot;src&quot;,fullPath);
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 시도:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;document.frames[&quot;myiframe&quot;].onload = function(){&lt;font&gt;&lt;/font&gt;
   alert(&quot;Hello World&quot;);&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또한 일부 Opera 버전에서는 onload가 여러 번 실행되고 일부 후크를 추가해야합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;// fixing Opera 9.26, 10.00&lt;font&gt;&lt;/font&gt;
if (doc.readyState &amp;amp;&amp;amp; doc.readyState != 'complete') {&lt;font&gt;&lt;/font&gt;
    // Opera fires load event multiple times&lt;font&gt;&lt;/font&gt;
    // Even when the DOM is not ready yet&lt;font&gt;&lt;/font&gt;
    // this fix should not affect other browsers&lt;font&gt;&lt;/font&gt;
    return;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// fixing Opera 9.64&lt;font&gt;&lt;/font&gt;
if (doc.body &amp;amp;&amp;amp; doc.body.innerHTML == &quot;false&quot;) {&lt;font&gt;&lt;/font&gt;
    // In Opera 9.64 event was fired second time&lt;font&gt;&lt;/font&gt;
    // when body.innerHTML changed from false&lt;font&gt;&lt;/font&gt;
    // to server response approx. after 1 sec&lt;font&gt;&lt;/font&gt;
    return;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;a href=&quot;http://valums.com/ajax-upload/&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Ajax Upload&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 에서 차용 한 코드&lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://valums.com/ajax-upload/&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/6000987/dynamically-set-iframe-src&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/6000987/dynamically-set-iframe-src&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2695</guid>
      <comments>https://nicepro.tistory.com/2695#entry2695comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:57:27 +0900</pubDate>
    </item>
    <item>
      <title>jquery 데이터 테이블 기본 정렬</title>
      <link>https://nicepro.tistory.com/2694</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;jquery 데이터 테이블 기본 정렬&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기본 정렬을 jquery 데이터 테이블의 두 번째 열로 설정하려고합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기본적으로 인덱스 0으로 정렬합니다. &lt;/font&gt;&lt;/font&gt;&lt;code&gt;&quot;aaSorting&quot;: [[ 1, &quot;asc&quot; ]]&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;구문을 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용하고 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;있지만 초기로드시 원하지 않는 열을 강조 표시합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;정렬이 포함되지 않고 0 인덱스 열이 사용되는 것처럼 열을 강조 표시하지 않고 특정 열의 기본 정렬을 어떻게 설정할 수 있습니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;몇 가지 옵션이 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;DataTable을 초기화 한 직후 TBODY의 TD 요소에서 정렬 클래스를 제거하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;a href=&quot;http://datatables.net/ref#bSortClasses&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://datatables.net/ref#bSortClasses를&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 사용하여 정렬 클래스를 비활성화합니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것의 문제점은 사용자 정렬 요청에 대한 정렬 클래스를 비활성화한다는 것입니다. 이는 사용자가 원하는 것일 수도 있고 아닐 수도 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;서버에서 필요한 정렬 순서로 테이블을 출력하도록하고 테이블 ( &lt;/font&gt;&lt;/font&gt;&lt;code&gt;aaSorting:[]&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;) &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;에 기본 정렬을 적용하지 마십시오 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/li&gt; 
&lt;/ol&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음은이를 수행하는 실제 코드입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$(document).ready(function()&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
  var oTable = $('#myTable').dataTable();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  // Sort immediately with column 2 (at position 1 in the array (base 0). More could be sorted with additional array elements&lt;font&gt;&lt;/font&gt;
  oTable.fnSort( [ [1,'asc'] ] );&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  // And to sort another column descending (at position 2 in the array (base 0).&lt;font&gt;&lt;/font&gt;
  oTable.fnSort( [ [2,'desc'] ] );&lt;font&gt;&lt;/font&gt;
} );&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;열을 강조 표시하지 않으려면 다음과 같이 CSS를 수정하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;table.dataTable tr.odd td.sorting_1 { background-color: transparent; }&lt;font&gt;&lt;/font&gt;
table.dataTable tr.even td.sorting_1 { background-color: transparent; }&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;fnSort 함수를 사용할 수 있습니다. 자세한 내용은 다음을 참조하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;http://datatables.net/api#fnSort&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://datatables.net/api#fnSort&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가장 좋은 방법은 정렬을 비활성화하고 원하는 정렬 순서 (데이터베이스 또는 기타 소스에서)로 데이터를 공급하는 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것을 'datatable'에 추가해보십시오 : &quot;bSort&quot;: false&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Datatables는이 기능에 대해 HTML5 data- * 속성을 지원합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;정렬 순서에서 여러 열을 지원합니다 (0 기반).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;table data-order=&quot;[[ 1, 'desc' ], [2, 'asc' ]]&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;thead&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;tr&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;td&amp;gt;First&amp;lt;/td&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;td&amp;gt;Another column&amp;lt;/td&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;td&amp;gt;A third&amp;lt;/td&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/tr&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/thead&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;tbody&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;tr&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;td&amp;gt;z&amp;lt;/td&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;td&amp;gt;1&amp;lt;/td&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;td&amp;gt;$%^&amp;amp;*&amp;lt;/td&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/tr&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;tr&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;td&amp;gt;y&amp;lt;/td&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;td&amp;gt;2&amp;lt;/td&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;td&amp;gt;*$%^&amp;amp;&amp;lt;/td&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/tr&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/tbody&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/table&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이제 내 jQuery는 간단 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;$('table').DataTables();&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하며 두 번째 및 세 번째 열이 desc / asc 순서로 정렬됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;&amp;lt;table&amp;gt;&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내가 재사용하는 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다른 좋은 속성은 다음과 같습니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;data-page-length=&quot;-1&quot;&lt;/code&gt; will set the page length to All (pass 25 for page length 25)...&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;data-fixed-header=&quot;true&quot;&lt;/code&gt; ... Make a guess &lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I had this problem too. I had used &lt;code&gt;stateSave&lt;/code&gt; option and that made this problem.&lt;br&gt; Remove this option and problem is solved.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;use this it works for me: &quot;order&quot;: [[ 1, &quot;ASC&quot; ]],&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;This worked for me:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;       jQuery('#tblPaging').dataTable({&lt;font&gt;&lt;/font&gt;
            &quot;sort&quot;: true,&lt;font&gt;&lt;/font&gt;
            &quot;pageLength&quot;: 20&lt;font&gt;&lt;/font&gt;
        });&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Just Include the following code:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;    $(document).ready(function() {&lt;font&gt;&lt;/font&gt;
        $('#tableID').DataTable( {&lt;font&gt;&lt;/font&gt;
            &quot;order&quot;: [[ 3, &quot;desc&quot; ]]&lt;font&gt;&lt;/font&gt;
        } );&lt;font&gt;&lt;/font&gt;
    } &lt;font&gt;&lt;/font&gt;
);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Full reference article with the example: &lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://datatables.net/examples/basic_init/table_sorting.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://datatables.net/examples/basic_init/table_sorting.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/8639191/jquery-datatables-default-sort&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/8639191/jquery-datatables-default-sort&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2694</guid>
      <comments>https://nicepro.tistory.com/2694#entry2694comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:57:19 +0900</pubDate>
    </item>
    <item>
      <title>JQuery select2는 목록의 옵션에서 기본값을 설정합니까?</title>
      <link>https://nicepro.tistory.com/2693</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;JQuery select2는 목록의 옵션에서 기본값을 설정합니까?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;JQuery Select2 플러그인을 사용하여 선택 요소의 기본 / 선택 값을 설정할 수 있기를 원합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;한 가지 더 방법 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;selected = &quot;selected&quot;&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;은 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;select&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;마크 업에 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;속성을 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;추가 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하고 호출 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;select2&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하는 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;선택한 값을 가져야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;추가 JavaScript가 필요하지 않습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이렇게 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;마크 업&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt; &lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;select class=&quot;select2&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
   &amp;lt;option id=&quot;foo&quot;&amp;gt;Some Text&amp;lt;/option&amp;gt;&lt;font&gt;&lt;/font&gt;
   &amp;lt;option id=&quot;bar&quot; selected=&quot;selected&quot;&amp;gt;Other Text&amp;lt;/option&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/select&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;자바 스크립트&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$('select').select2(); //oh yes just this!
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;바이올린 참조 : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://jsfiddle.net/6hZFU/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://jsfiddle.net/6hZFU/&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;편집 :&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; (감사합니다, Jay Haase!)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그래도 작동하지 않으면의 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;val&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;속성을 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;select2&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;로 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;설정하여 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;null&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같이 값을 지우십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$('select').select2(&quot;val&quot;, null); //a lil' bit more :)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그 후에로 설정하는 것은 간단 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;val&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;합니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;&quot;Whatever You Want&quot;&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이를 수행하는 한 가지 방법은 ...&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$('select').select2().select2('val', $('.select2 option:eq(1)').val());
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따라서 기본적으로 먼저 플러그인을 초기화 한 다음 'val'매개 변수를 사용하여 기본값을 지정합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;실제 값은 지정된 옵션 (이 경우 # 1)에서 가져옵니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따라서이 예제에서 선택한 값은 &quot;bar&quot;입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;select class=&quot;.select2&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;option id=&quot;foo&quot;&amp;gt;Some Text&amp;lt;/option&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;option id=&quot;bar&quot;&amp;gt;Other Text&amp;lt;/option&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/select&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것이 다른 사람에게 유용하기를 바랍니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;pre&gt;&lt;code&gt;$(&quot;#id&quot;).select2(&quot;val&quot;, null); //this will not work..you can try
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 작업을 실제로 수행해야합니다 ... 초기화 한 다음 값을 설정해야합니다.이 방법도 저에게 효과적입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$(&quot;#id&quot;).select2().select2(&quot;val&quot;, null);&lt;font&gt;&lt;/font&gt;
$(&quot;#id&quot;).select2().select2(&quot;val&quot;, 'oneofthevaluehere');&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;위의 솔루션은 저에게 효과적이지 않았지만 Select2 자체 웹 사이트의이 코드는 다음과 같이 작동했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$('select').val('US'); // Select the option with a value of 'US'&lt;font&gt;&lt;/font&gt;
$('select').trigger('change'); // Notify any JS components that the value changed&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;a href=&quot;https://select2.org/programmatic-control/add-select-clear-items#selecting-options&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여기에서 웹 페이지를 찾았습니다.&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것이 저처럼 어려움을 겪고있는 사람에게 도움이되기를 바랍니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대한 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;4.x의&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 버전&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$('#select2Id').val(__INDEX__).trigger('change');
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;INDEX로&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 값을 선택하려면&lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$('#select2Id').val('').trigger('change');
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아무것도 선택하지 않으려면 (있는 경우 자리 표시 자 표시) &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;미래에서 왔습니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;ajax 소스 기본값을 찾고 계십니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;// Set up the Select2 control&lt;font&gt;&lt;/font&gt;
$('#mySelect2').select2({&lt;font&gt;&lt;/font&gt;
    ajax: {&lt;font&gt;&lt;/font&gt;
        url: '/api/students'&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
});&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Fetch the preselected item, and add to the control&lt;font&gt;&lt;/font&gt;
var studentSelect = $('#mySelect2');&lt;font&gt;&lt;/font&gt;
$.ajax({&lt;font&gt;&lt;/font&gt;
    type: 'GET',&lt;font&gt;&lt;/font&gt;
    url: '/api/students/s/' + studentId&lt;font&gt;&lt;/font&gt;
}).then(function (data) {&lt;font&gt;&lt;/font&gt;
    // create the option and append to Select2&lt;font&gt;&lt;/font&gt;
    var option = new Option(data.full_name, data.id, true, true);&lt;font&gt;&lt;/font&gt;
    studentSelect.append(option).trigger('change');&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    // manually trigger the `select2:select` event&lt;font&gt;&lt;/font&gt;
    studentSelect.trigger({&lt;font&gt;&lt;/font&gt;
        type: 'select2:select',&lt;font&gt;&lt;/font&gt;
        params: {&lt;font&gt;&lt;/font&gt;
            data: data&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    });&lt;font&gt;&lt;/font&gt;
});&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;천만에요.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;Reference: &lt;a href=&quot;https://select2.org/programmatic-control/add-select-clear-items#preselecting-options-in-an-remotely-sourced-ajax-select2&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://select2.org/programmatic-control/add-select-clear-items#preselecting-options-in-an-remotely-sourced-ajax-select2&lt;/a&gt; &lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Don't know others issue, Only this code worked for me.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$('select').val('').select2();
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;For ajax select2 multiple select dropdown i did like this;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;  //preset element values&lt;font&gt;&lt;/font&gt;
  //topics is an array of format [{&quot;id&quot;:&quot;&quot;,&quot;text&quot;:&quot;&quot;}, .....]&lt;font&gt;&lt;/font&gt;
        $(id).val(topics);&lt;font&gt;&lt;/font&gt;
          setTimeout(function(){&lt;font&gt;&lt;/font&gt;
           ajaxTopicDropdown(id,&lt;font&gt;&lt;/font&gt;
                2,location.origin+&quot;/api for gettings topics/&quot;,&lt;font&gt;&lt;/font&gt;
                &quot;Pick a topic&quot;, true, 5);                      &lt;font&gt;&lt;/font&gt;
            },1);&lt;font&gt;&lt;/font&gt;
        // ajaxtopicDropdown is dry fucntion to get topics for diffrent element and url&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;pre&gt;&lt;code&gt;    $('select').select2(&quot;val&quot;,null);
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;If you are using an array data source you can do something like below -&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$(&quot;.select&quot;).select2({&lt;font&gt;&lt;/font&gt;
    data: data_names&lt;font&gt;&lt;/font&gt;
});&lt;font&gt;&lt;/font&gt;
data_names.forEach(function(name) {&lt;font&gt;&lt;/font&gt;
    if (name.selected) {&lt;font&gt;&lt;/font&gt;
        $(&quot;.select&quot;).select2('val', name.id);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
});&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;This assumes that out of your data set the one item which you want to set as default has an additional attribute called selected and we use that to set the value.&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/16969666/jquery-select2-set-default-value-from-an-option-in-list&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/16969666/jquery-select2-set-default-value-from-an-option-in-list&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2693</guid>
      <comments>https://nicepro.tistory.com/2693#entry2693comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:57:10 +0900</pubDate>
    </item>
    <item>
      <title>iOS7의 UITextView는 텍스트 문자열의 마지막 줄을 자릅니다.</title>
      <link>https://nicepro.tistory.com/2692</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;iOS7의 UITextView는 텍스트 문자열의 마지막 줄을 자릅니다.&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;iOS7의 UITextView는 정말 이상했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;UITextView의 마지막 줄을 입력하고 입력 할 때 스크롤보기가 예상대로 아래쪽으로 스크롤되지 않고 텍스트가 &quot;잘립니다&quot;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;clipsToBound 속성을 NO로 설정하려고 시도했지만 여전히 텍스트를 자릅니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 &quot;setContentOffset : animated&quot;를 호출하고 싶지 않습니다. 왜냐하면 하나는 매우 엉뚱한 솔루션입니다. 둘째, 커서가 텍스트 뷰의 중간 (수직)에 있으면 원하지 않는 스크롤이 발생합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음은 스크린 샷입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/wFJTh.png&quot; alt=&quot;여기에 이미지 설명 입력&quot;&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;어떤 도움이라도 대단히 감사하겠습니다!&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;감사!&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;문제는 iOS 7 때문입니다. 텍스트보기 대리자에 다음 코드를 추가합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;- (void)textViewDidChange:(UITextView *)textView {&lt;font&gt;&lt;/font&gt;
    CGRect line = [textView caretRectForPosition:&lt;font&gt;&lt;/font&gt;
        textView.selectedTextRange.start];&lt;font&gt;&lt;/font&gt;
    CGFloat overflow = line.origin.y + line.size.height&lt;font&gt;&lt;/font&gt;
        - ( textView.contentOffset.y + textView.bounds.size.height&lt;font&gt;&lt;/font&gt;
        - textView.contentInset.bottom - textView.contentInset.top );&lt;font&gt;&lt;/font&gt;
    if ( overflow &amp;gt; 0 ) {&lt;font&gt;&lt;/font&gt;
        // We are at the bottom of the visible text and introduced a line feed, scroll down (iOS 7 does not do it)&lt;font&gt;&lt;/font&gt;
        // Scroll caret to visible area&lt;font&gt;&lt;/font&gt;
        CGPoint offset = textView.contentOffset;&lt;font&gt;&lt;/font&gt;
        offset.y += overflow + 7; // leave 7 pixels margin&lt;font&gt;&lt;/font&gt;
        // Cannot animate with setContentOffset:animated: or caret will not appear&lt;font&gt;&lt;/font&gt;
        [UIView animateWithDuration:.2 animations:^{&lt;font&gt;&lt;/font&gt;
            [textView setContentOffset:offset];&lt;font&gt;&lt;/font&gt;
        }];&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내가 찾은 해결책 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://blog.mugunthkumar.com/coding/radar-15159094-uitextview-nsattributedstring-is-hopelessly-broken-on-ios-7-3/&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여기가&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 당신이 UITextView를 만든 후 한 줄 수정을 추가했다 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;self.textview.layoutManager.allowsNonContiguousLayout = NO;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 한 줄 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;은 iOS7에서 구문 강조 표시를 사용하여 UITextView 기반 코드 편집기를 만드는 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://justabunchoftyping.com/fix-for-ios7-uitextview-issues&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;세 가지 문제를 해결했습니다&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; .&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;편집 할 때 텍스트를 계속 볼 수 있도록 스크롤 (이 게시물의 문제)&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;UITextView가 키보드를 닫은 후 가끔 점프&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;보기를 스크롤하려고 할 때 UITextView 임의 스크롤 점프&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참고로 키보드가 표시되거나 숨겨 질 때 전체 UITextView의 크기를 조정했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;-textViewDidChangeSelection:&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;과 같이 UITextViewDelegate에서 delegate 메소드를 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;구현해보십시오 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;-(void)textViewDidChangeSelection:(UITextView *)textView {&lt;font&gt;&lt;/font&gt;
    [textView scrollRangeToVisible:textView.selectedRange];&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음은 davidisdk가 선택한 답변의 수정 된 버전입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;- (void)textViewDidChange:(UITextView *)textView {&lt;font&gt;&lt;/font&gt;
    NSRange selection = textView.selectedRange;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    if (selection.location + selection.length == [textView.text length]) {&lt;font&gt;&lt;/font&gt;
        CGRect caretRect = [textView caretRectForPosition:textView.selectedTextRange.start];&lt;font&gt;&lt;/font&gt;
        CGFloat overflow = caretRect.origin.y + caretRect.size.height - (textView.contentOffset.y + textView.bounds.size.height - textView.contentInset.bottom - textView.contentInset.top);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (overflow &amp;gt; 0.0f) {&lt;font&gt;&lt;/font&gt;
            CGPoint offset = textView.contentOffset;&lt;font&gt;&lt;/font&gt;
            offset.y += overflow + 7.0f;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            [UIView animateWithDuration:0.2f animations:^{&lt;font&gt;&lt;/font&gt;
                [textView setContentOffset:offset];&lt;font&gt;&lt;/font&gt;
            }];&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    } else {&lt;font&gt;&lt;/font&gt;
        [textView scrollRangeToVisible:selection];&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;textView의 콘텐츠 크기가 경계보다 크고 커서가 화면에서 벗어난 경우 (예 : 키보드 사용 및 화살표 키 누르기) textView가 삽입되는 텍스트에 애니메이션이 적용되지 않는 버그가 발생했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Imho 이것은 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;iOS 7의 모든 일반적인 UITextView 스크롤 / 키보드 관련 문제에 대한 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;확실한 대답&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 입니다. 깔끔하고 읽기 쉽고 사용하기 쉽고 유지 관리가 쉽고 쉽게 재사용 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기본 트릭 : &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;콘텐츠 삽입이 아닌 UITextView의 크기를 변경하기 만하면됩니다!&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음은 실습 예제입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Autolayout을 사용하는 NIB / Storyboard 기반 UIViewController가 있고 UITextView가 UIViewController에서 전체 루트 뷰를 채운다는 것은 당연한 일입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그렇지 않은 경우 필요에 맞게 textViewBottomSpaceConstraint를 변경하는 방법을 조정해야합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;어떻게:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;hr&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음 속성을 추가합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;@property (nonatomic, weak) IBOutlet NSLayoutConstraint *textViewBottomSpaceConstraint;&lt;font&gt;&lt;/font&gt;
@property (nonatomic) CGFloat textViewBottomSpaceConstraintFromNIB;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Interface Builder에서 textViewBottomSpaceConstraint를 연결하십시오 ( &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;잊지 마세요!&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; ).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 viewDidLoad에서 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;// Save the state of the UITextView's bottom constraint as set up in your NIB/Storyboard&lt;font&gt;&lt;/font&gt;
self.textViewBottomSpaceConstraintFromNIB = self.textViewBottomSpaceConstraint.constant;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
[[NSNotificationCenter defaultCenter] addObserver:self&lt;font&gt;&lt;/font&gt;
                                         selector:@selector(keyboardWillShowNotification:)&lt;font&gt;&lt;/font&gt;
                                             name:UIKeyboardWillShowNotification&lt;font&gt;&lt;/font&gt;
                                           object:nil];&lt;font&gt;&lt;/font&gt;
[[NSNotificationCenter defaultCenter] addObserver:self&lt;font&gt;&lt;/font&gt;
                                         selector:@selector(keyboardWillHideNotification:)&lt;font&gt;&lt;/font&gt;
                                             name:UIKeyboardWillHideNotification&lt;font&gt;&lt;/font&gt;
                                           object:nil];&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음 메서드를 추가하여 키보드 크기 조정을 처리합니다 ( &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://github.com/brennanMKE/Interfaces/tree/master/Keyboarding&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://github.com/brennanMKE/Interfaces/tree/master/Keyboarding&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 덕분에 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;-이 메서드는 brennan에서 제공합니다!).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;- (void)keyboardWillShowNotification:(NSNotification *)notification {&lt;font&gt;&lt;/font&gt;
    CGFloat height = [self getKeyboardHeight:notification forBeginning:TRUE];&lt;font&gt;&lt;/font&gt;
    NSTimeInterval duration = [self getDuration:notification];&lt;font&gt;&lt;/font&gt;
    UIViewAnimationOptions curve = [self getAnimationCurve:notification];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    [self keyboardWillShowWithHeight:height duration:duration curve:curve];&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
- (void)keyboardWillHideNotification:(NSNotification *)notification {&lt;font&gt;&lt;/font&gt;
    CGFloat height = [self getKeyboardHeight:notification forBeginning:FALSE];&lt;font&gt;&lt;/font&gt;
    NSTimeInterval duration = [self getDuration:notification];&lt;font&gt;&lt;/font&gt;
    UIViewAnimationOptions curve = [self getAnimationCurve:notification];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    [self keyboardWillHideWithHeight:height duration:duration curve:curve];&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
- (NSTimeInterval)getDuration:(NSNotification *)notification {&lt;font&gt;&lt;/font&gt;
    NSDictionary *info = [notification userInfo];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    NSTimeInterval duration;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    NSValue *durationValue = [info objectForKey:UIKeyboardAnimationDurationUserInfoKey];&lt;font&gt;&lt;/font&gt;
    [durationValue getValue:&amp;amp;duration];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    return duration;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
- (CGFloat)getKeyboardHeight:(NSNotification *)notification forBeginning:(BOOL)forBeginning {&lt;font&gt;&lt;/font&gt;
    NSDictionary *info = [notification userInfo];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    CGFloat keyboardHeight;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    NSValue *boundsValue = nil;&lt;font&gt;&lt;/font&gt;
    if (forBeginning) {&lt;font&gt;&lt;/font&gt;
        boundsValue = [info valueForKey:UIKeyboardFrameBeginUserInfoKey];&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    else {&lt;font&gt;&lt;/font&gt;
        boundsValue = [info valueForKey:UIKeyboardFrameEndUserInfoKey];&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];&lt;font&gt;&lt;/font&gt;
    if (UIDeviceOrientationIsLandscape(orientation)) {&lt;font&gt;&lt;/font&gt;
        keyboardHeight = [boundsValue CGRectValue].size.width;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    else {&lt;font&gt;&lt;/font&gt;
        keyboardHeight = [boundsValue CGRectValue].size.height;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    return keyboardHeight;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
- (UIViewAnimationOptions)getAnimationCurve:(NSNotification *)notification {&lt;font&gt;&lt;/font&gt;
    UIViewAnimationCurve curve = [[notification.userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] integerValue];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    switch (curve) {&lt;font&gt;&lt;/font&gt;
        case UIViewAnimationCurveEaseInOut:&lt;font&gt;&lt;/font&gt;
            return UIViewAnimationOptionCurveEaseInOut;&lt;font&gt;&lt;/font&gt;
            break;&lt;font&gt;&lt;/font&gt;
        case UIViewAnimationCurveEaseIn:&lt;font&gt;&lt;/font&gt;
            return UIViewAnimationOptionCurveEaseIn;&lt;font&gt;&lt;/font&gt;
            break;&lt;font&gt;&lt;/font&gt;
        case UIViewAnimationCurveEaseOut:&lt;font&gt;&lt;/font&gt;
            return UIViewAnimationOptionCurveEaseOut;&lt;font&gt;&lt;/font&gt;
            break;&lt;font&gt;&lt;/font&gt;
        case UIViewAnimationCurveLinear:&lt;font&gt;&lt;/font&gt;
            return UIViewAnimationOptionCurveLinear;&lt;font&gt;&lt;/font&gt;
            break;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    return kNilOptions;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;마지막으로, 키보드 알림에 반응하는 이러한 메서드를 추가하고 UITextView의 크기를 조정합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;- (void)keyboardWillShowWithHeight:(CGFloat)height duration:(CGFloat)duration curve:(UIViewAnimationOptions)curve&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    CGFloat correctionMargin = 15; // you can experiment with this margin so the bottom text view line is not flush against the keyboard which doesn't look nice&lt;font&gt;&lt;/font&gt;
    self.textViewBottomSpaceConstraint.constant = height + correctionMargin;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    [self.view setNeedsUpdateConstraints];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    [UIView animateWithDuration:duration delay:0 options:curve animations:^{&lt;font&gt;&lt;/font&gt;
        [self.view layoutIfNeeded];&lt;font&gt;&lt;/font&gt;
    } completion:^(BOOL finished) {&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    }];&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
- (void)keyboardWillHideWithHeight:(CGFloat)height duration:(CGFloat)duration curve:(UIViewAnimationOptions)curve&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    self.textViewBottomSpaceConstraint.constant = self.textViewBottomSpaceConstraintFromNIB;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    [self.view setNeedsUpdateConstraints];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    [UIView animateWithDuration:duration delay:0 options:curve animations:^{&lt;font&gt;&lt;/font&gt;
        [self.view layoutIfNeeded];&lt;font&gt;&lt;/font&gt;
    } completion:^(BOOL finished) {&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    }];&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또한 이러한 메서드를 추가하여 사용자가 클릭 한 위치로 자동으로 스크롤합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;- (void)textViewDidBeginEditing:(UITextView *)textView&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    [textView scrollRangeToVisible:textView.selectedRange];&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
- (void)textViewDidChangeSelection:(UITextView *)textView&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    [textView scrollRangeToVisible:textView.selectedRange];&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;pre&gt;&lt;code&gt;textView.contentInset = UIEdgeInsetsMake(0.0, 0.0, 10.0, 0.0);
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 또한 당신의 문제를 해결할 것입니다&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;StoryBoard를 사용하는 경우 AutoLayout을 켜고 (기본적으로) UITextView에 대한 상단 / 하단 제약 조건을 설정하지 않은 경우에도이 동작이 발생할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;파일 검사기를 확인하여 AutoLayout 상태를 확인하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음은 davididsk의 가장 우수한 솔루션의 MonoTouch 버전입니다 (위에서).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;TextView.SelectionChanged += (object sender, EventArgs e) =&amp;gt; {&lt;font&gt;&lt;/font&gt;
                TextView.ScrollRangeToVisible(TextView.SelectedRange);&lt;font&gt;&lt;/font&gt;
            };&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            TextView.Changed += (object sender, EventArgs e) =&amp;gt; {&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
                CGRect line = TextView.GetCaretRectForPosition(TextView.SelectedTextRange.Start);&lt;font&gt;&lt;/font&gt;
                nfloat overflow = line.Y + line.Height - &lt;font&gt;&lt;/font&gt;
                                     (TextView.ContentOffset.Y + &lt;font&gt;&lt;/font&gt;
                                      TextView.Bounds.Height -          &lt;font&gt;&lt;/font&gt;
                                      TextView.ContentInset.Bottom -&lt;font&gt;&lt;/font&gt;
                                      TextView.ContentInset.Top );&lt;font&gt;&lt;/font&gt;
                if ( overflow &amp;gt; 0 ) &lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    // We are at the bottom of the visible text and introduced &lt;font&gt;&lt;/font&gt;
                    // a line feed, scroll down (iOS 7 does not do it)&lt;font&gt;&lt;/font&gt;
                    // Scroll caret to visible area&lt;font&gt;&lt;/font&gt;
                    CGPoint offset = TextView.ContentOffset;&lt;font&gt;&lt;/font&gt;
                    offset.Y+= overflow + 7; // leave 7 pixels margin&lt;font&gt;&lt;/font&gt;
                    // Cannot animate with setContentOffset:animated: &lt;font&gt;&lt;/font&gt;
                    // or caret will not appear&lt;font&gt;&lt;/font&gt;
                    UIView.Animate(0.1,()=&amp;gt; {&lt;font&gt;&lt;/font&gt;
                        TextView.ContentOffset = offset;&lt;font&gt;&lt;/font&gt;
                    });&lt;font&gt;&lt;/font&gt;
                }&lt;font&gt;&lt;/font&gt;
            };&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 줄은 마지막 텍스트 줄이 표시되지 않도록합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;textView.scrollEnabled = false
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것을 제거하고 무슨 일이 일어나는지보십시오 ...&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;pre&gt;&lt;code&gt;   textView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 나를 위해 문제를 해결했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.m에서 theViewDelegate를 &quot;self&quot;로 설정하고 .h에서 사용한 다음이 코드를 .m에 추가하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;텍스트가있는 다음 줄로 이동 (래핑 또는 캐리지 리턴) 및 타이핑하기 위해 발생하는이 결함의 버전을 모두 처리합니다. 그리고 캐리지 리턴 만 있고 타이핑없이 다음 줄로 이동합니다 (다른 코드와 달리이 코드는 이 두 번째 글리치 시나리오에서 잘리지 않는 깜박이는 커서를 표시하기 위해 스크롤됩니다.)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;//!!!*!!****!*!**!*!*!!!MAKE SURE YOU SET DELEGATE AND USE THE &amp;lt;UITEXTVIEWDELEGATE&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
-(void)textViewDidChange:(UITextView *)textView {&lt;font&gt;&lt;/font&gt;
    [theTextView scrollRangeToVisible:[textView selectedRange]];//resizing textView frame causes text itself &quot;content frame?&quot; to still go below the textview frame and get clipped... auto-scrolling must be implimented. (iOS7 bug)&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
-(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {&lt;font&gt;&lt;/font&gt;
    if (([text isEqualToString:@&quot;\n&quot;]) &amp;amp;&amp;amp; (range.location == textView.text.length)) {//&quot;return&quot; at end of textView&lt;font&gt;&lt;/font&gt;
        [textView scrollRectToVisible:CGRectMake(5,5,5,999999999999999999) animated:NO];//for some reason the textViewDidChange auto scrolling doesnt work with a carriage return at the end of your textView... so I manually set it INSANELY low (NOT ANIMATED) here so that it automagically bounces back to the proper position before interface refreshes when textViewDidChange is called after this.&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    return YES;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/18966675/uitextview-in-ios7-clips-the-last-line-of-text-string&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/18966675/uitextview-in-ios7-clips-the-last-line-of-text-string&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2692</guid>
      <comments>https://nicepro.tistory.com/2692#entry2692comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:57:01 +0900</pubDate>
    </item>
    <item>
      <title>IE 브라우저의 텍스트 필드에서 Selenium WebDriver 입력이 매우 느림</title>
      <link>https://nicepro.tistory.com/2691</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;IE 브라우저의 텍스트 필드에서 Selenium WebDriver 입력이 매우 느림&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;스크립트가 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음을 사용하여 텍스트 필드에 입력 할 때 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;IE 11&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;브라우저에서 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;스크립트 중 하나를 실행 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Selenium 2.43.1&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하고 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;element.sendKeys(&quot;string&quot;);
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;IE 브라우저에서 문자열의 한 문자가 텍스트 필드에 입력되고 다음 문자를 입력하기 전에 1-2 초 동안 대기하는 것을 볼 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;한 문자를 입력하는 데 1-2 초가 걸립니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;IE에서 타이핑이 느린 이유는 무엇입니까?&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;타이핑 속도를 높일 수있는 다른 방법이 있습니까?&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ol&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내 문제는 드라이버 아키텍처에 관한 것이었고 32 비트를 다운로드하고 사용하여 해결했습니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여기서 32 비트로 전환하려면해야 할 일이 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;a href=&quot;http://selenium-release.storage.googleapis.com/index.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://selenium-release.storage.googleapis.com/index.html&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 에서 32 비트 드라이버 서비스를 다운로드합니다 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://selenium-release.storage.googleapis.com/index.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/a&gt; &lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;32 비트 드라이버 서비스에 대한 경로가있는 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;InterExplorerWeDriver&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;클래스를 사용하여 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;InternetExplorerDriverService&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;클래스를 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;인스턴스화하십시오 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;code&gt;InternetExplorerDriver ieDiver = new InternetExplorerDriver(“Path to the 32 bit Explorer driver”);&lt;/code&gt;&lt;/p&gt;&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또는&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 빌더를 사용하는 경우 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;System.setProperty(“webdriver.ie.driver”,“C:\\drivers\\IEDriverServer.exe”);&lt;font&gt;&lt;/font&gt;
DesiredCapabilities ieCapabilities=DesiredCapabilities.internetExplorer();&lt;font&gt;&lt;/font&gt;
ieCapabilities.setCapability(InternetExplorerDriver&lt;font&gt;&lt;/font&gt;
 .INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);&lt;font&gt;&lt;/font&gt;
ieCapabilities.setCapability(&quot;requireWindowFocus&quot;, true);&lt;font&gt;&lt;/font&gt;
File ie_temp=newFile(“C:\\Selenium\\IEDrivertemp”);&lt;font&gt;&lt;/font&gt;
InternetExplorerDriverService.Builder &lt;font&gt;&lt;/font&gt;
ies=newInternetExplorerDriverService.Builder();&lt;font&gt;&lt;/font&gt;
ies.withExtractPath(ie_temp);&lt;font&gt;&lt;/font&gt;
InternetExplorerDriverService service=ies.build();&lt;font&gt;&lt;/font&gt;
WebDriver driver=newInternetExplorerDriver(service,ieCapabilities))&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해결하는 데 도움이 된 스레드&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;http://forumsqa.com/question/typing-too-slow-in-text-fields-while-replaying-tests/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://forumsqa.com/question/typing-too-slow-in-text-fields-while-replaying-tests/&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나에게는 64 비트 버전의 IEDriverServer와 함께 작동했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;true&quot;값으로 requireWindowFocus 속성을 추가했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();&lt;font&gt;&lt;/font&gt;
capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);&lt;font&gt;&lt;/font&gt;
...&lt;font&gt;&lt;/font&gt;
capabilities.setCapability(&quot;requireWindowFocus&quot;, true);&lt;font&gt;&lt;/font&gt;
WebDriver driver = new InternetExplorerDriver(capabilities);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Selenium / IE Driver 2.47 버전을 사용하고 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;64 비트 WebDriver의 경우 :&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;IE 열기&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;인터넷 옵션 → 고급 → 보안으로 이동하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;선택 ☑ 향상된 보호 모드에 대해 64 비트 프로세스 사용&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;적용 및 확인을 클릭하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;32 비트 WebDriver의 경우 :&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;IE 열기&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;인터넷 옵션 → 고급 → 보안으로 이동하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;선택 취소 ☐ 향상된 보호 모드에 대해 64 비트 프로세스 활성화&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;적용 및 확인을 클릭하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이상하게 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;강화 된 보호 모드의 활성화 여부에 관계없이 설정이 필요했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대화 상자에 표시된 텍스트 외에는 컴퓨터를 다시 시작할 필요가 없습니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내 설정 : Windows 10, IE 11, 모든 64 비트, Selenium 3.4&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 나를 위해 조금 빨라졌습니다. &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;IEDriverServer 2.53.1&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;InternetExplorerOptions options = new InternetExplorerOptions();&lt;font&gt;&lt;/font&gt;
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;&lt;font&gt;&lt;/font&gt;
options.RequireWindowFocus = true;&lt;font&gt;&lt;/font&gt;
driver = new InternetExplorerDriver(options);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;32 비트 버전으로 변경할 수 있지만 64 비트가 필요한 경우이 솔루션을 시도 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;인터넷 옵션-&amp;gt; 보안-&amp;gt; 모든 영역에 대해 &quot;보호 모드 사용&quot;을 선택하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;고급-&amp;gt; 보안-&amp;gt; &quot;향상된 보호 모드 활성화&quot;를 선택하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이로 인해 64 비트 IE에서 더 이상 달팽이 입력이 발생하지 않습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;64 비트 버전의 IEDriverServer를 사용할 때도 같은 문제가 발생했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;32 비트로 변경하면 정상적으로 작동합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;출처 : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/14461827/webdriver-and-ie10-very-slow-input&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;WebDriver 및 IE10 매우 느린 입력&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 또한 같은 문제를 겪었습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;시도해 볼 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;인터넷 옵션-&amp;gt; 연결-&amp;gt; LAN 설정-&amp;gt; 선택 해제 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;자동으로 설정 감지&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; .&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;도움이 되었기를 바랍니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;For tests running on IE11 64bit, setting the &lt;code&gt;NATIVE_EVENTS&lt;/code&gt; capability to &lt;code&gt;false&lt;/code&gt; worked for me. Without it, using the 64bit driver server 3.0 was extremely slow as reported. The 32bit 3.0 driver server swallowed some of the chars it was supposed to send (e.g. &quot;FluentLenium&quot; became &quot;FlntLnum&quot;).&lt;/p&gt; 
&lt;p&gt;The following resolved both problems.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();&lt;font&gt;&lt;/font&gt;
capabilities.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);&lt;font&gt;&lt;/font&gt;
WebDriver driver = new InternetExplorerDriver(capabilities);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;I am not sure whether this has additional side effects.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I also faced the same issue with IE11 on Windows x64 bit. I was using 64bit version of IEDriverServer.exe (IE driver-3.7.0 with selenium-3.7.0). &lt;/p&gt; 
&lt;p&gt;After I changed to 32bit version of IEDriverServer.exe, it solved the issue &lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;This probably is an issue with the machine you are running the test on. If you experience general lag with the computer, then this will happen.&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Is there an alternate way to speed up typing?&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;Sure, you can create a custom method to clear the text, then use JavaScript to fill the field. (mind you that doing this, might not be able to work with things like &quot;typeahead&quot; and &quot;suggestions as you type&quot;)&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I struggled almost a day for finding out. This is because the 64 bit IE Driver sever (&lt;code&gt;IEDriverServer_x64_2.53.1&lt;/code&gt;). &lt;/p&gt; 
&lt;p&gt;I switched to &lt;code&gt;IEDriverServer_Win32_2.53.1&lt;/code&gt; then it worked, it is superfast now!&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Disable NATIVE_EVENT resolved my issue&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();&lt;font&gt;&lt;/font&gt;
 capabilities.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);&lt;font&gt;&lt;/font&gt;
 driver = new InternetExplorerDriver(capabilities);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;You can change to 32 bit version,it will be speed compare to 64 bit.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Instead of WebEelement.send.keys, I used Actions object with sendKeys method. This worked like a charm.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;to improve the speed for send Keys function, one can perform below steps:-&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;go to project--&amp;gt;properties-&amp;gt;Java compiler--&amp;gt;under the java compliance --deselect the use compliance option and change the compile compliance level to 1.7 and then click to apply.&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;It will work smoothly.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;For &lt;b&gt;IEServerDriver 3.14.0&lt;/b&gt; this works for speeding up typing a bit.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;WebDriver browser;&lt;font&gt;&lt;/font&gt;
InternetExplorerOptions options = new InternetExplorerOptions();&lt;font&gt;&lt;/font&gt;
    options.disableNativeEvents();&lt;font&gt;&lt;/font&gt;
    options.requireWindowFocus();&lt;font&gt;&lt;/font&gt;
browser = new InternetExplorerDriver(options);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;DesiredCapabilities method is deprecated and &lt;code&gt;options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;&lt;/code&gt; and &lt;code&gt;options.RequireWindowFocus = true;&lt;/code&gt; are no longer available.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;The below code helped me with resolving the issue.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();&lt;font&gt;&lt;/font&gt;
capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);&lt;font&gt;&lt;/font&gt;
...&lt;font&gt;&lt;/font&gt;
capabilities.setCapability(&quot;requireWindowFocus&quot;, true);&lt;font&gt;&lt;/font&gt;
WebDriver driver = new InternetExplorerDriver(capabilities);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/27985300/selenium-webdriver-typing-very-slow-in-text-field-on-ie-browser&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/27985300/selenium-webdriver-typing-very-slow-in-text-field-on-ie-browser&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2691</guid>
      <comments>https://nicepro.tistory.com/2691#entry2691comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:56:48 +0900</pubDate>
    </item>
    <item>
      <title>'Microsoft.Build.Tasks.v14.0.dll'을 찾을 수 없기 때문에 Visual Studio 2015에서 빌드 할 수 없습니다.</title>
      <link>https://nicepro.tistory.com/2690</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;'Microsoft.Build.Tasks.v14.0.dll'을 찾을 수 없기 때문에 Visual Studio 2015에서 빌드 할 수 없습니다.&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio 2015에서 빌드하려고 할 때 다음 파일이 누락 되었습니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 프로젝트는 이전에 VS2013에서 빌드되었습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;심각도 코드 설명 프로젝트 파일 줄 오류 &quot;C : \ Program Files (x86) \ MSBuild \ 14.0 \ bin \ Microsoft.Build.Tasks.v14.0.dll&quot;어셈블리에서 작업 팩토리 &quot;CodeTaskFactory&quot;를로드 할 수 없습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;파일 또는 어셈블리 'file : /// C : \ Program Files (x86) \ MSBuild \ 14.0 \ bin \ Microsoft.Build.Tasks.v14.0.dll'또는 해당 종속성 중 하나를로드 할 수 없습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;시스템이 지정된 파일을 찾을 수 없습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;/blockquote&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;어셈블리의 이름이 변경되었습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;CodeTaskFactory MSBuild 작업에서 AssemblyFile 매개 변수를 ...로 변경합니다 (오류에이 작업이있는 대상 파일 이름이 있어야 함).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;AssemblyFile=&quot;C:\Program Files (x86)\MSBuild\14.0\Bin\Microsoft.Build.Tasks.Core.dll&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;누군가가 영리하고 이와 같은 MSBuild 속성을 사용하려고 시도했을 가능성이 있습니다. (MSBuild 14에서는 작동하지 않지만 12에서는 작동합니다) ...&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;AssemblyFile=&quot;$(MSBuildToolsPath)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그냥 참고로 ... &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Microsoft.Build.Utilities.v12.0.dll&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;로 이름이 변경된 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;것과 같은 다른 것들이 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;code&gt;Microsoft.Build.Utilities.Core.dll&lt;/code&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio 2017에서 저에게 도움이 된 것은 Microsoft.Build.Tasks.Core.dll을 복사하고 이름을 Microsoft.Build.Tasks.v15.0.dll로 변경하는 것입니다. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://i.stack.imgur.com/1ynlI.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1ynlI.png&quot; alt=&quot;build.tasks.v15.0.dll&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;제 경우에는 SFML.NET nuget 패키지의 문제였습니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;빌드가 실패한 이유는 오래된 Nuget Baseclass.Contrib.Nuget.Output 구성 요소에 의존했습니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.Net 4.6으로 수동으로 업데이트 한 후 프로젝트 파일에서 모든 nuget staff를 삭제하고 프로젝트에서 파일을 삭제하고 Baseclass.Contrib.Nuget.Output의 모든 종속성을 다시 읽었습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio를 처음 다시 시작하면 나를 위해 일했습니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;두 번째로이 오류가 다시 발생하고 업데이트했습니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;Install-Package Baseclass.Contrib.Nuget.Output -Version 2.2.0-xbuild02 &lt;/code&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio를 다시 시작하는 것으로 충분했습니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이전에 다른 작업을 수행하는 모든 MSBuild.exe 프로세스를 종료했으며 MSBuild.exe 프로세스가 없으면 오류가 발생한다고 생각합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Gary의 답변에 따라 다음과 같이 매개 변수화했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;Choose&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;When Condition=&quot;'$(MSBuildToolsVersion)'=='14.0'&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;PropertyGroup&amp;gt;&lt;font&gt;&lt;/font&gt;
      &amp;lt;TasksAssemblyName&amp;gt;Microsoft.Build.Tasks.Core&amp;lt;/TasksAssemblyName&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/PropertyGroup&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;/When&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;Otherwise&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;PropertyGroup&amp;gt;&lt;font&gt;&lt;/font&gt;
      &amp;lt;TasksAssemblyName&amp;gt;Microsoft.Build.Tasks.v$(MSBuildToolsVersion)&amp;lt;/TasksAssemblyName&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/PropertyGroup&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;/Otherwise&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/Choose&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;UsingTask TaskName=&quot;SecondsSinceEpoch&quot; TaskFactory=&quot;CodeTaskFactory&quot; AssemblyFile=&quot;$(MSBuildToolsPath)\$(TasksAssemblyName).dll&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내 솔루션 : &quot;* .csproj&quot;파일에서 두 행 제거 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;Error Condition=&quot;!Exists('$(SolutionDir)\.nuget\NuGet.targets')&quot; Text=&quot;$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;Import Project=&quot;$(SolutionDir)\.nuget\NuGet.targets&quot; Condition=&quot;Exists('$(SolutionDir)\.nuget\NuGet.targets')&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;제 경우에는 루트에서 &quot;ls.pubignore.wpp.targets&quot;파일을 제거했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그리고 그것은 오류를 제거했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;:)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내 경우에는 VS2015에서 NuGet 패키지 관리자의 일부 패키지를 업데이트 한 다음 vs2015가 설치되지 않은 다른 컴퓨터에서 vs2013에서 동일한 솔루션을 열려고했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Microsoft Build Tools 2015를 설치하면 오류가 해결되었습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러면 GAC에 Microsoft.Build.Utilities.Core.dll이 추가되어 작동하게됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://www.microsoft.com/en-in/download/details.aspx?id=48159&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://www.microsoft.com/en-in/download/details.aspx?id=48159&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio 2017의 경우 이것이 저에게 효과적이며 제공된 두 가지 솔루션이 혼합되어 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;둘 다 자체적으로 작동하지 않았으므로 이것이 새로운 답변으로 제출하는 이유입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;파일에서 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\CodeAnalysis\Microsoft.CodeAnalysis.Targets&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;교체 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;AssemblyFile=&quot;$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll&quot;&amp;gt;&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;로&lt;/font&gt;&lt;/font&gt;&lt;code&gt;AssemblyFile=&quot;$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll&quot;&amp;gt;&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Build.Tasks.Core.dll&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;동일한 폴더에 이름을 가진 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;파일을 복사하십시오.&lt;/font&gt;&lt;/font&gt;&lt;code&gt;Microsoft.Build.Tasks.v15.0.dll&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/31722877/cant-build-in-visual-studio-2015-because-microsoft-build-tasks-v14-0-dll-cann&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/31722877/cant-build-in-visual-studio-2015-because-microsoft-build-tasks-v14-0-dll-cann&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2690</guid>
      <comments>https://nicepro.tistory.com/2690#entry2690comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:56:38 +0900</pubDate>
    </item>
    <item>
      <title>클래스의 모든 인스턴스 인쇄</title>
      <link>https://nicepro.tistory.com/2689</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;클래스의 모든 인스턴스 인쇄&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Python의 클래스를 사용하여 함수에 정의 된 형식으로 클래스의 모든 단일 인스턴스를 인쇄하는 함수를 어떻게 정의합니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 경우 두 가지 옵션이 표시됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가비지 수집기&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt; 
&lt;pre&gt;&lt;code&gt;import gc&lt;font&gt;&lt;/font&gt;
for obj in gc.get_objects():&lt;font&gt;&lt;/font&gt;
    if isinstance(obj, some_class):&lt;font&gt;&lt;/font&gt;
        dome_something(obj)&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 많은 오브젝트가있을 때 매우 느리다는 단점이 있지만 제어 할 수없는 유형에서 작동합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;mixin 및 weakrefs 사용&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt; 
&lt;pre&gt;&lt;code&gt;from collections import defaultdict&lt;font&gt;&lt;/font&gt;
import weakref&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
class KeepRefs(object):&lt;font&gt;&lt;/font&gt;
    __refs__ = defaultdict(list)&lt;font&gt;&lt;/font&gt;
    def __init__(self):&lt;font&gt;&lt;/font&gt;
        self.__refs__[self.__class__].append(weakref.ref(self))&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    @classmethod&lt;font&gt;&lt;/font&gt;
    def get_instances(cls):&lt;font&gt;&lt;/font&gt;
        for inst_ref in cls.__refs__[cls]:&lt;font&gt;&lt;/font&gt;
            inst = inst_ref()&lt;font&gt;&lt;/font&gt;
            if inst is not None:&lt;font&gt;&lt;/font&gt;
                yield inst&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
class X(KeepRefs):&lt;font&gt;&lt;/font&gt;
    def __init__(self, name):&lt;font&gt;&lt;/font&gt;
        super(X, self).__init__()&lt;font&gt;&lt;/font&gt;
        self.name = name&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
x = X(&quot;x&quot;)&lt;font&gt;&lt;/font&gt;
y = X(&quot;y&quot;)&lt;font&gt;&lt;/font&gt;
for r in X.get_instances():&lt;font&gt;&lt;/font&gt;
    print r.name&lt;font&gt;&lt;/font&gt;
del y&lt;font&gt;&lt;/font&gt;
for r in X.get_instances():&lt;font&gt;&lt;/font&gt;
    print r.name&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 경우 모든 참조는 목록에 약한 참조로 저장됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;많은 인스턴스를 자주 생성하고 삭제하는 경우 반복 후 weakref 목록을 정리해야합니다. 그렇지 않으면 많은 엉망이 될 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 경우 또 다른 문제는 기본 클래스 생성자를 호출해야한다는 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;을 재정의 할 수도 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;__new__&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;있지만 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;__new__&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;인스턴스화에는 첫 번째 기본 클래스 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;의 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;메서드 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;만 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 또한 사용자가 제어하는 ​​유형에서만 작동합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;편집&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; : 특정 형식에 따라 모든 인스턴스를 인쇄하는 방법은 연습으로 남겨져 있지만 기본적으로 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;for&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;루프 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;의 변형 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;일뿐입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;클래스에 정적 목록을 만들고 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;weakref&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가비지 수집기가 더 이상 필요하지 않을 때 인스턴스를 정리할 수 있도록 각 인스턴스에를 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;추가 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;import weakref&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
class A:&lt;font&gt;&lt;/font&gt;
    instances = []&lt;font&gt;&lt;/font&gt;
    def __init__(self, name=None):&lt;font&gt;&lt;/font&gt;
        self.__class__.instances.append(weakref.proxy(self))&lt;font&gt;&lt;/font&gt;
        self.name = name&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
a1 = A('a1')&lt;font&gt;&lt;/font&gt;
a2 = A('a2')&lt;font&gt;&lt;/font&gt;
a3 = A('a3')&lt;font&gt;&lt;/font&gt;
a4 = A('a4')&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
for instance in A.instances:&lt;font&gt;&lt;/font&gt;
    print(instance.name)&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Very nice and useful code, but it has a big problem: &lt;strong&gt;list is always bigger&lt;/strong&gt; and it is never cleaned-up, to test it just add &lt;code&gt;print(len(cls.__refs__[cls]))&lt;/code&gt; at the end of the &lt;code&gt;get_instances&lt;/code&gt; method.&lt;/p&gt; 
&lt;p&gt;Here a fix for the &lt;code&gt;get_instances&lt;/code&gt; method:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;__refs__ = defaultdict(list)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
@classmethod&lt;font&gt;&lt;/font&gt;
def get_instances(cls):&lt;font&gt;&lt;/font&gt;
    refs = []&lt;font&gt;&lt;/font&gt;
    for ref in cls.__refs__[cls]:&lt;font&gt;&lt;/font&gt;
        instance = ref()&lt;font&gt;&lt;/font&gt;
        if instance is not None:&lt;font&gt;&lt;/font&gt;
            refs.append(ref)&lt;font&gt;&lt;/font&gt;
            yield instance&lt;font&gt;&lt;/font&gt;
    # print(len(refs))&lt;font&gt;&lt;/font&gt;
    cls.__refs__[cls] = refs&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;or alternatively it could be done using WeakSet:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;from weakref import WeakSet&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
__refs__ = defaultdict(WeakSet)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
@classmethod&lt;font&gt;&lt;/font&gt;
def get_instances(cls):&lt;font&gt;&lt;/font&gt;
    return cls.__refs__[cls]&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Same as almost all other OO languages, keep all instances of the class in a collection of some kind.&lt;/p&gt; 
&lt;p&gt;You can try this kind of thing.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;class MyClassFactory( object ):&lt;font&gt;&lt;/font&gt;
    theWholeList= []&lt;font&gt;&lt;/font&gt;
    def __call__( self, *args, **kw ):&lt;font&gt;&lt;/font&gt;
         x= MyClass( *args, **kw )&lt;font&gt;&lt;/font&gt;
         self.theWholeList.append( x )&lt;font&gt;&lt;/font&gt;
         return x&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Now you can do this.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;object= MyClassFactory( args, ... )&lt;font&gt;&lt;/font&gt;
print MyClassFactory.theWholeList&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Python doesn't have an equivalent to Smallktalk's #allInstances as the architecture doesn't have this type of central object table (although modern smalltalks don't really work like that either).&lt;/p&gt; 
&lt;p&gt;As the other poster says, you have to explicitly manage a collection. His suggestion of a factory method that maintains a registry is a perfectly reasonable way to do it. You may wish to do something with &lt;a href=&quot;http://www.python.org/doc/2.5.2/lib/module-weakref.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;weak references&lt;/a&gt; so you don't have to explicitly keep track of object disposal.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;It's not clear if you need to print all class instances at once or when they're initialized, nor if you're talking about a class you have control over vs a class in a 3rd party library.&lt;/p&gt; 
&lt;p&gt;In any case, I would solve this by writing a class factory using Python metaclass support. If you don't have control over the class, manually update the &lt;code&gt;__metaclass__&lt;/code&gt; for the class or module you're tracking.&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;http://www.onlamp.com/pub/a/python/2003/04/17/metaclasses.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.onlamp.com/pub/a/python/2003/04/17/metaclasses.html&lt;/a&gt; for more information.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;You don't need to import ANYTHING! Just use &quot;self&quot;. Here's how you do this&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;class A:&lt;font&gt;&lt;/font&gt;
    instances = []&lt;font&gt;&lt;/font&gt;
    def __init__(self):&lt;font&gt;&lt;/font&gt;
        self.__class__.instances.append(self)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    @classmethod&lt;font&gt;&lt;/font&gt;
    def printInstances(cls):&lt;font&gt;&lt;/font&gt;
        for instance in cls.instances:&lt;font&gt;&lt;/font&gt;
            print(instance)&lt;font&gt;&lt;/font&gt;
A.printInstances()&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;It's this simple. No modules or libraries imported&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/328851/printing-all-instances-of-a-class&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/328851/printing-all-instances-of-a-class&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2689</guid>
      <comments>https://nicepro.tistory.com/2689#entry2689comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:56:30 +0900</pubDate>
    </item>
    <item>
      <title>XSL &amp;quot;포함&amp;quot;지시문이 있습니까?</title>
      <link>https://nicepro.tistory.com/2688</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;XSL &quot;포함&quot;지시문이 있습니까?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같은 XSL 스 니펫이 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;  &amp;lt;xsl:for-each select=&quot;item&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;xsl:variable name=&quot;hhref&quot; select=&quot;link&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;xsl:variable name=&quot;pdate&quot; select=&quot;pubDate&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;xsl:if test=&quot;hhref not contains '1234'&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
      &amp;lt;li&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;a href=&quot;{$hhref}&quot; title=&quot;{$pdate}&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
          &amp;lt;xsl:value-of select=&quot;title&quot;/&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/a&amp;gt;&lt;font&gt;&lt;/font&gt;
      &amp;lt;/li&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/xsl:if&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;/xsl:for-each&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;contains 구문을 해결할 수 없었기 때문에 if 문이 작동하지 않습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;xsl : if를 올바르게 표현하려면 어떻게해야합니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;물론입니다! &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예를 들면 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;xsl:if test=&quot;not(contains($hhref, '1234'))&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;li&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;a href=&quot;{$hhref}&quot; title=&quot;{$pdate}&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
      &amp;lt;xsl:value-of select=&quot;title&quot;/&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/a&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;/li&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/xsl:if&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;구문은 다음과 같습니다. &lt;/font&gt;&lt;/font&gt;&lt;code&gt;contains(stringToSearchWithin, stringToSearchFor)&lt;/code&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;표준 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.w3.org/TR/xpath&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;XPath&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 함수 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.w3.org/TR/xpath#function-contains&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;contains ()를&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 사용하십시오 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기능&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; : &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;부울 &lt;/font&gt;&lt;/font&gt;&lt;/em&gt; &lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;포함&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; (문자열, 문자열)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;는 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.w3.org/TR/xpath#function-contains&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;포함&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 첫 번째 인수 문자열이 두 번째 인수 문자열을 포함하는 경우는 true 함수가 리턴을하고, 그렇지 않은 경우는 false&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;실제로 xpath에는 다음과 같은 기능이 포함되어 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;xsl:for-each select=&quot;item&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;xsl:variable name=&quot;hhref&quot; select=&quot;link&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;xsl:variable name=&quot;pdate&quot; select=&quot;pubDate&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;xsl:if test=&quot;not(contains(hhref,'1234'))&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;li&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;a href=&quot;{$hhref}&quot; title=&quot;{$pdate}&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
      &amp;lt;xsl:value-of select=&quot;title&quot;/&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/a&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;/li&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/xsl:if&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;에서 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://zvon.org/xxl/XSLTreference/Output/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Zvon.org XSLT 참조&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;XPath function: boolean contains (string, string) 
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;도움이 되었기를 바랍니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;xsl:if test=&quot;not contains(hhref,'1234')&quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같아야합니다 ...&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;xsl:if test=&quot;contains($hhref, '1234')&quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;(검증되지 않은)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;See &lt;a href=&quot;http://www.w3schools.com/xpath/xpath_functions.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;w3schools&lt;/a&gt; (always a good reference BTW)&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/569908/is-there-an-xsl-contains-directive&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/569908/is-there-an-xsl-contains-directive&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2688</guid>
      <comments>https://nicepro.tistory.com/2688#entry2688comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:56:20 +0900</pubDate>
    </item>
    <item>
      <title>일반 배열을 포함하는 객체의 GetHashCode 재정의</title>
      <link>https://nicepro.tistory.com/2687</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;일반 배열을 포함하는 객체의 GetHashCode 재정의&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음 두 가지 속성을 포함하는 클래스가 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public int Id      { get; private set; }&lt;font&gt;&lt;/font&gt;
public T[] Values  { get; private set; }&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 그것을 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;IEquatable&amp;lt;T&amp;gt;&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;만들고 다음 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;object.Equals&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;과 같이 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;재정의 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public override bool Equals(object obj)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    return Equals(obj as SimpleTableRow&amp;lt;T&amp;gt;);&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
public bool Equals(SimpleTableRow&amp;lt;T&amp;gt; other)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    // Check for null&lt;font&gt;&lt;/font&gt;
    if(ReferenceEquals(other, null))&lt;font&gt;&lt;/font&gt;
        return false;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    // Check for same reference&lt;font&gt;&lt;/font&gt;
    if(ReferenceEquals(this, other))&lt;font&gt;&lt;/font&gt;
        return true;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    // Check for same Id and same Values&lt;font&gt;&lt;/font&gt;
    return Id == other.Id &amp;amp;&amp;amp; Values.SequenceEqual(other.Values);&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;오버라이드를 할 때는 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;물론 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;object.Equals&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;오버라이드해야합니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;GetHashCode&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하지만 어떤 코드를 구현해야합니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;일반 배열에서 해시 코드를 생성하려면 어떻게합니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그리고 그것을 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Id&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;정수 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;와 어떻게 결합 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;합니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public override int GetHashCode()&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    return // What?&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 스레드에서 발생하는 문제로 인해 잘못된 경우 어떻게되는지 보여주는 또 다른 답변을 게시하고 있습니다. 주로 배열을 사용할 수 없다는 것입니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;GetHashCode()&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;올바른 동작은 실행할 때 경고가 인쇄되지 않는 것입니다. 주석을 전환하여 수정하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;using System;&lt;font&gt;&lt;/font&gt;
using System.Collections.Generic;&lt;font&gt;&lt;/font&gt;
using System.Linq;&lt;font&gt;&lt;/font&gt;
static class Program&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    static void Main()&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        // first and second are logically equivalent&lt;font&gt;&lt;/font&gt;
        SimpleTableRow&amp;lt;int&amp;gt; first = new SimpleTableRow&amp;lt;int&amp;gt;(1, 2, 3, 4, 5, 6),&lt;font&gt;&lt;/font&gt;
            second = new SimpleTableRow&amp;lt;int&amp;gt;(1, 2, 3, 4, 5, 6);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (first.Equals(second) &amp;amp;&amp;amp; first.GetHashCode() != second.GetHashCode())&lt;font&gt;&lt;/font&gt;
        { // proven Equals, but GetHashCode() disagrees&lt;font&gt;&lt;/font&gt;
            Console.WriteLine(&quot;We have a problem&quot;);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        HashSet&amp;lt;SimpleTableRow&amp;lt;int&amp;gt;&amp;gt; set = new HashSet&amp;lt;SimpleTableRow&amp;lt;int&amp;gt;&amp;gt;();&lt;font&gt;&lt;/font&gt;
        set.Add(first);&lt;font&gt;&lt;/font&gt;
        set.Add(second);&lt;font&gt;&lt;/font&gt;
        // which confuses anything that uses hash algorithms&lt;font&gt;&lt;/font&gt;
        if (set.Count != 1) Console.WriteLine(&quot;Yup, very bad indeed&quot;);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
class SimpleTableRow&amp;lt;T&amp;gt; : IEquatable&amp;lt;SimpleTableRow&amp;lt;T&amp;gt;&amp;gt;&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public SimpleTableRow(int id, params T[] values) {&lt;font&gt;&lt;/font&gt;
        this.Id = id;&lt;font&gt;&lt;/font&gt;
        this.Values = values;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    public int Id { get; private set; }&lt;font&gt;&lt;/font&gt;
    public T[] Values { get; private set; }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public override int GetHashCode() // wrong&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        return Id.GetHashCode() ^ Values.GetHashCode();&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    /*&lt;font&gt;&lt;/font&gt;
    public override int GetHashCode() // right&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        int hash = Id;&lt;font&gt;&lt;/font&gt;
        if (Values != null)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            hash = (hash * 17) + Values.Length;&lt;font&gt;&lt;/font&gt;
            foreach (T t in Values)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                hash *= 17;&lt;font&gt;&lt;/font&gt;
                if (t != null) hash = hash + t.GetHashCode();&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        return hash;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    */&lt;font&gt;&lt;/font&gt;
    public override bool Equals(object obj)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        return Equals(obj as SimpleTableRow&amp;lt;T&amp;gt;);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    public bool Equals(SimpleTableRow&amp;lt;T&amp;gt; other)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        // Check for null&lt;font&gt;&lt;/font&gt;
        if (ReferenceEquals(other, null))&lt;font&gt;&lt;/font&gt;
            return false;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        // Check for same reference&lt;font&gt;&lt;/font&gt;
        if (ReferenceEquals(this, other))&lt;font&gt;&lt;/font&gt;
            return true;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        // Check for same Id and same Values&lt;font&gt;&lt;/font&gt;
        return Id == other.Id &amp;amp;&amp;amp; Values.SequenceEqual(other.Values);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;FWIW, it's very dangerous to use the contents of the Values in your hash code. You should only do this if you can guarantee that it will never change. However, since it is exposed, I don't think guaranteeing it is possible. The hashcode of an object should never change. Otherwise, it loses its value as a key in a Hashtable or Dictionary. Consider the hard-to-find bug of using an object as a key in a Hashtable, its hashcode changes because of an outside influence and you can no longer find it in the Hashtable!&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Since the hashCode is kinda a key for storing the object (lllike in a hashtable), i would use just Id.GetHashCode()&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;How about something like:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;    public override int GetHashCode()&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        int hash = Id;&lt;font&gt;&lt;/font&gt;
        if (Values != null)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            hash = (hash * 17) + Values.Length;&lt;font&gt;&lt;/font&gt;
            foreach (T t in Values)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                hash *= 17;&lt;font&gt;&lt;/font&gt;
                if (t != null) hash = hash + t.GetHashCode();&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        return hash;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;This should be compatible with &lt;code&gt;SequenceEqual&lt;/code&gt;, rather than doing a reference comparison on the array.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I just had to add another answer because one of the more obvious (and easiest to implement) solutions were not mentioned - not including the collection in your &lt;code&gt;GetHashCode&lt;/code&gt; calculation!&lt;/p&gt; 
&lt;p&gt;The main thing that seemed to have forgotten here is that the uniqueness from the result of &lt;code&gt;GetHashCode&lt;/code&gt; isn't required (or in many cases even possible). Unequal objects don't have to return unequal hash codes, the only requirement is that equal objects return equal hash codes. So by that definition, the following implementation of &lt;code&gt;GetHashCode&lt;/code&gt; is correct for all objects (assuming there's a correct &lt;code&gt;Equals&lt;/code&gt; implementation):&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public override int GetHashCode() &lt;font&gt;&lt;/font&gt;
{ &lt;font&gt;&lt;/font&gt;
    return 42; &lt;font&gt;&lt;/font&gt;
} &lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Of course this would yield the worst possible performance in hashtable lookup, O(n) instead of O(1), but it is still functionally correct.&lt;/p&gt; 
&lt;p&gt;With that in mind, my general recommendation when implementing &lt;code&gt;GetHashCode&lt;/code&gt; for an object that happens to have any kind of collection as one or more of its members is to simply ignore them and calculate &lt;code&gt;GetHashCode&lt;/code&gt; solely based on the other scalar members. This would work pretty well except if you put into a hash table a huge number of objects where all their scalar members have identical values, resulting in identical hash codes.&lt;/p&gt; 
&lt;p&gt;Ignoring collection members when calculating the hash code can also yield a performance improvement, despite the decreased distribution of the hash code values. Remember that using a hash code is supposed to improve performance in a hash table by not requiring to call &lt;code&gt;Equals&lt;/code&gt; N times, and instead will only require calling GetHashCode once and a quick hash table lookup. If each object has an inner array with 10,000 items which all participate in the calculation of the hash code, any benefits gained by the good distribution would probably be lost. &lt;strong&gt;It would be better to have a marginally less distributed hash code if generating it is considerably less costly.&lt;/strong&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;pre&gt;&lt;code&gt;public override int GetHashCode() {&lt;font&gt;&lt;/font&gt;
   return Id.GetHashCode() ^ Values.GetHashCode();  &lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;hr&gt; 
&lt;p&gt;There are several good points in the comments and other answers. The OP should consider whether the Values would be used as part of the &quot;key&quot; if the object were used as a key in a dictionary. If so, then they should be part of the hash code, otherwise, not.&lt;/p&gt; 
&lt;p&gt;On the other hand, I'm not sure why the GetHashCode method should mirror SequenceEqual. It's meant to compute an index into a hash table, not to be the complete determinant of equality. If there are many hash table collisions using the algorithm above, and if they differ in the sequence of the Values, then an algorithm should be chosen that takes sequence into account. If sequence doesn't really matter, save the time and don't take it into account.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I would do it this way:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;long result = Id.GetHashCode();&lt;font&gt;&lt;/font&gt;
foreach(T val in Values)&lt;font&gt;&lt;/font&gt;
    result ^= val.GetHashCode();&lt;font&gt;&lt;/font&gt;
return result;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I know this thread is pretty old, but I wrote this method to allow me to calculate hashcodes of multiple objects. It's been very helpful for this very case. It's not perfect, but it does meet my needs and most likely yours too.&lt;/p&gt; 
&lt;p&gt;I can't really take any credit for it. I got the concept from some of the .net gethashcode implementations. I'm using 419 (afterall, it's my favorite large prime), but you can choose just about any reasonable prime (not too small . . . not too large).&lt;/p&gt; 
&lt;p&gt;So, here's how I get my hashcodes:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;using System.Collections.Generic;&lt;font&gt;&lt;/font&gt;
using System.Linq;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
public static class HashCodeCalculator&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    public static int CalculateHashCode(params object[] args)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        return args.CalculateHashCode();&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public static int CalculateHashCode(this IEnumerable&amp;lt;object&amp;gt; args)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (args == null)&lt;font&gt;&lt;/font&gt;
            return new object().GetHashCode();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        unchecked&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            return args.Aggregate(0, (current, next) =&amp;gt; (current*419) ^ (next ?? new object()).GetHashCode());&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Provided that Id and Values will never change, and Values is not null...&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public override int GetHashCode()&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
  return Id ^ Values.GetHashCode();&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Note that your class is not immutable, since anyone can modify the contents of Values because it is an array. Given that, I wouldn't try to generate a hashcode using its contents.&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/638761/gethashcode-override-of-object-containing-generic-array&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/638761/gethashcode-override-of-object-containing-generic-array&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2687</guid>
      <comments>https://nicepro.tistory.com/2687#entry2687comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:56:12 +0900</pubDate>
    </item>
    <item>
      <title>VIM 스크립팅에 대한 좋은 가이드?</title>
      <link>https://nicepro.tistory.com/2686</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;VIM 스크립팅에 대한 좋은 가이드?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;저는 10 년 이상 VIM을 사용해 왔지만 실제로 VIM 스크립팅을 사용하지는 않았습니다 (항상 VIM이 Emacs보다 약한 영역이라고 주관적으로 믿었습니다).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;최근에 &quot;VIM 스크립트에서 일반 모드 명령을 실행할 수 있습니다&quot;라는 깨달음이 내 마음을 &quot;아하&quot;로 만들었고 갑자기 VIM 스크립트의 일부가 왜 그런지 깨닫기 시작했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;normal ma10jd'a20kp
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;훨씬 더 우아합니다&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Marker m = currentLocation();&lt;font&gt;&lt;/font&gt;
advanceLines(10);&lt;font&gt;&lt;/font&gt;
Buffer b = delete(currentLocation(), m);&lt;font&gt;&lt;/font&gt;
advanceLines(-20);&lt;font&gt;&lt;/font&gt;
insertBuffer(b);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이제 질문은-vim 스크립팅을 배울 수있는 좋은 리소스는 무엇입니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;감사!&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;제가 드릴 수있는 최고의 조언은 다음과 같은 내용을 읽는 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;:help usr_41.txt
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기본에 대한 좋은 개요를 제공합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음하고 싶은 일을 찾아서 함수를 만드십시오. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 작업을 수행하는 동안 다음을 많이 사용하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;:help function-list
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;모든 내장 함수가 무엇인지 알 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대부분은 다른 스크립팅 언어와 상당히 유사합니다 (가혹한 구문 임에도 불구하고). 따라서 파이썬에서 텍스트를 조작 한 경험이 있거나 어떤 것이 든 유용 할 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또한 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.vim.org/scripts&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;vim 스크립트 페이지&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 와 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.google.co.uk&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Google&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 에서 지식을 확장하는 데 도움이되는 기존 스크립트의 예를 확인하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;마지막으로 (그리고 아마도 가장 중요한), &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/tagged/vim&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;stackoverflow&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 또는 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.vim.org/maillist.php#vim&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Vim 메일 링리스트&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 에 물어 보는 것을 두려워하지 마십시오 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. 당신이 가질 수있는 모든 문제에 대해 많은 지원이있을 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Vimscript the Hard Way 알아보기도 확인해 볼 가치가 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;http://learnvimscriptthehardway.stevelosh.com/&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://learnvimscriptthehardway.stevelosh.com/&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;알이 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/2153892/good-guide-on-vim-scripting/2154360#2154360&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;좋은 대답을 했어요&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; . &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;질문과 관련된 몇 가지 팁이있는 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://vim.fandom.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;vim.wikia&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 도 추가 &lt;/font&gt;&lt;a href=&quot;https://vim.fandom.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하겠습니다&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; .&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참고로.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 그것이 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;ma10jd'a20kp&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;더 우아 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하다고 말하지 않을 것입니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같은 문제가 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;유지 관리가 매우 어렵습니다 (줄 수가 매개 변수가된다면 어떨까요?).&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사람들은 사용하는 법을 배운 적이없는 키를 재정의하는 것을 좋아합니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;:normal!&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;일부 일반 모드 명령은 사이드 케이스에서 이상한 동작을합니다 (예 : &lt;/font&gt;&lt;/font&gt;&lt;code&gt;&amp;lt;esc&amp;gt;&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;커서가 첫 번째 열에있을 때).&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;마크 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;a&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 와 이름없는 레지스터-다른 스크립트를 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;엉망으로 만들 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;거나 심지어 사용자가 스크립트에 의해 값이 변경되지 않을 것으로 예상 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;저도 비슷한 상황에 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여전히 내 &quot;읽기&quot;목록에 있지만 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;오늘 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.ibm.com/developerworks/linux/library/l-vim-script-3/index.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Vim 편집기 Scripting을&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 찾았 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;IBM DeveloperWorks의 기사는 일반적으로 매우 훌륭하므로 확인해 볼 가치가있을 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/2153892/good-guide-on-vim-scripting&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/2153892/good-guide-on-vim-scripting&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2686</guid>
      <comments>https://nicepro.tistory.com/2686#entry2686comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:56:01 +0900</pubDate>
    </item>
    <item>
      <title>대화 상자를 통한 Android 공유</title>
      <link>https://nicepro.tistory.com/2685</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대화 상자를 통한 Android 공유&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;TFLN (어젯밤의 텍스트)과 같은 앱에있는 &quot;공유를 통해&quot;대화 상자를 보았습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같이 보입니다 : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://garr.me/wp-content/uploads/2009/12/sharevia.jpg&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;공유 대화 http://garr.me/wp-content/uploads/2009/12/sharevia.jpg&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;텍스트를 공유하려고합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;누군가 나를 올바른 방향으로 가리킬 수 있습니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 의도로 수행됩니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 실제로 인 텐트로 수행됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예제 사진에서와 같이 이미지를 공유하려면 다음과 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Intent share = new Intent(Intent.ACTION_SEND);&lt;font&gt;&lt;/font&gt;
share.setType(&quot;image/jpeg&quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
share.putExtra(Intent.EXTRA_STREAM,&lt;font&gt;&lt;/font&gt;
  Uri.parse(&quot;file:///sdcard/DCIM/Camera/myPic.jpg&quot;));&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
startActivity(Intent.createChooser(share, &quot;Share Image&quot;));&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;텍스트의 경우 다음과 같이 사용합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Intent share = new Intent(Intent.ACTION_SEND);&lt;font&gt;&lt;/font&gt;
share.setType(&quot;text/plain&quot;);&lt;font&gt;&lt;/font&gt;
share.putExtra(Intent.EXTRA_TEXT, &quot;I'm being sent!!&quot;);&lt;font&gt;&lt;/font&gt;
startActivity(Intent.createChooser(share, &quot;Share Text&quot;));&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 받아 들여진 대답에 문제가 있었다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나를 위해 일한 것은 경로에서 파일을 만든 다음 다음과 같이 파일의 URI를 구문 분석하는 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Uri.fromFile(new File(filePath));
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대신에&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Uri.parse(filePath)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;누군가가 같은 문제를 겪고있는 경우를 대비하여.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;MIME 유형 이미지 / jpeg (예 : JPEG 이미지 공유를 지원하려는 경우)의 개체를 처리 할 수있는 인 텐트 필터와 ACTION_SEND 작업을 제공하는 활동을 제공해야합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대부분의 내장 Android 앱은 오픈 소스이므로 메시징 앱의 매니페스트 파일을 확인하여 사용중인 인 텐트 필터를 확인할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://developer.android.com/training/sharing/receive&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다른 앱에서 간단한 데이터 받기&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;매니페스트 업데이트&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;activity android:name=&quot;.ui.MyActivity&quot; &amp;gt;&lt;font&gt;&lt;/font&gt;
//To receive single image&lt;font&gt;&lt;/font&gt;
&amp;lt;intent-filter&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;action android:name=&quot;android.intent.action.SEND&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;data android:mimeType=&quot;image/*&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/intent-filter&amp;gt;&lt;font&gt;&lt;/font&gt;
//To receive multiple images&lt;font&gt;&lt;/font&gt;
&amp;lt;intent-filter&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;action android:name=&quot;android.intent.action.SEND_MULTIPLE&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;data android:mimeType=&quot;image/*&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/intent-filter&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;들어오는 콘텐츠 처리&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public class MyActivity extends AppCompactActivity {&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    void onCreate(Bundle savedInstanceState) {&lt;font&gt;&lt;/font&gt;
        // Get intent, action and MIME type&lt;font&gt;&lt;/font&gt;
        Intent intent = getIntent();&lt;font&gt;&lt;/font&gt;
        String action = intent.getAction();&lt;font&gt;&lt;/font&gt;
        String type = intent.getType();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (Intent.ACTION_SEND.equals(action) &amp;amp;&amp;amp; type != null) {&lt;font&gt;&lt;/font&gt;
            if (type.startsWith(&quot;image/&quot;)) {&lt;font&gt;&lt;/font&gt;
                handleSendImage(intent); // Handle single image being sent&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        } else if (Intent.ACTION_SEND_MULTIPLE.equals(action) &amp;amp;&amp;amp; type != null) {&lt;font&gt;&lt;/font&gt;
            if (type.startsWith(&quot;image/&quot;)) {&lt;font&gt;&lt;/font&gt;
                handleSendMultipleImages(intent); // Handle multiple images being sent&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    void handleSendImage(Intent intent) {&lt;font&gt;&lt;/font&gt;
        Uri imageUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM);&lt;font&gt;&lt;/font&gt;
        if (imageUri != null) {&lt;font&gt;&lt;/font&gt;
            // Update UI to reflect image being shared&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    void handleSendMultipleImages(Intent intent) {&lt;font&gt;&lt;/font&gt;
        ArrayList&amp;lt;Uri&amp;gt; imageUris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);&lt;font&gt;&lt;/font&gt;
        if (imageUris != null) {&lt;font&gt;&lt;/font&gt;
            // Update UI to reflect multiple images being shared&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/3553017/android-share-via-dialog&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/3553017/android-share-via-dialog&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2685</guid>
      <comments>https://nicepro.tistory.com/2685#entry2685comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:55:53 +0900</pubDate>
    </item>
    <item>
      <title>Glassfish 또는 Tomcat 앞에서 Apache Web Server를 사용하는 이유는 무엇입니까?</title>
      <link>https://nicepro.tistory.com/2684</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Glassfish 또는 Tomcat 앞에서 Apache Web Server를 사용하는 이유는 무엇입니까?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;GF 또는 Tomcat 앞에서 Apache Webserver를 사용하는 것이 좋은 생각입니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;성능 / 보안이 향상됩니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아니면 GF와 함께 Apache Web Server를 사용할 이유가 없습니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;a href=&quot;http://wiki.apache.org/tomcat/FAQ/Connectors#Q3&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://wiki.apache.org/tomcat/FAQ/Connectors#Q3&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 에서 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://wiki.apache.org/tomcat/FAQ/Connectors#Q3&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가져옴&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;클러스터링. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Apache HTTP를 프런트 엔드로 사용하면 Apache HTTP가 여러 Apache Tomcat 인스턴스에 대한 콘텐츠의 프런트 도어 역할을 할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Apache Tomcat 중 하나가 실패하면 Apache HTTP가이를 무시하고 Sysadmin은 밤새 잠을 잘 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하드웨어 부하 분산 장치와 Apache Tomcat의 클러스터링 기능을 사용하는 경우이 지점은 무시할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;클러스터링 / 보안. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Apache를 다른 URL 네임 스페이스 (/ app1 /, / app2 /, / app3 / 또는 가상 호스트)에 대해 다른 Apache Tomcat에 대한 프론트 도어로 사용할 수도 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러면 Apache Tomcat이 각각 보호 영역에있을 수 있으며 보안 관점에서 Apache HTTP 서버에 대해서만 걱정하면됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;본질적으로 Apache는 스마트 프록시 서버가됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;보안. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 주제는 어느 쪽이든 흔들릴 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Java에는 보안 관리자가 있고 Apache는 보안과 관련하여 더 큰 마인드 쉐어와 트릭을 가지고 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;더 자세히 설명하지는 않겠지 만 Google을 친구로 삼으십시오. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;시나리오에 따라 하나가 다른 것보다 나을 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 또한 Tomcat과 함께 Apache를 실행하는 경우 방어 할 시스템이 하나가 아니라 두 개라는 점을 명심하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;부가 기능. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;CGI, perl, PHP를 추가하는 것은 Apache에 매우 자연스러운 일입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Tomcat에 대한 느리고 더 많은 kludge. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Apache HTTP에는 또한 마음대로 플러그인 할 수있는 수백 개의 모듈이 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Apache Tomcat에는이 기능이있을 수 있지만 코드는 아직 작성되지 않았습니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;데코레이터! &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Apache Tomcat 앞에 Apache HTTP를 사용하면 Apache Tomcat이 지원하지 않거나 즉각적인 코드 지원이없는 데코레이터를 얼마든지 수행 할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예를 들어, mod_headers, mod_rewrite 및 mod_alias는 Apache Tomcat 용으로 작성 될 수 있지만 Apache HTTP가이 작업을 잘 수행했을 때 휠을 재발 명하는 이유는 무엇입니까?&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;속도. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Apache HTTP는 Apache Tomcat보다 정적 콘텐츠를 제공하는 데 더 빠릅니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 트래픽이 많은 사이트가 아니라면이 지점은 쓸모가 없습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 일부 시나리오에서는 Apache Tomcat이 Apache httpd보다 빠를 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따라서 귀하의 사이트를 벤치마킹하십시오. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Apache Tomcat은 적절한 커넥터 (sendFile이 활성화 된 APR)를 사용할 때 httpd 속도로 수행 할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Apache httpd와 Tomcat 중에서 선택할 때 속도를 고려해서는 안됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;소켓 처리 / 시스템 안정성. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Apache HTTP는 Apache Tomcat보다 오류 조건과 관련하여 더 나은 소켓 처리를 제공합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;주된 이유는 Apache Tomcat이 교차 플랫폼이어야하는 JVM을 통해 모든 소켓 처리를 수행해야하기 때문입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;문제는 소켓 최적화가 플랫폼 특정 시련이라는 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대부분의 경우 Java 코드는 괜찮지 만 연결 끊김, 유효하지 않은 패킷, 유효하지 않은 IP의 유효하지 않은 요청으로 폭격을 당할 때 Apache HTTP는 JVM 기반 프로그램보다 이러한 오류 조건을 삭제하는 데 더 효과적입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;(YMMV)&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;모두가 왜 당신에게 이유를 준 이후 톰캣 앞에 아파치를 넣어은 내가 당신에게 몇 가지 이유 이유를 제공 할 수 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;없습니다&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 로를 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;http://tomcat.apache.org/tomcat-6.0-doc/aio.html&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;AJP 커넥터는 &lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Comet&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; , &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Websockets&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 등을 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;의미하지 않는 &lt;/font&gt;&lt;a href=&quot;http://tomcat.apache.org/tomcat-6.0-doc/aio.html&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;고급 IO를 지원하지 않으며 지원하지 않을 것입니다&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; .&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;AJP를 사용하지 않는 경우 Apache에 mod_proxy를 사용할 때 상당히 큰 프록시 오버 헤드가 있음을 알았습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따라서 대기 시간이 짧은 Apache를 찾고 있다면 좋지 않을 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Apache는 Nginx 또는 Lighttpd 등에 비해 다소 큰 발자국을 가지고 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Apache를 앞에 두는 것은 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아닙니다&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; .&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;성능 향상. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.tomcatexpert.com/blog/2010/03/24/myth-or-truth-one-should-always-use-apache-httpd-front-apache-tomcat-improve-perform&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Tomcat은 APR을 사용하여 Apache만큼 빠르게 실행됩니다 (경우에 따라 더 빠름)&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; .&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;보안 향상. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Tomcat에서 진정한 보안 문제를 본 적이 없다고 생각합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 BS의 출처는 Tomcat이 Apache보다 덜 안전하다는 점을 모르겠습니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Apache가 제공하는 것은 더 많은 플러그인이며 다른 웹 기술을 실행할 수 있도록합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Tomcat 만 필요한 경우 HAProxy 또는 Nginx를로드 밸런서로 사용하는 것이 더 적합합니다.&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;ul&gt; 
 &lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;확장 성&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; -Amir와 user384706이 지적했듯이 Apache 뒤에서 애플리케이션의 여러 인스턴스를로드 밸런싱 할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이렇게하면 더 많은 볼륨을 처리하고 인스턴스 중 하나가 다운되는 경우 안정성을 높일 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;보안&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; -Apache, Tomcat 및 Glassfish는 모두 SSL을 지원하지만 Apache를 사용하기로 결정한 경우에는 SSL을 구성해야 할 가능성이 높습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;공격 (DoS, XSS, SQL 삽입 등)에 대한 추가 보호를 원하는 경우 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.modsecurity.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;mod_security&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 웹 애플리케이션 방화벽을 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;설치할 수 있습니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;추가 기능&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; -아파치는 URL 재 작성, 다른 프로그래밍 언어와의 인터페이스, 인증 및 기타 다양한 기능에 사용할 수있는 멋진 모듈이 많이 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;
   &lt;strike&gt; 
    &lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;성능&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; -정적 콘텐츠가 많은 경우 Apache와 함께 제공하면 성능이 향상됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대부분의 콘텐츠가 동적 인 경우 Tomcat 또는 Glassfish 만 사용하는 것이 그만큼 빠릅니다 (아마 더 빠름).
   &lt;/font&gt;&lt;/font&gt;&lt;/strike&gt; &lt;sub&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;( &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/q/654701/20770&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 질문&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 에 대한 답변에서 지적했듯이 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;더 이상 사실이 아닙니다.)&lt;/font&gt;&lt;/font&gt;&lt;/sub&gt;&lt;/p&gt;&lt;/li&gt; 
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Apache를 Tomcat 앞에 배치하는 한 가지 이유는로드 균형 조정 때문입니다. &lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;요청은 Apache 서버 앞에 도달하고 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;로드 및 가용성에 따라 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;백엔드 Tomcat &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;컨테이너&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 에 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;배포됩니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;클라이언트는 하나의 IP (Apache) 만 알고 있지만 요청은 여러 컨테이너에 분산됩니다. &lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따라서 이것은 일종의 분산 웹 응용 프로그램을 배포하고 강력한 것이 필요한 경우입니다. &lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;질문이 간단한 웹 응용 프로그램에 관한 것이라면 dbyrne 답변을 참조하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;LAMP 스택을 실행하는 경우 아파치에서 PHP / Ruby 항목을 실행하고 mod_jk를 사용하여 자바 항목을 tomcat에 전달할 수 있습니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/5122345/why-use-apache-web-server-in-front-of-glassfish-or-tomcat&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/5122345/why-use-apache-web-server-in-front-of-glassfish-or-tomcat&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2684</guid>
      <comments>https://nicepro.tistory.com/2684#entry2684comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:55:44 +0900</pubDate>
    </item>
    <item>
      <title>JS : 자식 창이 닫힐 때 듣기</title>
      <link>https://nicepro.tistory.com/2683</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;JS : 자식 창이 닫힐 때 듣기&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 방법으로 페이스 북 공유를 위해 자식 창을 엽니 다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;window.open(sharingUrl,'','toolbar=0,status=0,width=626,height=436');
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용자가 공유 또는 닫기를 클릭하면 창이 자동으로 닫힙니다 ... 이러한 이벤트에 리스너를 추가하는 방법이 있습니까? &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;를 호출 할 때 자식 창에 대한 참조를 저장 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;window.open()&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하면를 사용하여 폴링하여 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;속성을 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;setInterval()&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용하여 창이 아직 열려 있는지 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;확인할 수 있습니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;window.closed&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아래 예는 초당 두 번 확인합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;var child = window.open('http://google.com','','toolbar=0,status=0,width=626,height=436');&lt;font&gt;&lt;/font&gt;
var timer = setInterval(checkChild, 500);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
function checkChild() {&lt;font&gt;&lt;/font&gt;
    if (child.closed) {&lt;font&gt;&lt;/font&gt;
        alert(&quot;Child window closed&quot;);   &lt;font&gt;&lt;/font&gt;
        clearInterval(timer);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기타 참고 사항 :&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 자식 창에서 html을 제어 할 수있는 상황이 발생하면 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://developer.mozilla.org/en/DOM/window.onbeforeunload&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;onbeforeunload&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 이벤트를 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하여 부모 창에 경고 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;향후 참조를 위해 다음이 필요하지 않은 다른 솔루션을 공유하고 싶습니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;setInterval&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;var child = window.open('http://google.com','','toolbar=0,status=0,width=626,height=436');&lt;font&gt;&lt;/font&gt;
child.onunload = function(){ console.log('Child window closed'); };&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 잘 작동합니다&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;   &amp;lt;html&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;head&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;title&amp;gt;Detecting browser close in IE&amp;lt;/title&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
window.onbeforeunload = function(){ myUnloadEvent(); }&lt;font&gt;&lt;/font&gt;
function myUnloadEvent() {&lt;font&gt;&lt;/font&gt;
    alert ('You can have Ur Logic Here ,');&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&amp;lt;/script&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/head&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/script&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/head&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;body &amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;h1&amp;gt;Close the Window now&amp;lt;/h1&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/body&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/html&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/5712195/js-listen-when-child-window-is-closed&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/5712195/js-listen-when-child-window-is-closed&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2683</guid>
      <comments>https://nicepro.tistory.com/2683#entry2683comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:55:36 +0900</pubDate>
    </item>
    <item>
      <title>XCode 4에서 특정 코드 줄로 이동하려면 어떻게합니까?</title>
      <link>https://nicepro.tistory.com/2682</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;XCode 4에서 특정 코드 줄로 이동하려면 어떻게합니까?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그렇게 단순한 것 같지만 나는 이것을 어떻게할지 내 인생에서 알아낼 수 없습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;kbd&gt;CMD&lt;/kbd&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;+ &lt;/font&gt;&lt;/font&gt;&lt;kbd&gt;L&lt;/kbd&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;할 것입니다 ... 이것은 XCode 4에서 변경된 것 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/8248290/how-do-i-jump-to-a-specific-line-of-code-in-xcode-4&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/8248290/how-do-i-jump-to-a-specific-line-of-code-in-xcode-4&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2682</guid>
      <comments>https://nicepro.tistory.com/2682#entry2682comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:55:28 +0900</pubDate>
    </item>
    <item>
      <title>1 테라 바이트의 텍스트를 구문 분석하고 각 단어의 발생 횟수를 효율적으로 계산</title>
      <link>https://nicepro.tistory.com/2681</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;1 테라 바이트의 텍스트를 구문 분석하고 각 단어의 발생 횟수를 효율적으로 계산&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;최근에 나는 다음을 수행해야하는 모든 언어로 알고리즘을 만드는 인터뷰 질문을 보았습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;1TB의 콘텐츠 읽기 &lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해당 콘텐츠에서 반복되는 각 단어를 계산합니다. &lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가장 자주 발생하는 상위 10 개 단어 나열&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이에 대한 알고리즘을 만드는 가장 좋은 방법을 알려주시겠습니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;편집하다:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;좋습니다. 콘텐츠가 영어로되어 있다고 가정 해 보겠습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해당 콘텐츠에서 가장 자주 나오는 상위 10 개 단어를 어떻게 찾을 수 있습니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내 다른 의심은 의도적으로 고유 한 데이터를 제공하는 경우 버퍼가 힙 크기 오버플로와 함께 만료된다는 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;우리는 그것도 처리해야합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;인터뷰 답변&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 작업은 너무 복잡하지 않고 흥미 롭기 때문에 좋은 기술 토론을 시작할 수있는 좋은 방법입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 작업을 수행하려는 내 계획은 다음과 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;공백과 구두점을 구분 기호로 사용하여 입력 데이터를 단어로 분할&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;단어의 마지막 글자를 나타내는 노드에서 업데이트 된 카운터 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;로 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Trie&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Trie&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 구조에 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;발견 된 모든 단어를 공급합니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;완전히 채워진 트리를 탐색하여 가장 많은 수의 노드를 찾습니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;인터뷰의 맥락에서 ... 나는 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;칠판이나 종이에 나무를 그려서 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Trie&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Trie&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 의 아이디어를 보여줄 것입니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;비어있는 상태에서 시작한 다음 하나 이상의 반복되는 단어가 포함 된 단일 문장을 기반으로 트리를 만듭니다. &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;고양이가 쥐를 잡을 수 있습니다&quot;&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 라고 말합니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;마지막으로 가장 높은 수를 찾기 위해 트리를 횡단하는 방법을 보여줍니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음이 트리가 어떻게 좋은 메모리 사용, 좋은 단어 조회 속도 (특히 많은 단어가 서로 파생되는 자연어의 경우)를 제공하며 병렬 처리에 적합한 지 정당화합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;칠판에 그리기&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/GmiGk.jpg&quot; alt=&quot;예제 트라이 그리기&quot;&gt;&lt;/p&gt; 
&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;데모&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아래의 C # 프로그램은 4 코어 xeon W3520에서 75 초 동안 2GB의 텍스트를 처리하여 최대 8 개의 스레드를 처리합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;성능은 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;최적의 입력 구문 분석 코드 미만으로 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;초당&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 약 &lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;430 만 단어입니다&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; . &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;단어를 저장 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하는 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Trie&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Trie 구조&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 를 사용하면 자연어 입력을 처리 할 때 메모리가 문제가되지 않습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;메모:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;a href=&quot;http://www.gutenberg.org&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;구텐베르크 프로젝트&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 에서 얻은 테스트 텍스트&lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.gutenberg.org&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;입력 구문 분석 코드는 줄 바꿈을 가정하고 매우 차선책입니다&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;구두점 및 기타 비 단어 제거가 잘 수행되지 않음&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여러 개의 작은 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;파일&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 대신 &lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하나의 큰 파일을&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 처리 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하려면 파일 내의 지정된 오프셋 사이에서 스레드를 읽기 시작하는 데 적은 양의 코드가 필요합니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;hr&gt; 
&lt;pre&gt;&lt;code&gt;using System;&lt;font&gt;&lt;/font&gt;
using System.Collections.Generic;&lt;font&gt;&lt;/font&gt;
using System.Collections.Concurrent;&lt;font&gt;&lt;/font&gt;
using System.IO;&lt;font&gt;&lt;/font&gt;
using System.Threading;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
namespace WordCount&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    class MainClass&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        public static void Main(string[] args)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            Console.WriteLine(&quot;Counting words...&quot;);&lt;font&gt;&lt;/font&gt;
            DateTime start_at = DateTime.Now;&lt;font&gt;&lt;/font&gt;
            TrieNode root = new TrieNode(null, '?');&lt;font&gt;&lt;/font&gt;
            Dictionary&amp;lt;DataReader, Thread&amp;gt; readers = new Dictionary&amp;lt;DataReader, Thread&amp;gt;();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            if (args.Length == 0)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                args = new string[] { &quot;war-and-peace.txt&quot;, &quot;ulysees.txt&quot;, &quot;les-miserables.txt&quot;, &quot;the-republic.txt&quot;,&lt;font&gt;&lt;/font&gt;
                                      &quot;war-and-peace.txt&quot;, &quot;ulysees.txt&quot;, &quot;les-miserables.txt&quot;, &quot;the-republic.txt&quot; };&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            if (args.Length &amp;gt; 0)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                foreach (string path in args)&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    DataReader new_reader = new DataReader(path, ref root);&lt;font&gt;&lt;/font&gt;
                    Thread new_thread = new Thread(new_reader.ThreadRun);&lt;font&gt;&lt;/font&gt;
                    readers.Add(new_reader, new_thread);&lt;font&gt;&lt;/font&gt;
                    new_thread.Start();&lt;font&gt;&lt;/font&gt;
                }&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            foreach (Thread t in readers.Values) t.Join();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            DateTime stop_at = DateTime.Now;&lt;font&gt;&lt;/font&gt;
            Console.WriteLine(&quot;Input data processed in {0} secs&quot;, new TimeSpan(stop_at.Ticks - start_at.Ticks).TotalSeconds);&lt;font&gt;&lt;/font&gt;
            Console.WriteLine();&lt;font&gt;&lt;/font&gt;
            Console.WriteLine(&quot;Most commonly found words:&quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            List&amp;lt;TrieNode&amp;gt; top10_nodes = new List&amp;lt;TrieNode&amp;gt; { root, root, root, root, root, root, root, root, root, root };&lt;font&gt;&lt;/font&gt;
            int distinct_word_count = 0;&lt;font&gt;&lt;/font&gt;
            int total_word_count = 0;&lt;font&gt;&lt;/font&gt;
            root.GetTopCounts(ref top10_nodes, ref distinct_word_count, ref total_word_count);&lt;font&gt;&lt;/font&gt;
            top10_nodes.Reverse();&lt;font&gt;&lt;/font&gt;
            foreach (TrieNode node in top10_nodes)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                Console.WriteLine(&quot;{0} - {1} times&quot;, node.ToString(), node.m_word_count);&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            Console.WriteLine();&lt;font&gt;&lt;/font&gt;
            Console.WriteLine(&quot;{0} words counted&quot;, total_word_count);&lt;font&gt;&lt;/font&gt;
            Console.WriteLine(&quot;{0} distinct words found&quot;, distinct_word_count);&lt;font&gt;&lt;/font&gt;
            Console.WriteLine();&lt;font&gt;&lt;/font&gt;
            Console.WriteLine(&quot;done.&quot;);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    #region Input data reader&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public class DataReader&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        static int LOOP_COUNT = 1;&lt;font&gt;&lt;/font&gt;
        private TrieNode m_root;&lt;font&gt;&lt;/font&gt;
        private string m_path;        &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public DataReader(string path, ref TrieNode root)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            m_root = root;&lt;font&gt;&lt;/font&gt;
            m_path = path;&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public void ThreadRun()&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            for (int i = 0; i &amp;lt; LOOP_COUNT; i++) // fake large data set buy parsing smaller file multiple times&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                using (FileStream fstream = new FileStream(m_path, FileMode.Open, FileAccess.Read))&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    using (StreamReader sreader = new StreamReader(fstream))&lt;font&gt;&lt;/font&gt;
                    {&lt;font&gt;&lt;/font&gt;
                        string line;&lt;font&gt;&lt;/font&gt;
                        while ((line = sreader.ReadLine()) != null)&lt;font&gt;&lt;/font&gt;
                        {&lt;font&gt;&lt;/font&gt;
                            string[] chunks = line.Split(null);&lt;font&gt;&lt;/font&gt;
                            foreach (string chunk in chunks)&lt;font&gt;&lt;/font&gt;
                            {&lt;font&gt;&lt;/font&gt;
                                m_root.AddWord(chunk.Trim());&lt;font&gt;&lt;/font&gt;
                            }&lt;font&gt;&lt;/font&gt;
                        }&lt;font&gt;&lt;/font&gt;
                    }&lt;font&gt;&lt;/font&gt;
                }&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    #endregion&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    #region TRIE implementation&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public class TrieNode : IComparable&amp;lt;TrieNode&amp;gt;&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        private char m_char;&lt;font&gt;&lt;/font&gt;
        public int m_word_count;&lt;font&gt;&lt;/font&gt;
        private TrieNode m_parent = null;&lt;font&gt;&lt;/font&gt;
        private ConcurrentDictionary&amp;lt;char, TrieNode&amp;gt; m_children = null;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public TrieNode(TrieNode parent, char c)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            m_char = c;&lt;font&gt;&lt;/font&gt;
            m_word_count = 0;&lt;font&gt;&lt;/font&gt;
            m_parent = parent;&lt;font&gt;&lt;/font&gt;
            m_children = new ConcurrentDictionary&amp;lt;char, TrieNode&amp;gt;();            &lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public void AddWord(string word, int index = 0)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            if (index &amp;lt; word.Length)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                char key = word[index];&lt;font&gt;&lt;/font&gt;
                if (char.IsLetter(key)) // should do that during parsing but we're just playing here! right?&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    if (!m_children.ContainsKey(key))&lt;font&gt;&lt;/font&gt;
                    {&lt;font&gt;&lt;/font&gt;
                        m_children.TryAdd(key, new TrieNode(this, key));&lt;font&gt;&lt;/font&gt;
                    }&lt;font&gt;&lt;/font&gt;
                    m_children[key].AddWord(word, index + 1);&lt;font&gt;&lt;/font&gt;
                }&lt;font&gt;&lt;/font&gt;
                else&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    // not a letter! retry with next char&lt;font&gt;&lt;/font&gt;
                    AddWord(word, index + 1);&lt;font&gt;&lt;/font&gt;
                }&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
            else&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                if (m_parent != null) // empty words should never be counted&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    lock (this)&lt;font&gt;&lt;/font&gt;
                    {&lt;font&gt;&lt;/font&gt;
                        m_word_count++;                        &lt;font&gt;&lt;/font&gt;
                    }&lt;font&gt;&lt;/font&gt;
                }&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public int GetCount(string word, int index = 0)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            if (index &amp;lt; word.Length)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                char key = word[index];&lt;font&gt;&lt;/font&gt;
                if (!m_children.ContainsKey(key))&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    return -1;&lt;font&gt;&lt;/font&gt;
                }&lt;font&gt;&lt;/font&gt;
                return m_children[key].GetCount(word, index + 1);&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
            else&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                return m_word_count;&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public void GetTopCounts(ref List&amp;lt;TrieNode&amp;gt; most_counted, ref int distinct_word_count, ref int total_word_count)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            if (m_word_count &amp;gt; 0)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                distinct_word_count++;&lt;font&gt;&lt;/font&gt;
                total_word_count += m_word_count;&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
            if (m_word_count &amp;gt; most_counted[0].m_word_count)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                most_counted[0] = this;&lt;font&gt;&lt;/font&gt;
                most_counted.Sort();&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
            foreach (char key in m_children.Keys)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                m_children[key].GetTopCounts(ref most_counted, ref distinct_word_count, ref total_word_count);&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public override string ToString()&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            if (m_parent == null) return &quot;&quot;;&lt;font&gt;&lt;/font&gt;
            else return m_parent.ToString() + m_char;&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public int CompareTo(TrieNode other)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            return this.m_word_count.CompareTo(other.m_word_count);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    #endregion&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여기에서는 8 개의 스레드에서 동일한 20MB의 텍스트를 100 번 처리 한 결과입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Counting words...&lt;font&gt;&lt;/font&gt;
Input data processed in 75.2879952 secs&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
Most commonly found words:&lt;font&gt;&lt;/font&gt;
the - 19364400 times&lt;font&gt;&lt;/font&gt;
of - 10629600 times&lt;font&gt;&lt;/font&gt;
and - 10057400 times&lt;font&gt;&lt;/font&gt;
to - 8121200 times&lt;font&gt;&lt;/font&gt;
a - 6673600 times&lt;font&gt;&lt;/font&gt;
in - 5539000 times&lt;font&gt;&lt;/font&gt;
he - 4113600 times&lt;font&gt;&lt;/font&gt;
that - 3998000 times&lt;font&gt;&lt;/font&gt;
was - 3715400 times&lt;font&gt;&lt;/font&gt;
his - 3623200 times&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
323618000 words counted&lt;font&gt;&lt;/font&gt;
60896 distinct words found&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여기에서 많은 것은 지정되지 않은 몇 가지 사항에 달려 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예를 들어,이 작업을 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;한 번&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 시도하고 있습니까, 아니면 정기적이고 지속적으로이를 수행 할 시스템을 구축하려고합니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;입력을 제어 할 수 있습니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;우리는 모두 단일 언어 (예 : 영어)로 된 텍스트를 다루고 있습니까? 아니면 여러 언어로 표현되는 (그렇다면 몇 개)?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이는 다음과 같은 이유로 중요합니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;데이터가 단일 하드 드라이브에서 시작되는 경우 병렬 카운팅 (예 : 맵 축소)은 아무런 효과가 없습니다. 병목 현상은 디스크의 전송 속도가 될 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;더 빨리 계산할 수 있도록 더 많은 디스크에 복사하는 것은 하나의 디스크에서 직접 계산하는 것보다 느립니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;정기적으로이 작업을 수행하도록 시스템을 설계하는 경우 대부분의 강조점은 실제로 하드웨어에 있습니다. 특히 대역폭을 늘리기 위해 많은 디스크를 병렬로 사용하고 최소한 CPU.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아무리 많은 텍스트를 읽고 있더라도 처리해야하는 개별 단어의 수에는 제한이 있습니다. 테라 바이트 단위의 영어 텍스트가 있더라도 수십억 개의 텍스트를 볼 수는 없습니다. 영어로 다른 단어. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;빠른 확인을 위해 Oxford English Dictionary는 약 600,000 단어를 영어로 나열합니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;실제 단어는 언어마다 분명히 다르지만 언어 당 단어 수는 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;거의&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 일정하므로 작성하는지도의 크기는 표현되는 언어 수에 따라 크게 달라집니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그것은 대부분 얼마나 많은 언어를 표현할 수 있는지에 대한 질문을 남깁니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;지금은 최악의 경우를 가정 해 보겠습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;ISO 639-2에는 485 인간 언어에 대한 코드가 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;언어 당 평균 700,000 개의 단어와 단어 당 10 바이트의 UTF-8이라는 평균 단어 길이를 가정 해 보겠습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;단순한 선형 목록으로 저장하기 만하면 지구상의 모든 언어로 된 모든 단어를 6GB 미만의 8 바이트 주파수 카운트와 함께 저장할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대신 Patricia trie와 같은 것을 사용한다면, &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아마도&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 그 모든 언어에 대해 확신 할 수는 없지만 최소한 3 기가 바이트 이하로 축소 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;할 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;계획을 세울 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;수 &lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;있을 것입니다&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; .&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이제 현실은 우리가 그곳의 여러 곳에서 숫자를 거의 과대 평가했다는 것입니다. 꽤 많은 언어가 상당한 수의 단어를 공유하고, 많은 (특히 오래된) 언어는 아마도 영어보다 단어가 적을 것입니다. 목록에서, 아마도 서면 양식이 전혀없는 일부가 포함 된 것 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;요약 : 거의 모든 합리적으로 새로운 데스크톱 / 서버에는지도를 완전히 RAM에 저장할 수있는 충분한 메모리가 있으며 더 많은 데이터가이를 변경하지 않습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;병렬로 연결된 디스크 하나 (또는 ​​몇 개)의 경우 어쨌든 I / O 바운드가 될 것이므로 병렬 카운팅 (등)은 아마도 순 손실이 될 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다른 최적화가 많은 것을 의미하기 전에 병렬로 수십 개의 디스크가 필요할 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 작업에 대해 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/MapReduce&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;맵 축소&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 방식을 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;시도 할 수 있습니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;map-reduce의 장점은 확장 성입니다. 따라서 1TB, 10TB 또는 1PB의 경우에도 동일한 접근 방식이 작동하며 새로운 스케일에 맞게 알고리즘을 수정하기 위해 많은 작업을 수행 할 필요가 없습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;프레임 워크는 또한 클러스터에있는 모든 머신 (및 코어)간에 작업을 분배합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;먼저- &lt;/font&gt;&lt;/font&gt;&lt;code&gt;(word,occurances)&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;쌍을 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;만듭니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이에 대한 의사 코드는 다음과 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;map(document):&lt;font&gt;&lt;/font&gt;
  for each word w:&lt;font&gt;&lt;/font&gt;
     EmitIntermediate(w,&quot;1&quot;)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
reduce(word,list&amp;lt;val&amp;gt;):&lt;font&gt;&lt;/font&gt;
   Emit(word,size(list))&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;둘째, 쌍에 대한 단일 반복으로 상위 K 개의 가장 높은 발생률을 가진 항목을 쉽게 찾을 수 있습니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/q/10751953/572670&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 스레드&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 는이 개념을 설명합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;주요 아이디어는 상위 K 요소의 최소 힙을 보유하고 반복하는 동안 힙에 항상 지금까지 본 상위 K 요소가 포함되어 있는지 확인하는 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;완료되면 힙에 상위 K 요소가 포함됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;더 확장 가능한 (머신이 적 으면 더 느리지 만) 대안은 map-reduce 정렬 기능을 사용하고 발생에 따라 데이터를 정렬하고 상위 K를 grep하는 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것에 대해 주목할 세 가지.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;특히 : 파일이 메모리에 저장하기에 너무 크며, 단어 목록 (잠재적으로)이 메모리에 저장하기에 너무 크며, 32 비트 정수에 대해 너무 클 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이러한주의 사항을 통과 한 후에는 간단해야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 게임은 잠재적으로 큰 단어 목록을 관리하고 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;더 쉬운 경우 (머리가 회전하지 않도록).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;65K RAM과 1MB 파일이있는 Z-80 8 비트 시스템을 실행 중입니다 ...&quot;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;똑같은 문제.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;요구 사항에 따라 다르지만 약간의 오류를 감당할 수 있다면 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;스트리밍 알고리즘&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 과 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;확률 데이터 구조&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 는 매우 시간과 공간 효율적이고 구현하기가 매우 간단하기 때문에 흥미로울 수 있습니다. 예를 들면 다음과 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;헤비 타자 (예 : 공간 절약), 상위 n 개의 가장 자주 사용되는 단어에만 관심이있는 경우&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;모든 단어에 대한 예상 카운트를 얻기위한 최소 카운트 스케치&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이러한 데이터 구조에는 매우 적은 상수 공간 만 필요합니다 (정확한 양은 허용 할 수있는 오류에 따라 다름).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이러한 알고리즘에 대한 훌륭한 설명은 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://alex.smola.org/teaching/berkeley2012/streams.html&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://alex.smola.org/teaching/berkeley2012/streams.html&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 을 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조하십시오 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;DAWG ( &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Deterministic_acyclic_finite_state_automaton&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;wikipedia&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 및 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.dotnetperls.com/directed-acyclic-word-graph&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;자세한 내용이 포함 된 C # 작성)&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 를 사용하고 싶습니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;리프 노드에 카운트 필드를 추가하는 것은 간단하고 메모리가 효율적이며 조회에 매우 적합합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;편집 : 단순히 사용을 시도했지만 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Dictionary&amp;lt;string, int&amp;gt;&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;어디 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;&amp;lt;string, int&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&amp;gt; 단어 수를 나타냅니다? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;너무 일찍 최적화하려고하십니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;편집자 주 :이 게시물은 원래이 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Directed_acyclic_word_graph&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;위키피디아 기사에&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 링크되었으며 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;, DAWG라는 용어의 또 다른 의미에 관한 것으로 보입니다. 효율적인 근사 문자열 일치를 위해 한 단어의 모든 하위 문자열을 저장하는 방법입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다른 솔루션은 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;SQL&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 테이블을 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하여 시스템이 데이터를 최대한 잘 처리하도록 할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;먼저 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;word&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;컬렉션의 각 단어에 대해 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;단일 필드가있는 테이블을 만듭니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 쿼리를 사용하십시오 (구문 문제로 죄송합니다. SQL이 녹슬 었습니다-실제로는 의사 코드입니다).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;SELECT DISTINCT word, COUNT(*) AS c FROM myTable GROUP BY word ORDER BY c DESC
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;일반적인 아이디어는 먼저 모든 단어가 포함 된 테이블 (디스크에 저장 됨)을 생성 한 다음 쿼리를 사용하여 계산하고 정렬 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;(word,occurances)&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하는 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 검색된 목록에서 상위 K를 가져올 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;hr&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;모두에게 : SQL 문에 구문이나 기타 문제가있는 경우 : 자유롭게 편집하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;첫째, 저는 최근에야 Trie 데이터 구조를 &quot;발견&quot;했으며 zeFrenchy의 답변은 제가 속도를 높이는 데 큰 도움이되었습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;댓글에서 여러 사람이 성능을 개선하는 방법에 대해 제안하는 것을 보았지만 이는 사소한 조정일 뿐이므로 실제 병목 현상 인 ConcurrentDictionary를 여러분과 공유 할 것이라고 생각했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;저는 스레드 로컬 스토리지를 가지고 놀아보고 싶었고 귀하의 샘플은 저에게 그렇게 할 수있는 좋은 기회를주었습니다. 그리고 몇 가지 사소한 변경 후 스레드 당 사전을 사용하고 Join () 후 사전을 결합하면 성능이 ~ 30 % 향상되었습니다. (8 개의 스레드에서 20MB를 100 번 처리하는 작업은 내 상자에서 ~ 48 초에서 ~ 33 초로 단축되었습니다.)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;코드는 아래에 붙여넣고 승인 된 답변에서 많이 변경되지 않았 음을 알 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;추신 : 평판 점수가 50 점 이상이 아니 어서 댓글에 넣을 수 없었습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;using System;&lt;font&gt;&lt;/font&gt;
using System.Collections.Generic;&lt;font&gt;&lt;/font&gt;
using System.IO;&lt;font&gt;&lt;/font&gt;
using System.Linq;&lt;font&gt;&lt;/font&gt;
using System.Text;&lt;font&gt;&lt;/font&gt;
using System.Threading;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
namespace WordCount&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    class MainClass&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        public static void Main(string[] args)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            Console.WriteLine(&quot;Counting words...&quot;);&lt;font&gt;&lt;/font&gt;
            DateTime start_at = DateTime.Now;&lt;font&gt;&lt;/font&gt;
            Dictionary&amp;lt;DataReader, Thread&amp;gt; readers = new Dictionary&amp;lt;DataReader, Thread&amp;gt;();&lt;font&gt;&lt;/font&gt;
            if (args.Length == 0)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                args = new string[] { &quot;war-and-peace.txt&quot;, &quot;ulysees.txt&quot;, &quot;les-miserables.txt&quot;, &quot;the-republic.txt&quot;,&lt;font&gt;&lt;/font&gt;
                                      &quot;war-and-peace.txt&quot;, &quot;ulysees.txt&quot;, &quot;les-miserables.txt&quot;, &quot;the-republic.txt&quot; };&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            List&amp;lt;ThreadLocal&amp;lt;TrieNode&amp;gt;&amp;gt; roots;&lt;font&gt;&lt;/font&gt;
            if (args.Length == 0)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                roots = new List&amp;lt;ThreadLocal&amp;lt;TrieNode&amp;gt;&amp;gt;(1);&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
            else&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                roots = new List&amp;lt;ThreadLocal&amp;lt;TrieNode&amp;gt;&amp;gt;(args.Length);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
                foreach (string path in args)&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    ThreadLocal&amp;lt;TrieNode&amp;gt; root = new  ThreadLocal&amp;lt;TrieNode&amp;gt;(() =&amp;gt;&lt;font&gt;&lt;/font&gt;
                    {&lt;font&gt;&lt;/font&gt;
                        return new TrieNode(null, '?');&lt;font&gt;&lt;/font&gt;
                    });&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
                    roots.Add(root);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
                    DataReader new_reader = new DataReader(path, root);&lt;font&gt;&lt;/font&gt;
                    Thread new_thread = new Thread(new_reader.ThreadRun);&lt;font&gt;&lt;/font&gt;
                    readers.Add(new_reader, new_thread);&lt;font&gt;&lt;/font&gt;
                    new_thread.Start();&lt;font&gt;&lt;/font&gt;
                }&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            foreach (Thread t in readers.Values) t.Join();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            foreach(ThreadLocal&amp;lt;TrieNode&amp;gt; root in roots.Skip(1))&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                roots[0].Value.CombineNode(root.Value);&lt;font&gt;&lt;/font&gt;
                root.Dispose();&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            DateTime stop_at = DateTime.Now;&lt;font&gt;&lt;/font&gt;
            Console.WriteLine(&quot;Input data processed in {0} secs&quot;, new TimeSpan(stop_at.Ticks - start_at.Ticks).TotalSeconds);&lt;font&gt;&lt;/font&gt;
            Console.WriteLine();&lt;font&gt;&lt;/font&gt;
            Console.WriteLine(&quot;Most commonly found words:&quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            List&amp;lt;TrieNode&amp;gt; top10_nodes = new List&amp;lt;TrieNode&amp;gt; { roots[0].Value, roots[0].Value, roots[0].Value, roots[0].Value, roots[0].Value, roots[0].Value, roots[0].Value, roots[0].Value, roots[0].Value, roots[0].Value };&lt;font&gt;&lt;/font&gt;
            int distinct_word_count = 0;&lt;font&gt;&lt;/font&gt;
            int total_word_count = 0;&lt;font&gt;&lt;/font&gt;
            roots[0].Value.GetTopCounts(top10_nodes, ref distinct_word_count, ref total_word_count);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            top10_nodes.Reverse();&lt;font&gt;&lt;/font&gt;
            foreach (TrieNode node in top10_nodes)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                Console.WriteLine(&quot;{0} - {1} times&quot;, node.ToString(), node.m_word_count);&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            roots[0].Dispose();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            Console.WriteLine();&lt;font&gt;&lt;/font&gt;
            Console.WriteLine(&quot;{0} words counted&quot;, total_word_count);&lt;font&gt;&lt;/font&gt;
            Console.WriteLine(&quot;{0} distinct words found&quot;, distinct_word_count);&lt;font&gt;&lt;/font&gt;
            Console.WriteLine();&lt;font&gt;&lt;/font&gt;
            Console.WriteLine(&quot;done.&quot;);&lt;font&gt;&lt;/font&gt;
            Console.ReadLine();&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    #region Input data reader&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public class DataReader&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        static int LOOP_COUNT = 100;&lt;font&gt;&lt;/font&gt;
        private TrieNode m_root;&lt;font&gt;&lt;/font&gt;
        private string m_path;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public DataReader(string path, ThreadLocal&amp;lt;TrieNode&amp;gt; root)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            m_root = root.Value;&lt;font&gt;&lt;/font&gt;
            m_path = path;&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public void ThreadRun()&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            for (int i = 0; i &amp;lt; LOOP_COUNT; i++) // fake large data set buy parsing smaller file multiple times&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                using (FileStream fstream = new FileStream(m_path, FileMode.Open, FileAccess.Read))&lt;font&gt;&lt;/font&gt;
                using (StreamReader sreader = new StreamReader(fstream))&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    string line;&lt;font&gt;&lt;/font&gt;
                    while ((line = sreader.ReadLine()) != null)&lt;font&gt;&lt;/font&gt;
                    {&lt;font&gt;&lt;/font&gt;
                        string[] chunks = line.Split(null);&lt;font&gt;&lt;/font&gt;
                        foreach (string chunk in chunks)&lt;font&gt;&lt;/font&gt;
                        {&lt;font&gt;&lt;/font&gt;
                            m_root.AddWord(chunk.Trim());&lt;font&gt;&lt;/font&gt;
                        }&lt;font&gt;&lt;/font&gt;
                    }&lt;font&gt;&lt;/font&gt;
                }&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    #endregion&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    #region TRIE implementation&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public class TrieNode : IComparable&amp;lt;TrieNode&amp;gt;&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        private char m_char;&lt;font&gt;&lt;/font&gt;
        public int m_word_count;&lt;font&gt;&lt;/font&gt;
        private TrieNode m_parent = null;&lt;font&gt;&lt;/font&gt;
        private Dictionary&amp;lt;char, TrieNode&amp;gt; m_children = null;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public TrieNode(TrieNode parent, char c)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            m_char = c;&lt;font&gt;&lt;/font&gt;
            m_word_count = 0;&lt;font&gt;&lt;/font&gt;
            m_parent = parent;&lt;font&gt;&lt;/font&gt;
            m_children = new Dictionary&amp;lt;char, TrieNode&amp;gt;();            &lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public void CombineNode(TrieNode from)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            foreach(KeyValuePair&amp;lt;char, TrieNode&amp;gt; fromChild in from.m_children)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                char keyChar = fromChild.Key;&lt;font&gt;&lt;/font&gt;
                if (!m_children.ContainsKey(keyChar))&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    m_children.Add(keyChar, new TrieNode(this, keyChar));&lt;font&gt;&lt;/font&gt;
                }&lt;font&gt;&lt;/font&gt;
                m_children[keyChar].m_word_count += fromChild.Value.m_word_count;&lt;font&gt;&lt;/font&gt;
                m_children[keyChar].CombineNode(fromChild.Value);&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public void AddWord(string word, int index = 0)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            if (index &amp;lt; word.Length)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                char key = word[index];&lt;font&gt;&lt;/font&gt;
                if (char.IsLetter(key)) // should do that during parsing but we're just playing here! right?&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    if (!m_children.ContainsKey(key))&lt;font&gt;&lt;/font&gt;
                    {&lt;font&gt;&lt;/font&gt;
                        m_children.Add(key, new TrieNode(this, key));&lt;font&gt;&lt;/font&gt;
                    }&lt;font&gt;&lt;/font&gt;
                    m_children[key].AddWord(word, index + 1);&lt;font&gt;&lt;/font&gt;
                }&lt;font&gt;&lt;/font&gt;
                else&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    // not a letter! retry with next char&lt;font&gt;&lt;/font&gt;
                    AddWord(word, index + 1);&lt;font&gt;&lt;/font&gt;
                }&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
            else&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                if (m_parent != null) // empty words should never be counted&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    m_word_count++;                        &lt;font&gt;&lt;/font&gt;
                }&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public int GetCount(string word, int index = 0)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            if (index &amp;lt; word.Length)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                char key = word[index];&lt;font&gt;&lt;/font&gt;
                if (!m_children.ContainsKey(key))&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    return -1;&lt;font&gt;&lt;/font&gt;
                }&lt;font&gt;&lt;/font&gt;
                return m_children[key].GetCount(word, index + 1);&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
            else&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                return m_word_count;&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public void GetTopCounts(List&amp;lt;TrieNode&amp;gt; most_counted, ref int distinct_word_count, ref int total_word_count)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            if (m_word_count &amp;gt; 0)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                distinct_word_count++;&lt;font&gt;&lt;/font&gt;
                total_word_count += m_word_count;&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
            if (m_word_count &amp;gt; most_counted[0].m_word_count)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                most_counted[0] = this;&lt;font&gt;&lt;/font&gt;
                most_counted.Sort();&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
            foreach (char key in m_children.Keys)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                m_children[key].GetTopCounts(most_counted, ref distinct_word_count, ref total_word_count);&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public override string ToString()&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            return BuildString(new StringBuilder()).ToString();&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        private StringBuilder BuildString(StringBuilder builder)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            if (m_parent == null)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                return builder;&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
            else&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                return m_parent.BuildString(builder).Append(m_char);&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        public int CompareTo(TrieNode other)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            return this.m_word_count.CompareTo(other.m_word_count);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    #endregion&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;빠른 일반 알고리즘으로 나는 이것을 할 것입니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Create a map with entries being the count for a specific word and the key being the actual string.  &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
for each string in content:&lt;font&gt;&lt;/font&gt;
   if string is a valid key for the map:&lt;font&gt;&lt;/font&gt;
      increment the value associated with that key&lt;font&gt;&lt;/font&gt;
   else&lt;font&gt;&lt;/font&gt;
      add a new key/value pair to the map with the key being the word and the count being one&lt;font&gt;&lt;/font&gt;
done&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음지도에서 가장 큰 값을 찾을 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&lt;font&gt;&lt;/font&gt;
create an array size 10 with data pairs of (word, count) &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
for each value in the map&lt;font&gt;&lt;/font&gt;
    if current pair has a count larger than the smallest count in the array&lt;font&gt;&lt;/font&gt;
        replace that pair with the current one&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
print all pairs in array&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Well, personally, I'd split the file into different sizes of say 128mb, maintaining two in memory all the time while scannng, any discovered word is added to a Hash list, and List of List count, then I'd iterate the list of list at the end to find the top 10...&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Well the 1st thought is to manage a dtabase in form of hashtable /Array or whatever to save each words occurence, but according to the data size i would rather:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Get the 1st 10 found words where occurence &amp;gt;= 2&lt;/li&gt; 
 &lt;li&gt;Get how many times these words occure in the entire string and delete them while counting&lt;/li&gt; 
 &lt;li&gt;Start again, once you have two sets of 10 words each you get the most occured 10 words of both sets&lt;/li&gt; 
 &lt;li&gt;Do the same for the rest of the string(which dosnt contain these words anymore).&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;You can even try to be more effecient and start with 1st found 10 words where occurence &amp;gt;= 5 for example or more, if not found reduce this value until 10 words found. Throuh this you have a good chance to avoid using memory intensivly saving all words occurences which is a huge amount of data, and you can save scaning rounds (in a good case)&lt;/p&gt; 
&lt;p&gt;But in the worst case you may have more rounds than in a conventional algorithm.&lt;/p&gt; 
&lt;p&gt;By the way its a problem i would try to solve with a functional programing language rather than OOP.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;The method below will only read your data once and can be tuned for memory sizes. &lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Read the file in chunks of say 1GB&lt;/li&gt; 
 &lt;li&gt;For each chunk make a list of say the 5000 most occurring words with their frequency &lt;/li&gt; 
 &lt;li&gt;Merge the lists based on frequency (1000 lists with 5000 words each)&lt;/li&gt; 
 &lt;li&gt;Return the top 10 of the merged list&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Theoretically you might miss words, althoug I think that chance is very very small.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Storm is the technogy to look at. It separates the role of data input (spouts ) from processors (bolts). The chapter 2 of the storm book solves your exact problem and describes the system architecture very well - &lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/com/1449324010&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.amazon.com/Getting-Started-Storm-Jonathan-Leibiusky/dp/1449324010&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;Storm is more real time processing as opposed to batch processing with Hadoop. If your data is per existing then you can distribute loads to different spouts and spread them for processing to different bolts . &lt;/p&gt; 
&lt;p&gt;This algorithm also will enable support for data growing beyond terabytes as the date will be analysed as it arrives in real time.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Very interesting question. It relates more to logic analysis than coding. With the assumption of English language and valid sentences it comes easier.&lt;/p&gt; 
&lt;p&gt;You don't have to count all words, just the ones with a length less than or equal to the average word length of the given language (for English is 5.1). Therefore you will not have problems with memory.&lt;/p&gt; 
&lt;p&gt;As for reading the file you should choose a parallel mode, reading chunks (size of your choice) by manipulating file positions for white spaces. If you decide to read chunks of 1MB for example all chunks except the first one should be a bit wider (+22 bytes from left and +22 bytes from right where 22 represents the longest English word - if I'm right). For parallel processing you will need a concurrent dictionary or local collections that you will merge.&lt;/p&gt; 
&lt;p&gt;Keep in mind that normally you will end up with a top ten as part of a valid stop word list (this is probably another reverse approach which is also valid as long as the content of the file is ordinary).&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Try to think of special data structure to approach this kind of problems. In this case special kind of tree like trie to store strings in specific way, very efficient. Or second way to build your own solution like counting words. I guess this TB of data would be in English then we do have around 600,000 words in general so it'll be possible to store only those words and counting which strings would be repeated + this solution will need regex to eliminate some special characters. First solution will be faster, I'm pretty sure. &lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Trie&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Trie&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여기 자바 &lt;/font&gt;&lt;a href=&quot;http://algs4.cs.princeton.edu/52trie/TrieST.java.html&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://algs4.cs.princeton.edu/52trie/TrieST.java.html&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 의 타이어 구현이 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;br&gt; &lt;a href=&quot;http://algs4.cs.princeton.edu/52trie/TrieST.java.html&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;MapReduce&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt; &lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; WordCount는 hadoop을 사용하는 mapreduce를 통해 효율적으로 달성 할 수 있습니다. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://hadoop.apache.org/docs/r1.2.1/mapred_tutorial.html#Example%3A+WordCount+v1.0&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://hadoop.apache.org/docs/r1.2.1/mapred_tutorial.html#Example%3A+WordCount+v1.0&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 대용량 파일을 파싱 할 수 있으며 클러스터의 여러 노드를 사용하여이 작업을 수행합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public void map(LongWritable key, Text value, OutputCollector&amp;lt;Text, IntWritable&amp;gt; output, Reporter reporter) throws IOException {&lt;font&gt;&lt;/font&gt;
       String line = value.toString();&lt;font&gt;&lt;/font&gt;
       StringTokenizer tokenizer = new StringTokenizer(line);&lt;font&gt;&lt;/font&gt;
       while (tokenizer.hasMoreTokens()) {&lt;font&gt;&lt;/font&gt;
             word.set(tokenizer.nextToken());&lt;font&gt;&lt;/font&gt;
             output.collect(word, one);&lt;font&gt;&lt;/font&gt;
       }&lt;font&gt;&lt;/font&gt;
         }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
public static class Reduce extends MapReduceBase implements Reducer&amp;lt;Text, IntWritable, Text, IntWritable&amp;gt; {&lt;font&gt;&lt;/font&gt;
         public void reduce(Text key, Iterator&amp;lt;IntWritable&amp;gt; values, OutputCollector&amp;lt;Text, IntWritable&amp;gt; output, Reporter reporter) throws IOException {&lt;font&gt;&lt;/font&gt;
       int sum = 0;&lt;font&gt;&lt;/font&gt;
           while (values.hasNext()) {&lt;font&gt;&lt;/font&gt;
             sum += values.next().get();&lt;font&gt;&lt;/font&gt;
           }&lt;font&gt;&lt;/font&gt;
       output.collect(key, new IntWritable(sum));&lt;font&gt;&lt;/font&gt;
     }&lt;font&gt;&lt;/font&gt;
       }&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/12190326/parsing-one-terabyte-of-text-and-efficiently-counting-the-number-of-occurrences&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/12190326/parsing-one-terabyte-of-text-and-efficiently-counting-the-number-of-occurrences&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2681</guid>
      <comments>https://nicepro.tistory.com/2681#entry2681comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:55:20 +0900</pubDate>
    </item>
    <item>
      <title>AWS EC2 Ubuntu Ubuntu 12.04.1 LTS : deb 명령을 찾을 수 없음</title>
      <link>https://nicepro.tistory.com/2680</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;AWS EC2 Ubuntu Ubuntu 12.04.1 LTS : deb 명령을 찾을 수 없음&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;AWS EC2 Linux 인스턴스에 mongoDb를 설치하려고 할 때 : Ubuntu 12.04.1 LTS,&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;deb 명령을 찾을 수 없음을 의미하는 다음 오류가 발생합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;$ deb 죄송합니다. command-not-found가 충돌했습니다! &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://bugs.launchpad.net/command-not-found/+filebug&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://bugs.launchpad.net/command-not-found/+filebug&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 에서 버그 보고서를 제출 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하십시오 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. 보고서에 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음 정보를 포함하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
 &lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;명령을 찾을 수없는 버전 : 0.2.44&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;누군가 내 AWS 인스턴스에 deb를 설치하는 방법을 찾도록 도와 줄 수 있습니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Deb는 명령이 아닙니다. &lt;/font&gt;&lt;/font&gt;&lt;code&gt;/etc/apt/sources.list&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;파일 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;을 편집 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하고 다음 줄을 추가해야합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;파일의 끝까지.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 시스템을 업데이트 한 다음 MongoDB를 설치합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;mongodb가 필요한 패키지라고 가정하고 다음 명령을 실행하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;sudo apt-get update&lt;font&gt;&lt;/font&gt;
sudo apt-get install mongodb&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/13195385/aws-ec2-ubuntu-ubuntu-12-04-1-lts-deb-command-not-found&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/13195385/aws-ec2-ubuntu-ubuntu-12-04-1-lts-deb-command-not-found&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2680</guid>
      <comments>https://nicepro.tistory.com/2680#entry2680comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:55:00 +0900</pubDate>
    </item>
    <item>
      <title>불씨 링크에 수업 추가</title>
      <link>https://nicepro.tistory.com/2679</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;불씨 링크에 수업 추가&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;중첩 된 경로에 대한 링크를 만들고이 링크에 클래스를 추가하려고합니다 (트위터 부트 스트랩 용).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;결과는 다음과 같아야합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt; a href=&quot;/#/rents/42&quot; class=&quot;btn btn-primary btn-small&quot;&amp;gt;do something&amp;lt; /a&amp;gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;첫 시도:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;{{#link-to &quot;rent&quot; rent}}
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;리소스에 대한 링크를 제공하지만 (css) 클래스를 지정할 수 없습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;문서에서 제목 속성 만 지정할 수 있음을 알 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;두 번째 시도 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt; a href=&quot;/#/rents/{{rend.id}}&quot; class=&quot;btn btn-primary btn-small&quot;&amp;gt;do something&amp;lt; /a&amp;gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Ember가 href에 [자동 업데이트를위한] 도우미 태그를 추가 할 것이기 때문입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그래서 내가 무엇을 할 수 있니?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용하다:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;{{#link-to 'rent' rent class='btn btn-primary btn-small'}}Go to rent{{/link-to}}&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;으로는 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;link-to&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;뷰 도우미입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;{{#linkTo}}&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;도우미 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;에서 클래스를 잘 추가 할 수 있으며 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;, 불씨를 혼동하지 않도록 기억하면됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;엠버는 클래스가 생각하는 수 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;routeName&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;의 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;params&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;I는 모두 후 클래스를 포함 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;params&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하고 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;routeName&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그리고 그것을 잘 작동합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;{{#linkTo 'dashboard.screenshots' value.model class='thumbnail'}}&lt;font&gt;&lt;/font&gt;
   ........&lt;font&gt;&lt;/font&gt;
{{/linkTo}}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;생산 &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;a id=&quot;ember507&quot; class=&quot;ember-view thumbnail&quot; href=&quot;#/project-2/member-1/task-2/screenshot-30&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
   .........&lt;font&gt;&lt;/font&gt;
&amp;lt;/a&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;변수에서 수동으로 무언가를 구성하려면 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;{{unbound}}&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;ember.js에 도우미가 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예를 들어 코드는 다음과 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;a href=&quot;/#/rents/{{unbound rend.id}}&quot; class=&quot;btn btn-primary btn-small&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
   do something&lt;font&gt;&lt;/font&gt;
&amp;lt;/a&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/14552911/add-class-to-ember-link-to&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/14552911/add-class-to-ember-link-to&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2679</guid>
      <comments>https://nicepro.tistory.com/2679#entry2679comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:54:53 +0900</pubDate>
    </item>
    <item>
      <title>Gnome 터미널의 배경 설정을 재정의하는 Vim 색 구성표</title>
      <link>https://nicepro.tistory.com/2678</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Gnome 터미널의 배경 설정을 재정의하는 Vim 색 구성표&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그놈 터미널의 배경을 약간 투명하게 짙은 파란색으로 설정하여 코딩 할 때 기본 웹 페이지 나 다른 문서를 볼 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 터미널 배경으로 보이는 smyck 색 구성표를 배경으로 사용했기 때문에 Vim에 들어가면 매끄럽게 보입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/oMa9m.png&quot; alt=&quot;웹 페이지 상단의 내 터미널 창&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; (웹 페이지 상단의 내 터미널 창)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Wt5jw.png&quot; alt=&quot;vim에 들어가는 동일한 터미널 창&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; (vim에 들어가는 동일한 터미널 창)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;최근에 다른 색 구성표로 전환하기로 결정했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;젤리 빈을 시험해 보았을 때 아래에서 볼 수 있듯이 기본 터미널 배경 설정 (색상과 투명도 모두)이 재정의되었음을 알았습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/p8Kcu.png&quot; alt=&quot;이제 젤리 빈과 함께 vim에 들어가는 동일한 터미널 창&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; (이제 jellybeans로 vim에 들어가는 동일한 터미널 창)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;AfterColors 플러그인을 설치했지만 기본 배경을 되돌리기 위해 색 구성표를 어디에서 조정해야할지 모르겠습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;어떤 제안이라도?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;ctermbg를 none으로 설정합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;hi Normal ctermbg=none
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;perreal의 대답에 추가로, 당신은 또한&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;highlight NonText ctermbg=none&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이렇게하면 다른 &quot;존재하지 않는&quot;영역을 투명하게 만드는 데 도움이됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/21572179/vim-color-scheme-overriding-the-background-settings-in-gnome-terminal&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/21572179/vim-color-scheme-overriding-the-background-settings-in-gnome-terminal&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2678</guid>
      <comments>https://nicepro.tistory.com/2678#entry2678comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:54:45 +0900</pubDate>
    </item>
    <item>
      <title>명령 출력을 bash의 변수에 저장할 때 줄 바꿈을 유지하는 방법은 무엇입니까?</title>
      <link>https://nicepro.tistory.com/2677</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;명령 출력을 bash의 변수에 저장할 때 줄 바꿈을 유지하는 방법은 무엇입니까?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Linux에서 bash 셸을 사용하고 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 간단한 스크립트가 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;#!/bin/bash&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
TEMP=`sed -n '/'&quot;Starting deployment of&quot;'/,/'&quot;Failed to start context&quot;'/p' &quot;/usr/java/jboss/standalone/log/server.log&quot; | tac | awk '/'&quot;Starting deployment of&quot;'/ {print;exit} 1' | tac`&lt;font&gt;&lt;/font&gt;
echo $TEMP&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하지만이 스크립트를 실행하면&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;./temp.sh
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;모든 출력은 캐리지 리턴 / 새 줄없이 인쇄됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;출력을 $ TEMP에 저장하는 방식인지 에코 명령 자체인지 확실하지 않습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;명령의 출력을 변수에 저장하고 줄 바꿈 / 캐리지 리턴을 유지하려면 어떻게해야합니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;변수를 &lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;인용&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 하십시오. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그 이유는 다음과 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$ f=&quot;fafafda&lt;font&gt;&lt;/font&gt;
&amp;gt; adffd&lt;font&gt;&lt;/font&gt;
&amp;gt; adfadf&lt;font&gt;&lt;/font&gt;
&amp;gt; adfafd&lt;font&gt;&lt;/font&gt;
&amp;gt; afd&quot;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ echo $f&lt;font&gt;&lt;/font&gt;
fafafda adffd adfadf adfafd afd&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ echo &quot;$f&quot;&lt;font&gt;&lt;/font&gt;
fafafda&lt;font&gt;&lt;/font&gt;
adffd&lt;font&gt;&lt;/font&gt;
adfadf&lt;font&gt;&lt;/font&gt;
adfafd&lt;font&gt;&lt;/font&gt;
afd&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따옴표가 없으면 쉘은 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;$TEMP&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;포함 된 문자로 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대체 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;됩니다 (그 중 하나는 개행 문자 임). &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;echo&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;쉘 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;을 호출하기 전에 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Internal Field Separator&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;(IFS)를 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용하여 해당 문자열을 여러 인수로 분할 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하고 결과 인수 목록을 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;echo&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기본적으로는 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;IFS&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;공백 (공백, 탭 및 줄 바꿈)으로 설정되어 있으므로 셸은 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;$TEMP&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;문자열을 인수로 자르고 줄 바꿈을 볼 수 없습니다. 셸은 공백처럼 구분자로 간주하기 때문입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;같은 문제가 발생했습니다. 견적이 도움이 될 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ubuntu@host:~/apps$ apps=&quot;abc&lt;font&gt;&lt;/font&gt;
&amp;gt; def&quot;&lt;font&gt;&lt;/font&gt;
ubuntu@host:~/apps$ echo $apps&lt;font&gt;&lt;/font&gt;
abc def&lt;font&gt;&lt;/font&gt;
ubuntu@host:~/apps$ echo &quot;$apps&quot;&lt;font&gt;&lt;/font&gt;
abc&lt;font&gt;&lt;/font&gt;
def&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/22101778/how-to-preserve-line-breaks-when-storing-a-command-output-to-a-variable-in-bash&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/22101778/how-to-preserve-line-breaks-when-storing-a-command-output-to-a-variable-in-bash&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2677</guid>
      <comments>https://nicepro.tistory.com/2677#entry2677comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:54:36 +0900</pubDate>
    </item>
    <item>
      <title>dplyr mutate rowSums 계산 또는 사용자 지정 함수</title>
      <link>https://nicepro.tistory.com/2676</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;dplyr mutate rowSums 계산 또는 사용자 지정 함수&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;rowSums&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같이 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;행 계산의 종류에서 새 변수를 변경하려고 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;iris %&amp;gt;% &lt;font&gt;&lt;/font&gt;
  mutate_(sumVar = &lt;font&gt;&lt;/font&gt;
            iris %&amp;gt;% &lt;font&gt;&lt;/font&gt;
            select(Sepal.Length:Petal.Width) %&amp;gt;%&lt;font&gt;&lt;/font&gt;
            rowSums)&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;결과는 &quot;sumVar&quot;가 첫 번째 값 (10.2)으로 잘립니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Source: local data frame [150 x 6]&lt;font&gt;&lt;/font&gt;
Groups: &amp;lt;by row&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
   Sepal.Length Sepal.Width Petal.Length Petal.Width Species sumVar&lt;font&gt;&lt;/font&gt;
1           5.1         3.5          1.4         0.2  setosa   10.2&lt;font&gt;&lt;/font&gt;
2           4.9         3.0          1.4         0.2  setosa   10.2&lt;font&gt;&lt;/font&gt;
3           4.7         3.2          1.3         0.2  setosa   10.2&lt;font&gt;&lt;/font&gt;
4           4.6         3.1          1.5         0.2  setosa   10.2&lt;font&gt;&lt;/font&gt;
5           5.0         3.6          1.4         0.2  setosa   10.2&lt;font&gt;&lt;/font&gt;
6           5.4         3.9          1.7         0.4  setosa   10.2&lt;font&gt;&lt;/font&gt;
..&lt;font&gt;&lt;/font&gt;
Warning message:&lt;font&gt;&lt;/font&gt;
Truncating vector to length 1 &lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;rowwise&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;적용 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해야합니까 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또는 이러한 종류의 계산에 사용할 올바른 동사는 무엇입니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;편집하다:&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;더 구체적으로, 인라인 사용자 정의 함수를 실현하는 방법이 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;dplyr&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;있습니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같이 할 수 있는지 궁금합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;iris %&amp;gt;% &lt;font&gt;&lt;/font&gt;
  mutate(sumVar = colsum_function(Sepal.Length:Petal.Width))&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 해결 방법에 더 가깝지만 사용할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;iris %&amp;gt;% mutate(sumVar = rowSums(.[1:4]))
&lt;/code&gt;&lt;/pre&gt; 
&lt;hr&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;주석에 쓰여진 것처럼 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;select&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;, 예를 들어 요약하려는 열을 얻기 위해 mutate 내부를 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용할 수도 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;iris %&amp;gt;% &lt;font&gt;&lt;/font&gt;
  mutate(sumVar = rowSums(select(., contains(&quot;Sepal&quot;)))) %&amp;gt;% &lt;font&gt;&lt;/font&gt;
  head &lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또는 &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;iris %&amp;gt;% &lt;font&gt;&lt;/font&gt;
  mutate(sumVar = select(., contains(&quot;Sepal&quot;)) %&amp;gt;% rowSums()) %&amp;gt;% &lt;font&gt;&lt;/font&gt;
  head&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;더 복잡한 방법은 다음과 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; iris %&amp;gt;% select(Sepal.Length:Petal.Width) %&amp;gt;%&lt;font&gt;&lt;/font&gt;
mutate(sumVar = rowSums(.)) %&amp;gt;% left_join(iris)&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;@docendodiscimus의 댓글을 답변으로 추가합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그에게 +1!&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;iris %&amp;gt;% mutate(sumVar = rowSums(select(., contains(&quot;Sepal&quot;))))
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I am using this simple solution, which is a more robust modification of the answer by Davide Passaretti:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;iris %&amp;gt;% select(Sepal.Length:Petal.Width) %&amp;gt;%&lt;font&gt;&lt;/font&gt;
  transmute(sumVar = rowSums(.)) %&amp;gt;% bind_cols(iris, .)&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;(But it requires a defined row order, which should be fine, unless you work with remote datasets perhaps..)&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;You can also use a grep in place of &lt;code&gt;contains&lt;/code&gt; or &lt;code&gt;matches&lt;/code&gt;, just in case you need to get fancy with the regular expressions (&lt;code&gt;matches&lt;/code&gt; doesn't seem to much like negative lookaheads and the like in my experience).&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;iris %&amp;gt;% mutate(sumVar = rowSums(select(., grep(&quot;Sepal&quot;, names(.)))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/27354734/dplyr-mutate-rowsums-calculations-or-custom-functions&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/27354734/dplyr-mutate-rowsums-calculations-or-custom-functions&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2676</guid>
      <comments>https://nicepro.tistory.com/2676#entry2676comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:54:28 +0900</pubDate>
    </item>
    <item>
      <title>Docker 컨테이너에서 영구적으로 PATH 환경 변수 업데이트</title>
      <link>https://nicepro.tistory.com/2675</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Docker 컨테이너에서 영구적으로 PATH 환경 변수 업데이트&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는에 추가하는 시도 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;PATH&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;파일에 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;~/.profile&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;와 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;/etc/profile&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;PATH = $PATH:/required/path
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 작동하지 않습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 라인 쇼를 추가하려고 시도했지만 작동하지 않았습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;export PATH
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;컨테이너와 호스트를 모두 다시 시작한 후에도 작동하지 않았습니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;당신은을 포함 할 경우 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;/new/path&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;에 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Dockerfile&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 라인을 추가 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;ENV PATH &quot;$PATH:/new/path&quot;&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Dockerfile&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 에서 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;작동합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Dockerfile &lt;/font&gt;&lt;/font&gt;&lt;code&gt;ENV PATH xxx&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;에이 Dockerfile &lt;/font&gt;&lt;a href=&quot;https://gist.github.com/deepak/5933685&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://gist.github.com/deepak/5933685&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 의 예제를 참조하십시오.&lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://gist.github.com/deepak/5933685&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;irc 채팅에서이 질문에 대한 답을 얻었습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 문제를 접할 수있는 모든 사람을 위해 여기에 제공됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;많은 사람들이 업데이트로 잘못된 답변을 주 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;~/.profile&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;었지만 작동하지 않았습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따라서 아래 답변을 사용하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;~/.bashrc&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용자에 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대한 파일 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;을 업데이트하거나 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;/etc/enviroment&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;모든 사용자에게 적용될 전역 변경을 위해 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;파일 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;전역을 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;업데이트합니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;에서 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;.bashrc&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;수출 경로 :&lt;/font&gt;&lt;/font&gt;&lt;code&gt;export PATH=$PATH:/new/path/bin&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;환경에서 : &lt;/font&gt;&lt;/font&gt;&lt;code&gt;PATH=$PATH:/new/path/bin&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/28722548/updating-path-environment-variable-permanently-in-docker-container&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/28722548/updating-path-environment-variable-permanently-in-docker-container&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2675</guid>
      <comments>https://nicepro.tistory.com/2675#entry2675comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:54:19 +0900</pubDate>
    </item>
    <item>
      <title>msi 설치 후 exe를 실행 하시겠습니까?</title>
      <link>https://nicepro.tistory.com/2674</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;msi 설치 후 exe를 실행 하시겠습니까?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio 2008을 사용하여 설치 프로젝트와 함께 내 프로그램을 배포하는 msi를 만듭니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;msi가 방금 설치 한 exe를 실행하도록하는 방법을 알고 싶습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;커스텀 액션? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그렇다면 장소 / 방법을 설명해주십시오. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;감사.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 일반적인 질문입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 그것을하지 않는다 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;단지&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 사용자 지정 작업. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내가 아는 유일한 방법은 .msi가 생성 된 후 수정하는 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;자바 스크립트 스크립트를 빌드 후 이벤트로 실행하여 정확히 수행합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;설치 마법사에 &quot;Launch Application Foo?&quot;라는 확인란과 함께 새 대화 상자가 삽입됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그리고 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용자 지정 작업이&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 확인란을 선택하면 응용 프로그램을 실행합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;설치 마법사 순서의 마지막 화면으로 나타납니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같이 보입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;https://imgur.com/bhubH.png&quot; alt=&quot;대체 텍스트&quot;&gt;&lt;/p&gt; 
&lt;hr&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음은 MSI를 수정하는 데 사용하는 스크립트입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre class=&quot;lang-js prettyprint-override&quot;&gt;&lt;code&gt;// EnableLaunchApplication.js &amp;lt;msi-file&amp;gt;&lt;font&gt;&lt;/font&gt;
// Performs a post-build fixup of an msi to launch a specific file when the install has completed&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Configurable values&lt;font&gt;&lt;/font&gt;
var checkboxChecked = true;                     // Is the checkbox on the finished dialog checked by default?&lt;font&gt;&lt;/font&gt;
var checkboxText = &quot;Launch [ProductName]&quot;;      // Text for the checkbox on the finished dialog&lt;font&gt;&lt;/font&gt;
var filename = &quot;WindowsApplication1.exe&quot;;       // The name of the executable to launch - change this to match the file you want to launch at the end of your setup&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Constant values from Windows Installer&lt;font&gt;&lt;/font&gt;
var msiOpenDatabaseModeTransact = 1;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
var msiViewModifyInsert         = 1;&lt;font&gt;&lt;/font&gt;
var msiViewModifyUpdate         = 2;&lt;font&gt;&lt;/font&gt;
var msiViewModifyAssign         = 3;&lt;font&gt;&lt;/font&gt;
var msiViewModifyReplace        = 4;&lt;font&gt;&lt;/font&gt;
var msiViewModifyDelete         = 6;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
if (WScript.Arguments.Length != 1)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
        WScript.StdErr.WriteLine(WScript.ScriptName + &quot; file&quot;);&lt;font&gt;&lt;/font&gt;
        WScript.Quit(1);&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
var filespec = WScript.Arguments(0);&lt;font&gt;&lt;/font&gt;
var installer = WScript.CreateObject(&quot;WindowsInstaller.Installer&quot;);&lt;font&gt;&lt;/font&gt;
var database = installer.OpenDatabase(filespec, msiOpenDatabaseModeTransact);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
var sql;&lt;font&gt;&lt;/font&gt;
var view;&lt;font&gt;&lt;/font&gt;
var record;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
try&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
        var fileId = FindFileIdentifier(database, filename);&lt;font&gt;&lt;/font&gt;
        if (!fileId)&lt;font&gt;&lt;/font&gt;
                throw &quot;Unable to find '&quot; + filename + &quot;' in File table&quot;;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        WScript.Echo(&quot;Updating the Control table...&quot;);&lt;font&gt;&lt;/font&gt;
        // Modify the Control_Next of BannerBmp control to point to the new CheckBox&lt;font&gt;&lt;/font&gt;
        sql = &quot;SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE `Dialog_`='FinishedForm' AND `Control`='BannerBmp'&quot;;&lt;font&gt;&lt;/font&gt;
        view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
        view.Execute();&lt;font&gt;&lt;/font&gt;
        record = view.Fetch();&lt;font&gt;&lt;/font&gt;
        record.StringData(11) = &quot;CheckboxLaunch&quot;;&lt;font&gt;&lt;/font&gt;
        view.Modify(msiViewModifyReplace, record);&lt;font&gt;&lt;/font&gt;
        view.Close();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        // Insert the new CheckBox control&lt;font&gt;&lt;/font&gt;
        sql = &quot;INSERT INTO `Control` (`Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help`) VALUES ('FinishedForm', 'CheckboxLaunch', 'CheckBox', '9', '201', '343', '12', '3', 'LAUNCHAPP', '{\\VSI_MS_Sans_Serif13.0_0_0}&quot; + checkboxText + &quot;', 'CloseButton', '|')&quot;;&lt;font&gt;&lt;/font&gt;
        view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
        view.Execute();&lt;font&gt;&lt;/font&gt;
        view.Close();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        WScript.Echo(&quot;Updating the ControlEvent table...&quot;);&lt;font&gt;&lt;/font&gt;
        // Modify the Order of the EndDialog event of the FinishedForm to 1&lt;font&gt;&lt;/font&gt;
        sql = &quot;SELECT `Dialog_`, `Control_`, `Event`, `Argument`, `Condition`, `Ordering` FROM `ControlEvent` WHERE `Dialog_`='FinishedForm' AND `Event`='EndDialog'&quot;;&lt;font&gt;&lt;/font&gt;
        view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
        view.Execute();&lt;font&gt;&lt;/font&gt;
        record = view.Fetch();&lt;font&gt;&lt;/font&gt;
        record.IntegerData(6) = 1;&lt;font&gt;&lt;/font&gt;
        view.Modify(msiViewModifyReplace, record);&lt;font&gt;&lt;/font&gt;
        view.Close();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        // Insert the Event to launch the application&lt;font&gt;&lt;/font&gt;
        sql = &quot;INSERT INTO `ControlEvent` (`Dialog_`, `Control_`, `Event`, `Argument`, `Condition`, `Ordering`) VALUES ('FinishedForm', 'CloseButton', 'DoAction', 'VSDCA_Launch', 'LAUNCHAPP=1', '0')&quot;;&lt;font&gt;&lt;/font&gt;
        view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
        view.Execute();&lt;font&gt;&lt;/font&gt;
        view.Close();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        WScript.Echo(&quot;Updating the CustomAction table...&quot;);&lt;font&gt;&lt;/font&gt;
        // Insert the custom action to launch the application when finished&lt;font&gt;&lt;/font&gt;
        sql = &quot;INSERT INTO `CustomAction` (`Action`, `Type`, `Source`, `Target`) VALUES ('VSDCA_Launch', '210', '&quot; + fileId + &quot;', '')&quot;;&lt;font&gt;&lt;/font&gt;
        view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
        view.Execute();&lt;font&gt;&lt;/font&gt;
        view.Close();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (checkboxChecked)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
                WScript.Echo(&quot;Updating the Property table...&quot;);&lt;font&gt;&lt;/font&gt;
                // Set the default value of the CheckBox&lt;font&gt;&lt;/font&gt;
                sql = &quot;INSERT INTO `Property` (`Property`, `Value`) VALUES ('LAUNCHAPP', '1')&quot;;&lt;font&gt;&lt;/font&gt;
                view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
                view.Execute();&lt;font&gt;&lt;/font&gt;
                view.Close();&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        database.Commit();&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
catch(e)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
        WScript.StdErr.WriteLine(e);&lt;font&gt;&lt;/font&gt;
        WScript.Quit(1);&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
function FindFileIdentifier(database, fileName)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
        // First, try to find the exact file name&lt;font&gt;&lt;/font&gt;
        var sql = &quot;SELECT `File` FROM `File` WHERE `FileName`='&quot; + fileName + &quot;'&quot;;&lt;font&gt;&lt;/font&gt;
        var view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
        view.Execute();&lt;font&gt;&lt;/font&gt;
        var record = view.Fetch();&lt;font&gt;&lt;/font&gt;
        if (record)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
                var value = record.StringData(1);&lt;font&gt;&lt;/font&gt;
                view.Close();&lt;font&gt;&lt;/font&gt;
                return value;&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        view.Close();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        // The file may be in SFN|LFN format.  Look for a filename in this case next&lt;font&gt;&lt;/font&gt;
        sql = &quot;SELECT `File`, `FileName` FROM `File`&quot;;&lt;font&gt;&lt;/font&gt;
        view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
        view.Execute();&lt;font&gt;&lt;/font&gt;
        record = view.Fetch();&lt;font&gt;&lt;/font&gt;
        while (record)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
                if (StringEndsWith(record.StringData(2), &quot;|&quot; + fileName))&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                        var value = record.StringData(1);&lt;font&gt;&lt;/font&gt;
                        view.Close();&lt;font&gt;&lt;/font&gt;
                        return value;&lt;font&gt;&lt;/font&gt;
                }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
                record = view.Fetch();&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        view.Close();&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
function StringEndsWith(str, value)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
        if (str.length &amp;lt; value.length)&lt;font&gt;&lt;/font&gt;
                return false;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        return (str.indexOf(value, str.length - value.length) != -1);&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 원래 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://blogs.msdn.com/b/astebner/archive/2006/08/12/696833.aspx&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Aaron Stebner의 블로그&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 에서 이것을 &lt;/font&gt;&lt;a href=&quot;http://blogs.msdn.com/b/astebner/archive/2006/08/12/696833.aspx&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가져와&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 수정했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해당 Javascript 파일을 프로젝트 디렉토리 (.vdproj를 포함하는 것과 동일한 디렉토리)에 저장하고 이름을 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;ModifyMsiToEnableLaunchApplication.js&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;각각의 고유 한 설정 프로젝트에 대해 해당 스크립트를 수정하고 적절한 exe 이름을 입력해야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 Setup 프로젝트에서 빌드 후 이벤트를 다음과 같이 설정해야합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;cscript.exe &quot;$(ProjectDir)ModifyMsiToEnableLaunchApplication.js&quot; &quot;$(BuiltOuputPath)&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;매크로 이름을 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;$(BuiltOuputPath)&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;올바르게 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;입력해야 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 단어는 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Ouput&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Microsoft에서 철자가, 그리고 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Built&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;철자가되지 않는다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Build&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;!&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그렇게해야합니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; : &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;UNINSTALL에 &quot;run Foo.exe&quot;확인란이 포함되지 않은 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/a/2998791/48082&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 수정&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; .&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 훨씬 더 간단한 솔루션 인 것 같습니다. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/3168782/visual-studio-installer-how-to-launch-app-at-end-of-installer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio 설치 관리자&amp;gt; 설치 프로그램 종료시 앱을 시작하는 방법&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;확인!!! &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음은 체크 박스 컨트롤 가시성 조건을 추가하는 것과 함께 컨트롤의 Y 및 높이를 변경할 수있는 기능을 제공하는 코드 (두 가지 보조 기능 'FindFileIdentifier'및 'StringEndsWith'가없는 상태입니다. 대신 원본을 사용하십시오.) ( 'NEW-START'에서 'NEW-END'사이에 표시된 2 개의 댓글 참조) :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre class=&quot;lang-js prettyprint-override&quot;&gt;&lt;code&gt;&lt;font&gt;&lt;/font&gt;
// EnableLaunchApplication.js &lt;font&gt;&lt;/font&gt;
// Performs a post-build fixup of an msi to launch a specific file when the install has completed&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Configurable values&lt;font&gt;&lt;/font&gt;
var checkboxChecked = true;                     // Is the checkbox on the finished dialog checked by default?&lt;font&gt;&lt;/font&gt;
var checkboxText = &quot;Launch [ProductName]?&quot;;     // Text for the checkbox on the finished dialog&lt;font&gt;&lt;/font&gt;
var filename = &quot;*.exe&quot;;                     // The name of the executable to launch - change * to match the file name you want to launch at the end of your setup&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Constant values from Windows Installer&lt;font&gt;&lt;/font&gt;
var msiOpenDatabaseModeTransact = 1;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
var msiViewModifyInsert         = 1&lt;font&gt;&lt;/font&gt;
var msiViewModifyUpdate         = 2&lt;font&gt;&lt;/font&gt;
var msiViewModifyAssign         = 3&lt;font&gt;&lt;/font&gt;
var msiViewModifyReplace        = 4&lt;font&gt;&lt;/font&gt;
var msiViewModifyDelete         = 6&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
if (WScript.Arguments.Length != 1)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
        WScript.StdErr.WriteLine(WScript.ScriptName + &quot; file&quot;);&lt;font&gt;&lt;/font&gt;
        WScript.Quit(1);&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
var filespec = WScript.Arguments(0);&lt;font&gt;&lt;/font&gt;
var installer = WScript.CreateObject(&quot;WindowsInstaller.Installer&quot;);&lt;font&gt;&lt;/font&gt;
var database = installer.OpenDatabase(filespec, msiOpenDatabaseModeTransact);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
var sql&lt;font&gt;&lt;/font&gt;
var view&lt;font&gt;&lt;/font&gt;
var record&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
try&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
        var fileId = FindFileIdentifier(database, filename);&lt;font&gt;&lt;/font&gt;
        if (!fileId)&lt;font&gt;&lt;/font&gt;
                throw &quot;Unable to find '&quot; + filename + &quot;' in File table&quot;;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        WScript.Echo(&quot;Updating the Control table...&quot;);&lt;font&gt;&lt;/font&gt;
        // Modify the Control_Next of BannerBmp control to point to the new CheckBox&lt;font&gt;&lt;/font&gt;
        sql = &quot;SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE `Dialog_`='FinishedForm' AND `Control`='BannerBmp'&quot;;&lt;font&gt;&lt;/font&gt;
        view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
        view.Execute();&lt;font&gt;&lt;/font&gt;
        record = view.Fetch();&lt;font&gt;&lt;/font&gt;
        record.StringData(11) = &quot;CheckboxLaunch&quot;;&lt;font&gt;&lt;/font&gt;
        view.Modify(msiViewModifyReplace, record);&lt;font&gt;&lt;/font&gt;
        view.Close();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        // NEW - START&lt;font&gt;&lt;/font&gt;
        // Insert the new CheckBox control&lt;font&gt;&lt;/font&gt;
        // I changed the value for Y below from 201 to 191 in order to make the checkbox more obvious to the user's eye. In order to do so, and avoid the controls 'BodyText' &amp;amp; 'BodyTextRemove' in the same form to&lt;font&gt;&lt;/font&gt;
        // overlap the checkbox, I added yet 2 more sql statements that change the values of the heights for the 'BodyText' &amp;amp; 'BodyTextRemove' from 138 to 128. This way I can play around with the values without using&lt;font&gt;&lt;/font&gt;
        // the Orca msi editor.&lt;font&gt;&lt;/font&gt;
        var CheckBoxY = 191; //This was initially set to 201&lt;font&gt;&lt;/font&gt;
        var NewHeight = 128; //This was initially set to 138&lt;font&gt;&lt;/font&gt;
        sql = &quot;INSERT INTO `Control` (`Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help`) VALUES ('FinishedForm', 'CheckboxLaunch', 'CheckBox', '9', '&quot; + CheckBoxY + &quot;', '343', '12', '3', 'LAUNCHAPP', '{\\VSI_MS_Sans_Serif13.0_0_0}&quot; + checkboxText + &quot;', 'CloseButton', '|')&quot;;&lt;font&gt;&lt;/font&gt;
        view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
        view.Execute();&lt;font&gt;&lt;/font&gt;
        view.Close();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        sql = &quot;Select `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE `Dialog_` = 'FinishedForm' AND `Control` = 'BodyText'&quot;;&lt;font&gt;&lt;/font&gt;
        view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
        view.Execute();&lt;font&gt;&lt;/font&gt;
        record = view.Fetch();&lt;font&gt;&lt;/font&gt;
        record.IntegerData(7) = NewHeight;&lt;font&gt;&lt;/font&gt;
        view.Modify(msiViewModifyReplace, record);&lt;font&gt;&lt;/font&gt;
        view.Close();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        sql = &quot;Select `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE `Dialog_` = 'FinishedForm' AND `Control` = 'BodyTextRemove'&quot;;&lt;font&gt;&lt;/font&gt;
        view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
        view.Execute();&lt;font&gt;&lt;/font&gt;
        record = view.Fetch();&lt;font&gt;&lt;/font&gt;
        record.IntegerData(7) = NewHeight;&lt;font&gt;&lt;/font&gt;
        view.Modify(msiViewModifyReplace, record);&lt;font&gt;&lt;/font&gt;
        view.Close();&lt;font&gt;&lt;/font&gt;
        // NEW - END&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        WScript.Echo(&quot;Updating the ControlEvent table...&quot;);&lt;font&gt;&lt;/font&gt;
        // Modify the Order of the EndDialog event of the FinishedForm to 1&lt;font&gt;&lt;/font&gt;
        sql = &quot;SELECT `Dialog_`, `Control_`, `Event`, `Argument`, `Condition`, `Ordering` FROM `ControlEvent` WHERE `Dialog_`='FinishedForm' AND `Event`='EndDialog'&quot;;&lt;font&gt;&lt;/font&gt;
        view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
        view.Execute();&lt;font&gt;&lt;/font&gt;
        record = view.Fetch();&lt;font&gt;&lt;/font&gt;
        record.IntegerData(6) = 1;&lt;font&gt;&lt;/font&gt;
        view.Modify(msiViewModifyReplace, record);&lt;font&gt;&lt;/font&gt;
        view.Close();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        // Insert the Event to launch the application&lt;font&gt;&lt;/font&gt;
        sql = &quot;INSERT INTO `ControlEvent` (`Dialog_`, `Control_`, `Event`, `Argument`, `Condition`, `Ordering`) VALUES ('FinishedForm', 'CloseButton', 'DoAction', 'VSDCA_Launch', 'LAUNCHAPP=1', '0')&quot;;&lt;font&gt;&lt;/font&gt;
        view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
        view.Execute();&lt;font&gt;&lt;/font&gt;
        view.Close();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        WScript.Echo(&quot;Updating the CustomAction table...&quot;);&lt;font&gt;&lt;/font&gt;
        // Insert the custom action to launch the application when finished&lt;font&gt;&lt;/font&gt;
        sql = &quot;INSERT INTO `CustomAction` (`Action`, `Type`, `Source`, `Target`) VALUES ('VSDCA_Launch', '210', '&quot; + fileId + &quot;', '')&quot;;&lt;font&gt;&lt;/font&gt;
        view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
        view.Execute();&lt;font&gt;&lt;/font&gt;
        view.Close();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (checkboxChecked)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
                WScript.Echo(&quot;Updating the Property table...&quot;);&lt;font&gt;&lt;/font&gt;
                // Set the default value of the CheckBox&lt;font&gt;&lt;/font&gt;
                sql = &quot;INSERT INTO `Property` (`Property`, `Value`) VALUES ('LAUNCHAPP', '1')&quot;;&lt;font&gt;&lt;/font&gt;
                view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
                view.Execute();&lt;font&gt;&lt;/font&gt;
                view.Close();&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        // NEW - START&lt;font&gt;&lt;/font&gt;
        WScript.Echo(&quot;Updating the ControlCondition table...&quot;);&lt;font&gt;&lt;/font&gt;
        // Insert the conditions where the Launch Application Checkbox appears&lt;font&gt;&lt;/font&gt;
        sql = &quot;INSERT INTO `ControlCondition` (`Dialog_`, `Control_`, `Action`, `Condition`) VALUES ('FinishedForm', 'CheckboxLaunch', 'Show', 'REMOVE=\&quot;\&quot;')&quot;;&lt;font&gt;&lt;/font&gt;
        view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
        view.Execute();&lt;font&gt;&lt;/font&gt;
        view.Close();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        sql = &quot;INSERT INTO `ControlCondition` (`Dialog_`, `Control_`, `Action`, `Condition`) VALUES ('FinishedForm', 'CheckboxLaunch', 'Hide', 'REMOVE&amp;lt;&amp;gt;\&quot;\&quot;')&quot;;&lt;font&gt;&lt;/font&gt;
        view = database.OpenView(sql);&lt;font&gt;&lt;/font&gt;
        view.Execute();&lt;font&gt;&lt;/font&gt;
        view.Close();&lt;font&gt;&lt;/font&gt;
        //NEW - END&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        database.Commit();&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
catch(e)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
        WScript.StdErr.WriteLine(e);&lt;font&gt;&lt;/font&gt;
        WScript.Quit(1);&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;숨겨진 확인란 버그&quot;와 관련하여 위의 Cheeso와 Muleskinner의 답변에 설명되지 않은 다음을 알아 냈습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;The change of the script (provided by Muleskinner) places the Y position of the checkbox to 201 (I guess top Y pixel for the control). If you change Y to, say, 151 (in order to kind of align it in the center vertically), the bug &quot;suddenly&quot; appears. The reason for that is that there is another control in the Control table of the msi, namely the 'BodyText' ('Dialog' field = 'FinishedForm') which its Y is set to 63 and its height to 138. That is 138 + 63 = 201. Therefore, if you change the Y value for the checkbox, the 'BodyText' control overlaps the newly added control and that's why the user needs to put their mouse over in order to show the checkbox. If you have no 'BodyText' or its number of characters is small enough you could change (by using Orca msi editor as I do, or by altering the script above) the Ys and Heights of these 2 controls in order to be able and accomodate a different Y position for the newly added checkbox. The same applies for the control: 'BodyTextRemove' in which again we should alter its height value (which appears during uninstall)&lt;/p&gt; 
&lt;p&gt;Hope that this helps all the users that had the same question as I had about this &quot;bug&quot;&lt;/p&gt; 
&lt;p&gt;Nevertheless, the script does a really good job!&lt;/p&gt; 
&lt;p&gt;Another question was how to make invisible the Checkbox during unistallation procedure. Using the Orca msi editor I added the following 2 rows in the ControlCondition table of the msi:&lt;/p&gt; 
&lt;p&gt;Row 1 (When control should be shown):&lt;/p&gt; 
&lt;p&gt;(Dialog)FinishedForm (Control)CheckboxLaunch (Action)Show (Condition)REMOVE=&quot;&quot;&lt;/p&gt; 
&lt;p&gt;Row 2 (When control should be invisible):&lt;/p&gt; 
&lt;p&gt;(Dialog)FinishedForm (Control)CheckboxLaunch (Action)Hide (Condition)REMOVE&amp;lt;&amp;gt;&quot;&quot;&lt;/p&gt; 
&lt;p&gt;P.S. I am using VS 2010, on windows 7 (x64), but I believe these should work with previous versions too.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;오류 코드 '1' 'Unspecified error'&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 오류로 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;인해 &lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;'PostBuildEvent'가 실패한&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 경우 PostBuildEvent를&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;cscript.exe \&quot;$(ProjectDir)ModifyMsiToEnableLaunchApplication.js\&quot; \&quot;$(BuiltOuputPath)\&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;...에&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;cscript.exe &quot;$(ProjectDir)ModifyMsiToEnableLaunchApplication.js&quot; &quot;$(BuiltOuputPath)&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;숨겨진 확인란 버그&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 와 관련하여 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;스크립트의 54 행을 다음과 같이 편집 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;sql = &quot;INSERT INTO `Control` (`Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help`) VALUES ('FinishedForm', 'CheckboxLaunch', 'CheckBox', '9', '201', '343', '12', '3', 'LAUNCHAPP', '{\\VSI_MS_Sans_Serif13.0_0_0}&quot; + checkboxText + &quot;', 'CloseButton', '|')&quot;;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예 .. 사용자 지정 작업을 작성하여 InstallExecutionSequence 테이블 끝에 붙입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/1668274/run-exe-after-msi-installation&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/1668274/run-exe-after-msi-installation&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2674</guid>
      <comments>https://nicepro.tistory.com/2674#entry2674comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:54:11 +0900</pubDate>
    </item>
    <item>
      <title>&amp;quot;if&amp;quot;필터가있는 반복자에 대한 한 줄 for 루프?</title>
      <link>https://nicepro.tistory.com/2673</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;if&quot;필터가있는 반복자에 대한 한 줄 for 루프?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;어리석은 질문 : &lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;간단한 for 루프와 간단한 if 문이 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;for airport in airports:&lt;font&gt;&lt;/font&gt;
    if airport.is_important:&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;어떻게 든 이것을 한 줄로 쓸 수 있는지 궁금합니다. &lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예, 이렇게 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;for airport in (airport for airport in airports if airport.is_important):
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 그것은 너무 어리 석고 중복됩니다 ( &lt;/font&gt;&lt;/font&gt;&lt;code&gt;for airport in airport for airport in airports...&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;). &lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;더 좋은 방법이 있습니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아니, 더 짧은 길이 없습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;일반적으로 두 줄로 나눕니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;important_airports = (airport for airport in airports if airport.is_important)&lt;font&gt;&lt;/font&gt;
for airport in important_airports:&lt;font&gt;&lt;/font&gt;
    # do stuff&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 더 유연하고 읽기 쉬우 며 여전히 많은 메모리를 소비하지 않습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;당신은 할 수 있습니다&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;for airport in filter(lamdba x: x.is_important, airports):&lt;font&gt;&lt;/font&gt;
    # do stuff...&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 루프에 부정적인 가드를 사용할 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;읽기 쉽고 추가 수준의 들여 쓰기를 도입하지 않습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;for airport in airports:&lt;font&gt;&lt;/font&gt;
    if not airport.is_important: continue&lt;font&gt;&lt;/font&gt;
    &amp;lt;body of loop&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Mabe 이것, 그러나 그것은 다소 똑같은 장황합니다 ...&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;import itertools&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
for airport in itertools.ifilter(lambda x: x.is_important, airports):&lt;font&gt;&lt;/font&gt;
    ...&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 파이썬의 디자인 철학입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;한 줄에 넣기에는 너무 많은 단어가 필요하다면, 당신을 쫓는 사람을 돕기 위해 몇 줄로 나누어야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;목록 및 생성기 표현식은 이터 러블을 제자리에서 변환하여 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;map&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;및 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;filter&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음은 일부 다른 필터 버전에 대한 대안입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;from operator import attrgetter as attr&lt;font&gt;&lt;/font&gt;
for airport in filter(attr('is_important'), airports):&lt;font&gt;&lt;/font&gt;
    ...&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 매우 간결하고 점 표기법 attr ( 'first_class.is_full')을 사용할 수있는 장점이 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또한 filter_by_attr과 같은 유틸리티 함수에 그런 것 (또는 목록 이해력을 사용하는 버전)을 넣을 수도 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;for airport in filter_by_attr(airports, 'is_important'):&lt;font&gt;&lt;/font&gt;
    ...&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 여전히 e-satis가 당신이 사용하는 방법에 관계없이 새로운 변수에 넣는 것이 옳다고 생각합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;특히 사용이 해당 속성의 이름과 정확히 일치하지 않는 경우 (또는 기준이 더 복잡한 경우) 더 명확합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이에 대한 유일한 메모는 여러 곳에서 이것을 사용하는 경우 공항을 특별 컬렉션으로 만들어야하며 필터링 된 컬렉션을 반환하는 @property 인 'important_airports'를 사용해야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또는 필터링을 숨기는 다른 추상화 (예 : 서비스 호출).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;목록 이해 사용 (공항이 객체 목록 인 경우에만) :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;for airport in [a for a in airports if a.is_important]:
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/2401785/single-line-for-loop-over-iterator-with-an-if-filter&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/2401785/single-line-for-loop-over-iterator-with-an-if-filter&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2673</guid>
      <comments>https://nicepro.tistory.com/2673#entry2673comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:53:57 +0900</pubDate>
    </item>
    <item>
      <title>Excel의 하위 문자열</title>
      <link>https://nicepro.tistory.com/2672</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Excel의 하위 문자열&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아래에 Excel에 표시된 데이터 세트가 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;R/V(208,0,32)   YR/V(255,156,0)         Y/V(255,217,0)&lt;font&gt;&lt;/font&gt;
R/S(184,28,16)  YR/S(216,128,0)         Y/S(209,171,0)&lt;font&gt;&lt;/font&gt;
R/B(255,88,80)  YR/B(255,168,40)    Y/B(255,216,40)&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그리고 각 셀의 데이터를 다음과 같이 분리하고 싶습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;R/V 208 0 32&lt;font&gt;&lt;/font&gt;
R/S 184 28 16&lt;font&gt;&lt;/font&gt;
R/B 255 88 80&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 경우에 사용할 수있는 Excel의 기능은 무엇입니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;미리 감사드립니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;kennytm의 링크는 죽었고 그는 예제를 제공하지 않았으므로 다음은 하위 문자열을 수행하는 방법입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;=MID(text, start_num, char_num)
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;cell &lt;/font&gt;&lt;/font&gt;&lt;code&gt;A1&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Hello&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;=MID(A1, 2, 3) 
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;돌아올 것이다 &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;ell
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;문자 2에서 시작하고 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;e&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;3 문자를 반환하기 때문입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Excel에서 하위 문자열 함수는 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://support.office.com/en-gb/article/MID-MIDB-functions-d5f9e25c-d7d6-472e-b568-4ecb12433028&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;MID 함수&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 라고 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하며 indexOf는 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대소 문자를 구분하는 위치의 경우 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://support.office.com/en-GB/article/FIND-FINDB-functions-C7912941-AF2A-4BDF-A553-D0D89B0A0628&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;FIND&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; , 대소 문자를 구분 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하지 않는 위치의 경우 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://support.office.com/en-us/article/SEARCH-function-C0391AB0-BE44-4519-BA51-90CC8DF12748&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;SEARCH 함수라고&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;텍스트 구문 분석의 첫 부분의 경우 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://support.office.com/en-us/article/LEFT-LEFTB-functions-9203d2d2-7960-479b-84c6-1ea52b99640c&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;LEFT 함수&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 도 유용 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여기에서 모든 텍스트 함수를 참조하십시오 : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://support.office.com/en-us/article/Text-functions-reference-CCCD86AD-547D-4EA9-A065-7BB697C2A56E&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;텍스트 함수 (참조)&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; .&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;전체 워크 시트 함수 참조 목록은 다음에서 제공됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://support.office.com/en-us/article/Excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Excel 함수 (범주 별) &lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;br&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://support.office.com/en-us/article/Excel-functions-alphabetical-b3944572-255d-4efb-bb96-c6d90033e188&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Excel 함수 (알파벳순)&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이를 수행 할 수있는 또 다른 방법은 대체 기능을 사용하는 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;(&quot;, &quot;)&quot;및 &quot;,&quot;를 공백으로 대체하십시오. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1, &quot;(&quot;, &quot; &quot;), &quot;)&quot;, &quot; &quot;), &quot;,&quot;, &quot; &quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기본에서 시작하여 원하는 결과를 얻을 수 있다고 생각합니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예를 들어 &quot;/&quot;뒤에 데이터를 추출하는 상황이있었습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;주어진 엑셀 필드의 값은 2rko6xyda14gdl7 / VEERABABU % 20MATCHA % 20IN131621.jpg입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;슬래시 기호 다음에 &quot;I5&quot;셀에서 텍스트를 추출하고 싶었습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그래서 먼저 &quot;/&quot;기호가 어디에 있는지 찾고 싶습니다 (FIND ( &quot;/&quot;, I5). 이것은 &quot;/&quot;의 위치를 ​​알려줍니다. 그런 다음 LEN (I5)으로 얻을 수있는 텍스트의 길이를 알아야합니다. .so 총 길이에서 &quot;/&quot;의 위치를 ​​뺀 값. LEN (I5)-(FIND ( &quot;/&quot;, I5)). 이것은 먼저 &quot;/&quot;위치를 찾은 다음 필요한 총 텍스트를 가져옵니다. RIGHT 함수는 RIGHT (I5,12)입니다. 가장 오른쪽 문자부터 시작하여 마지막 12 자리의 값을 모두 추출하므로 위의 함수 &quot;LEN (I5)-(FIND (&quot;/ &quot;, I5)를 대체하겠습니다. ) &quot;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;접근 방식은 &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;= RIGHT (I5, LEN (I5)-(FIND ( &quot;/&quot;, I5)))는 VEERABABU % 20MATCHA % 20IN131621.jpg로 나에게 줄 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 분명하다고 생각한다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;모두 바꾸기를 사용하는 것은 어떻습니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대괄호의 All을 공백으로 바꾸십시오. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그리고 쉼표는 공백입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그리고 나는 당신이 그것을 달성 할 수 있다고 생각합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/2727679/substring-in-excel&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/2727679/substring-in-excel&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2672</guid>
      <comments>https://nicepro.tistory.com/2672#entry2672comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:53:49 +0900</pubDate>
    </item>
    <item>
      <title>Ubuntu 10.4에서 RubyGems 1.3.6을 어떻게 구할 수 있습니까?</title>
      <link>https://nicepro.tistory.com/2671</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Ubuntu 10.4에서 RubyGems 1.3.6을 어떻게 구할 수 있습니까?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;방금 Ubuntu 10.4 및 Ruby1.9.1과 함께 새 VM (VirtualBox)을 설치했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;RUbyGems1.9.1에 대한 패키지가 있지만 gem --version을 수행하면 여전히 1.3.5를 얻습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 그것을 사용하여 작동하게했다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;gem install rubygems-update&lt;font&gt;&lt;/font&gt;
cd /var/lib/gems/1.9.1/bin&lt;font&gt;&lt;/font&gt;
sudo ./update_rubygems&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;더 이상 작동하지 않습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이제 다음과 같은 오류 메시지가 표시됩니다. &quot;내 이메일, 블로그 게시물 또는 README를 읽는 사람이없는 것 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;RUBY 1.9에서 RUBYGEMS를 업데이트하지 마십시오! &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;자세한 내용은 UPGRADING.rdoc를 참조하십시오. &quot;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Ubuntu에서 1.3.5를 넘어서는 유일한 방법은 apt-get을 벗어나 소스를 다운로드하는 것입니다. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://blog.zenspider.com/2010/12/rubygems-141-has-been-released.html&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://blog.zenspider.com/2010/12/rubygems-141-has-been-released.html&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/2777831/how-can-i-get-rubygems-1-3-6-on-ubuntu-10-4&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/2777831/how-can-i-get-rubygems-1-3-6-on-ubuntu-10-4&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2671</guid>
      <comments>https://nicepro.tistory.com/2671#entry2671comment</comments>
      <pubDate>Sun, 10 Jan 2021 19:53:41 +0900</pubDate>
    </item>
    <item>
      <title>HTML 내부에서 자바 스크립트를 사용하여 동적으로 SVG 요소 만들기</title>
      <link>https://nicepro.tistory.com/2670</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;HTML 내부에서 자바 스크립트를 사용하여 동적으로 SVG 요소 만들기&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;HTML 페이지 안에 사각형을 만든 다음 해당 사각형에 텍스트를 작성하고 싶습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또한 해당 텍스트가 하이퍼 링크 여야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 내가 한 일이지만 작동하지 않습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;    &amp;lt;!DOCTYPE html&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;html&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;body&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&amp;lt;script&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    var svg   = document.documentElement;&lt;font&gt;&lt;/font&gt;
    var svgNS = svg.namespaceURI;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    var rect = document.createElementNS(svgNS,'rect');&lt;font&gt;&lt;/font&gt;
    rect.setAttribute('x',5);&lt;font&gt;&lt;/font&gt;
    rect.setAttribute('y',5);&lt;font&gt;&lt;/font&gt;
    rect.setAttribute('width',500);&lt;font&gt;&lt;/font&gt;
    rect.setAttribute('height',500);&lt;font&gt;&lt;/font&gt;
    rect.setAttribute('fill','#95B3D7');&lt;font&gt;&lt;/font&gt;
    svg.appendChild(rect);&lt;font&gt;&lt;/font&gt;
    document.body.appendChild(svg);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    var h=document.createElement('a');&lt;font&gt;&lt;/font&gt;
    var t=document.createTextNode('Hello World');&lt;font&gt;&lt;/font&gt;
    h.appendChild(t);&lt;font&gt;&lt;/font&gt;
    document.body.appendChild(h);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&amp;lt;/script&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&amp;lt;/body&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/html&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;제발 도와 주 시겠어요? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;감사.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;변화&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;var svg   = document.documentElement;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;...에&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;var svg = document.createElementNS(&quot;http://www.w3.org/2000/svg&quot;, &quot;svg&quot;);
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;SVG&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;요소 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;를 만들 수 있습니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;링크가 하이퍼 링크가 되려면 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;href&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;속성을 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;추가하기 만하면됩니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;h.setAttributeNS(null, 'href', 'http://www.google.com');
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;a href=&quot;http://jsbin.com/Udeyaje/2/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;데모&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것을 html에 추가하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;svg id=&quot;mySVG&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;/&amp;gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 기능을 시도하고 프로그램에 맞게 조정하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;var svgNS = &quot;http://www.w3.org/2000/svg&quot;;  &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
function createCircle()&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    var myCircle = document.createElementNS(svgNS,&quot;circle&quot;); //to create a circle. for rectangle use &quot;rectangle&quot;&lt;font&gt;&lt;/font&gt;
    myCircle.setAttributeNS(null,&quot;id&quot;,&quot;mycircle&quot;);&lt;font&gt;&lt;/font&gt;
    myCircle.setAttributeNS(null,&quot;cx&quot;,100);&lt;font&gt;&lt;/font&gt;
    myCircle.setAttributeNS(null,&quot;cy&quot;,100);&lt;font&gt;&lt;/font&gt;
    myCircle.setAttributeNS(null,&quot;r&quot;,50);&lt;font&gt;&lt;/font&gt;
    myCircle.setAttributeNS(null,&quot;fill&quot;,&quot;black&quot;);&lt;font&gt;&lt;/font&gt;
    myCircle.setAttributeNS(null,&quot;stroke&quot;,&quot;none&quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    document.getElementById(&quot;mySVG&quot;).appendChild(myCircle);&lt;font&gt;&lt;/font&gt;
}     &lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;svg 편집을 용이하게하기 위해 중간 기능을 사용할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre class=&quot;lang-js prettyprint-override&quot;&gt;&lt;code&gt;function getNode(n, v) {&lt;font&gt;&lt;/font&gt;
  n = document.createElementNS(&quot;http://www.w3.org/2000/svg&quot;, n);&lt;font&gt;&lt;/font&gt;
  for (var p in v)&lt;font&gt;&lt;/font&gt;
    n.setAttributeNS(null, p, v[p]);&lt;font&gt;&lt;/font&gt;
  return n&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이제 다음과 같이 작성할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre class=&quot;lang-js prettyprint-override&quot;&gt;&lt;code&gt;svg.appendChild( getNode('rect', { width:200, height:20, fill:'#ff0000' }) );
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예 (대시가있는 속성에 대해 camelcase를 허용하는 향상된 getNode 함수 (예 : strokeWidth&amp;gt; stroke-width)) :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;snippet&quot; data-lang=&quot;js&quot; data-hide=&quot;false&quot; data-console=&quot;true&quot;&gt; 
 &lt;div class=&quot;snippet-code&quot;&gt; 
  &lt;pre class=&quot;snippet-code-js lang-js prettyprint-override&quot;&gt;&lt;code&gt;function getNode(n, v) {&lt;font&gt;&lt;/font&gt;
  n = document.createElementNS(&quot;http://www.w3.org/2000/svg&quot;, n);&lt;font&gt;&lt;/font&gt;
  for (var p in v)&lt;font&gt;&lt;/font&gt;
    n.setAttributeNS(null, p.replace(/[A-Z]/g, function(m, p, o, s) { return &quot;-&quot; + m.toLowerCase(); }), v[p]);&lt;font&gt;&lt;/font&gt;
  return n&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
var svg = getNode(&quot;svg&quot;);&lt;font&gt;&lt;/font&gt;
document.body.appendChild(svg);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
var r = getNode('rect', { x: 10, y: 10, width: 100, height: 20, fill:'#ff00ff' });&lt;font&gt;&lt;/font&gt;
svg.appendChild(r);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
var r = getNode('rect', { x: 20, y: 40, width: 100, height: 40, rx: 8, ry: 8, fill: 'pink', stroke:'purple', strokeWidth:7 });&lt;font&gt;&lt;/font&gt;
svg.appendChild(r);&lt;/code&gt;&lt;/pre&gt; 
 &lt;/div&gt; 
&lt;/div&gt; 
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/20539196/creating-svg-elements-dynamically-with-javascript-inside-html&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/20539196/creating-svg-elements-dynamically-with-javascript-inside-html&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2670</guid>
      <comments>https://nicepro.tistory.com/2670#entry2670comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:41:07 +0900</pubDate>
    </item>
    <item>
      <title>동기화 된 블록이 동기화 된 방법보다 나은 이유는 무엇입니까?</title>
      <link>https://nicepro.tistory.com/2669</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;동기화 된 블록이 동기화 된 방법보다 나은 이유는 무엇입니까?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;스레딩에서 동기화를 배우기 시작했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;동기화 된 방법 : &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public class Counter{&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  private static int count = 0;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  public static synchronized int getCount(){&lt;font&gt;&lt;/font&gt;
    return count;&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  public synchronized setCount(int count){&lt;font&gt;&lt;/font&gt;
     this.count = count;&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;동기화 된 블록 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public class Singleton{&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
private static volatile Singleton _instance;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
public static Singleton getInstance(){&lt;font&gt;&lt;/font&gt;
   if(_instance == null){&lt;font&gt;&lt;/font&gt;
            synchronized(Singleton.class){&lt;font&gt;&lt;/font&gt;
              if(_instance == null)&lt;font&gt;&lt;/font&gt;
              _instance = new Singleton();&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
   }&lt;font&gt;&lt;/font&gt;
   return _instance;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;동기화 방법과 동기화 블록은 언제 사용해야합니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;동기화 된 블록이 동기화 된 방법보다 나은 이유는 무엇입니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;더 나은 문제가 아니라 단지 다릅니다.&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;메서드를 동기화하면 개체 자체와 효과적으로 동기화됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;정적 메서드의 경우 개체의 클래스와 동기화됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따라서 다음 두 코드는 동일한 방식으로 실행됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public synchronized int getCount() {&lt;font&gt;&lt;/font&gt;
    // ...&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 당신이 이것을 쓴 것과 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public int getCount() {&lt;font&gt;&lt;/font&gt;
    synchronized (this) {&lt;font&gt;&lt;/font&gt;
        // ...&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;특정 개체에 대한 동기화를 제어하거나 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;메서드의 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;일부만&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 개체에 동기화하려는 경우 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;synchronized&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;블록 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;을 지정합니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;/font&gt;&lt;code&gt;synchronized&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;메서드 선언에 키워드 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;를 사용하면 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;전체 메서드가 개체 또는 클래스에 동기화됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;일반적으로 문제가되지는 않지만 보안 관점에서 메서드에 넣는 것보다 개인 개체에 동기화를 사용하는 것이 좋습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;메서드에 넣는 것은 스레드 안전성을 제공하기 위해 객체 자체의 잠금을 사용하고 있음을 의미합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이러한 종류의 메커니즘을 사용하면 코드의 악의적 인 사용자가 개체에 대한 잠금을 획득하고 영구적으로 유지하여 다른 스레드를 효과적으로 차단할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;악의가없는 사용자는 실수로 동일한 작업을 효과적으로 수행 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;개인 데이터 멤버의 잠금을 사용하면 악의적 인 사용자가 개인 개체에 대한 잠금을 얻을 수 없기 때문에이를 방지 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;private final Object lockObject = new Object();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
public void getCount() {&lt;font&gt;&lt;/font&gt;
    synchronized( lockObject ) {&lt;font&gt;&lt;/font&gt;
        ...&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 기술은 Bloch의 Effective Java (2nd Ed), 항목 # 70에 언급되어 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;차이점은 잠금을 획득하는 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;동기화 된 메서드는 전체 개체에 대한 잠금을 획득합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;즉, 하나의 스레드에서 메서드를 실행하는 동안 다른 스레드는 전체 개체에서 동기화 된 메서드를 사용할 수 없습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;동기화 된 블록은 동기화 된 키워드 뒤의 괄호 사이에있는 개체의 잠금을 획득합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;동기화 된 블록이 종료 될 때까지 다른 스레드는 잠긴 개체에 대한 잠금을 획득 할 수 없습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따라서 전체 개체를 잠 그려면 동기화 된 방법을 사용하십시오. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;객체의 다른 부분을 다른 스레드에서 액세스 할 수 있도록하려면 동기화 된 블록을 사용하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;If you choose the locked object carefully, synchronized blocks will lead to less contention, because the whole object/class is not blocked.&lt;/p&gt; 
&lt;p&gt;This applies similarly to static methods: a synchronized static method will acquire a lock in the whole class object, while a synchronized block inside a static method will acquire a lock in the object between parentheses.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Define 'better'. A synchronized block is only better because it allows you to:&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;Synchronize on a different object&lt;/li&gt; 
 &lt;li&gt;Limit the scope of synchronization&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;Now your specific example is an example of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Double-checked_locking&quot; rel=&quot;noreferrer&quot;&gt;double-checked locking&lt;/a&gt; pattern which is suspect (in older Java versions it was broken, and it is easy to do it wrong).&lt;/p&gt; 
&lt;p&gt;If your initialization is cheap, it might be better to initialize immediately with a final field, and not on the first request, it would also remove the need for synchronization.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Difference between &lt;strong&gt;synchronized block&lt;/strong&gt; and &lt;strong&gt;synchronized method&lt;/strong&gt; are following: &lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;synchronized block reduce scope of lock, &lt;strong&gt;but&lt;/strong&gt; synchronized method's scope of lock is whole method.&lt;/li&gt; 
 &lt;li&gt;synchronized block has better performance as only the critical section is locked &lt;strong&gt;but&lt;/strong&gt; synchronized method has poor performance than block.&lt;/li&gt; 
 &lt;li&gt;synchronized block provide granular control over lock &lt;strong&gt;but&lt;/strong&gt; synchronized method lock either on current object represented by this or class level lock.&lt;/li&gt; 
 &lt;li&gt;synchronized block can throw NullPointerException &lt;strong&gt;but&lt;/strong&gt; synchronized method doesn't throw.&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;&lt;strong&gt;synchronized block:&lt;/strong&gt; &lt;code&gt;synchronized(this){}&lt;/code&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;synchronized method:&lt;/strong&gt; &lt;code&gt;public synchronized void fun(){}&lt;/code&gt;&lt;/p&gt;&lt;/li&gt; 
&lt;/ol&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;strong&gt;synchronized&lt;/strong&gt; should only be used when you want your class to be Thread safe. In fact most of the classes should not use synchronized anyways. &lt;strong&gt;synchronized&lt;/strong&gt; method would only provide a &lt;strong&gt;lock&lt;/strong&gt; on this object and only for the duration of its execution. if you really wanna to make your classes thread safe, you should consider making your variables &lt;strong&gt;volatile&lt;/strong&gt; or &lt;strong&gt;synchronize&lt;/strong&gt; the access.&lt;/p&gt; 
&lt;p&gt;one of the issues of using &lt;strong&gt;synchronized method&lt;/strong&gt; is that all of the members of the class would use the same &lt;strong&gt;lock&lt;/strong&gt; which will make your program slower. In your case synchronized method and block would execute no different. what I'd would recommend is to use a dedicated &lt;strong&gt;lock&lt;/strong&gt; and use a &lt;strong&gt;synchronized block&lt;/strong&gt; something like this.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public class AClass {&lt;font&gt;&lt;/font&gt;
private int x;&lt;font&gt;&lt;/font&gt;
private final Object lock = new Object();     //it must be final!&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
 public void setX() {&lt;font&gt;&lt;/font&gt;
    synchronized(lock) {&lt;font&gt;&lt;/font&gt;
        x++;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
 }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;strong&gt;In your case both are equivalent!&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;Synchronizing a static method is equivalent to a synchronized block on corresponding Class object.&lt;/p&gt; 
&lt;p&gt;In fact when you declare a synchronized static method lock is obtained on the monitor corresponding to the Class object.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public static synchronized int getCount() {&lt;font&gt;&lt;/font&gt;
    // ...&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;is same as&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public int getCount() {&lt;font&gt;&lt;/font&gt;
    synchronized (ClassName.class) {&lt;font&gt;&lt;/font&gt;
        // ...&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Because lock is expensive, when you are using synchronized block you lock only if &lt;code&gt;_instance == null&lt;/code&gt;, and after &lt;code&gt;_instance&lt;/code&gt; finally initialized you'll never lock. But when you synchronize on method you lock unconditionally, even after the &lt;code&gt;_instance&lt;/code&gt; is initialized. This is the idea behind double-checked locking optimization pattern &lt;a href=&quot;http://en.wikipedia.org/wiki/Double-checked_locking&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Double-checked_locking&lt;/a&gt;.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;It should not be considered as a question of best for usage, but it really depends on the use case or the scenario.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;Synchronized Methods&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;An entire method can be marked as synchronized resulting an implicit lock on the this reference (instance methods) or class (static methods). This is very convenient mechanism to achieve synchronization.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;Steps&lt;/strong&gt; A thread access the synchronized method. It implicitly acquires the lock and execute the code. If other thread want to access the above method, it has to wait. The thread can't get the lock, will be blocked and has to wait till the lock is released. &lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;Synchronized Blocks&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;To acquire a lock on an object for a specific set of code block, synchronized blocks are the best fit. As a block is sufficient, using a synchronized method will be a waste. &lt;/p&gt; 
&lt;p&gt;More specifically with Synchronized Block , it is possible to define the object reference on which are want to acquire a lock.&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/20906548/why-is-synchronized-block-better-than-synchronized-method&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/20906548/why-is-synchronized-block-better-than-synchronized-method&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2669</guid>
      <comments>https://nicepro.tistory.com/2669#entry2669comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:40:58 +0900</pubDate>
    </item>
    <item>
      <title>jQuery를 사용하여 선택 목록에서 선택한 속성 설정</title>
      <link>https://nicepro.tistory.com/2668</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;jQuery를 사용하여 선택 목록에서 선택한 속성 설정&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음 HTML이 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;select id=&quot;dropdown&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;option&amp;gt;A&amp;lt;/option&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;option&amp;gt;B&amp;lt;/option&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;option&amp;gt;C&amp;lt;/option&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/select&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;문자열 &quot;B&quot;가 있으므로 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;selected&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;속성 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;을 설정하고 싶습니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;select id=&quot;dropdown&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;option&amp;gt;A&amp;lt;/option&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;option selected=&quot;selected&quot;&amp;gt;B&amp;lt;/option&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;option&amp;gt;C&amp;lt;/option&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/select&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;jQuery에서 어떻게할까요?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;value&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;옵션 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;의 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;속성 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;을 포함하기 위해 HTML을 약간 수정해도 괜찮다면이 작업 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;을 수행하는 데 필요한 코드를 크게 줄일 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;option&amp;gt;B&amp;lt;/option&amp;gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;...에&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;option value=&quot;B&quot;&amp;gt;B&amp;lt;/option&amp;gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같은 작업을하려는 경우 유용합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;option value=&quot;IL&quot;&amp;gt;Illinois&amp;lt;/option&amp;gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이를 통해 다음 jQuery가 변경됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$(&quot;select option[value='B']&quot;).attr(&quot;selected&quot;,&quot;selected&quot;);
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;속성 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용을 포함 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하지&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 않기로 결정한 경우 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;value&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;각 옵션을 순환하고 해당 값을 수동으로 확인해야합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$(&quot;select option&quot;).each(function(){&lt;font&gt;&lt;/font&gt;
  if ($(this).text() == &quot;B&quot;)&lt;font&gt;&lt;/font&gt;
    $(this).attr(&quot;selected&quot;,&quot;selected&quot;);&lt;font&gt;&lt;/font&gt;
});&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;select id=&quot;cars&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;option value='volvo'&amp;gt;volvo&amp;lt;/option&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;option value='bmw'&amp;gt;bmw&amp;lt;/option&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;option value='fiat'&amp;gt;fiat&amp;lt;/option&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/select&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
var make = &quot;fiat&quot;;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$(&quot;#cars option[value='&quot; + make + &quot;']&quot;).attr(&quot;selected&quot;,&quot;selected&quot;);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;JQuery를 사용하는 경우 1.6부터 .prop () 메서드를 사용해야합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$('select option:nth(1)').prop(&quot;selected&quot;,&quot;selected&quot;);
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I'd iterate through the options, comparing the text to what I want to be selected, then set the selected attribute on that option. Once you find the correct one, terminate the iteration (unless you have a multiselect).&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; $('#dropdown').find('option').each( function() {&lt;font&gt;&lt;/font&gt;
      var $this = $(this);&lt;font&gt;&lt;/font&gt;
      if ($this.text() == 'B') {&lt;font&gt;&lt;/font&gt;
         $this.attr('selected','selected');&lt;font&gt;&lt;/font&gt;
         return false;&lt;font&gt;&lt;/font&gt;
      }&lt;font&gt;&lt;/font&gt;
 });&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;You can follow the .selectedIndex strategy of danielrmt, but determine the index based on the text within the option tags like this:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$('#dropdown')[0].selectedIndex = $('#dropdown option').toArray().map(jQuery.text).indexOf('B');
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;This works on the original HTML without using value attributes.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;h1&gt;This can be a solution&lt;/h1&gt; 
&lt;pre&gt;&lt;code&gt;$(document).on('change', 'select', function () {&lt;font&gt;&lt;/font&gt;
            var value = $(this).val();&lt;font&gt;&lt;/font&gt;
            $(this).find('option[value=&quot;' + value + '&quot;]').attr(&quot;selected&quot;, &quot;selected&quot;);&lt;font&gt;&lt;/font&gt;
        })&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;You can use pure DOM. See &lt;a href=&quot;http://www.w3schools.com/htmldom/prop_select_selectedindex.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.w3schools.com/htmldom/prop_select_selectedindex.asp&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;document.getElementById('dropdown').selectedIndex = 1;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;but jQuery can help:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$('#dropdown').selectedIndex = 1;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Code:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;var select = function(dropdown, selectedValue) {&lt;font&gt;&lt;/font&gt;
    var options = $(dropdown).find(&quot;option&quot;);&lt;font&gt;&lt;/font&gt;
    var matches = $.grep(options,&lt;font&gt;&lt;/font&gt;
        function(n) { return $(n).text() == selectedValue; });&lt;font&gt;&lt;/font&gt;
    $(matches).attr(&quot;selected&quot;, &quot;selected&quot;);&lt;font&gt;&lt;/font&gt;
};&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Example:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;select(&quot;#dropdown&quot;, &quot;B&quot;);
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;pre&gt;&lt;code&gt;$('#select_id option:eq(0)').prop('selected', 'selected');
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;its good&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Something along the lines of...&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$('select option:nth(1)').attr(&quot;selected&quot;,&quot;selected&quot;); 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/1311287/setting-the-selected-attribute-on-a-select-list-using-jquery&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/1311287/setting-the-selected-attribute-on-a-select-list-using-jquery&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2668</guid>
      <comments>https://nicepro.tistory.com/2668#entry2668comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:40:48 +0900</pubDate>
    </item>
    <item>
      <title>Jersey 클라이언트를 사용하여 POST 작업 수행</title>
      <link>https://nicepro.tistory.com/2667</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Jersey 클라이언트를 사용하여 POST 작업 수행&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Java 메서드에서 Jersey 클라이언트 개체를 사용하여 RESTful 웹 서비스 (또한 Jersey를 사용하여 작성 됨)에서 POST 작업을 수행하고 싶지만 클라이언트를 사용하여 FormParam의 값으로 사용할 값을 보내는 방법을 잘 모르겠습니다. 서버에서. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;쿼리 매개 변수를 잘 보낼 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아직이 작업을 수행하지는 않았지만 Google-Fu &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://blogs.oracle.com/enterprisetechtips/entry/consuming_restful_web_services_with&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;를 간략히 살펴보면 blogs.oracle.com&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 에서 사용자가 요청한 내용에 대한 예제와 함께 &lt;/font&gt;&lt;a href=&quot;http://blogs.oracle.com/enterprisetechtips/entry/consuming_restful_web_services_with&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기술 팁을 확인할&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;블로그 게시물에서 가져온 예 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;MultivaluedMap formData = new MultivaluedMapImpl();&lt;font&gt;&lt;/font&gt;
formData.add(&quot;name1&quot;, &quot;val1&quot;);&lt;font&gt;&lt;/font&gt;
formData.add(&quot;name2&quot;, &quot;val2&quot;);&lt;font&gt;&lt;/font&gt;
ClientResponse response = webResource&lt;font&gt;&lt;/font&gt;
    .type(MediaType.APPLICATION_FORM_URLENCODED_TYPE)&lt;font&gt;&lt;/font&gt;
    .post(ClientResponse.class, formData);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;도움이 되나요?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Jersey 2.x부터 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;MultivaluedMapImpl&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;클래스는 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://docs.oracle.com/javaee/7/api/javax/ws/rs/core/MultivaluedHashMap.html&quot;&gt;&lt;code&gt;MultivaluedHashMap&lt;/code&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이를 사용하여 양식 데이터를 추가하고 서버로 보낼 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;    WebTarget webTarget = client.target(&quot;http://www.example.com/some/resource&quot;);&lt;font&gt;&lt;/font&gt;
    MultivaluedMap&amp;lt;String, String&amp;gt; formData = new MultivaluedHashMap&amp;lt;String, String&amp;gt;();&lt;font&gt;&lt;/font&gt;
    formData.add(&quot;key1&quot;, &quot;value1&quot;);&lt;font&gt;&lt;/font&gt;
    formData.add(&quot;key2&quot;, &quot;value2&quot;);&lt;font&gt;&lt;/font&gt;
    Response response = webTarget.request().post(Entity.form(formData));&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;양식 엔터티는 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;&quot;application/x-www-form-urlencoded&quot;&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이제 &lt;/font&gt;&lt;a href=&quot;https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/client.html#client.ex.formpost&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Jersey Client 문서&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 의 첫 번째 예입니다.&lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/client.html#client.ex.formpost&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예 5.1. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;양식 매개 변수가있는 POST 요청&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Client client = ClientBuilder.newClient();&lt;font&gt;&lt;/font&gt;
WebTarget target = client.target(&quot;http://localhost:9998&quot;).path(&quot;resource&quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
Form form = new Form();&lt;font&gt;&lt;/font&gt;
form.param(&quot;x&quot;, &quot;foo&quot;);&lt;font&gt;&lt;/font&gt;
form.param(&quot;y&quot;, &quot;bar&quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
MyJAXBBean bean =&lt;font&gt;&lt;/font&gt;
target.request(MediaType.APPLICATION_JSON_TYPE)&lt;font&gt;&lt;/font&gt;
    .post(Entity.entity(form,MediaType.APPLICATION_FORM_URLENCODED_TYPE),&lt;font&gt;&lt;/font&gt;
        MyJAXBBean.class);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;파일 업로드가 필요한 경우 MediaType.MULTIPART_FORM_DATA_TYPE을 사용해야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;MultivaluedMap을 사용할 수없는 것처럼 보이므로 여기에 FormDataMultiPart를 사용한 솔루션이 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;InputStream stream = getClass().getClassLoader().getResourceAsStream(fileNameToUpload);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
FormDataMultiPart part = new FormDataMultiPart();&lt;font&gt;&lt;/font&gt;
part.field(&quot;String_key&quot;, &quot;String_value&quot;);&lt;font&gt;&lt;/font&gt;
part.field(&quot;fileToUpload&quot;, stream, MediaType.TEXT_PLAIN_TYPE);&lt;font&gt;&lt;/font&gt;
String response = WebResource.type(MediaType.MULTIPART_FORM_DATA_TYPE).post(String.class, part);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가장 간단 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Form form = new Form();&lt;font&gt;&lt;/font&gt;
form.add(&quot;id&quot;, &quot;1&quot;);    &lt;font&gt;&lt;/font&gt;
form.add(&quot;name&quot;, &quot;supercobra&quot;);&lt;font&gt;&lt;/font&gt;
ClientResponse response = webResource&lt;font&gt;&lt;/font&gt;
  .type(MediaType.APPLICATION_FORM_URLENCODED_TYPE)&lt;font&gt;&lt;/font&gt;
  .post(ClientResponse.class, form);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또한 이것을 시도 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;MultivaluedMap formData = new MultivaluedMapImpl();&lt;font&gt;&lt;/font&gt;
formData.add(&quot;name1&quot;, &quot;val1&quot;);&lt;font&gt;&lt;/font&gt;
formData.add(&quot;name2&quot;, &quot;val2&quot;);&lt;font&gt;&lt;/font&gt;
webResource.path(&quot;yourJerseysPathPost&quot;).queryParams(formData).post();&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/2136119/using-the-jersey-client-to-do-a-post-operation&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/2136119/using-the-jersey-client-to-do-a-post-operation&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2667</guid>
      <comments>https://nicepro.tistory.com/2667#entry2667comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:40:39 +0900</pubDate>
    </item>
    <item>
      <title>일반 텍스트 영역</title>
      <link>https://nicepro.tistory.com/2666</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;일반 텍스트 영역&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Onselect 이벤트에는 스크립트가 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$(&quot;#vinanghinguyen_images_bbocde&quot;).val('');&lt;font&gt;&lt;/font&gt;
$(&quot;#vinanghinguyen_images_bbocde&quot;).val(vinanghinguyen_final_bbcode);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;값을 추가하기 전에 일반 텍스트 영역 id = &quot;vinanghinguyen_images_bbocde&quot;를 원합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 textarea add add add add and value and not clear. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가치를 추가하기 전에 지우고 싶습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여기서 uploadify를 사용하는 것은 내 기능입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;script type = &quot;text/javascript&quot; &amp;gt;&lt;font&gt;&lt;/font&gt;
  $(document).ready(function() {&lt;font&gt;&lt;/font&gt;
    vinanghinguyen_bbcode = '';&lt;font&gt;&lt;/font&gt;
    vinanghinguyen_final_bbcode = '';&lt;font&gt;&lt;/font&gt;
    vinanghinguyen_link = '';&lt;font&gt;&lt;/font&gt;
    vinanghinguyen_final_derect_link = '';&lt;font&gt;&lt;/font&gt;
    response = '';&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    $('#file_upload').uploadify({&lt;font&gt;&lt;/font&gt;
      'uploader'  : '{SITE_FULL_URL}/uploadify/uploadify.swf',&lt;font&gt;&lt;/font&gt;
      'script'    : '{SITE_FULL_URL}/uploadify/uploadify.php',&lt;font&gt;&lt;/font&gt;
      'cancelImg' : '{SITE_FULL_URL}/uploadify/cancel.png',&lt;font&gt;&lt;/font&gt;
      'folder'    : 'data/picture_upload/2011',&lt;font&gt;&lt;/font&gt;
      'auto'      : false,&lt;font&gt;&lt;/font&gt;
      'multi'     : true,&lt;font&gt;&lt;/font&gt;
      'buttonText': '',&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
      'onComplete': function(event, ID, fileObj, response, data) {&lt;font&gt;&lt;/font&gt;
        vinanghinguyen_bbcode = '[IMG]' + 'http://cnttvnn.com' + response + '[/IMG]' + '\n';&lt;font&gt;&lt;/font&gt;
        vinanghinguyen_final_bbcode = vinanghinguyen_final_bbcode + vinanghinguyen_bbcode;&lt;font&gt;&lt;/font&gt;
        vinanghinguyen_derect_link = 'http://cnttvnn.com' + response + '\n';&lt;font&gt;&lt;/font&gt;
        vinanghinguyen_final_derect_link = vinanghinguyen_final_derect_link + vinanghinguyen_derect_link;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        $(&quot;#vinanghinguyen_images_bbocde&quot;).val('').val(vinanghinguyen_final_bbcode);&lt;font&gt;&lt;/font&gt;
      //$(&quot;#vinanghinguyen_images_derect_link&quot;).val(vinanghinguyen_final_derect_link);&lt;font&gt;&lt;/font&gt;
        $(&quot;#vinanghinguyen_result&quot;).show();&lt;font&gt;&lt;/font&gt;
        $(&quot;.uploadifyQueue&quot;).height(5);&lt;font&gt;&lt;/font&gt;
      },&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
      'onSelect': function(event, ID, fileObj) {&lt;font&gt;&lt;/font&gt;
        $(&quot;#vinanghinguyen_images_bbocde&quot;).val('');&lt;font&gt;&lt;/font&gt;
        $(&quot;#vinanghinguyen_result&quot;).hide();&lt;font&gt;&lt;/font&gt;
        $(&quot;.uploadifyQueue&quot;).height(315);&lt;font&gt;&lt;/font&gt;
      },&lt;font&gt;&lt;/font&gt;
    });&lt;font&gt;&lt;/font&gt;
  });&lt;font&gt;&lt;/font&gt;
&amp;lt;/script&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;을 수행 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;$(&quot;#vinanghinguyen_images_bbocde&quot;).val('');&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하면 텍스트 영역의 모든 내용이 제거되므로 문제가 발생하지 않으면 다른 곳에서 문제가 발생할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;제공 한 예제가 작동하므로 코드의 조금 더 큰 부분을 게시하면 도움이 될 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;$('textarea').val('')&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용의 문제는 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;$('textarea').text('')&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;, 또는 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;$('textarea').html('')&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그 문제에 관해서는 단지 서버에서 전송 한 원래의 DOM에 무엇 지울 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용자가이를 지운 다음 새 입력을 입력하면 지우기 버튼이 더 이상 작동하지 않습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;.val('')&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;은 사용자 입력 케이스를 올바르게 처리합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 작동합니다 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$('#textareaName').val('');
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;blockquote&gt; 
 &lt;p&gt;This method removes not only child (and other descendant) elements, but also any text within the set of matched elements. This is because, according to the DOM specification, any string of text within an element is considered a child node of that element.&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;pre&gt;&lt;code&gt;$('textarea').empty()
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;try this&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; $(&quot;#vinanghinguyen_images_bbocde&quot;).attr(&quot;value&quot;, &quot;&quot;); 
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Try this,&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$('textarea#textarea_id').val(&quot; &quot;);
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I just tried using this code and @psynnott's answer was correct though I needed to know it would work repeatedly, seems to work with jquery 1.7.1 &amp;gt;&lt;/p&gt; 
&lt;p&gt;I modified the jfiddle to the following &lt;a href=&quot;http://jsfiddle.net/Rjj9v/109/&quot; rel=&quot;nofollow&quot;&gt;http://jsfiddle.net/Rjj9v/109/&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$('#mytext').text('');
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;This is not a new answer @psynnott is correct I am just providing a more concise example that shows the textarea is still working after the clear because if you use .val(&quot;&quot;) the text area stops working&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Correct answer is: $(&quot;#selElement_Id option:selected&quot;).removeAttr(&quot;selected&quot;);&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I agree with @Jakub Arnold's answer. The problem should be somewhere else. I could not figure out the problem but found a work around.&lt;/p&gt; 
&lt;p&gt;Wrap your concerned element with a parent element and cause its html to create a new element with the id you are concerned with. See below&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;div id=&quot;theParent&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;div id=&quot;vinanghinguyen_images_bbocde&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
'onSelect'    : function(event,ID,fileObj) {&lt;font&gt;&lt;/font&gt;
 $(&quot;#theParent&quot;).html(&quot;&amp;lt;div id='vinanghinguyen_images_bbocde'&amp;gt;&amp;lt;/div&amp;gt;&quot;);&lt;font&gt;&lt;/font&gt;
 $(&quot;#vinanghinguyen_result&quot;).hide();&lt;font&gt;&lt;/font&gt;
 $(&quot;.uploadifyQueue&quot;).height(315);&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I believe the problem is simply a spelling error when writing bbcode as bbocde:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$(&quot;#vinanghinguyen_images_bbocde&quot;).val('')
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;should be:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$(&quot;#vinanghinguyen_images_bbcode&quot;).val('')
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Rather simpler method would be by using JavaScript method of innerHTML.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;document.getElementById(&quot;#id_goes_here&quot;).innerHTML = &quot;&quot;;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Rather simpler and more effective way.&lt;/p&gt; 
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/8284960/clear-text-area&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/8284960/clear-text-area&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2666</guid>
      <comments>https://nicepro.tistory.com/2666#entry2666comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:40:31 +0900</pubDate>
    </item>
    <item>
      <title>오른쪽에 아래쪽 삼각형이있는 스피너 주위의 테두리와 같은 사용자 지정 스피너를 만드는 방법은 무엇입니까?</title>
      <link>https://nicepro.tistory.com/2665</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;오른쪽에 아래쪽 삼각형이있는 스피너 주위의 테두리와 같은 사용자 지정 스피너를 만드는 방법은 무엇입니까?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;오른쪽 하단 모서리에 삼각형이있는 스피너 주위의 선과 같은 커스텀 스피너를 개발하고 싶습니다. &lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음 이미지처럼&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/UPILD.jpg&quot; alt=&quot;여기에 이미지 설명 입력&quot;&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;위의 무화과에 대해 나는&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;spinner.xml&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; &amp;lt;Spinner android:background=&quot;@drawable/spinner_background&quot;/&amp;gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;spinner_background.xml&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;item android:state_pressed=&quot;true&quot;&lt;font&gt;&lt;/font&gt;
      android:drawable=&quot;@drawable/spinner_ab_pressed_new_theme_bs&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;shape&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        &amp;lt;solid &lt;font&gt;&lt;/font&gt;
            android:color=&quot;@color/White&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        &amp;lt;corners android:radius=&quot;3dp&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        &amp;lt;padding &lt;font&gt;&lt;/font&gt;
            android:bottom=&quot;10dp&quot; &lt;font&gt;&lt;/font&gt;
            android:left=&quot;10dp&quot; &lt;font&gt;&lt;/font&gt;
            android:right=&quot;10dp&quot; &lt;font&gt;&lt;/font&gt;
            android:top=&quot;10dp&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
         &amp;lt;stroke &lt;font&gt;&lt;/font&gt;
            android:width=&quot;2dp&quot; &lt;font&gt;&lt;/font&gt;
            android:color=&quot;@color/skyblue&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/shape&amp;gt;&lt;font&gt;&lt;/font&gt;
 &amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
 &amp;lt;!-- spinner_ab_default_new_theme_bs -&amp;gt; this image for corner triangle --&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;item&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    android:drawable=&quot;@drawable/spinner_ab_default_new_theme_bs&quot; &amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;shape&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;solid&lt;font&gt;&lt;/font&gt;
            android:color=&quot;@color/White&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/solid&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        &amp;lt;corners android:radius=&quot;3dp&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        &amp;lt;padding&lt;font&gt;&lt;/font&gt;
            android:bottom=&quot;10dp&quot; &lt;font&gt;&lt;/font&gt;
            android:left=&quot;10dp&quot; &lt;font&gt;&lt;/font&gt;
            android:right=&quot;10dp&quot; &lt;font&gt;&lt;/font&gt;
            android:top=&quot;10dp&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
         &amp;lt;stroke &lt;font&gt;&lt;/font&gt;
            android:width=&quot;2dp&quot; &lt;font&gt;&lt;/font&gt;
            android:color=&quot;@color/gray&quot;/&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/shape&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그리고 다음 이미지와 같은 출력을 얻었습니다.&lt;/font&gt;&lt;/font&gt;&lt;br&gt; &lt;img src=&quot;https://i.stack.imgur.com/WkpHe.jpg&quot; alt=&quot;여기에 이미지 설명 입력&quot;&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 많은 것을 시도했지만 목표를 달성하지 못했습니다. &lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;위의 첫 번째 이미지와 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;스피너&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt; &lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;Spinner&lt;font&gt;&lt;/font&gt;
    android:id=&quot;@+id/To_Units&quot;&lt;font&gt;&lt;/font&gt;
    style=&quot;@style/spinner_style&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;style.xml&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;    &amp;lt;style name=&quot;spinner_style&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
          &amp;lt;item name=&quot;android:layout_width&quot;&amp;gt;match_parent&amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
          &amp;lt;item name=&quot;android:layout_height&quot;&amp;gt;wrap_content&amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
          &amp;lt;item name=&quot;android:background&quot;&amp;gt;@drawable/gradient_spinner&amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
          &amp;lt;item name=&quot;android:layout_margin&quot;&amp;gt;10dp&amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
          &amp;lt;item name=&quot;android:paddingLeft&quot;&amp;gt;8dp&amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
          &amp;lt;item name=&quot;android:paddingRight&quot;&amp;gt;20dp&amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
          &amp;lt;item name=&quot;android:paddingTop&quot;&amp;gt;5dp&amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
          &amp;lt;item name=&quot;android:paddingBottom&quot;&amp;gt;5dp&amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
          &amp;lt;item name=&quot;android:popupBackground&quot;&amp;gt;#DFFFFFFF&amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
     &amp;lt;/style&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;gradient_spinner.xml&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; (드로어 블 폴더에 있음)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;selector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    &amp;lt;item&amp;gt;&amp;lt;layer-list&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;item&amp;gt;&amp;lt;shape&amp;gt;&lt;font&gt;&lt;/font&gt;
                    &amp;lt;gradient android:angle=&quot;90&quot; android:endColor=&quot;#B3BBCC&quot; android:startColor=&quot;#E8EBEF&quot; android:type=&quot;linear&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
                    &amp;lt;stroke android:width=&quot;1dp&quot; android:color=&quot;#000000&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
                    &amp;lt;corners android:radius=&quot;4dp&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
                    &amp;lt;padding android:bottom=&quot;3dp&quot; android:left=&quot;3dp&quot; android:right=&quot;3dp&quot; android:top=&quot;3dp&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;/shape&amp;gt;&amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;item &amp;gt;&amp;lt;bitmap android:gravity=&quot;bottom|right&quot; android:src=&quot;@drawable/spinner_arrow&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/layer-list&amp;gt;&amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&amp;lt;/selector&amp;gt;  &lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;code&gt;@drawable/spinner_arrow&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 오른쪽 하단 이미지입니다&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 간단한 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;your_layout.xml&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;android.support.v7.widget.AppCompatSpinner&lt;font&gt;&lt;/font&gt;
  android:layout_width=&quot;match_parent&quot;&lt;font&gt;&lt;/font&gt;
  android:layout_height=&quot;wrap_content&quot;&lt;font&gt;&lt;/font&gt;
  android:background=&quot;@drawable/spinner_background&quot;&lt;font&gt;&lt;/font&gt;
/&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;드로어 블 폴더에서 spinner_background.xml&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;selector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;item&amp;gt;&amp;lt;layer-list&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;item&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;shape&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;solid&lt;font&gt;&lt;/font&gt;
                android:color=&quot;@color/colorWhite&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;/solid&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            &amp;lt;corners android:radius=&quot;3dp&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            &amp;lt;padding&lt;font&gt;&lt;/font&gt;
                android:bottom=&quot;10dp&quot;&lt;font&gt;&lt;/font&gt;
                android:left=&quot;10dp&quot;&lt;font&gt;&lt;/font&gt;
                android:right=&quot;10dp&quot;&lt;font&gt;&lt;/font&gt;
                android:top=&quot;10dp&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;stroke&lt;font&gt;&lt;/font&gt;
                android:width=&quot;2dp&quot;&lt;font&gt;&lt;/font&gt;
                android:color=&quot;@color/colorDarkGrey&quot;/&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/shape&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;item &amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;bitmap android:gravity=&quot;bottom|right&quot;&lt;font&gt;&lt;/font&gt;
        android:src=&quot;@drawable/ic_arrow_drop_down_black_24dp&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;/layer-list&amp;gt;&amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/selector&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;시사:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ur5rl.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ur5rl.png&quot; alt=&quot;스피너 예&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;XML의 스피너 선언에서 한 줄을 사용하여 다음을 수행 할 수 있습니다. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://i.stack.imgur.com/9JJ3U.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9JJ3U.png&quot; alt=&quot;여기에 이미지 설명 입력&quot;&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음을 추가하십시오. &lt;/font&gt;&lt;/font&gt;&lt;code&gt;style=&quot;@android:style/Widget.Holo.Light.Spinner&quot;&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;This is a default generated style in android. It doesn't contain borders around it though. For that you'd better search something on google.&lt;/p&gt; 
&lt;p&gt;Hope this helps.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; AFter a lot of digging I got something which works well for introducing border around spinner.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;layer-list xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;item&lt;font&gt;&lt;/font&gt;
        android:bottom=&quot;8dp&quot;&lt;font&gt;&lt;/font&gt;
        android:top=&quot;8dp&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;shape&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;solid android:color=&quot;@android:color/white&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;corners android:radius=&quot;4dp&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;stroke&lt;font&gt;&lt;/font&gt;
                android:width=&quot;2dp&quot;&lt;font&gt;&lt;/font&gt;
                android:color=&quot;#9E9E9E&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;padding&lt;font&gt;&lt;/font&gt;
                android:bottom=&quot;16dp&quot;&lt;font&gt;&lt;/font&gt;
                android:left=&quot;8dp&quot;&lt;font&gt;&lt;/font&gt;
                android:right=&quot;16dp&quot;&lt;font&gt;&lt;/font&gt;
                android:top=&quot;16dp&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/shape&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/item&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/layer-list&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Place this in the drawable folder and use it as a background for spinner. Like this:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;RelativeLayout&lt;font&gt;&lt;/font&gt;
        android:id=&quot;@+id/speaker_relative_layout&quot;&lt;font&gt;&lt;/font&gt;
        android:layout_width=&quot;0dp&quot;&lt;font&gt;&lt;/font&gt;
        android:layout_height=&quot;70dp&quot;&lt;font&gt;&lt;/font&gt;
        android:layout_marginEnd=&quot;8dp&quot;&lt;font&gt;&lt;/font&gt;
        android:layout_marginLeft=&quot;8dp&quot;&lt;font&gt;&lt;/font&gt;
        android:layout_marginRight=&quot;8dp&quot;&lt;font&gt;&lt;/font&gt;
        android:layout_marginStart=&quot;8dp&quot;&lt;font&gt;&lt;/font&gt;
        android:layout_marginTop=&quot;16dp&quot;&lt;font&gt;&lt;/font&gt;
        android:background=&quot;@drawable/spinner_style&quot;&lt;font&gt;&lt;/font&gt;
        app:layout_constraintLeft_toLeftOf=&quot;parent&quot;&lt;font&gt;&lt;/font&gt;
        app:layout_constraintRight_toRightOf=&quot;parent&quot;&lt;font&gt;&lt;/font&gt;
        app:layout_constraintTop_toTopOf=&quot;parent&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        &amp;lt;Spinner&lt;font&gt;&lt;/font&gt;
            android:id=&quot;@+id/select_speaker_spinner&quot;&lt;font&gt;&lt;/font&gt;
            style=&quot;@style/Widget.AppCompat.DropDownItem.Spinner&quot;&lt;font&gt;&lt;/font&gt;
            android:layout_width=&quot;match_parent&quot;&lt;font&gt;&lt;/font&gt;
            android:layout_height=&quot;70dp&quot;&lt;font&gt;&lt;/font&gt;
            android:entries=&quot;@array/select_speaker_spinner_array&quot;&lt;font&gt;&lt;/font&gt;
            android:spinnerMode=&quot;dialog&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    &amp;lt;/RelativeLayout&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;There are two ways to achieve this.&lt;/p&gt; 
&lt;p&gt;1- As already proposed u can set the background of your spinner as custom 9 patch Image with all the adjustments made into it . &lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;android:background=&quot;@drawable/btn_dropdown&quot; &lt;font&gt;&lt;/font&gt;
android:clickable=&quot;true&quot;&lt;font&gt;&lt;/font&gt;
android:dropDownVerticalOffset=&quot;-10dip&quot;&lt;font&gt;&lt;/font&gt;
android:dropDownHorizontalOffset=&quot;0dip&quot;&lt;font&gt;&lt;/font&gt;
android:gravity=&quot;center&quot;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;If you want your Spinner to show With various different background colors i would recommend making the drop down image transparent, &amp;amp; loading that spinner in a relative layout with your color set in.&lt;/p&gt; 
&lt;p&gt;btn _dropdown is as:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;selector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;item&lt;font&gt;&lt;/font&gt;
    android:state_window_focused=&quot;false&quot; android:state_enabled=&quot;true&quot;&lt;font&gt;&lt;/font&gt;
    android:drawable=&quot;@drawable/spinner_default&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;item&lt;font&gt;&lt;/font&gt;
    android:state_window_focused=&quot;false&quot; android:state_enabled=&quot;false&quot;&lt;font&gt;&lt;/font&gt;
    android:drawable=&quot;@drawable/spinner_default&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;item&lt;font&gt;&lt;/font&gt;
    android:state_pressed=&quot;true&quot;&lt;font&gt;&lt;/font&gt;
    android:drawable=&quot;@drawable/spinner_pressed&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;item&lt;font&gt;&lt;/font&gt;
    android:state_focused=&quot;true&quot; android:state_enabled=&quot;true&quot;&lt;font&gt;&lt;/font&gt;
    android:drawable=&quot;@drawable/spinner_pressed&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;item&lt;font&gt;&lt;/font&gt;
    android:state_enabled=&quot;true&quot;&lt;font&gt;&lt;/font&gt;
    android:drawable=&quot;@drawable/spinner_default&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;item&lt;font&gt;&lt;/font&gt;
    android:state_focused=&quot;true&quot;&lt;font&gt;&lt;/font&gt;
    android:drawable=&quot;@drawable/spinner_pressed&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;item&lt;font&gt;&lt;/font&gt;
    android:drawable=&quot;@drawable/spinner_default&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/selector&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;where the various states of pngwould define your various States of spinner seleti&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;간단한 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://developer.android.com/tools/help/draw9patch.html&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나인 패치&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; png 이미지를 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;디자인하여 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;스피너의 배경으로 사용할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;김프를 사용하면 이미지에 테두리와 직각 삼각형을 모두 넣을 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;배경&quot;만 변경하려면 (모서리 추가, 색상 변경, ....) 원하는 배경 드로어 블을 사용하여 FrameLayout에 넣을 수 있습니다. 그렇지 않으면 스피너 화살표를 잃지 않도록 9 개의 패치 배경을 만들어야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;스피너 배경이 투명합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;어댑터-&amp;gt; getDropDownView에 이것을 추가하는 것은 매우 쉽습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;getDropDownView :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;convertView.setBackground(getContext().getResources().getDrawable(R.drawable.bg_spinner_dropdown));
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;bg_spinner_dropdown :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;shape xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;font&gt;&lt;/font&gt;
    android:shape=&quot;rectangle&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;solid android:color=&quot;@color/white&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;corners&lt;font&gt;&lt;/font&gt;
        android:bottomLeftRadius=enter code here&quot;25dp&quot;&lt;font&gt;&lt;/font&gt;
        android:bottomRightRadius=&quot;25dp&quot;&lt;font&gt;&lt;/font&gt;
        android:topLeftRadius=&quot;25dp&quot;&lt;font&gt;&lt;/font&gt;
        android:topRightRadius=&quot;25dp&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/shape&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/17231683/how-to-create-custom-spinner-like-border-around-the-spinner-with-down-triangle-o&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/17231683/how-to-create-custom-spinner-like-border-around-the-spinner-with-down-triangle-o&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2665</guid>
      <comments>https://nicepro.tistory.com/2665#entry2665comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:40:22 +0900</pubDate>
    </item>
    <item>
      <title>git push heroku master가 &amp;quot;모든 최신 정보&amp;quot;라고 말하지만 앱이 최신 상태가 아닙니다.</title>
      <link>https://nicepro.tistory.com/2664</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;git push heroku master가 &quot;모든 최신 정보&quot;라고 말하지만 앱이 최신 상태가 아닙니다.&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Heroku에 이전 코드를 실행하는 앱이 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 작은 변화를 만들고 그 변화를 약속했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 그 다음 달렸다&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;git push heroku master
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그것은 말할 것이다&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Fetching repository, done.&lt;font&gt;&lt;/font&gt;
Everything up-to-date&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하지만 내가 가서 앱을 보면 모두 오래된 코드입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;약 15 일 전에 Heroku의 다른 버전으로 사이트를 되돌 렸지만 그 이후로 업데이트를 푸시하고 작동했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Heroku가 내 github 저장소에서 최신 파일을 가져 오지 못하는 이유는 무엇입니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;앱을 재설정하고 github에서 파일을 다시 푸시하는 방법이 있습니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;데이터베이스에 프로덕션 데이터가 있으므로 만지고 싶지 않습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;미리 감사드립니다 !!&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;현재 지점이 마스터인지 확인하십시오. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; git branch 
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;포인터가 마스터를 가리키고 있지 않으면 마스터 브랜치를 확인하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;git checkout master
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;변경 사항을 커밋하고 heroku로 푸시하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;git commit -am &quot;xxxyyzzz&quot;    &lt;font&gt;&lt;/font&gt;
git push heroku master&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;를 실행할 때 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;git push heroku master&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;git은 마스터에서 푸시하는 것으로 가정하므로 변경 사항이 다른 브랜치에있는 경우 변경없이 마스터 브랜치를 푸시하려고합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;두 가지 옵션이 있습니다&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;1. 변경 사항을 master와 병합하고 푸시합니다.&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt; &lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;실제 브랜치에서 변경 사항을 커밋 한 다음 마스터와 병합합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;git commit -a - m &quot;your messages&quot;&lt;font&gt;&lt;/font&gt;
git checkout master&lt;font&gt;&lt;/font&gt;
git merge your_feature_branch&lt;font&gt;&lt;/font&gt;
git push heroku master&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;2. 실제 지점에서 변경 사항을 푸시합니다.&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;git push heroku your_feature_branch:master
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 당신이 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;뒤 따르는 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;것을 잊었을 것입니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;git commit -m 'xyz'&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 비슷한 문제가 있었고 결코 내 변경 사항이 heroku에 표시되지 않았습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;자신을 재확인하기 위해 나는 heroku에서 클론을 가져 왔고 분명히 최신 상태였습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 방법을 따르면 문제를 해결할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;1 단계 :&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 새 분기 만들기&lt;/font&gt;&lt;/font&gt;&lt;code&gt;master&lt;/code&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;git checkout -b new_branch
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;2 단계 :&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 파일에 주석을 추가하여 새 커밋을 만든 다음 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;git add .&lt;font&gt;&lt;/font&gt;
git commit -m &quot;Just a test commit to push new branch to heroku&quot;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;3 단계 :&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 새 분기를 heroku로 푸시합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;git push heroku new_branch:master&lt;font&gt;&lt;/font&gt;
heroku restart&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이제 heroku에서 성공적으로 변경 사항을 볼 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 오래된 문제이지만 다른 사람이 다음과 같은 문제를 겪을 경우 나에게 효과가있는 내용 (초보자)으로 업데이트하고 싶었습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여기 (Hudson에서 제공) 지침을 따른 후 마침내 &quot;마스터&quot;브랜치를 확인한 후 &quot;git pull&quot;을 수행하는 것이 나에게 트릭을 제공했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아마도 &quot;git push heroku master&quot;는 master의 로컬 브랜치 만 밀어 낼까요?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;물론 이것은 필요한 모든 변경 사항이 마스터에 올바르게 병합되었다고 가정합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;모든 병합 (개발에서 마스터까지)이 GitHub에서 처리되고 나중에 개발과 병합 된 새 브랜치에서 작업 중이었기 때문에 프로젝트가 설정된 이후로 로컬의 마스터에서 가져 오지 않았습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따라서 위의 단계를 Hudson에서 다시 설명하려면 다음을 수행하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;git checkout master&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;git pull&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;(here, I updated README to have a change to commit, like &quot;Heroku deploy [date, time]&quot;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;git commit -am &quot;xxxyyzzz&quot;&lt;/code&gt; &lt;/p&gt; 
&lt;p&gt;&lt;code&gt;git push heroku master&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;heroku run rake db:migrate&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;heroku restart&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;Good luck!&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Try:&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;heroku status&lt;/code&gt; &lt;/p&gt; 
&lt;p&gt;This returned the following, which confirmed that the problem was with the heroku API (and not with my app!):&lt;/p&gt; 
&lt;p&gt;&quot;The API is experiencing delays. This may result in delays with adding new domains, new releases, and other such actions. Currently, engineers are investigating the issue.&quot;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;When this happens, I push previous commit hash to master like this:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;git push some-heroku-app-name SOME-COMMIT-HASH:master --force
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Then I re-push master like this:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;git push some-heroku-app-name master:master
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I know, I know, silly, but it happened to me so I'm leaving a warning to others: make sure the app you're pushing to is the same app you're checking for changes.&lt;/p&gt; 
&lt;p&gt;In my case I was pushing to staging and then running a shell on production and not understanding why the static files didn't change.&lt;/p&gt; 
&lt;p&gt;(It started with a real issue where static files didn't change when I pushed a new version, but it was probably a one-push fluke, and it only kept me going in circles for another hour because I was testing the wrong app.)&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;If you're using Java, don't forget to rebuild the project before pushing.&lt;/p&gt; 
&lt;p&gt;In case of Gradle:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;gradlew clean install
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;had the same issue, what worked for me was: make a commit with a random message and then push&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;git commit -m&quot;random message&quot;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
git push heroku master&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;My executable name had changed but I forgot to change the name in my &lt;strong&gt;Procfile&lt;/strong&gt;. So while all the files were updating correctly in heroku, the same old executable was running. I used &lt;code&gt;heroku local&lt;/code&gt; from the command line to help track that issue down.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Same issue, I added a remote to my local repository with the heroku git:remote command and then pushed it.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;heroku git:remote -a your-heroku-app&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
git push heroku master&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/21947406/git-push-heroku-master-says-everything-up-to-date-but-the-app-is-not-current&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/21947406/git-push-heroku-master-says-everything-up-to-date-but-the-app-is-not-current&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2664</guid>
      <comments>https://nicepro.tistory.com/2664#entry2664comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:40:09 +0900</pubDate>
    </item>
    <item>
      <title>pyspark 데이터 프레임 집계에 대한 열 이름 변경</title>
      <link>https://nicepro.tistory.com/2663</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;pyspark 데이터 프레임 집계에 대한 열 이름 변경&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;pyspark 데이터 프레임으로 일부 데이터를 분석하고 있으며 집계중인 데이터 프레임이 있다고 가정합니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;df&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;df.groupBy(&quot;group&quot;)\&lt;font&gt;&lt;/font&gt;
  .agg({&quot;money&quot;:&quot;sum&quot;})\&lt;font&gt;&lt;/font&gt;
  .show(100)&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 나에게 줄 것이다 : &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;group                SUM(money#2L)&lt;font&gt;&lt;/font&gt;
A                    137461285853&lt;font&gt;&lt;/font&gt;
B                    172185566943&lt;font&gt;&lt;/font&gt;
C                    271179590646&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;집계는 잘 작동하지만 새 열 이름 &quot;SUM (money # 2L)&quot;이 마음에 들지 않습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 열의 이름을 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;.agg&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;메서드 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;에서 사람이 읽을 수있는 이름으로 바꾸는 깔끔한 방법이 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;있습니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아마도에서 할 일과 더 비슷할 것입니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;dplyr&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;df %&amp;gt;% group_by(group) %&amp;gt;% summarise(sum_money = sum(money))
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여전히 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;dplyr&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 구문을 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;선호하지만 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 코드 조각은 다음을 수행합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;import pyspark.sql.functions as sf&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
df.groupBy(&quot;group&quot;)\&lt;font&gt;&lt;/font&gt;
  .agg(sf.sum('money').alias('money'))\&lt;font&gt;&lt;/font&gt;
  .show(100)&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;장황 해집니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;code&gt;withColumnRenamed&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;트릭을해야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음은 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://spark.apache.org/docs/latest/api/python/pyspark.sql.html?highlight=rename#pyspark.sql.DataFrame.withColumnRenamed&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;pyspark.sql API에&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 대한 링크 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;df.groupBy(&quot;group&quot;)\&lt;font&gt;&lt;/font&gt;
  .agg({&quot;money&quot;:&quot;sum&quot;})\&lt;font&gt;&lt;/font&gt;
  .withColumnRenamed(&quot;SUM(money)&quot;, &quot;money&quot;)&lt;font&gt;&lt;/font&gt;
  .show(100)&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 일부 사람들을 도울 수있는 약간의 도우미 기능을 만들었습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre class=&quot;lang-py prettyprint-override&quot;&gt;&lt;code&gt;import re&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
from functools import partial&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
def rename_cols(agg_df, ignore_first_n=1):&lt;font&gt;&lt;/font&gt;
    &quot;&quot;&quot;changes the default spark aggregate names `avg(colname)` &lt;font&gt;&lt;/font&gt;
    to something a bit more useful. Pass an aggregated dataframe&lt;font&gt;&lt;/font&gt;
    and the number of aggregation columns to ignore.&lt;font&gt;&lt;/font&gt;
    &quot;&quot;&quot;&lt;font&gt;&lt;/font&gt;
    delimiters = &quot;(&quot;, &quot;)&quot;&lt;font&gt;&lt;/font&gt;
    split_pattern = '|'.join(map(re.escape, delimiters))&lt;font&gt;&lt;/font&gt;
    splitter = partial(re.split, split_pattern)&lt;font&gt;&lt;/font&gt;
    split_agg = lambda x: '_'.join(splitter(x))[0:-ignore_first_n]&lt;font&gt;&lt;/font&gt;
    renamed = map(split_agg, agg_df.columns[ignore_first_n:])&lt;font&gt;&lt;/font&gt;
    renamed = zip(agg_df.columns[ignore_first_n:], renamed)&lt;font&gt;&lt;/font&gt;
    for old, new in renamed:&lt;font&gt;&lt;/font&gt;
        agg_df = agg_df.withColumnRenamed(old, new)&lt;font&gt;&lt;/font&gt;
    return agg_df&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예 : &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre class=&quot;lang-py prettyprint-override&quot;&gt;&lt;code&gt;gb = (df.selectExpr(&quot;id&quot;, &quot;rank&quot;, &quot;rate&quot;, &quot;price&quot;, &quot;clicks&quot;)&lt;font&gt;&lt;/font&gt;
 .groupby(&quot;id&quot;)&lt;font&gt;&lt;/font&gt;
 .agg({&quot;rank&quot;: &quot;mean&quot;,&lt;font&gt;&lt;/font&gt;
       &quot;*&quot;: &quot;count&quot;,&lt;font&gt;&lt;/font&gt;
       &quot;rate&quot;: &quot;mean&quot;, &lt;font&gt;&lt;/font&gt;
       &quot;price&quot;: &quot;mean&quot;, &lt;font&gt;&lt;/font&gt;
       &quot;clicks&quot;: &quot;mean&quot;, &lt;font&gt;&lt;/font&gt;
       })&lt;font&gt;&lt;/font&gt;
)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; gb.columns&lt;font&gt;&lt;/font&gt;
['id',&lt;font&gt;&lt;/font&gt;
 'avg(rate)',&lt;font&gt;&lt;/font&gt;
 'count(1)',&lt;font&gt;&lt;/font&gt;
 'avg(price)',&lt;font&gt;&lt;/font&gt;
 'avg(rank)',&lt;font&gt;&lt;/font&gt;
 'avg(clicks)']&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; rename_cols(gb).columns&lt;font&gt;&lt;/font&gt;
['id',&lt;font&gt;&lt;/font&gt;
 'avg_rate',&lt;font&gt;&lt;/font&gt;
 'count_1',&lt;font&gt;&lt;/font&gt;
 'avg_price',&lt;font&gt;&lt;/font&gt;
 'avg_rank',&lt;font&gt;&lt;/font&gt;
 'avg_clicks']&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사람들이 너무 많이 타이핑하는 것을 막기 위해 적어도 조금은합니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같이 간단합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; val maxVideoLenPerItemDf = requiredItemsFiltered.groupBy(&quot;itemId&quot;).agg(max(&quot;playBackDuration&quot;).as(&quot;customVideoLength&quot;))&lt;font&gt;&lt;/font&gt;
maxVideoLenPerItemDf.show()&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Use &lt;code&gt;.as&lt;/code&gt; in agg to name the new row created.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;pre&gt;&lt;code&gt;df = df.groupby('Device_ID').agg(aggregate_methods)&lt;font&gt;&lt;/font&gt;
for column in df.columns:&lt;font&gt;&lt;/font&gt;
    start_index = column.find('(')&lt;font&gt;&lt;/font&gt;
    end_index = column.find(')')&lt;font&gt;&lt;/font&gt;
    if (start_index and end_index):&lt;font&gt;&lt;/font&gt;
        df = df.withColumnRenamed(column, column[start_index+1:end_index])&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;The above code can strip out anything that is outside of the &quot;()&quot;. For example, &quot;sum(foo)&quot; will be renamed as &quot;foo&quot;.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;pre&gt;&lt;code&gt;import findspark&lt;font&gt;&lt;/font&gt;
findspark.init()&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
from pyspark.sql import SparkSession&lt;font&gt;&lt;/font&gt;
from pyspark.sql.functions import *&lt;font&gt;&lt;/font&gt;
from pyspark.sql.types import *&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
spark = SparkSession.builder.appName('test').getOrCreate()&lt;font&gt;&lt;/font&gt;
data = [(1, &quot;siva&quot;, 100), (2, &quot;siva2&quot;, 200),(3, &quot;siva3&quot;, 300),(4, &quot;siva4&quot;, 400),(5, &quot;siva5&quot;, 500)]&lt;font&gt;&lt;/font&gt;
schema = ['id', 'name', 'sallary']&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
df = spark.createDataFrame(data, schema=schema)&lt;font&gt;&lt;/font&gt;
df.show()&lt;font&gt;&lt;/font&gt;
+---+-----+-------+&lt;font&gt;&lt;/font&gt;
| id| name|sallary|&lt;font&gt;&lt;/font&gt;
+---+-----+-------+&lt;font&gt;&lt;/font&gt;
|  1| siva|    100|&lt;font&gt;&lt;/font&gt;
|  2|siva2|    200|&lt;font&gt;&lt;/font&gt;
|  3|siva3|    300|&lt;font&gt;&lt;/font&gt;
|  4|siva4|    400|&lt;font&gt;&lt;/font&gt;
|  5|siva5|    500|&lt;font&gt;&lt;/font&gt;
+---+-----+-------+&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
**df.agg({&quot;sallary&quot;: &quot;max&quot;}).withColumnRenamed('max(sallary)', 'max').show()**&lt;font&gt;&lt;/font&gt;
+---+&lt;font&gt;&lt;/font&gt;
|max|&lt;font&gt;&lt;/font&gt;
+---+&lt;font&gt;&lt;/font&gt;
|500|&lt;font&gt;&lt;/font&gt;
+---+&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Considering you have a dictionary &lt;code&gt;columns_and_operations&lt;/code&gt; and, after the aggregation, want to do the renaming without the hardcoding, a simpler way would be:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;from functools import reduce&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
columns_and_operations = {&lt;font&gt;&lt;/font&gt;
        &quot;rank&quot;: &quot;mean&quot;,&lt;font&gt;&lt;/font&gt;
        &quot;*&quot;: &quot;count&quot;,&lt;font&gt;&lt;/font&gt;
        &quot;rate&quot;: &quot;mean&quot;, &lt;font&gt;&lt;/font&gt;
        &quot;price&quot;: &quot;mean&quot;, &lt;font&gt;&lt;/font&gt;
         &quot;clicks&quot;: &quot;mean&quot;}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
df = df.groupBy(&quot;group&quot;).agg(columns_and_operations)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
old_names = [&quot;{}({})&quot;.format(v, k) for k, v in columns_and_operations.items()]&lt;font&gt;&lt;/font&gt;
new_names = list(columns_and_operations.keys())&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
df = reduce(lambda df, i: df.withColumnRenamed(old_names[i],&lt;font&gt;&lt;/font&gt;
                                               new_names[i]),&lt;font&gt;&lt;/font&gt;
            range(len(old_names)),&lt;font&gt;&lt;/font&gt;
            df)&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/29988287/renaming-columns-for-pyspark-dataframes-aggregates&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/29988287/renaming-columns-for-pyspark-dataframes-aggregates&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2663</guid>
      <comments>https://nicepro.tistory.com/2663#entry2663comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:40:00 +0900</pubDate>
    </item>
    <item>
      <title>ES6지도 객체를 정렬 할 수 있습니까?</title>
      <link>https://nicepro.tistory.com/2662</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;ES6지도 객체를 정렬 할 수 있습니까?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;es6 맵 객체의 항목을 정렬 할 수 있습니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;var map = new Map();&lt;font&gt;&lt;/font&gt;
map.set('2-1', foo);&lt;font&gt;&lt;/font&gt;
map.set('0-1', bar);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;결과 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;map.entries = {&lt;font&gt;&lt;/font&gt;
    0: {&quot;2-1&quot;, foo },&lt;font&gt;&lt;/font&gt;
    1: {&quot;0-1&quot;, bar }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;키를 기준으로 항목을 정렬 할 수 있습니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;map.entries = {&lt;font&gt;&lt;/font&gt;
    0: {&quot;0-1&quot;, bar },&lt;font&gt;&lt;/font&gt;
    1: {&quot;2-1&quot;, foo }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;MDN 문서에 따르면 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Map 객체는 삽입 순서에 따라 요소를 반복합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같이 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;snippet&quot; data-lang=&quot;js&quot; data-hide=&quot;false&quot;&gt; 
 &lt;div class=&quot;snippet-code&quot;&gt; 
  &lt;pre class=&quot;snippet-code-js lang-js prettyprint-override&quot;&gt;&lt;code&gt;var map = new Map();&lt;font&gt;&lt;/font&gt;
map.set('2-1', &quot;foo&quot;);&lt;font&gt;&lt;/font&gt;
map.set('0-1', &quot;bar&quot;);&lt;font&gt;&lt;/font&gt;
map.set('3-1', &quot;baz&quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
var mapAsc = new Map([...map.entries()].sort());&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
console.log(mapAsc)&lt;/code&gt;&lt;/pre&gt; 
 &lt;/div&gt; 
&lt;/div&gt; 
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;를 사용 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;.sort()&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하여 배열은 각 요소의 문자열 변환에 따라 각 문자의 유니 코드 코드 포인트 값에 따라 정렬됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따라서 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;2-1, 0-1, 3-1&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;올바르게 정렬됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;변환 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Map&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용하여 배열 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/from?v=control&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;Array.from&lt;/code&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;, 정렬 배열로 변환 다시 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Map&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;, 예를 들어,&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;new Map(&lt;font&gt;&lt;/font&gt;
  Array&lt;font&gt;&lt;/font&gt;
    .from(eventsByDate)&lt;font&gt;&lt;/font&gt;
    .sort((a, b) =&amp;gt; {&lt;font&gt;&lt;/font&gt;
      // a[0], b[0] is the key of the map&lt;font&gt;&lt;/font&gt;
      return a[0] - b[0];&lt;font&gt;&lt;/font&gt;
    })&lt;font&gt;&lt;/font&gt;
)&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;짧은 대답&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt; 
&lt;pre&gt;&lt;code&gt; new Map([...map].sort((a, b) =&amp;gt; &lt;font&gt;&lt;/font&gt;
   // Some sort function comparing keys with a[0] b[0] or values with a[1] b[1]&lt;font&gt;&lt;/font&gt;
   // Be sure to return -1 if lower and, if comparing values, return 0 if equal&lt;font&gt;&lt;/font&gt;
 ))&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예를 들어 같을 수있는 값 문자열을 비교하면 [1]에 액세스하고 0을 반환하는 같음 조건이있는 정렬 함수를 전달합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; new Map([...map].sort((a, b) =&amp;gt; (a[1] &amp;gt; b[1] &amp;amp;&amp;amp; 1) || a[1] === b[1] ? 0 : -1))
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;같을 수없는 (동일한 문자열 키가 서로 덮어 쓰기) 키 문자열을 비교하면 equals 조건을 건너 뛸 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 다음과 같은 경우 lazy를 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;a[0] &amp;gt; b[0]&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;잘못 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;반환 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하면 false (0, 즉 같음)가 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;반환되므로 명시 적으로 -1을 반환해야합니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;a[0] &amp;lt; b[0]&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; new Map([...map].sort((a, b) =&amp;gt; a[0] &amp;gt; b[0] ? 1 : -1))
&lt;/code&gt;&lt;/pre&gt; 
&lt;hr&gt; 
&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예제와 함께 자세히&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;.entries()&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;에서 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;[...map.entries()]&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;(많은 답변에서 제안) 아마 멀리 당신을위한 JS 엔진 최적화합니다 않는지도의 추가 반복을 추가, 중복입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;간단한 테스트 케이스에서 질문이 요구하는 것을 다음과 같이 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;new Map([...map].sort())
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;...되는 키 모든 문자열 경우 으깨 콤마 가입 키 값 등 문자열 강제를 비교 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;'2-1,foo'&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하고 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;'0-1,[object Object]'&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;새로운 신청서와 새로운 맵을 반환 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참고 : &lt;/font&gt;&lt;/font&gt;&lt;code&gt;{}&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;SO의 콘솔 출력 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;에만 표시되는 경우 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;실제 브라우저 콘솔에서 확인하세요.&lt;/font&gt;&lt;/font&gt;&lt;/em&gt; &lt;/p&gt; 
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;snippet&quot; data-lang=&quot;js&quot; data-hide=&quot;false&quot; data-console=&quot;true&quot; data-babel=&quot;false&quot;&gt; 
 &lt;div class=&quot;snippet-code&quot;&gt; 
  &lt;pre class=&quot;snippet-code-js lang-js prettyprint-override&quot;&gt;&lt;code&gt;const map = new Map([&lt;font&gt;&lt;/font&gt;
  ['2-1', 'foo'],&lt;font&gt;&lt;/font&gt;
  ['0-1', { bar: 'bar' }],&lt;font&gt;&lt;/font&gt;
  ['3-5', () =&amp;gt; 'fuz'],&lt;font&gt;&lt;/font&gt;
  ['3-2', [ 'baz' ]]&lt;font&gt;&lt;/font&gt;
])&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
console.log(new Map([...map].sort()))&lt;/code&gt;&lt;/pre&gt; 
 &lt;/div&gt; 
&lt;/div&gt; 
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 이와 같이 강압과 문자열 화에 의존하는 것은 좋은 습관이 아닙니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같은 놀라움을 얻을 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;snippet&quot; data-lang=&quot;js&quot; data-hide=&quot;false&quot; data-console=&quot;true&quot; data-babel=&quot;false&quot;&gt; 
 &lt;div class=&quot;snippet-code&quot;&gt; 
  &lt;pre class=&quot;snippet-code-js lang-js prettyprint-override&quot;&gt;&lt;code&gt;const map = new Map([&lt;font&gt;&lt;/font&gt;
  ['2', '3,buh?'],&lt;font&gt;&lt;/font&gt;
  ['2,1', 'foo'],&lt;font&gt;&lt;/font&gt;
  ['0,1', { bar: 'bar' }],&lt;font&gt;&lt;/font&gt;
  ['3,5', () =&amp;gt; 'fuz'],&lt;font&gt;&lt;/font&gt;
  ['3,2', [ 'baz' ]],&lt;font&gt;&lt;/font&gt;
])&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Compares '2,3,buh?' with '2,1,foo'&lt;font&gt;&lt;/font&gt;
// Therefore sorts ['2', '3,buh?'] ******AFTER****** ['2,1', 'foo']&lt;font&gt;&lt;/font&gt;
console.log('Buh?', new Map([...map].sort()))&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Let's see exactly what each iteration is using as its comparator&lt;font&gt;&lt;/font&gt;
for (const iteration of map) {&lt;font&gt;&lt;/font&gt;
  console.log(iteration.toString())&lt;font&gt;&lt;/font&gt;
}&lt;/code&gt;&lt;/pre&gt; 
 &lt;/div&gt; 
&lt;/div&gt; 
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이와 같은 버그는 디버그하기가 정말 어렵습니다. 위험을 감수하지 마십시오!&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;당신이 키 또는 값을 정렬 할 경우에 명시 적으로 접근하는 것이 가장 좋습니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;a[0]&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;과 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;b[0]&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;같이, 정렬 기능에. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;우리가 반환해야 함을 참고 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;-1&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하고 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;1&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;있지, 이전과 이후 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;false&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또는 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;0&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;원시와 같은 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;a[0] &amp;gt; b[0]&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이가 동등하게 취급되기 때문에 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;/p&gt;
&lt;div class=&quot;snippet&quot; data-lang=&quot;js&quot; data-hide=&quot;false&quot; data-console=&quot;true&quot; data-babel=&quot;false&quot;&gt; 
 &lt;div class=&quot;snippet-code&quot;&gt; 
  &lt;pre class=&quot;snippet-code-js lang-js prettyprint-override&quot;&gt;&lt;code&gt;const map = new Map([&lt;font&gt;&lt;/font&gt;
  ['2,1', 'this is overwritten'],&lt;font&gt;&lt;/font&gt;
  ['2,1', '0,1'],&lt;font&gt;&lt;/font&gt;
  ['0,1', '2,1'],&lt;font&gt;&lt;/font&gt;
  ['2,2', '3,5'],&lt;font&gt;&lt;/font&gt;
  ['3,5', '2,1'],&lt;font&gt;&lt;/font&gt;
  ['2', ',9,9']&lt;font&gt;&lt;/font&gt;
])&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// For keys, we don't need an equals case, because identical keys overwrite &lt;font&gt;&lt;/font&gt;
const sortStringKeys = (a, b) =&amp;gt; a[0] &amp;gt; b[0] ? 1 : -1 &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// For values, we do need an equals case&lt;font&gt;&lt;/font&gt;
const sortStringValues = (a, b) =&amp;gt; (a[1] &amp;gt; b[1] &amp;amp;&amp;amp; 1) || a[1] === b[1] ? 0 : -1&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
console.log('By keys:', new Map([...map].sort(sortStringKeys)))&lt;font&gt;&lt;/font&gt;
console.log('By values:', new Map([...map].sort(sortStringValues)))&lt;/code&gt;&lt;/pre&gt; 
 &lt;/div&gt; 
&lt;/div&gt; 
&lt;p&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;The idea is to extract the keys of your map into an array. Sort this array. Then iterate over this sorted array, get its value pair from the unsorted map and put them into a new map. The new map will be in sorted order. The code below is it's implementation:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;var unsortedMap = new Map();&lt;font&gt;&lt;/font&gt;
unsortedMap.set('2-1', 'foo');&lt;font&gt;&lt;/font&gt;
unsortedMap.set('0-1', 'bar');&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Initialize your keys array&lt;font&gt;&lt;/font&gt;
var keys = [];&lt;font&gt;&lt;/font&gt;
// Initialize your sorted maps object&lt;font&gt;&lt;/font&gt;
var sortedMap = new Map();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Put keys in Array&lt;font&gt;&lt;/font&gt;
unsortedMap.forEach(function callback(value, key, map) {&lt;font&gt;&lt;/font&gt;
    keys.push(key);&lt;font&gt;&lt;/font&gt;
});&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Sort keys array and go through them to put in and put them in sorted map&lt;font&gt;&lt;/font&gt;
keys.sort().map(function(key) {&lt;font&gt;&lt;/font&gt;
    sortedMap.set(key, unsortedMap.get(key));&lt;font&gt;&lt;/font&gt;
});&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// View your sorted map&lt;font&gt;&lt;/font&gt;
console.log(sortedMap);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Unfortunately, not really implemented in ES6. You have this feature with &lt;a href=&quot;https://facebook.github.io/immutable-js/docs/#/OrderedMap&quot; rel=&quot;nofollow&quot;&gt;OrderedMap.sort()&lt;/a&gt; from ImmutableJS or &lt;a href=&quot;https://lodash.com/docs#sortBy&quot; rel=&quot;nofollow&quot;&gt;_.sortBy()&lt;/a&gt; from Lodash. &lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;You can convert to an array and call array soring methods on it:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;[...map].sort(/* etc */);
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;One way is to get the entries array, sort it, and then create a new Map with the sorted array:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;let ar = [...myMap.entries()];&lt;font&gt;&lt;/font&gt;
sortedArray = ar.sort();&lt;font&gt;&lt;/font&gt;
sortedMap = new Map(sortedArray);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;But if you don't want to create a new object, but to work on the same one, you can do something like this:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;// Get an array of the keys and sort them&lt;font&gt;&lt;/font&gt;
let keys = [...myMap.keys()];&lt;font&gt;&lt;/font&gt;
sortedKeys = keys.sort();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
sortedKeys.forEach((key)=&amp;gt;{&lt;font&gt;&lt;/font&gt;
  // Delete the element and set it again at the end&lt;font&gt;&lt;/font&gt;
  const value = this.get(key);&lt;font&gt;&lt;/font&gt;
  this.delete(key);&lt;font&gt;&lt;/font&gt;
  this.set(key,value);&lt;font&gt;&lt;/font&gt;
})&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;The snippet below sorts given map by its keys and maps the keys to key-value objects again. I used localeCompare function since my map was string-&amp;gt;string object map.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;var hash = {'x': 'xx', 't': 'tt', 'y': 'yy'};&lt;font&gt;&lt;/font&gt;
Object.keys(hash).sort((a, b) =&amp;gt; a.localeCompare(b)).map(function (i) {&lt;font&gt;&lt;/font&gt;
            var o = {};&lt;font&gt;&lt;/font&gt;
            o[i] = hash[i];&lt;font&gt;&lt;/font&gt;
            return o;&lt;font&gt;&lt;/font&gt;
        });&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;result: &lt;code&gt;[{t:'tt'}, {x:'xx'}, {y: 'yy'}];&lt;/code&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Perhaps a more realistic example about not sorting a Map object but preparing the sorting up front before doing the Map. The syntax gets actually pretty compact if you do it like this. You can apply the sorting before the map function like this, with a sort function before map (Example from a React app I am working on using JSX syntax) &lt;/p&gt; 
&lt;p&gt;Mark that I here define a sorting function inside using an arrow function that returns -1 if it is smaller and 0 otherwise sorted on a property of the Javascript objects in the array I get from an API.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;report.ProcedureCodes.sort((a, b) =&amp;gt; a.NumericalOrder &amp;lt; b.NumericalOrder ? -1 : 0).map((item, i) =&amp;gt;&lt;font&gt;&lt;/font&gt;
                        &amp;lt;TableRow key={i}&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
                            &amp;lt;TableCell&amp;gt;{item.Code}&amp;lt;/TableCell&amp;gt;&lt;font&gt;&lt;/font&gt;
                            &amp;lt;TableCell&amp;gt;{item.Text}&amp;lt;/TableCell&amp;gt;&lt;font&gt;&lt;/font&gt;
                            {/* &amp;lt;TableCell&amp;gt;{item.NumericalOrder}&amp;lt;/TableCell&amp;gt; */}&lt;font&gt;&lt;/font&gt;
                        &amp;lt;/TableRow&amp;gt;&lt;font&gt;&lt;/font&gt;
                    )&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;pre&gt;&lt;code&gt;let map = new Map();&lt;font&gt;&lt;/font&gt;
map.set('2-1', &quot;foo&quot;);&lt;font&gt;&lt;/font&gt;
map.set('0-1', &quot;bar&quot;);&lt;font&gt;&lt;/font&gt;
map.set('3-1', &quot;baz&quot;);&lt;font&gt;&lt;/font&gt;
let mapAsc = new Map([...map.entries()].sort());&lt;font&gt;&lt;/font&gt;
console.log(mapAsc);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Map(3)&amp;nbsp;{&quot;0-1&quot; =&amp;gt; &quot;bar&quot;, &quot;2-1&quot; =&amp;gt; &quot;foo&quot;, &quot;3-1&quot; =&amp;gt; &quot;baz&quot;}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/31158902/is-it-possible-to-sort-a-es6-map-object&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/31158902/is-it-possible-to-sort-a-es6-map-object&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2662</guid>
      <comments>https://nicepro.tistory.com/2662#entry2662comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:39:49 +0900</pubDate>
    </item>
    <item>
      <title>해시 테이블의 기초?</title>
      <link>https://nicepro.tistory.com/2661</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 테이블의 기초?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 테이블의 기본 개념에 대해 꽤 혼란 스럽습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시를 코딩한다면 어떻게 시작할까요? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 테이블과 일반 배열의 차이점은 무엇입니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기본적으로 누군가가이 질문에 답하면 내 모든 질문에 답할 수 있다고 생각합니다. 무작위로 생성 된 100 개의 숫자 (키로)가 있다면 어떻게 해시 테이블을 구현할 수 있으며 왜 배열보다 유리할까요?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;의사 코드 또는 Java는 학습 도구로 높이 평가 될 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;지금까지의 답변은 해시 테이블을 정의하고 일부 이론을 설명하는 데 도움이되었지만 예제를 통해 더 나은 느낌을 얻을 수 있다고 생각합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 테이블과 일반 배열의 차이점은 무엇입니까?&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 테이블과 배열은 모두 데이터를 저장하고 검색 할 수있는 구조입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;둘 다 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;색인&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 을 지정하고 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이와 연관된 값을 검색 할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Daniel Spiewak이 언급했듯이 차이점은 배열의 인덱스는 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;순차적&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 인 반면 해시 테이블 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;의 인덱스는 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;연관된 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;데이터&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 의 &lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;값을&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 기반으로한다는 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 테이블을 사용하는 이유는 무엇입니까?&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 테이블은 많은 양의 데이터, 특히 쉽게 검색 할 수없는 데이터에서 항목을 검색하는 매우 효율적인 방법을 제공 할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;( &quot;대형은&quot;여기에 의미 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://en.wiktionary.org/wiki/ginormous&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;ginormous 한&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 이 순차적 인 검색을 수행하는 데 시간이 오래 걸릴 것이라는 의미에서).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시를 코딩한다면 어떻게 시작할까요?&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;문제 없어요. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가장 간단한 방법은 숫자 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;N&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;(일반적으로 정수) &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;를 반환하는 데이터에 대해 수행 할 수있는 임의의 수학 연산을 만드는 것 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음이 숫자를 '버킷'배열의 색인으로 사용하고 데이터를 버킷 #에 저장합니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;N&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;요령은 나중에 쉽게 찾을 수 있도록 다른 버킷에 값을 배치하는 작업을 선택하는 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예 :&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 대형 쇼핑몰은 구매자가 주차 한 위치를 기억할 수 있도록 고객의 자동차와 주차 위치에 대한 데이터베이스를 유지합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;데이터베이스 저장 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;make&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;, &lt;/font&gt;&lt;/font&gt;&lt;code&gt;color&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;, &lt;/font&gt;&lt;/font&gt;&lt;code&gt;license plate&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;,와 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;parking location&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;상점을 떠날 때 구매자는 제조업체와 색상을 입력하여 자신의 차를 찾습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;데이터베이스는 번호판 및 주차 공간의 (상대적으로 짧은) 목록을 반환합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;빠른 스캔으로 구매자의 차를 찾습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;SQL 쿼리로이를 구현할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;SELECT license, location FROM cars WHERE make=&quot;$(make)&quot; AND color=&quot;$(color)&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;데이터가 기본적으로 목록에 불과한 배열에 저장된 경우 모든 일치 항목에 대해 배열을 스캔하여 쿼리를 구현하는 것을 상상할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;반면에 해시 규칙을 상상해보십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;제조업체 및 색상에있는 모든 문자의 ASCII 문자 코드를 추가하고 100으로 나누고 나머지를 해시 값으로 사용합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 규칙은 각 항목을 0에서 99 사이의 숫자로 변환하여 기본적으로 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;데이터를 100 개의 버킷 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;으로 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;정렬&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;고객이 자동차를 찾아야 할 때마다 제조업체와 색상을 해시 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하여 정보가 포함 된 100 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;개 중 하나의&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 버킷 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;을 찾을 수 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;즉시 검색을 100 배 줄였습니다!&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이제 수십 개의 기준에 따라 검색되는 수백만 개의 항목이있는 데이터베이스와 같이 방대한 양의 데이터로 예제를 확장하십시오. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;좋은&quot;해시 함수는 추가 검색을 최소화하는 방식으로 데이터를 버킷에 배포하여 상당한 시간을 절약합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;먼저 해시 함수가 무엇인지 이해해야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 함수는 키 (예 : 임의 길이의 문자열)를 가져와 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가능한 한 고유&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 한 숫자 &lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;를&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 반환하는 함수 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;동일한 키는 항상 동일한 해시를 반환해야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Java의 정말 간단한 문자열 해싱 함수는 다음과 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public int stringHash(String s) {&lt;font&gt;&lt;/font&gt;
    int h = s.length();&lt;font&gt;&lt;/font&gt;
    for(char c : s.toCharArray()) {&lt;font&gt;&lt;/font&gt;
        h ^= c;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    return h;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;a href=&quot;http://www.azillionmonkeys.com/qed/hash.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://www.azillionmonkeys.com/qed/hash.html&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 에서 좋은 해시 함수를 공부할 수 있습니다 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.azillionmonkeys.com/qed/hash.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이제 해시 맵은이 해시 값을 사용하여 값을 배열에 배치합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;단순한 자바 방법 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public void put(String key, Object val) {&lt;font&gt;&lt;/font&gt;
    int hash = stringHash(s) % array.length;&lt;font&gt;&lt;/font&gt;
    if(array[hash] == null) {&lt;font&gt;&lt;/font&gt;
        array[hash] = new LinkedList&amp;lt;Entry&amp;lt;String, Object&amp;gt; &amp;gt;();&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    for(Entry e : array[hash]) {&lt;font&gt;&lt;/font&gt;
        if(e.key.equals(key)){&lt;font&gt;&lt;/font&gt;
            e.value = val;&lt;font&gt;&lt;/font&gt;
            return;&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    array[hash].add(new Entry&amp;lt;String, Object&amp;gt;(key, val));&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;(이 맵은 고유 키를 적용합니다. 모든 맵이 적용되는 것은 아닙니다.)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;두 개의 다른 키가 동일한 값으로 해시되거나 두 개의 다른 해시가 동일한 배열 인덱스에 매핑 될 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이를 처리하기위한 많은 기술이 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가장 간단한 방법은 각 배열 인덱스에 대해 연결 목록 (또는 이진 트리)을 사용하는 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 함수가 충분하면 선형 검색이 필요하지 않습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이제 키를 찾습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public Object get(String key) {&lt;font&gt;&lt;/font&gt;
    int hash = stringHash(key) % array.length;&lt;font&gt;&lt;/font&gt;
    if(array[hash] != null) {&lt;font&gt;&lt;/font&gt;
        for(Entry e : array[hash]) {&lt;font&gt;&lt;/font&gt;
            if(e.key.equals(key))&lt;font&gt;&lt;/font&gt;
                return e.value;&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    return null;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 테이블은 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;연관성&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 이 &lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;있습니다&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; . &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 선형 데이터 구조 인 배열과 큰 차이가 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;배열을 사용하면 다음과 같이 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;int[] arr = ...&lt;font&gt;&lt;/font&gt;
for (int i = 0; i &amp;lt; arr.length; i++) {&lt;font&gt;&lt;/font&gt;
    System.out.println(arr[i] + 1);&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;정확한 메모리 오프셋 ( &lt;/font&gt;&lt;/font&gt;&lt;code&gt;i&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;) &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;을 지정하여 배열에서 요소를 얻는 방법을 확인하십시오 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이는 키 / 값 쌍을 저장하고 나중에 키를 기반으로 값을 검색 할 수있는 해시 테이블과 대조됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Hashtable&amp;lt;String, Integer&amp;gt; table = new Hashtable&amp;lt;String, Integer&amp;gt;();&lt;font&gt;&lt;/font&gt;
table.put(&quot;Daniel&quot;, 20);&lt;font&gt;&lt;/font&gt;
table.put(&quot;Chris&quot;, 18);&lt;font&gt;&lt;/font&gt;
table.put(&quot;Joseph&quot;, 16);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;위의 표를 사용하여 다음과 같은 호출을 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;int n = table.get(&quot;Chris&quot;);
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;... 그리고 그 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;n&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가치는 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;18&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 이것이 아마도 대부분의 질문에 답할 것이라고 생각합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 테이블의 구현은 상당히 흥미로운 주제이며, &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Hash_table&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;위키피디아가 잘 다루고 있습니다&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; .&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;해시 테이블이 키를 조회하는 방식과 키가 생성되는 방식에 더 관심이 있습니다.&quot;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해싱은 키 개체를 숫자로 변환합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이를 &quot;해싱&quot;이라고합니다. 객체에서 해시를 만듭니다. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Hash_function&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 함수를&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 참조하십시오 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예를 들어, 문자열의 바이트를 합산하는 것은 표준 해시 기술입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시를 관리 가능한 크기로 유지하기 위해 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;모듈로 2 &lt;/font&gt;&lt;/font&gt;&lt;sup&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;32&lt;/font&gt;&lt;/font&gt;&lt;/sup&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 합계를 계산합니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시는 항상 같은 대답을 제공합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;O&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; (1)입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;숫자는 HashTable에서 &quot;슬롯&quot;을 제공합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;임의의 키 객체가 주어지면 해시 값은 해시 값을 계산합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 해시 값은 테이블의 슬롯을 제공합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;보통 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;mod( hash, table size )&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것도 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;O&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; (1)입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것이 일반적인 해결책입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;두 개의 숫자 계산을 통해 임의의 개체를 키로 사용하여 임의의 개체를 값으로 사용했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이만큼 빠를 수있는 것은 거의 없습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;객체에서 해시 값으로의 변환은 이러한 일반적인 방법 중 하나로 발생합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;4 바이트의 &quot;기본&quot;객체 인 경우 객체의 기본 값은 숫자입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;개체의 주소는 4 바이트이며 개체의 주소는 해시 값으로 사용할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;간단한 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Hash_function&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 함수&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; (MD5, SHA1 등)는 개체의 바이트를 누적하여 4 바이트 숫자를 만듭니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;고급 해시는 단순한 바이트 합계가 아니며 단순한 합계는 모든 원래 입력 비트를 충분히 반영하지 않습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 테이블의 슬롯은 mod (number, size of table)입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해당 슬롯에 원하는 값이 있으면 완료된 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;원하는 값이 아니라면 다른 곳을 찾아야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;테이블에서 빈 자리를 찾는 데 널리 사용되는 몇 가지 프로빙 알고리즘이 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;선형은 다음 자유 지점에 대한 간단한 검색입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Quadratic은 빈 슬롯을 찾는 비선형 호핑입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;난수 생성기 (고정 시드 포함)를 사용하여 데이터를 균등하지만 임의로 분산하는 일련의 프로브를 생성 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;프로빙 알고리즘은 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;O&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 가 아닙니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;(1). &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;테이블이 충분히 크면 충돌 확률이 낮고 프로브는 중요하지 않습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;테이블이 너무 작 으면 충돌이 발생하고 프로빙이 발생합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 시점에서 성능 최적화를 위해 프로빙과 테이블 크기의 균형을 맞추는 것은 &quot;조정 및 조정&quot;의 문제가됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;보통 우리는 테이블을 더 크게 만듭니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Hash_table&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 테이블을&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 참조하십시오 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아직 특별히 언급하지 않은 것 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;배열에 대해 해시 테이블을 사용하는 요점은 성능입니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;배열을 반복하는 것은 일반적으로 O (1)에서 O (x)까지 어디든 걸릴 수 있습니다. 여기서 x는 배열의 항목 수입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;배열에서 수십만 개의 항목에 대해 이야기하는 경우 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;항목을 찾는 시간은 매우 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가변적&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;적절하게 가중 된 해시 테이블은 일반적으로 해시 테이블 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;에있는 항목의 수에 관계없이 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;거의 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;일정한&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 액세스 시간이 O (1)을 약간 넘습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;무작위로 생성 된 100 개의 숫자에 해시 테이블을 사용하고 싶지 않을 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 테이블에 대해 생각하는 좋은 방법은 값 쌍에 대해 생각하는 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;학생을 사용하고 모든 사람이 학생 ID 번호를 가지고 있다고합시다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;프로그램에서 학생에 대한 정보 (이름, 전화 번호, 청구서 등)를 저장합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기본 정보 (예 : 이름 또는 학생 ID) 만 사용하여 학생에 대한 모든 정보를 찾으려고합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;학생이 10,000 명이라고 가정 해 보겠습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;모든 항목을 배열에 저장하면 각 항목의 학생 ID를 찾고있는 항목과 비교하여 전체 배열을 반복해야합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대신 학생 ID 번호를 배열의 위치로 &quot;해시&quot;(아래 참조)하면 번호가 동일한 해시를 가진 학생의 학생 만 검색하면됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;원하는 것을 찾는 데 훨씬 적은 노력이 필요합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 예에서 학생 ID가 6 자리 숫자라고 가정 해 보겠습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;우리의 해시 함수는 &quot;해시 키&quot;로 숫자의 맨 아래 3 자리 만 사용할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따라서 232145는 배열 위치 145로 해시됩니다. 따라서 999 요소의 배열 만 필요합니다 (각 요소는 학생 ​​목록 임).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그것은 당신에게 좋은 시작이 될 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;물론 이런 종류의 정보에 대해서는 교과서 나 위키피디아를 읽어야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 나는 당신이 이미 그것을했고 독서에 지쳐 있다고 가정합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;간단히 말해 해시 테이블이 작동하는 방식입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;책으로 가득 찬 도서관이 있다고 상상해보십시오. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;책을 배열로 보관하는 경우 각 책을 선반의 한 지점에 놓고 누군가가 책을 찾도록 요청하면 모든 선반을 살펴 보게됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;누군가 &quot;책 # 12345&quot;라고 말하면 꽤 쉽게 찾을 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대신 책 제목이 'A'로 시작하면 1 행에 간다고 가정 해 봅시다. 두 번째 문자가 'B'이면 1 행, 랙 2에갑니다. 세 번째 문자가 'C'이면 책 위치를 식별 할 때까지 행 1, 랙 2, 선반 3 ... 등으로 이동합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러면 책 제목에 따라 정확히 어디에 있어야하는지 알 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이제 제가 설명한 단순한 &quot;해싱&quot;알고리즘에는 몇 가지 문제가 있습니다. 일부 선반은 과부하 상태이고 다른 선반은 비어 있고 일부 책은 동일한 슬롯에 할당됩니다. 따라서 실제 해시 함수는 신중하게 구성됩니다. 그러한 문제를 피하십시오. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 이것이 기본 아이디어입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 테이블과 배열의 차이점에 대해 그 부분에 대답하겠습니다 ...하지만 이전에 가져 오기의 해싱 알고리즘을 구현 한 적이 없기 때문에 더 많은 지식을 가진 사람에게 맡기겠습니다. :)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;배열은 정렬 된 객체 목록입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;객체 자체는별로 중요하지 않습니다. 중요한 것은 삽입 순서대로 객체를 나열하려는 경우 항상 동일하다는 것입니다 (즉, 첫 번째 요소 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;의 인덱스는 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;항상&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 0입니다).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 테이블은 순서가 아닌 키로 색인이 생성됩니다. 해싱 알고리즘에 대한 기본 검색이 제가 할 수있는 것보다 훨씬 더 많은 통찰력을 제공 할 것이라고 생각합니다. 위키피디아는 매우 괜찮은 정보를 제공합니다. &quot;키로 사용되는 임의의 개체에 대한 빠른 검색을 위해 키가 들어갑니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;장점 : 삽입 순서가 중요한 경우 배열 또는 정렬 된 목록이 필요합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;임의의 키 (다양한 해시 기능으로 입력)를 통한 빠른 조회가 중요하다면 해시 테이블이 의미가 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;[위 me.yahoo.com/a의 댓글에 대한 답변입니다.]&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그것은 해시 함수에 따라 다릅니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 함수가 단어 길이에 따라 단어를 해시한다고 가정 해 봅시다. chris의 키는 5가됩니다. 마찬가지로 yahoo의 키도 5가됩니다. 5로 키가있는 '버킷'에서). &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이렇게하면 데이터 크기와 동일한 배열을 만들 필요가 없습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;제 생각에이 질문은 지금까지 매우 명확하고 다양한 방식으로 대답됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다른 관점을 추가하고 싶습니다 (새로운 독자도 혼동 할 수 있음)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;최소한의 추상화 수준에서 배열은 연속적인 메모리 블록입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;시작 주소 ( &lt;/font&gt;&lt;/font&gt;&lt;code&gt;startAddress&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;), 크기 ( &lt;/font&gt;&lt;/font&gt;&lt;code&gt;sizeOfElement&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;) 및 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;index&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;단일 요소의가 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;주어지면 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;요소의 주소는 다음과 같이 계산됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;elementAddress = startAddress + sizeOfElement * index
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여기서 주목해야 할 흥미로운 점은 배열이 &lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;O (1)&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;code&gt;index&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 에서 값의 위치를 ​​계산하는 해시 함수로 키와 위의 함수를 사용하여 해시 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;테이블로 추상화 /보기 할 수 있다는 것 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;입니다.&lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해시 테이블은 빠른 조회를 위해 생성 된 데이터 구조입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;항목 수가 매우 적 으면 해시 테이블이 효과적이지 않습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/a/18417489/730807&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참고&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;몇 가지 예 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;    import java.util.Collection;&lt;font&gt;&lt;/font&gt;
    import java.util.Enumeration;&lt;font&gt;&lt;/font&gt;
    import java.util.Hashtable;&lt;font&gt;&lt;/font&gt;
    import java.util.Set;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public class HashtableDemo {&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public static void main(String args[]) {&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Creating Hashtable for example&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
     Hashtable companies = new Hashtable();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Java Hashtable example to put object into Hashtable&lt;font&gt;&lt;/font&gt;
// put(key, value) is used to insert object into map&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
     companies.put(&quot;Google&quot;, &quot;United States&quot;);&lt;font&gt;&lt;/font&gt;
     companies.put(&quot;Nokia&quot;, &quot;Finland&quot;);&lt;font&gt;&lt;/font&gt;
     companies.put(&quot;Sony&quot;, &quot;Japan&quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Java Hashtable example to get Object from Hashtable&lt;font&gt;&lt;/font&gt;
// get(key) method is used to retrieve Objects from Hashtable&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
     companies.get(&quot;Google&quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Hashtable containsKey Example&lt;font&gt;&lt;/font&gt;
// Use containsKey(Object) method to check if an Object exits as key in&lt;font&gt;&lt;/font&gt;
// hashtable&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
     System.out.println(&quot;Does hashtable contains Google as key: &quot;+companies.containsKey(&quot;Google&quot;));&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Hashtable containsValue Example&lt;font&gt;&lt;/font&gt;
// just like containsKey(), containsValue returns true if hashtable&lt;font&gt;&lt;/font&gt;
// contains specified object as value&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
      System.out.println(&quot;Does hashtable contains Japan as value: &quot;+companies.containsValue(&quot;Japan&quot;));&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Hashtable enumeration Example&lt;font&gt;&lt;/font&gt;
// hashtabl.elements() return enumeration of all hashtable values&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
      Enumeration enumeration = companies.elements();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
      while (enumeration.hasMoreElements()) {&lt;font&gt;&lt;/font&gt;
      System.out.println(&quot;hashtable values: &quot;+enumeration.nextElement());&lt;font&gt;&lt;/font&gt;
      }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// How to check if Hashtable is empty in Java&lt;font&gt;&lt;/font&gt;
// use isEmpty method of hashtable to check emptiness of hashtable in&lt;font&gt;&lt;/font&gt;
// Java&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
       System.out.println(&quot;Is companies hashtable empty: &quot;+companies.isEmpty());&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// How to find size of Hashtable in Java&lt;font&gt;&lt;/font&gt;
// use hashtable.size() method to find size of hashtable in Java&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
      System.out.println(&quot;Size of hashtable in Java: &quot; + companies.size());&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// How to get all values form hashtable in Java&lt;font&gt;&lt;/font&gt;
// you can use keySet() method to get a Set of all the keys of hashtable&lt;font&gt;&lt;/font&gt;
// in Java&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
      Set hashtableKeys = companies.keySet();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// you can also get enumeration of all keys by using method keys()&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
      Enumeration hashtableKeysEnum = companies.keys();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// How to get all keys from hashtable in Java&lt;font&gt;&lt;/font&gt;
// There are two ways to get all values form hashtalbe first by using&lt;font&gt;&lt;/font&gt;
// Enumeration and second getting values ad Collection&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
      Enumeration hashtableValuesEnum = companies.elements();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
      Collection hashtableValues = companies.values();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Hashtable clear example&lt;font&gt;&lt;/font&gt;
// by using clear() we can reuse an existing hashtable, it clears all&lt;font&gt;&lt;/font&gt;
// mappings.&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
       companies.clear();&lt;font&gt;&lt;/font&gt;
      }&lt;font&gt;&lt;/font&gt;
     }&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;산출:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Does hashtable contains Google as key: true&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
Does hashtable contains Japan as value: true&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
hashtable values: Finland&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
hashtable values: United States&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
hashtable values: Japan&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
Is companies hashtable empty: false&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
Size of hashtable in Java: 3&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/282712/the-fundamentals-of-hash-tables&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/282712/the-fundamentals-of-hash-tables&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2661</guid>
      <comments>https://nicepro.tistory.com/2661#entry2661comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:39:38 +0900</pubDate>
    </item>
    <item>
      <title>Visual Studio의 메서드에 대한 코드 조각</title>
      <link>https://nicepro.tistory.com/2660</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio의 메서드에 대한 코드 조각&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio에서 예를 들어 입력 할 수 있습니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;...에 대한 &lt;/font&gt;&lt;/font&gt;&lt;kbd&gt;TAB&lt;/kbd&gt; &lt;kbd&gt;TAB&lt;/kbd&gt;&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;코드 조각이 나타납니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;비공개, 공개 등의 메소드에 대한 내장 코드 스 니펫도 있습니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;ctor&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; : 기본 생성자&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;소품&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; : 속성&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;propg&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; : 읽기 전용 속성&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;sim&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; : &lt;/font&gt;&lt;/font&gt;&lt;code&gt;static int main&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;방법&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;svm&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; : &lt;/font&gt;&lt;/font&gt;&lt;code&gt;static void main&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;방법&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여기에 좋은 목록이 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.developer.com/net/net/article.php/3557701/Introducing-Visual-Studio-2005-IntelliSense-Code-Snippets.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;있습니다&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; . &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;직접 만들고 싶다면 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://github.com/mmanela/snippetdesigner&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Snippet Designer&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 가 매우 좋습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://docs.microsoft.com/en-us/visualstudio/ide/visual-csharp-code-snippets&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음은 Visual Studio 2017 용 모든 Visual C # 코드 조각입니다.&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;메서드 조각을 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://visualstudiogallery.msdn.microsoft.com/d4e9939d-baac-43d4-bece-960eb57e02c1?SRC=VSIDE&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio Extension&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 으로 다운로드 할 수 있습니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음을 지원합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;method (typical method)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
vmethod (virtual method)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
smethod (static method)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
xmethod (extension method)&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio에서 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;도구&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; → &lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;확장 및 업데이트&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 메뉴로 이동합니다 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;확장 및 업데이트&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 창 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;관찰&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;검색 필드 (오른쪽 위)에 &quot;C # Methods Code Snippets&quot;를 입력합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/li&gt; 
&lt;/ol&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음은 Visual Studio 2010 용 사용자 지정 코드 조각을 만드는 데 사용한 단계이지만 Visual Studio 2008에서도 작동합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;method.snippet&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 이라는 새 텍스트 파일을 &lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;만들고&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 다음을 붙여 넣습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;CodeSnippets  xmlns=&quot;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;CodeSnippet Format=&quot;1.0.0&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;Header&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;Title&amp;gt;method&amp;lt;/Title&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;Shortcut&amp;gt;method&amp;lt;/Shortcut&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;Description&amp;gt;Code snippet for method&amp;lt;/Description&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;Author&amp;gt;Kevin Hogg&amp;lt;/Author&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;SnippetTypes&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;SnippetType&amp;gt;Expansion&amp;lt;/SnippetType&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;/SnippetTypes&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/Header&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;Snippet&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;Declarations&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;Literal&amp;gt;&lt;font&gt;&lt;/font&gt;
                    &amp;lt;ID&amp;gt;methodname&amp;lt;/ID&amp;gt;&lt;font&gt;&lt;/font&gt;
                    &amp;lt;ToolTip&amp;gt;Method name&amp;lt;/ToolTip&amp;gt;&lt;font&gt;&lt;/font&gt;
                    &amp;lt;Function&amp;gt;MethodName()&amp;lt;/Function&amp;gt;&lt;font&gt;&lt;/font&gt;
                    &amp;lt;Default&amp;gt;MethodNamePlaceholder&amp;lt;/Default&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;/Literal&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;/Declarations&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;Code Language=&quot;csharp&quot;&amp;gt;&amp;lt;![CDATA[public void $methodname$ ()&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        $end$&lt;font&gt;&lt;/font&gt;
    }]]&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;/Code&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/Snippet&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/CodeSnippet&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/CodeSnippets&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Windows 탐색기의 snippets 폴더에 파일을 복사합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio 2010 : C : \ Program Files (x86) \ Microsoft Visual Studio 10.0 \ VC # \ Snippets \ 1033 \ Visual C #&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio 2008 : C : \ Program Files (x86) \ Microsoft Visual Studio 9.0 \ VC # \ Snippets \ 1033 \ Visual C #&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;파일을 저장하면 코드 조각이 자동으로로드되므로 이제 Visual Studio를 열고 다음을 입력 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;method&amp;lt;tab&amp;gt;&amp;lt;tab&amp;gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;* 여기서 &amp;lt;tab&amp;gt;은 &lt;/font&gt;&lt;/font&gt;&lt;kbd&gt;Tab&lt;/kbd&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;키보드 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;의 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;키입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이제 이름을 변경할 수 있도록 MethodNamePlaceholder가 강조 표시된 다음이 생성 된 것을 볼 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public void MethodNamePlaceholder()&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용 가능한 모든 목록을 보려면 다음을 수행하십시오 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;snippet&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;를 눌러 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;kbd&gt;CTRL&lt;/kbd&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;+&lt;/font&gt;&lt;/font&gt;&lt;kbd&gt;K&lt;/kbd&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 후 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;kbd&gt;CTRL&lt;/kbd&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;+&lt;/font&gt;&lt;/font&gt;&lt;kbd&gt;X&lt;/kbd&gt;&lt;/strong&gt;&lt;/li&gt; 
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;MSDN에서도 언급 한 내가 사용하는 일부 스 니펫은 다음과 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;ol&gt; 
  &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;' &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;#if&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; #if 지시문과 #endif 지시문을 만듭니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
  &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;' &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;#region&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; #region 지시문 및 #endregion 지시문을 만듭니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;~&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 포함하는 클래스에 대한 소멸자를 만듭니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;attribute&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; Attribute에서 파생되는 클래스에 대한 선언을 만듭니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;체크 된&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 블록을 생성합니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;class&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 클래스 선언을 만듭니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;ctor&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 포함하는 클래스에 대한 생성자를 만듭니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;cw&lt;/strong&gt; Creates a call to WriteLine.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;do&lt;/strong&gt; Creates a do while loop.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;else&lt;/strong&gt; Creates an else block.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;enum&lt;/strong&gt; Creates an enum declaration.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;equals&lt;/strong&gt; Creates a method declaration that overrides the Equals method defined in the Object class.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;exception&lt;/strong&gt; Creates a declaration for a class that derives from an exception (Exception by default).&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;for&lt;/strong&gt; Creates a for loop.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;foreach&lt;/strong&gt; Creates a foreach loop.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;forr&lt;/strong&gt; Creates a for loop that decrements the loop variable after each iteration.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;if&lt;/strong&gt; Creates an if block.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;indexer&lt;/strong&gt; Creates an indexer declaration.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;interface&lt;/strong&gt; Creates an interface declaration.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;invoke&lt;/strong&gt; Creates a block that safely invokes an event.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;iterator&lt;/strong&gt; Creates an iterator.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;iterindex&lt;/strong&gt; Creates a &quot;named&quot; iterator and indexer pair by using a nested class.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;lock&lt;/strong&gt; Creates a lock block.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;mbox&lt;/strong&gt; Creates a call to MessageBox.Show. You may have to add a reference to System.Windows.Forms.dll.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;namespace&lt;/strong&gt; Creates a namespace declaration.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;prop&lt;/strong&gt; Creates an auto-implemented property declaration.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;propfull&lt;/strong&gt; Creates a property declaration with get and set accessors.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;propg&lt;/strong&gt; Creates a read-only auto-implemented property with a private &quot;set&quot; accessor.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;sim&lt;/strong&gt; Creates a static int Main method declaration.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;struct&lt;/strong&gt; Creates a struct declaration.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;svm&lt;/strong&gt; Creates a static void Main method declaration.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;switch&lt;/strong&gt; Creates a switch block.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;try&lt;/strong&gt; Creates a try-catch block.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;tryf&lt;/strong&gt; Creates a try-finally block.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;unchecked&lt;/strong&gt; Creates an unchecked block.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;unsafe&lt;/strong&gt; Creates an unsafe block.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;using&lt;/strong&gt; Creates a using directive.&lt;/li&gt; 
  &lt;li&gt;&lt;strong&gt;while&lt;/strong&gt; Creates a while loop.&lt;/li&gt; 
 &lt;/ol&gt; 
&lt;/blockquote&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I made my own snippet for a method. The XML code for it is the following, and you can add it to a file called &quot;my_method.snippet&quot; (or whatever_you_want.snippet) in C:\Users\YOUR_USERNAME\Documents\Visual Studio 2012\Code Snippets\Visual C#\My Code Snippets (your path might be different because I use VS2012):&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;CodeSnippet Format=&quot;1.0.0&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;Header&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;Title&amp;gt;method&amp;lt;/Title&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;Shortcut&amp;gt;method&amp;lt;/Shortcut&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;SnippetTypes&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;SnippetType&amp;gt;Expansion&amp;lt;/SnippetType&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/SnippetTypes&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/Header&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;Snippet&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;Declarations&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;Literal&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;ID&amp;gt;access_modifier&amp;lt;/ID&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;Default&amp;gt;private&amp;lt;/Default&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;/Literal&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;Literal&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;ID&amp;gt;return_type&amp;lt;/ID&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;Default&amp;gt;void&amp;lt;/Default&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;/Literal&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;Literal&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;ID&amp;gt;name&amp;lt;/ID&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;Default&amp;gt;New_method&amp;lt;/Default&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;/Literal&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/Declarations&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;Code Language=&quot;csharp&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;![CDATA[$access_modifier$ $return_type$ $name$ ()&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
    $end$&lt;font&gt;&lt;/font&gt;
    }]]&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/Code&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/Snippet&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/CodeSnippet&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;You can create customs snippets. Like this:&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;http://www.mediafire.com/file/gz3tzjnydk5/meth.snippet&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.mediafire.com/file/gz3tzjnydk5/meth.snippet&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;The code snippet for properties is:&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;prop&lt;kbd&gt;TAB&lt;/kbd&gt;&lt;kbd&gt;TAB&lt;/kbd&gt;&lt;/p&gt; 
&lt;/blockquote&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/292164/code-snippets-for-methods-in-visual-studio&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/292164/code-snippets-for-methods-in-visual-studio&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2660</guid>
      <comments>https://nicepro.tistory.com/2660#entry2660comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:39:25 +0900</pubDate>
    </item>
    <item>
      <title>내장 된 가우스 함수를 사용하지 않고 이미지를 가우시안 블러 처리하려면 어떻게합니까?</title>
      <link>https://nicepro.tistory.com/2659</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내장 된 가우스 함수를 사용하지 않고 이미지를 가우시안 블러 처리하려면 어떻게합니까?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기본 가우시안 흐림 공식을 사용하여 이미지를 흐리게 만들고 싶습니다. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Gaussian_blur&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Wikipedia 기사를&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 읽었 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;지만이를 구현하는 방법을 모르겠습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;공식을 사용하여 가중치를 결정하는 방법은 무엇입니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;MATLAB과 같은 내장 함수를 사용하고 싶지 않습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;순진한 가우시안 블러를 작성하는 것은 실제로 매우 쉽습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다른 컨볼 루션 필터와 똑같은 방식으로 수행됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;상자와 가우스 필터의 유일한 차이점은 사용하는 행렬입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같이 정의 된 이미지가 있다고 가정 해보십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; 0  1  2  3  4  5  6  7  8  9&lt;font&gt;&lt;/font&gt;
10 11 12 13 14 15 16 17 18 19&lt;font&gt;&lt;/font&gt;
20 21 22 23 24 25 26 27 28 29&lt;font&gt;&lt;/font&gt;
30 31 32 33 34 35 36 37 38 39&lt;font&gt;&lt;/font&gt;
40 41 42 43 44 45 46 47 48 49&lt;font&gt;&lt;/font&gt;
50 51 52 53 54 55 56 57 58 59&lt;font&gt;&lt;/font&gt;
60 61 62 63 64 65 66 67 68 69&lt;font&gt;&lt;/font&gt;
70 71 72 73 74 75 76 77 78 79&lt;font&gt;&lt;/font&gt;
80 81 82 83 84 85 86 87 88 89&lt;font&gt;&lt;/font&gt;
90 91 92 93 94 95 96 97 98 99&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;3x3 상자 필터 행렬은 다음과 같이 정의됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;0.111 0.111 0.111&lt;font&gt;&lt;/font&gt;
0.111 0.111 0.111&lt;font&gt;&lt;/font&gt;
0.111 0.111 0.111&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가우시안 블러를 적용하려면 다음을 수행합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;픽셀 11의 경우 픽셀 0, 1, 2, 10, 11, 12, 20, 21, 22를로드해야합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 픽셀 0에 3x3 블러 필터의 왼쪽 상단 부분을 곱합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;픽셀 1은 상단 가운데, 픽셀 2, 픽셀 3은 오른쪽 상단, 픽셀 10은 왼쪽 가운데 등입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 모두 추가하고 결과를 픽셀 11에 씁니다. 보시다시피 Pixel 11은 이제 자체 및 주변 픽셀의 평균입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가장자리 케이스는 조금 더 복잡해집니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;텍스처 가장자리 값으로 어떤 값을 사용합니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;한 가지 방법은 다른 쪽을 감싸는 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 나중에 바둑판 식으로 배열되는 이미지에 적합합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또 다른 방법은 픽셀을 주변 장소로 밀어 넣는 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따라서 왼쪽 상단의 경우 다음과 같이 샘플을 배치 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; 0  0  1&lt;font&gt;&lt;/font&gt;
 0  0  1&lt;font&gt;&lt;/font&gt;
10 10 11&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것이 어떻게 큰 필터 커널 (예 : 5x5 또는 9x9 등)로 쉽게 확장되는지 알 수 있기를 바랍니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가우스 필터와 박스 필터의 차이는 행렬에 들어가는 숫자입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가우스 필터는 행과 열에 대한 가우스 분포를 사용합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예 : 임의로 정의 된 필터의 경우 (예 : 가우스는 아니지만 멀지 않은 경우)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;0.1 0.8 0.1
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;첫 번째 열은 동일하지만 위 행의 첫 번째 항목에 곱해집니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;0.01 0.8 0.1&lt;font&gt;&lt;/font&gt;
0.08 &lt;font&gt;&lt;/font&gt;
0.01 &lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;두 번째 열은 동일하지만 값은 위의 행에서 0.8로 곱해집니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;0.01 0.08 0.01&lt;font&gt;&lt;/font&gt;
0.08 0.64 0.08&lt;font&gt;&lt;/font&gt;
0.01 0.08 0.01&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;The result of adding all of the above together should equal 1. The difference between the above filter and the original box filter would be that the end pixel written would have a much heavier weighting towards the central pixel (ie the one that is in that position already). The blur occurs because the surrounding pixels do blur into that pixel, though not as much. Using this sort of filter you get a blur but one that doesn't destroy as much of the high frequency (ie rapid changing of colour from pixel to pixel) information.&lt;/p&gt; 
&lt;p&gt;These sort of filters can do lots of interesting things. You can do an edge detect using this sort of filter by subtracting the surrounding pixels from the current pixel. This will leave only the really big changes in colour (high frequencies) behind.&lt;/p&gt; 
&lt;p&gt;Edit: A 5x5 filter kernel is define exactly as above.&lt;/p&gt; 
&lt;p&gt;e.g if your row is 0.1 0.2 0.4 0.2 0.1 then if you multiply each value in their by the first item to form a column and then multiply each by the second item to form the second column and so on you'll end up with a filter of&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;0.01 0.02 0.04 0.02 0.01&lt;font&gt;&lt;/font&gt;
0.02 0.04 0.08 0.04 0.02&lt;font&gt;&lt;/font&gt;
0.04 0.08 0.16 0.08 0.04&lt;font&gt;&lt;/font&gt;
0.02 0.04 0.08 0.04 0.02&lt;font&gt;&lt;/font&gt;
0.01 0.02 0.04 0.02 0.01&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;taking some arbitrary positions you can see that position 0, 0 is simple 0.1 * 0.1. Position 0, 2 is 0.1 * 0.4, position 2, 2 is 0.4 * 0.4 and position 1, 2 is 0.2 * 0.4.&lt;/p&gt; 
&lt;p&gt;I hope that gives you a good enough explanation.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Here's the pseudo-code for the code I used in C# to calculate the kernel. I do not dare say that I treat the end-conditions correctly, though:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;double[] kernel = new double[radius * 2 + 1];&lt;font&gt;&lt;/font&gt;
double twoRadiusSquaredRecip = 1.0 / (2.0 * radius * radius);&lt;font&gt;&lt;/font&gt;
double sqrtTwoPiTimesRadiusRecip = 1.0 / (sqrt(2.0 * Math.PI) * radius);&lt;font&gt;&lt;/font&gt;
double radiusModifier = 1.0;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
int r = -radius;&lt;font&gt;&lt;/font&gt;
for (int i = 0; i &amp;lt; kernel.Length; i++)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    double x = r * radiusModifier;&lt;font&gt;&lt;/font&gt;
    x *= x;&lt;font&gt;&lt;/font&gt;
    kernel[i] =&lt;font&gt;&lt;/font&gt;
    sqrtTwoPiTimesRadiusRecip * Exp(-x * sqrtTwoPiTimesRadiusRecip);&lt;font&gt;&lt;/font&gt;
    r++;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
double div = Sum(kernel);&lt;font&gt;&lt;/font&gt;
for (int i = 0; i &amp;lt; kernel.Length; i++)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    kernel[i] /= div;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Hope this can help.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;To use the filter kernel discussed in the Wikipedia article you need to implement (discrete) &lt;a href=&quot;http://en.wikipedia.org/wiki/Convolution&quot; rel=&quot;noreferrer&quot;&gt;convolution&lt;/a&gt;. The idea is that you have a small matrix of values (the kernel), you move this kernel from pixel to pixel in the image (i.e. so that the center of the matrix is on the pixel), multiply the matrix elements with the overlapped image elements, sum all the values in the result and replace the old pixel value with this sum. &lt;/p&gt; 
&lt;p&gt;Gaussian blur can be separated into two 1D convolutions (one vertical and one horizontal) instead of a 2D convolution, which also speeds things up a bit.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I am not clear whether you want to restrict this &lt;em&gt;to&lt;/em&gt; certain technologies, but if not &lt;a href=&quot;http://www.w3.org/Graphics/SVG/&quot; rel=&quot;nofollow noreferrer&quot;&gt;SVG (ScalableVectorGraphics)&lt;/a&gt; has an implementation of Gaussian Blur. I believe it applies to all primitives including pixels. SVG has the advantage of being an Open standard and widely implemented.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Well, Gaussian Kernel is a separable kernel.&lt;br&gt; Hence all you need is a function which supports Separable 2D Convolution like - &lt;a href=&quot;https://github.com/RoyiAvital/Projects/blob/master/ImageConvolution/ImageConvolution/ImageConvolutionSeparableKernel.c&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;ImageConvolutionSeparableKernel()&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;Once you have it, all needed is a wrapper to generate 1D Gaussian Kernel and send it to the function as done in &lt;a href=&quot;https://github.com/RoyiAvital/Projects/blob/master/ImageConvolution/ImageConvolution/ImageConvolutionGaussianKernel.c&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;ImageConvolutionGaussianKernel()&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;The code is a straight forward C implementation of 2D Image Convolution accelerated by SIMD (SSE) and Multi Threading (OpenMP).&lt;/p&gt; 
&lt;p&gt;The whole project is given by - &lt;a href=&quot;https://github.com/RoyiAvital/Projects/tree/master/ImageConvolution&quot; rel=&quot;nofollow noreferrer&quot;&gt;Image Convolution - GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/1696113/how-do-i-gaussian-blur-an-image-without-using-any-in-built-gaussian-functions&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/1696113/how-do-i-gaussian-blur-an-image-without-using-any-in-built-gaussian-functions&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2659</guid>
      <comments>https://nicepro.tistory.com/2659#entry2659comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:39:15 +0900</pubDate>
    </item>
    <item>
      <title>존재하지 않는 경우 디렉토리 생성</title>
      <link>https://nicepro.tistory.com/2658</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;존재하지 않는 경우 디렉토리 생성&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내 앱에서 파일을 다른 하드 디스크에 복사하고 싶습니다. 이것이 내 코드입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; #include &amp;lt;windows.h&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
using namespace std;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
int main(int argc, char* argv[] )&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    string Input = &quot;C:\\Emploi NAm.docx&quot;;&lt;font&gt;&lt;/font&gt;
    string CopiedFile = &quot;Emploi NAm.docx&quot;;&lt;font&gt;&lt;/font&gt;
    string OutputFolder = &quot;D:\\test&quot;;&lt;font&gt;&lt;/font&gt;
    CopyFile(Input.c_str(), string(OutputFolder+CopiedFile).c_str(), TRUE);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    return 0;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그래서 이것을 실행하면 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;D:&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;HDD에 파일이 표시 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;testEmploi NAm.docx&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;되지만 존재하지 않는 경우 테스트 폴더를 생성하고 싶습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Boost 라이브러리를 사용하지 않고하고 싶습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;WINAPI &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/desktop/aa363855%28v=vs.85%29.aspx&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;CreateDirectory()&lt;/code&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기능을 사용하여 폴더를 만듭니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;실패하지만 다음 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;GetLastError()&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;을 반환 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하므로 디렉토리가 이미 존재하는지 확인하지 않고이 함수를 사용할 수 있습니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;ERROR_ALREADY_EXISTS&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;if (CreateDirectory(OutputFolder.c_str(), NULL) ||&lt;font&gt;&lt;/font&gt;
    ERROR_ALREADY_EXISTS == GetLastError())&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    // CopyFile(...)&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
else&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
     // Failed to create directory.&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대상 파일을 구성하는 코드가 올바르지 않습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;string(OutputFolder+CopiedFile).c_str()
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 다음을 생성합니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;&quot;D:\testEmploi Nam.docx&quot;&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;: 디렉토리와 파일 이름 사이에 누락 된 경로 구분자가 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;수정 예 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;string(OutputFolder+&quot;\\&quot;+CopiedFile).c_str()
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아마도 가장 쉽고 효율적인 방법은 boost와 boost :: filesystem 함수를 사용하는 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이렇게하면 디렉토리를 간단하게 구축하고 플랫폼 독립적인지 확인할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;const char* path = _filePath.c_str();&lt;font&gt;&lt;/font&gt;
boost::filesystem::path dir(path);&lt;font&gt;&lt;/font&gt;
if(boost::filesystem::create_directory(dir))&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    std::cerr&amp;lt;&amp;lt; &quot;Directory Created: &quot;&amp;lt;&amp;lt;_filePath&amp;lt;&amp;lt;std::endl;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;a href=&quot;http://www.boost.org/doc/libs/1_63_0/libs/filesystem/doc/reference.html#create_directory&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;boost :: filesystem :: create_directory-문서&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;pre&gt;&lt;code&gt;#include &amp;lt;experimental/filesystem&amp;gt; // or #include &amp;lt;filesystem&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
namespace fs = std::experimental::filesystem;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
if (!fs::is_directory(&quot;src&quot;) || !fs::exists(&quot;src&quot;)) { // Check if src folder exists&lt;font&gt;&lt;/font&gt;
    fs::create_directory(&quot;src&quot;); // create src folder&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음은 폴더를 만드는 간단한 방법입니다 .......&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;#include &amp;lt;windows.h&amp;gt;&lt;font&gt;&lt;/font&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
void CreateFolder(const char * path)&lt;font&gt;&lt;/font&gt;
{   &lt;font&gt;&lt;/font&gt;
    if(!CreateDirectory(path ,NULL))&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        return;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
CreateFolder(&quot;C:\\folder_name\\&quot;)&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;위의 코드는 저에게 잘 작동합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;code&gt;_mkdir&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 또한 일을 할 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;_mkdir(&quot;D:\\test&quot;);
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/2fkk4dzw.aspx&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://msdn.microsoft.com/en-us/library/2fkk4dzw.aspx&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용하다 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa363855.aspx&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;CreateDirectory (char *DirName, SECURITY_ATTRIBUTES Attribs);&lt;/code&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;함수가 성공하면 0이 아닌 값을 반환 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;NULL&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;OpenCV 특정&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Opencv는 아마도 의존성 부스트를 통해 파일 시스템을 지원합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;#include &amp;lt;opencv2/core/utils/filesystem.hpp&amp;gt;&lt;font&gt;&lt;/font&gt;
cv::utils::fs::createDirectory(outputDir);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;cstdlib&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 를 사용할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;비록-http: &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.cplusplus.com/articles/j3wTURfi/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;//www.cplusplus.com/articles/j3wTURfi/&lt;/font&gt;&lt;/font&gt;&lt;/a&gt; &lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;#include &amp;lt;cstdlib&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
const int dir= system(&quot;mkdir -p foo&quot;);&lt;font&gt;&lt;/font&gt;
if (dir&amp;lt; 0)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
     return;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음을 사용하여 디렉토리가 이미 존재하는지 확인할 수도 있습니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;#include &amp;lt;dirent.h&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/9235679/create-a-directory-if-it-doesnt-exist&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/9235679/create-a-directory-if-it-doesnt-exist&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2658</guid>
      <comments>https://nicepro.tistory.com/2658#entry2658comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:39:06 +0900</pubDate>
    </item>
    <item>
      <title>Interface Builder의 UILabel에 유니 코드 문자를 입력하는 방법은 무엇입니까?</title>
      <link>https://nicepro.tistory.com/2657</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Interface Builder의 UILabel에 유니 코드 문자를 입력하는 방법은 무엇입니까?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;라벨에 유니 코드 문자 (스피커 기호 U + 1F50A)를 표시하고 싶습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Interface Builder에이 기호를 입력 할 수 있습니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예, &quot;편집&quot;&amp;gt; &quot;특수 문자…&quot;를 클릭 할 수 있습니다. 여기에서 모든 유니 코드 문자 (이모 지 포함)를 찾아서 Interface Builder에서 레이블 텍스트를 설정 한 위치에 복사 / 붙여 넣기 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;편집&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; : Xcode 6에서는 &quot;편집&quot;&amp;gt; &quot;이모티콘 및 문자&quot;입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Xcode 7+ : &quot;편집&quot;&amp;gt; &quot;이모티콘 및 기호&quot;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;프로그래밍 방식으로 시도했지만 실패한 사람들은 다음을 사용하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;label.text = @&quot;\U0001F50A&quot;;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;프로그래밍 방식으로 수행하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;NSString 유형을 사용하여 레이블에 대한 IBOutlet을 선언합니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;// UTF-8 Hexadecimal Encoding&lt;font&gt;&lt;/font&gt;
NSString *myString = [NSString stringWithUTF8String:&quot;0xF09F948A&quot;];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
myLabel.text = myString;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또한 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/8917215/unicode-in-button-title-in-xcode&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 질문을보세요.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Xcode 8 / Swift 3에서 가장 쉬운 방법은 유니 코드 이스케이프를 사용하는 것입니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;let a = &quot;\u{1F50A}&quot;  
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;소수의 사람들이 이것을 아는 이유는 재미 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;옵션&quot;을 누른 상태에서 16 진수를 입력하여 유니 코드 기호를 직접 입력 할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;필요한 모든 것 : (Sierra 예) &quot;Preference-&amp;gt; Keyboards-&amp;gt; Input Sources&quot;로 이동하여 &quot;Unicode Hex&quot;를 검색합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;기타&quot;섹션 아래에 나타납니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음으로 추가하면이 입력 소스를 선택하는 곳 어디에서나 Unicode-char를 입력 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예 : ✓ = (Alt + 2713), €-(20ac) 등. 2100에서 2800까지 가장 흥미로운 섹션. 여기에서 찾을 수있는 전체 목록- &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://unicode-table.com/en/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;유니 코드 표&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;PS :이 방법은 4 자리 유니 코드에만 적합합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/11070428/how-to-enter-unicode-characters-in-a-uilabel-in-interface-builder&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/11070428/how-to-enter-unicode-characters-in-a-uilabel-in-interface-builder&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2657</guid>
      <comments>https://nicepro.tistory.com/2657#entry2657comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:38:57 +0900</pubDate>
    </item>
    <item>
      <title>pip를 사용하여 우분투 12.04에 pymssql을 설치하려고</title>
      <link>https://nicepro.tistory.com/2656</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;pip를 사용하여 우분투 12.04에 pymssql을 설치하려고&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;pip를 사용하여 우분투 12.04에 pymssql을 설치하려고합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 내가 얻는 오류입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내가 완전히 길을 잃었으므로 어떤 도움이라도 대단히 감사하겠습니다!&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;인터넷 검색을 시도했지만 불행히도 아무 소용이 없습니다 ...&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;  Downloading pymssql-2.0.0b1-dev-20130403.tar.gz (2.8Mb): 2.8Mb downloaded&lt;font&gt;&lt;/font&gt;
  Running setup.py egg_info for package pymssql&lt;font&gt;&lt;/font&gt;
    warning: no files found matching '*.pyx' under directory 'Cython/Debugger/Tests'&lt;font&gt;&lt;/font&gt;
    warning: no files found matching '*.pxd' under directory 'Cython/Debugger/Tests'&lt;font&gt;&lt;/font&gt;
    warning: no files found matching '*.h' under directory 'Cython/Debugger/Tests'&lt;font&gt;&lt;/font&gt;
    warning: no files found matching '*.pxd' under directory 'Cython/Utility'&lt;font&gt;&lt;/font&gt;
    Compiling module Cython.Plex.Scanners ...&lt;font&gt;&lt;/font&gt;
    Compiling module Cython.Plex.Actions ...&lt;font&gt;&lt;/font&gt;
    Compiling module Cython.Compiler.Lexicon ...&lt;font&gt;&lt;/font&gt;
    Compiling module Cython.Compiler.Scanning ...&lt;font&gt;&lt;/font&gt;
    Compiling module Cython.Compiler.Parsing ...&lt;font&gt;&lt;/font&gt;
    Compiling module Cython.Compiler.Visitor ...&lt;font&gt;&lt;/font&gt;
    Compiling module Cython.Compiler.FlowControl ...&lt;font&gt;&lt;/font&gt;
    Compiling module Cython.Compiler.Code ...&lt;font&gt;&lt;/font&gt;
    Compiling module Cython.Runtime.refnanny ...&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    Installed /home/radek/build/pymssql/Cython-0.19.1-py2.7-linux-x86_64.egg&lt;font&gt;&lt;/font&gt;
    cc -c /tmp/clock_gettimeh7sDgX.c -o tmp/clock_gettimeh7sDgX.o&lt;font&gt;&lt;/font&gt;
    cc tmp/clock_gettimeh7sDgX.o -lrt -o a.out&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    warning: no files found matching 'win32/freetds.zip'&lt;font&gt;&lt;/font&gt;
Installing collected packages: pymssql&lt;font&gt;&lt;/font&gt;
  Running setup.py install for pymssql&lt;font&gt;&lt;/font&gt;
    skipping '_mssql.c' Cython extension (up-to-date)&lt;font&gt;&lt;/font&gt;
    building '_mssql' extension&lt;font&gt;&lt;/font&gt;
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/radek/build/pymssql/freetds/nix_64/include -I/usr/include/python2.7 -c _mssql.c -o build/temp.linux-x86_64-2.7/_mssql.o -Wno-parentheses-equality -DMSDBLIB&lt;font&gt;&lt;/font&gt;
    gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/_mssql.o -L/home/radek/build/pymssql/freetds/nix_64/lib -lsybdb -lct -lrt -o build/lib.linux-x86_64-2.7/_mssql.so&lt;font&gt;&lt;/font&gt;
    /usr/bin/ld: cannot find -lct&lt;font&gt;&lt;/font&gt;
    collect2: ld returned 1 exit status&lt;font&gt;&lt;/font&gt;
    error: command 'gcc' failed with exit status 1&lt;font&gt;&lt;/font&gt;
    Complete output from command /usr/bin/python -c &quot;import setuptools;__file__='/home/radek/build/pymssql/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))&quot; install --single-version-externally-managed --record /tmp/pip-Et_P1_-record/install-record.txt:&lt;font&gt;&lt;/font&gt;
    running install&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
running build&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
running build_ext&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
skipping '_mssql.c' Cython extension (up-to-date)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
building '_mssql' extension&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
creating build&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
creating build/temp.linux-x86_64-2.7&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/radek/build/pymssql/freetds/nix_64/include -I/usr/include/python2.7 -c _mssql.c -o build/temp.linux-x86_64-2.7/_mssql.o -Wno-parentheses-equality -DMSDBLIB&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
creating build/lib.linux-x86_64-2.7&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/_mssql.o -L/home/radek/build/pymssql/freetds/nix_64/lib -lsybdb -lct -lrt -o build/lib.linux-x86_64-2.7/_mssql.so&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
/usr/bin/ld: cannot find -lct&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
collect2: ld returned 1 exit status&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
error: command 'gcc' failed with exit status 1&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
----------------------------------------&lt;font&gt;&lt;/font&gt;
Command /usr/bin/python -c &quot;import setuptools;__file__='/home/radek/build/pymssql/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))&quot; install --single-version-externally-managed --record /tmp/pip-Et_P1_-record/install-record.txt failed with error code 1&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;python-dev&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;패키지가 설치되어 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;있는지 확인합니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;(@ravihemnani 덕분에 네이티브 바인딩으로 패키지를 컴파일해야 함).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;pip &lt;/font&gt;&lt;/font&gt;&lt;code&gt;freetds-dev&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;로 설치하기 전에 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;FreeTDS 개발 패키지 ( &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;)를 설치해야합니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;pymssql&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$ sudo apt-get install freetds-dev
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;virtualenv&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 또는 설치하려는 위치에 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$ pip install pymssql
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;freetds-dev와 별도로 python-dev를 설치해야합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;sudo apt-get install python-dev
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그렇지 않으면 다시 몇 가지 오류가 발생합니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;OpenSuse (및 관련 OS) 사용자 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;zypper in freetds-devel&lt;font&gt;&lt;/font&gt;
pip install pymssql&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Mac에서&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;brew install freetds@0.91&lt;font&gt;&lt;/font&gt;
brew link --force freetds@0.91&lt;font&gt;&lt;/font&gt;
pip install pymssql&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/17368964/trying-to-install-pymssql-on-ubuntu-12-04-using-pip&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/17368964/trying-to-install-pymssql-on-ubuntu-12-04-using-pip&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2656</guid>
      <comments>https://nicepro.tistory.com/2656#entry2656comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:38:49 +0900</pubDate>
    </item>
    <item>
      <title>아틀라스에서 로컬로 방랑 상자 파일을 다운로드하고 구성</title>
      <link>https://nicepro.tistory.com/2655</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아틀라스에서 로컬로 방랑 상자 파일을 다운로드하고 구성&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나중에 내 방랑 파일과 함께 로컬에서 사용하기 위해 Atlas에서 방랑 상자 파일을 다운로드하고 싶습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 작업을 어떻게 수행하고 구성 할 수 있습니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;파일을 다운로드하려면 URL에 버전과 공급자를 추가해야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예를 들어 trusty64를 다운로드하려면 먼저 &lt;/font&gt;&lt;a href=&quot;https://app.vagrantup.com/ubuntu/boxes/trusty64/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://app.vagrantup.com/ubuntu/boxes/trusty64/&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; URL이 필요합니다.&lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://app.vagrantup.com/ubuntu/boxes/trusty64/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 나중에 버전과 공급자를 추가해야합니다 (예 : 다운로드 URL). &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://app.vagrantup.com/ubuntu/boxes/trusty64/versions/20180206.0.0/providers/virtualbox.box&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://app.vagrantup.com/ubuntu/boxes/trusty64/versions/20180206.0.0/providers/virtualbox.box&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 방랑 파일에서 로컬로 추가해야합니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;vagrant 파일에 로컬로 추가하려면 다음 명령을 사용하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;vagrant box add foo-box /path/to/vagrant-box.box&lt;font&gt;&lt;/font&gt;
vagrant init foo-box&lt;font&gt;&lt;/font&gt;
vagrant up&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 vagrantfile을 생성하고 vagrant 파일을 구성 할 수 있습니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 이렇게하면 상자가 버전 0으로 추가됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;○ → vagrant box add ubuntu/trusty64 ~/Downloads/trusty-server-cloudimg-amd64-vagrant-disk1.box &lt;font&gt;&lt;/font&gt;
==&amp;gt; box: Box file was not detected as metadata. Adding it directly...&lt;font&gt;&lt;/font&gt;
==&amp;gt; box: Adding box 'ubuntu/trusty64' (v0) for provider: &lt;font&gt;&lt;/font&gt;
    box: Unpacking necessary files from: file:///Users/ram/Downloads/trusty-server-cloudimg-amd64-vagrant-disk1.box&lt;font&gt;&lt;/font&gt;
==&amp;gt; box: Successfully added box 'ubuntu/trusty64' (v0) for 'virtualbox'!&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;vagrant는 수동으로 추가 된 상자의 버전 번호를 지정할 수 없습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;○ → vagrant box add ubuntu/trusty64 ~/Downloads/trusty-server-cloudimg-amd64-vagrant-disk1.box --box-version 20151021.0.0&lt;font&gt;&lt;/font&gt;
==&amp;gt; box: Box file was not detected as metadata. Adding it directly...&lt;font&gt;&lt;/font&gt;
You specified a box version constraint with a direct box file&lt;font&gt;&lt;/font&gt;
path. Box version constraints only work with boxes from Vagrant&lt;font&gt;&lt;/font&gt;
Cloud or a custom box host. Please remove the version constraint&lt;font&gt;&lt;/font&gt;
and try again.&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;상자의 버전 번호를 업데이트하려면 ~ / .vagrant.d / boxes / ubuntu-VAGRANTSLASH-trusty64 / 0의 폴더 이름 '0'을 다운로드 한 버전 번호로 변경하십시오. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예 : '20160120.0.0'&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; |2.2.3| MacBook-Pro in ~/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-trusty64&lt;font&gt;&lt;/font&gt;
○ → mv 0 20160120.0.0&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이제 vagrant 명령으로 다음에 버전을 업데이트하도록 모두 설정되었습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;○ → vagrant box list&lt;font&gt;&lt;/font&gt;
ubuntu/trusty64 (virtualbox, 20160120.0.0)&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;스크립트에서 다운로드 할 수없는 동일한 문제에 직면했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그래서 수동으로 상자를 다운로드하고 아래와 같이 방랑자에 추가했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여기에서 원하는 버전을 얻을 수 있습니다-https: &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://atlas.hashicorp.com/ubuntu/boxes/precise64&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;//atlas.hashicorp.com/ubuntu/boxes/precise64&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;wget https://atlas.hashicorp.com/ubuntu/boxes/precise64/versions/20160818.0.0/providers/virtualbox.box&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
cd my_vagrant_project&lt;font&gt;&lt;/font&gt;
vagrant box add precise64 ~/Downloads/precise-server-cloudimg-amd64-vagrant-disk1.box&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
vagrant init precise64&lt;font&gt;&lt;/font&gt;
vagrant up&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;먼저&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 다음 링크에서 최신 버전을 확인 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://app.vagrantup.com/laravel/boxes/homestead&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여기&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt; &lt;br&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 업데이트&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; : 당신의 버전 변경하려고 다음, 최신 버전의 수를 얻기 위해, 위의 언급 한 링크로 이동하여 시도 할 수 있습니다 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;울부 짖는 URL&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 이제 최신 버전은 다음과 같습니다 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;7.2.1&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 에 대한 virtualbox : &lt;/font&gt;&lt;/font&gt;&lt;br&gt; &lt;a href=&quot;https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/providers/virtualbox.box&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/providers/virtualbox.box&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; for hyperv : &lt;/font&gt;&lt;/font&gt;&lt;br&gt; &lt;a href=&quot;https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/providers/hyperv.box&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; vmware 용 &lt;/font&gt;&lt;a href=&quot;https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/providers/hyperv.box&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;provider / hyperv.box&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; : &lt;/font&gt;&lt;/font&gt;&lt;br&gt; &lt;a href=&quot;https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/providers/vmware_desktop.box&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/providers/vmware_desktop.box&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 병렬 용 : &lt;/font&gt;&lt;/font&gt;&lt;br&gt; &lt;a href=&quot;https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/providers/parallels.box&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://vagrantcloud.com/laravel/boxes/homestead/ versions / 7.2.1 / providers / parallels.box &lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt; &lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아마도&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt; in the future the link changed so try to get download vagrant box by using command on your terminal/CMD by command&lt;br&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;vagrant box add laravel/homestead
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;choose your virtualization method&lt;br&gt; then you will see the download link &lt;strong&gt;ended with *.box&lt;/strong&gt;, after that you can cancel it &lt;strong&gt;CTRL+C&lt;/strong&gt; and copy the &lt;strong&gt;download link&lt;/strong&gt; and download it locally by using &lt;strong&gt;IDM/aria2c -x16&lt;/strong&gt; etc.&lt;br&gt; &lt;strong&gt;Second&lt;/strong&gt;: Use this command &lt;br&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;vagrant box add laravel/homestead {Path of file from your local computer}
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;strong&gt;third&lt;/strong&gt;:add metadata by go to&lt;br&gt; 1- you create a file called metadata_url NOTE: There is no extension for metadata_url&lt;br&gt;&lt;/p&gt; 
&lt;p&gt;2- Then add this link and save the file&lt;br&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;https://atlas.hashicorp.com/laravel/homestead
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;3- Copy metadata_url file to: &lt;br&gt;for &lt;strong&gt;windows&lt;/strong&gt; go to &lt;br&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;%userprofile%\.vagrant.d\boxes\laravel-VAGRANTSLASH-homestead
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;4- Then rename the folder named 0 to the version of the homestead for now &lt;strong&gt;7.2.1&lt;/strong&gt; &lt;br&gt; I hope this help for more information &lt;br&gt; &lt;a href=&quot;https://laravel.com/docs/5.2/homestead&quot; rel=&quot;nofollow noreferrer&quot;&gt;Laravel&lt;/a&gt;&lt;br&gt; &lt;a href=&quot;https://laravel.io/forum/05-06-2015-how-to-download-vagrant-box-manually&quot; rel=&quot;nofollow noreferrer&quot;&gt;metadata&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;strong&gt;Download virtualbox.box:&lt;/strong&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;https://app.vagrantup.com/laravel/boxes/homestead/versions/6.4.0/providers/virtualbox.box
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;You can change the version(6.4.0) of homestead box with the Current Version.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Current version: 6.4.0.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;Check for the latest version here: &lt;a href=&quot;https://app.vagrantup.com/laravel/boxes/homestead&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://app.vagrantup.com/laravel/boxes/homestead&lt;/a&gt;&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;After downloading the box, rename it to virtualbox.box&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;Don't forget to include the .box extension.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;Add the downloaded homestead box to vagrant:&lt;/strong&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;vagrant box add laravel/homestead file:///f:/virtualbox.box
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Change the Drive( &lt;code&gt;c: or d: or e:&lt;/code&gt;) or Path(&lt;code&gt;c:/folder1/folder2/virtualbox.box&lt;/code&gt;) to the location where you have stored your downloaded homestead box.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;You will get success massage like image below:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9aW5T.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9aW5T.png&quot; alt=&quot;success image&quot;&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;Update homestead box&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;Navigate to vagrant directory:&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;c:/users/YourUserName/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;After that, Create a file called &lt;code&gt;metadata_url&lt;/code&gt;&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; There is no extension for metadata_url&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;Then add the link below and save the file&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;https://app.vagrantup.com/laravel/homestead
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Do not add a newline after link in above file.&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Rename folder 0 to 6.4.0&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;&lt;strong&gt;&lt;em&gt;6.4.0 is your homestead box version.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;And it's Done. Hope it help.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;If you have the ubuntu-VAGRANTSLASH-trusty64 folder from someone else machine you can simply copy paste the folder to &lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;~/.vagrant.d/boxes
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;and use the &lt;code&gt;vagrant up&lt;/code&gt; to start the servers. This way you &lt;strong&gt;do not need&lt;/strong&gt; to add the trusty64 &lt;a href=&quot;https://stackoverflow.com/a/28399325/3168721&quot;&gt;box manually&lt;/a&gt;.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Instructions for OSX/Fusion:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;wget https://vagrantcloud.com/hashicorp/boxes/precise64/versions/1.1.0/providers/vmware_fusion.box&lt;font&gt;&lt;/font&gt;
# For some reason, the downloaded filename was set to an uuid&lt;font&gt;&lt;/font&gt;
# mv &amp;lt;uuid&amp;gt; vmware_fusion.box&lt;font&gt;&lt;/font&gt;
vagrant box add hashicorp/precise64 vmware_fusion.box&lt;font&gt;&lt;/font&gt;
cd vagrant.d/boxes/hashicorp-VAGRANTSLASH-precise64&lt;font&gt;&lt;/font&gt;
mv 0 1.1.0&lt;font&gt;&lt;/font&gt;
echo -n &quot;https://app.vagrantup.com/hashicorp/boxes/precise64&quot; &amp;gt; metadata_url&lt;font&gt;&lt;/font&gt;
vagrant box list&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I try to use &lt;code&gt;vagrant up&lt;/code&gt; and I got URL to download box file:&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://vagrantcloud.com/centos/boxes/7/versions/1801.02/providers/virtualbox.box&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://vagrantcloud.com/centos/boxes/7/versions/1801.02/providers/virtualbox.box&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/28399324/download-vagrant-box-file-locally-from-atlas-and-configuring-it&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/28399324/download-vagrant-box-file-locally-from-atlas-and-configuring-it&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2655</guid>
      <comments>https://nicepro.tistory.com/2655#entry2655comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:38:40 +0900</pubDate>
    </item>
    <item>
      <title>corecrt.h를 찾을 수 없음 : $ (UniversalCRT_IncludePath)가 잘못되었습니다.</title>
      <link>https://nicepro.tistory.com/2654</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;corecrt.h를 찾을 수 없음 : $ (UniversalCRT_IncludePath)가 잘못되었습니다.&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Windows 10이 설치된 랩톱에 Visual Studio 2015를 설치했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;항상 Windows 10을 사용하는 다른 PC에서 동일한 버전의 Visual Studio (업데이트 3)로 만든 솔루션으로 리포지토리를 복제했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;랩톱에서 솔루션을 빌드하려고하면 다음 오류가 발생합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;c:\program files (x86)\microsoft visual studio 14.0\vc\include\crtdefs.h(10): fatal error C1083: Cannot open include file: 'corecrt.h': No such file or directory
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;에서 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://social.msdn.microsoft.com/Forums/vstudio/en-US/86bc577b-528c-469c-a506-15383a44c111/missing-corecrth-from-the-default-include-folder-for-vs215?forum=vcgeneral&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 페이지&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 내가 추가해야합니다 읽었습니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;$(UniversalCRT_IncludePath)&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;경로를 포함 내에 있지만,이 경우에도 나는이 같은 오류를 얻을 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;$(UniversalCRT_IncludePath)&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 경로를 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;확인하고 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 경로는 내 노트북에 없습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대신 나는 이것을 가지고 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그래서 윈도우 버전이 다른 것 같습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아마도 이것은 사실입니다. 왜냐하면 내 랩톱에서는 1511 윈도우를 업그레이드하지 않았고 다른 PC에서는 모두 올바르게 설치 되었기 때문입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내 질문은 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;corecrt.h&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;경로를 엉망으로 만들지 않고 두 PC에서 파일을 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;어떻게 참조 할 수 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;있습니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 경로는 PC에 의존하기 때문에 하드 링크를 피하고 싶습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그리고 나는 그것이 시스템에 의존하고 솔루션에 케이블로 연결되지 않아야한다는 점을 고려할 때 랩톱에서 경로가 잘못된 이유를 이해할 수 없습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 문제를 어떻게 해결할 수 있습니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;랩톱을 동일한 Windows 버전으로 업데이트 할 수 있다는 것을 알고 있지만 여러 가지 이유로이를 피하고 싶습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;-- 편집하다&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 경로가 있음을 알았습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;C:\Program Files (x86)\Windows Kits\8.1\Include\10.0.10240.0\ucrt
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;동일한 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;10.0.10240.0&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;버전이지만 다른 Windows 키트 버전과 관련되어 있으므로이 경우 문제가있을 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내 랩톱에는 Visual Studio 2013도 있으므로 Visual Studio 2013에서 가져올 수 있지만 Visual Studio 2013으로 다른 프로젝트를 유지 관리하고 있고 아직 제거 할 수 없기 때문에 제거 할 수 없습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio 2015 폴더 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;$(UniversalCRT_IncludePath)&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;에서 일부 .bat 파일 (vcvarsall.bat 또는 유사)에서 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;명시 적으로 설정할 수 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;있지만 어떤 파일과 위치를 알 수 없습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio 2017의 경우 다음을 수행해야했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio 설치 관리자를 실행합니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;수정 버튼을 선택합니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;개별 구성 요소&quot;탭으로 이동합니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;컴파일러, 빌드 도구 및 런타임&quot;까지 아래로 스크롤하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;Windows Universal CRT SDK&quot;를 선택합니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;설치.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ol&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 문제를 이미 고쳤을 수도 있지만 다른 사람이 오면 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://devtalk.nvidia.com/default/topic/969047/cuda-8-vs2015-corecrt-h-error/?offset=7&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여기&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 팁을 따라이 문제를 해결했습니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기본적으로 다음 시스템 환경 변수를 설정합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;INCLUDE=&quot;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt&quot;&lt;font&gt;&lt;/font&gt;
LIB=&quot;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\um\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64&quot;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아마 훨씬 더 나은 모범 사례 방법이있을 것입니다.하지만 초고속으로 고치는 것만으로는 훌륭했습니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 같은 문제가 있었다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 여기서 답을 시도했다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;100 % 작동하지 않았습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내가 찾은 것은 VC ++ 2015 도구 세트 (x86, x64)가 2017 Community Edition (지금 사용하고 있음)에 필요하지만 include 또는 lib 링크를 추가하지 않고 있다는 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;친애하는.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;프로젝트 속성 (메뉴 프로젝트&amp;gt; 속성)을 확인하십시오. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;구성 속성&amp;gt; 일반에서 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;플랫폼 도구 집합 및 Windows SDK 버전 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;을 확인합니다 ( &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;플랫폼 도구&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 집합&amp;gt; VS2015를 사용하는 경우). 플랫폼 도구 집합 = VS2017 및 Windows SDK 버전 = 10.xx를 설정 한 후 저에게 효과적이었습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio를 설치하는 동안 누락 된 것이있을 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;VC ++ 도구 세트를 선택하는 것을 잊었는지 여부를 확인할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;code&gt;Control Panel&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;-&amp;gt; &lt;/font&gt;&lt;/font&gt;&lt;code&gt;All Control Panel Items&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;-&amp;gt; &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Programs and Features&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;-&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;code&gt;Visual studio 2015&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;딸깍 하는 소리 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;change/uninstall&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;선택 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;VC++2015 toolset(x86,x64)&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하고 설치하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Visual Studio Community 2017 RC (15.0.26206.0)의 경우 선택적 도구의 이름은 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;VC++ 2017 v141 toolset(x86,x64)&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Nowjv.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Nowjv.gif&quot; alt=&quot;`VC ++ 2017 v141 도구 세트 (x86, x64)&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나를 위해 Visual Studio에서이 설정을 도와줍니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;프로젝트 속성-&amp;gt; VC ++ 디렉토리-&amp;gt; 디렉토리 포함-&amp;gt; 편집을 위해 엽니 다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;체크 박스 부모 또는 프로젝트 기본값에서 상속&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ul&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;의 경우 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Visual Studio 2015 Enterprise&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;parsley72와 비슷한 방식으로 문제를 해결했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;1. Run the Visual Studio Installer;&lt;font&gt;&lt;/font&gt;
2. Select Modify button;&lt;font&gt;&lt;/font&gt;
3. Go to &quot;Windows and Web Development&quot;;&lt;font&gt;&lt;/font&gt;
4. Tick &quot;Universal Windows App Development Tools&quot;;&lt;font&gt;&lt;/font&gt;
5. Install.&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Windows에서 PyTorch를 컴파일하고 Windows Universal CRT SDK를 설치하는 동안이 오류가 발생했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;주위를 둘러 보면 두 가지 원인이있는 것 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;vcvarsall.bat를 실행해야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;VS2017 x64 기본 명령 프롬프트를 시작하면이 bat 파일이 실행됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;Set vcvars_ver to correct version that is on your machine. To find the version you have, go to &lt;code&gt;%PROGRAMFILES(X86)%\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\&lt;/code&gt;. Inside this folder you will see folder such as &lt;code&gt;14.13.26128&lt;/code&gt;. So you set &lt;code&gt;vcvars_ver&lt;/code&gt; to 14.13.&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;Below fragment in my batch file shows above two steps:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;set &quot;VS150COMNTOOLS=%PROGRAMFILES(X86)%\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build&quot;&lt;font&gt;&lt;/font&gt;
call &quot;%VS150COMNTOOLS%\vcvarsall.bat&quot; x64 -vcvars_ver=14.13&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;The reason of error could possibly could be because you don't have the updated version of windows 10 sdk&lt;/p&gt; 
&lt;p&gt;you can also download and install window 10 sdk autonomously,&lt;/p&gt; 
&lt;p&gt;using this link &lt;a href=&quot;https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/&quot; rel=&quot;nofollow noreferrer&quot;&gt;windows 10 sdk&lt;/a&gt;, and add it into your system path&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;hope it helps.&lt;/p&gt; 
&lt;/blockquote&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;The &lt;strong&gt;Windows SDK&lt;/strong&gt; you have selected in your project &lt;strong&gt;isn't installed&lt;/strong&gt;.&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rY9pL.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rY9pL.png&quot; alt=&quot;Visual Studio 프로젝트 설정 Windows SDK 버전 8.1&quot;&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;Either install the SDK you want or select one of installed ones (note: selecting &lt;em&gt;&amp;lt;inherit from parent&amp;gt;&lt;/em&gt; option will default to &lt;strong&gt;8.1&lt;/strong&gt;, which isn't installed by default in VS 2017+)&lt;/p&gt; 
&lt;p&gt;To install the Windows SDK, run the installer and go to &lt;strong&gt;&lt;em&gt;Individual components&lt;/em&gt;&lt;/strong&gt; and scroll to the very bottom:&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/5njFu.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/5njFu.png&quot; alt=&quot;Visual Studio 설치 관리자-개별 구성 요소-Windows 8.1 SDK&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Either add the older Windows SDK (ex. version 8.1 / Universal) to your machine (as described by parsley72), or &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/mt186161.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;re-target Project(s) to use one of the Windows SDK(s) installed on your computer&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;I just ran into this with VS2017 and re-targeting worked. Though I'm still waiting for an answer on whether &lt;a href=&quot;https://stackoverflow.com/questions/48215453/does-windows-sdk-restrict-eligible-versions-of-windows&quot;&gt;targeting a newer Windows SDK version has any ill effects&lt;/a&gt;.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I have no experience with VC++ but I have to build ta-lib for a python project. Since I do not want to touch anything in VC Studio but I have experienced with regular C programming under Unix, I have taken the approach of adding the include path directly in the Makefile; e.g.:&lt;/p&gt; 
&lt;p&gt;INCPATH = -I&quot;..........\include&quot; -I&quot;..........\src\ta_common&quot; -I&quot;..........\src\ta_abstract&quot; -I&quot;..........\src\ta_abstract\tables&quot; -I&quot;..........\src\ta_abstract\frames&quot; &lt;strong&gt;-I&quot;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt&quot; -I&quot;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include&quot;&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;There are multiple Makefiles under sub-directories so I have had to make changes to each one but it works alright for me.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;I resolve this error by the next 3 step.&lt;/p&gt; 
&lt;p&gt;1) All file from:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\x86&lt;font&gt;&lt;/font&gt;
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Copy to:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\VS\lib\x86
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;2) 다음의 모든 파일 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\x64&lt;font&gt;&lt;/font&gt;
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;에게 복사:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\VS\lib\x64
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;3) 모든 파일 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;에게 복사: &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\VS\include
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그런 다음 프로젝트를 다시 빌드하고 모두 제대로 작동합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Windows 10 sdk를 다시 설치하십시오 .Windows sdk가 없거나 내용이 변경되면이 오류가 팝업됩니다 .wdk를 설치 한 후 나에게 발생했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/38290169/cannot-find-corecrt-h-universalcrt-includepath-is-wrong&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/38290169/cannot-find-corecrt-h-universalcrt-includepath-is-wrong&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2654</guid>
      <comments>https://nicepro.tistory.com/2654#entry2654comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:38:30 +0900</pubDate>
    </item>
    <item>
      <title>c # : 문자열 상수를 저장하기 위해 열거 형을 사용하는 방법?</title>
      <link>https://nicepro.tistory.com/2653</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;c # : 문자열 상수를 저장하기 위해 열거 형을 사용하는 방법?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;blockquote&gt; 
 &lt;p&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;중복 가능성 : &lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;br&gt; &lt;a href=&quot;https://stackoverflow.com/questions/630803/enum-with-strings&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;문자열이있는 열거 형&lt;/font&gt;&lt;/font&gt;&lt;/a&gt; &lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;열거 형에 문자열 상수를 가질 수 있습니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;      enum{name1=&quot;hmmm&quot; name2=&quot;bdidwe&quot;}
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그렇지 않은 경우 가장 좋은 방법은 무엇입니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 그것을 문자열에서 작동하지 않기 때문에 지금은 모든 관련 상수를 하나의 클래스로 그룹화하고 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;      class operation&lt;font&gt;&lt;/font&gt;
      {&lt;font&gt;&lt;/font&gt;
          public const string  name1=&quot;hmmm&quot;;&lt;font&gt;&lt;/font&gt;
          public const string  name2=&quot;bdidwe&quot;&lt;font&gt;&lt;/font&gt;
      }&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;열거 형 상수는 서수 유형 ( &lt;/font&gt;&lt;/font&gt;&lt;code&gt;int&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기본적으로) &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;만 가능 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하므로 열거 형에 문자열 상수를 사용할 수 없습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;문자열 기반 열거 형&quot;과 같은 것을 원할 때 원치 않는 인스턴스화와 원치 않는 하위 클래스 화를 방지하기 위해 정적 클래스로 만드는 것을 제외하고는 여러분이했던 것처럼 상수를 보유 할 클래스를 만듭니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 메서드 시그니처의 유형으로 문자열을 사용하지 않고 더 안전하고 제한적인 유형 (예 :)을 선호하는 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Operation&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;경우 안전한 열거 형 패턴을 사용할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public sealed class Operation&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    public static readonly Operation Name1 = new Operation(&quot;Name1&quot;);&lt;font&gt;&lt;/font&gt;
    public static readonly Operation Name2 = new Operation(&quot;Name2&quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private Operation(string value)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        Value = value;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public string Value { get; private set; }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;을 사용하여이 작업을 수행 할 수 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.componentmodel.descriptionattribute.aspx&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;DescriptionAttribute&lt;/code&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;있지만 속성에서 문자열을 가져 오려면 코드를 작성해야합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public enum YourEnum&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    [Description(&quot;YourName1&quot;)]&lt;font&gt;&lt;/font&gt;
    Name1,&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    [Description(&quot;YourName2&quot;)]&lt;font&gt;&lt;/font&gt;
    Name2&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;열거 형의 요점은 서수 상수입니다. &lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 확장 방법을 사용하여 원하는 것을 얻을 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;  enum Operation&lt;font&gt;&lt;/font&gt;
  {&lt;font&gt;&lt;/font&gt;
      name1,&lt;font&gt;&lt;/font&gt;
      name2&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  static class OperationTextExtender&lt;font&gt;&lt;/font&gt;
  {&lt;font&gt;&lt;/font&gt;
        public static String AsText(this Operation operation)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
              switch(operation)&lt;font&gt;&lt;/font&gt;
              {&lt;font&gt;&lt;/font&gt;
                    case Operation.name1: return &quot;hmmm&quot;;&lt;font&gt;&lt;/font&gt;
                    case Operation.name2: return &quot;bdidwe&quot;;&lt;font&gt;&lt;/font&gt;
                    ...&lt;font&gt;&lt;/font&gt;
              }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  ...&lt;font&gt;&lt;/font&gt;
  var test1 = Operation.name1;&lt;font&gt;&lt;/font&gt;
  var test2 = test1.AsText();   &lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;귀하 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;operation&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;와 같은 컴파일되지 않습니다 클래스입니다 ... 당신이 NAME1 및 NAME2의 유형을 선언하지 않았다 ...&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하지만 그게 제가 취할 접근법입니다 ... 예.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;구조체로 만들면 원하는 값일 수도 있고 아닐 수도있는 값 유형이됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/1851567/chow-to-use-enum-for-storing-string-constants&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;https://stackoverflow.com/questions/1851567/chow-to-use-enum-for-storing-string-constants&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2653</guid>
      <comments>https://nicepro.tistory.com/2653#entry2653comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:38:19 +0900</pubDate>
    </item>
    <item>
      <title>메서드 숨기기와 재정의</title>
      <link>https://nicepro.tistory.com/2652</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;메서드 숨기기와 재정의&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;div class=&quot;question-status question-originals-of-duplicate&quot;&gt; 
 &lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 질문에 이미 답변이 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
 &lt;ul&gt; 
  &lt;li&gt; &lt;a href=&quot;/questions/392721/difference-between-shadowing-and-overriding-in-c&quot; dir=&quot;ltr&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;C #에서 섀도 잉과 재정의의 차이점은 무엇입니까? &lt;/font&gt;&lt;/font&gt;&lt;/a&gt; &lt;span class=&quot;question-originals-answer-count&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;5 답변&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;/li&gt; 
 &lt;/ul&gt; 
&lt;/div&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;C #에서 메서드를 재정의하는 것과 숨기는 것에 대해 약간 혼란 스럽습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;각각의 실제적인 사용과 각각의 사용시기에 대한 설명도 감사 &lt;/font&gt;&lt;/font&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;할&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;재정의에 대해 혼란 스럽습니다. 왜 재정의해야합니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;지금까지 내가 배운 것은 오버 링을 통해 서명을 변경하지 않고도 파생 클래스의 메서드에 원하는 구현을 제공 할 수 있다는 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;수퍼 클래스의 메서드를 재정의하지 않고 하위 클래스의 메서드를 변경하면 수퍼 클래스 메서드가 변경됩니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 또한 다음에 대해 혼란 스럽습니다. 이것은 무엇을 증명합니까?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;class A&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    virtual m1()&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        console.writeline(&quot;Bye to all&quot;);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
class B : A&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    override m1()&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        console.writeLine(&quot;Hi to all&quot;);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
class C&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    A a = new A();&lt;font&gt;&lt;/font&gt;
    B b = new B();&lt;font&gt;&lt;/font&gt;
    a = b; (what is this)&lt;font&gt;&lt;/font&gt;
    a.m1(); // what this will print and why?&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    b = a; // what happens here?&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;중히 여기다:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public class BaseClass&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
  public void WriteNum()&lt;font&gt;&lt;/font&gt;
  {&lt;font&gt;&lt;/font&gt;
    Console.WriteLine(12);&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
  public virtual void WriteStr()&lt;font&gt;&lt;/font&gt;
  {&lt;font&gt;&lt;/font&gt;
    Console.WriteLine(&quot;abc&quot;);&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
public class DerivedClass : BaseClass&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
  public new void WriteNum()&lt;font&gt;&lt;/font&gt;
  {&lt;font&gt;&lt;/font&gt;
    Console.WriteLine(42);&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
  public override void WriteStr()&lt;font&gt;&lt;/font&gt;
  {&lt;font&gt;&lt;/font&gt;
    Console.WriteLine(&quot;xyz&quot;);&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
/* ... */&lt;font&gt;&lt;/font&gt;
BaseClass isReallyBase = new BaseClass();&lt;font&gt;&lt;/font&gt;
BaseClass isReallyDerived = new DerivedClass();&lt;font&gt;&lt;/font&gt;
DerivedClass isClearlyDerived = new DerivedClass();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
isReallyBase.WriteNum(); // writes 12&lt;font&gt;&lt;/font&gt;
isReallyBase.WriteStr(); // writes abc&lt;font&gt;&lt;/font&gt;
isReallyDerived.WriteNum(); // writes 12&lt;font&gt;&lt;/font&gt;
isReallyDerived.WriteStr(); // writes xyz&lt;font&gt;&lt;/font&gt;
isClearlyDerived.WriteNum(); // writes 42&lt;font&gt;&lt;/font&gt;
isClearlyDerived.writeStr(); // writes xyz&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;재정의는 파생 클래스가 기본 클래스보다 더 구체적인 동작을 가질 수있는 고전적인 OO 방식입니다 (일부 언어에서는 선택의 여지가 없음). &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;객체에서 가상 메서드가 호출되면 가장 많이 파생 된 메서드 버전이 호출됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따라서 우리가 다루고있는 경우에도 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;isReallyDerived&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;A와 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;BaseClass&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;정의 다음 기능이 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;DerivedClass&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;숨기는 것은 우리가 완전히 다른 방법을 가지고 있다는 것을 의미합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;우리가 호출하는 경우 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;WriteNum()&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;에 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;isReallyDerived&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음 다른이 있음을 알 수있는 방법은 없습니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;WriteNum()&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;에 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;DerivedClass&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가 호출되지 않도록이. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;우리가 객체를 처리 할 때 그것은 단지 호출 할 수 있습니다 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;로&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;DerivedClass&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; .&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;Most of the time hiding is bad. Generally, either you should have a method as virtual if its likely to be changed in a derived class, and override it in the derived class. There are however two things it is useful for:&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;p&gt;Forward compatibility. If &lt;code&gt;DerivedClass&lt;/code&gt; had a &lt;code&gt;DoStuff()&lt;/code&gt; method, and then later on &lt;code&gt;BaseClass&lt;/code&gt; was changed to add a &lt;code&gt;DoStuff()&lt;/code&gt; method, (remember that they may be written by different people and exist in different assemblies) then a ban on member hiding would have suddenly made &lt;code&gt;DerivedClass&lt;/code&gt; buggy without it changing. Also, if the new &lt;code&gt;DoStuff()&lt;/code&gt; on &lt;code&gt;BaseClass&lt;/code&gt; was virtual, then automatically making that on &lt;code&gt;DerivedClass&lt;/code&gt; an override of it could lead to the pre-existing method being called when it shouldn't. Hence it's good that hiding is the default (we use &lt;code&gt;new&lt;/code&gt; to make it clear we definitely want to hide, but leaving it out hides and emits a warning on compilation).&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;Poor-man's covariance. Consider a &lt;code&gt;Clone()&lt;/code&gt; method on &lt;code&gt;BaseClass&lt;/code&gt; that returns a new &lt;code&gt;BaseClass&lt;/code&gt; that's a copy of that created. In the override on &lt;code&gt;DerivedClass&lt;/code&gt; this will create a &lt;code&gt;DerivedClass&lt;/code&gt; but return it as a &lt;code&gt;BaseClass&lt;/code&gt;, which isn't as useful. What we could do is to have a virtual protected &lt;code&gt;CreateClone()&lt;/code&gt; that is overridden. In &lt;code&gt;BaseClass&lt;/code&gt; we have a &lt;code&gt;Clone()&lt;/code&gt; that returns the result of this - and all is well - in &lt;code&gt;DerivedClass&lt;/code&gt; we hide this with a new &lt;code&gt;Clone()&lt;/code&gt; that returns a &lt;code&gt;DerivedClass&lt;/code&gt;. Calling &lt;code&gt;Clone()&lt;/code&gt; on &lt;code&gt;BaseClass&lt;/code&gt; will always return a &lt;code&gt;BaseClass&lt;/code&gt; reference, which will be a &lt;code&gt;BaseClass&lt;/code&gt; value or a &lt;code&gt;DerivedClass&lt;/code&gt; value as appropriate. Calling &lt;code&gt;Clone()&lt;/code&gt; on &lt;code&gt;DerivedClass&lt;/code&gt; will return a &lt;code&gt;DerivedClass&lt;/code&gt; value, which is what we'd want in that context. There are other variants of this principle, however it should be noted that they are all pretty rare.&lt;/p&gt;&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;An important thing to note with the second case, is that we've used hiding precisely to &lt;strong&gt;remove&lt;/strong&gt; surprises to the calling code, as the person using &lt;code&gt;DerivedClass&lt;/code&gt; might reasonably expect its &lt;code&gt;Clone()&lt;/code&gt; to return a &lt;code&gt;DerivedClass&lt;/code&gt;. The results of any of the ways it could be called are kept consistent with each other. Most cases of hiding risk introducing surprises, which is why they are generally frowned upon. This one is justified precisely because it solves the very problem that hiding often introduces.&lt;/p&gt; 
&lt;p&gt;In all, hiding is sometimes necessary, infrequently useful, but generally bad, so be very wary of it.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Overriding is when you provide a new &lt;code&gt;override&lt;/code&gt; implementation of a method in a descendant class when that method is defined in the base class as &lt;code&gt;virtual&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Hiding is when you provide a new implementation of a method in a descendant class when that method is &lt;em&gt;not&lt;/em&gt; defined in the base class as &lt;code&gt;virtual&lt;/code&gt;, or when your new implementation does not specify &lt;code&gt;override&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Hiding is very often bad; you should generally try not to do it if you can avoid it at all. Hiding can cause unexpected things to happen, because Hidden methods are only used when called on a variable of the actual type you defined, not if using a base class reference... on the other hand, Virtual methods which are overridden will end up with the proper method version being called, even when called using the base class reference on a child class.&lt;/p&gt; 
&lt;p&gt;For instance, consider these classes:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public class BaseClass&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
  public virtual void Method1()  //Virtual method&lt;font&gt;&lt;/font&gt;
  {&lt;font&gt;&lt;/font&gt;
    Console.WriteLine(&quot;Running BaseClass Method1&quot;);&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
  public void Method2()  //Not a virtual method&lt;font&gt;&lt;/font&gt;
  {&lt;font&gt;&lt;/font&gt;
    Console.WriteLine(&quot;Running BaseClass Method2&quot;);&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
public class InheritedClass : BaseClass&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
  public override void Method1()  //Overriding the base virtual method.&lt;font&gt;&lt;/font&gt;
  {&lt;font&gt;&lt;/font&gt;
    Console.WriteLine(&quot;Running InheritedClass Method1&quot;);&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
  public new void Method2()  //Can't override the base method; must 'new' it.&lt;font&gt;&lt;/font&gt;
  {&lt;font&gt;&lt;/font&gt;
    Console.WriteLine(&quot;Running InheritedClass Method2&quot;);&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Let's call it like this, with an instance of InheritedClass, in a matching reference:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;InheritedClass inherited = new InheritedClass();&lt;font&gt;&lt;/font&gt;
inherited.Method1();&lt;font&gt;&lt;/font&gt;
inherited.Method2();&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;This returns what you should expect; both methods say they are running the InheritedClass versions. &lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Running InheritedClass Method1&lt;br&gt; Running InheritedClass Method2&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;This code creates an instance of the same, InheritedClass, but stores it in a BaseClass reference:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;BaseClass baseRef = new InheritedClass();&lt;font&gt;&lt;/font&gt;
baseRef.Method1();&lt;font&gt;&lt;/font&gt;
baseRef.Method2();&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Normally, under OOP principles, you should expect the same output as the above example. But you don't get the same output:&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Running InheritedClass Method1&lt;br&gt; Running BaseClass Method2&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;When you wrote the InheritedClass code, you may have wanted all calls to &lt;code&gt;Method2()&lt;/code&gt; to run the code you wrote in it. Normally, this would be how it works - assuming you are working with a &lt;code&gt;virtual&lt;/code&gt; method that you have overridden. But because you are using a &lt;code&gt;new&lt;/code&gt;/hidden method, it calls the version on the reference you are using, instead.&lt;/p&gt; 
&lt;hr&gt; 
&lt;p&gt;If that's the behavior you &lt;em&gt;truly want&lt;/em&gt;, then; there you go. But I would strongly suggest that if that's what you want, there may be a larger architectural issue with the code.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Method Overriding is simpley override a default implementation of a base class method in the derived class.&lt;/p&gt; 
&lt;p&gt;Method Hiding : You can make use of 'new' keyword before a virtual method in a derived class &lt;/p&gt; 
&lt;p&gt;as &lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;class Foo  &lt;font&gt;&lt;/font&gt;
{  &lt;font&gt;&lt;/font&gt;
  public virtual void foo1()  &lt;font&gt;&lt;/font&gt;
  {  &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  }  &lt;font&gt;&lt;/font&gt;
}  &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
class Bar:Foo  &lt;font&gt;&lt;/font&gt;
{  &lt;font&gt;&lt;/font&gt;
  public new virtual void foo1()  &lt;font&gt;&lt;/font&gt;
  {   &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  }  &lt;font&gt;&lt;/font&gt;
}  &lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;now if you make another class Bar1 which is derived from Bar , you can override foo1 which is defind in Bar.&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/3838553/overriding-vs-method-hiding&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/3838553/overriding-vs-method-hiding&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2652</guid>
      <comments>https://nicepro.tistory.com/2652#entry2652comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:38:10 +0900</pubDate>
    </item>
    <item>
      <title>Ruby on Rails-정적 메서드</title>
      <link>https://nicepro.tistory.com/2651</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Ruby on Rails-정적 메서드&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;5 분마다 메서드를 실행하고 싶습니다. 루비 (cron)에 대해 언제든지 구현했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하지만 작동하지 않습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내 방법에 액세스 할 수 없다고 생각합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;실행하려는 메서드는 클래스에 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 그 메서드를 정적으로 만들어야해서 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;MyClass.MyMethod&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 올바른 구문을 찾을 수 없거나 잘못된 위치를 찾고있을 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Schedule.rb&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;every 5.minutes do&lt;font&gt;&lt;/font&gt;
  runner &quot;Ping.checkPings&quot;&lt;font&gt;&lt;/font&gt;
end&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Ping.rb&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;def checkPings      &lt;font&gt;&lt;/font&gt;
  gate =  Net::Ping::External.new(&quot;10.10.1.1&quot;)&lt;font&gt;&lt;/font&gt;
  @monitor_ping = Ping.new()&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  if gate.ping?        &lt;font&gt;&lt;/font&gt;
    MonitorPing.WAN = true&lt;font&gt;&lt;/font&gt;
  else &lt;font&gt;&lt;/font&gt;
    MonitorPing.WAN = false&lt;font&gt;&lt;/font&gt;
  end&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  @monitor_ping.save      &lt;font&gt;&lt;/font&gt;
end&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;정적 메서드를 선언하려면 ...&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;def self.checkPings&lt;font&gt;&lt;/font&gt;
  # A static method&lt;font&gt;&lt;/font&gt;
end&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;... 또는 ...&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;class Myclass extend self&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  def checkPings&lt;font&gt;&lt;/font&gt;
    # Its static method&lt;font&gt;&lt;/font&gt;
  end&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
end&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Ruby에서 다음과 같이 정적 메서드를 사용할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;class MyModel&lt;font&gt;&lt;/font&gt;
    def self.do_something&lt;font&gt;&lt;/font&gt;
        puts &quot;this is a static method&quot;&lt;font&gt;&lt;/font&gt;
    end&lt;font&gt;&lt;/font&gt;
end&lt;font&gt;&lt;/font&gt;
MyModel.do_something  # =&amp;gt; &quot;this is a static method&quot;&lt;font&gt;&lt;/font&gt;
MyModel::do_something # =&amp;gt; &quot;this is a static method&quot;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또한 메서드에 잘못된 명명 규칙을 사용하고 있음을 확인하십시오. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;check_pings&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;대신 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;해야 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하지만 이것은 코드가 작동하는지 여부에 영향을 미치지 않으며 단지 루비 스타일 일뿐입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;코드 변경 &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;class MyModel&lt;font&gt;&lt;/font&gt;
  def checkPings&lt;font&gt;&lt;/font&gt;
  end&lt;font&gt;&lt;/font&gt;
end&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;...에 &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;class MyModel&lt;font&gt;&lt;/font&gt;
  def self.checkPings&lt;font&gt;&lt;/font&gt;
  end&lt;font&gt;&lt;/font&gt;
end&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;메소드 이름에 self가 추가됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;def checkPings&lt;/code&gt; is an instance method for the class MyModel whereas &lt;code&gt;def self.checkPings&lt;/code&gt; is a class method.&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Instead of extending &lt;code&gt;self&lt;/code&gt; for the whole class, you can create a block that extends from self and define your static methods inside.&lt;/p&gt; 
&lt;p&gt;you would do something like this :&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;class &amp;lt;&amp;lt; self&lt;font&gt;&lt;/font&gt;
#define static methods here&lt;font&gt;&lt;/font&gt;
end&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;So in your example, you would do something like this :&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;class Ping&lt;font&gt;&lt;/font&gt;
  class &amp;lt;&amp;lt; self&lt;font&gt;&lt;/font&gt;
    def checkPings&lt;font&gt;&lt;/font&gt;
      #do you ping code here&lt;font&gt;&lt;/font&gt;
      # checkPings is a static method&lt;font&gt;&lt;/font&gt;
    end&lt;font&gt;&lt;/font&gt;
  end&lt;font&gt;&lt;/font&gt;
end&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;and you can call it as follows : &lt;code&gt;Ping.checkPings&lt;/code&gt;&lt;/p&gt;
&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;You cannot have static methods in Ruby. In Ruby, all methods are dynamic. There is only one kind of method in Ruby: dynamic instance methods.&lt;/p&gt; 
&lt;p&gt;Really, the term &lt;em&gt;static method&lt;/em&gt; is a misnomer anyway. A static method is a method which is not associated with any object and which is not dispatched dynamically (hence &quot;static&quot;), but those two are pretty much the &lt;em&gt;definition&lt;/em&gt; of what it means to be a &quot;method&quot;. We already have a perfectly good name for this construct: a &lt;em&gt;procedure&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/5231534/ruby-on-rails-static-method&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/5231534/ruby-on-rails-static-method&lt;/a&gt;&lt;/p&gt;</description>
      <category>Nice programing</category>
      <category>C#</category>
      <category>C++</category>
      <category>java</category>
      <category>JavaScript</category>
      <category>jQuery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>nicepro</author>
      <guid isPermaLink="true">https://nicepro.tistory.com/2651</guid>
      <comments>https://nicepro.tistory.com/2651#entry2651comment</comments>
      <pubDate>Sat, 9 Jan 2021 11:38:00 +0900</pubDate>
    </item>
  </channel>
</rss>