<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>copycodes</title>
    <link>https://copycodes.tistory.com/</link>
    <description>각종 프로그래밍 정보를 다루는 블로그입니다.</description>
    <language>ko</language>
    <pubDate>Sat, 23 May 2026 14:45:10 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>copycodes</managingEditor>
    <image>
      <title>copycodes</title>
      <url>https://tistory1.daumcdn.net/tistory/4115755/attach/48babd56931a43ea8034a3568830f76b</url>
      <link>https://copycodes.tistory.com</link>
    </image>
    <item>
      <title>WebView에서 양식 필드를 탭하면 소프트 키보드가 표시되지 않습니다.</title>
      <link>https://copycodes.tistory.com/2070</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;WebView에서 양식 필드를 탭하면 소프트 키보드가 표시되지 않습니다.&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;내 WebView를 만들고 WebChromeClient 및 WebViewClient 개체를 설정했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 WebView를 시작하면 HTML 양식 필드를 터치하면 반응하지만 (커서가 나타남) 선택되지 않고 소프트 키보드가 시작되지 않습니다. &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;a href=&quot;https://stackoverflow.com/questions/3098186/android-how-to-add-custom-soft-keyboard-when-form-field-is-selected-in-webview&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;code&gt;myWebview.requestFocusFromTouch()&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;a href=&quot;https://stackoverflow.com/questions/3098186/android-how-to-add-custom-soft-keyboard-when-form-field-is-selected-in-webview&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;/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;a href=&quot;http://code.google.com/p/android/issues/detail?id=7189&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://code.google.com/p/android/issues/detail?id=7189&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;webview.requestFocus(View.FOCUS_DOWN);&lt;font&gt;&lt;/font&gt;
    webview.setOnTouchListener(new View.OnTouchListener() {&lt;font&gt;&lt;/font&gt;
        @Override&lt;font&gt;&lt;/font&gt;
        public boolean onTouch(View v, MotionEvent event) {&lt;font&gt;&lt;/font&gt;
            switch (event.getAction()) {&lt;font&gt;&lt;/font&gt;
                case MotionEvent.ACTION_DOWN:&lt;font&gt;&lt;/font&gt;
                case MotionEvent.ACTION_UP:&lt;font&gt;&lt;/font&gt;
                    if (!v.hasFocus()) {&lt;font&gt;&lt;/font&gt;
                        v.requestFocus();&lt;font&gt;&lt;/font&gt;
                    }&lt;font&gt;&lt;/font&gt;
                    break;&lt;font&gt;&lt;/font&gt;
            }&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;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Dv_MH의 답변에 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;내가해야 할 일은 WebView를 확장하고 onCheckIsTextEditor ()에 대해 true를 반환하는 것뿐입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;import android.content.Context;&lt;font&gt;&lt;/font&gt;
import android.util.AttributeSet;&lt;font&gt;&lt;/font&gt;
import android.webkit.WebView;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
public class LiveWebView extends WebView {&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public LiveWebView(Context context) {&lt;font&gt;&lt;/font&gt;
        super(context);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public LiveWebView(Context context, AttributeSet attrs) {&lt;font&gt;&lt;/font&gt;
        super(context, attrs);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public LiveWebView(Context context, AttributeSet attrs, int defStyle) {&lt;font&gt;&lt;/font&gt;
        super(context, attrs, defStyle);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    @Override&lt;font&gt;&lt;/font&gt;
    public boolean onCheckIsTextEditor() {&lt;font&gt;&lt;/font&gt;
        return true;&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;거기에서 일반 WebView (대화 상자에서도)로 사용할 수있었습니다.&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;WebView web = new WebView(context) {&lt;font&gt;&lt;/font&gt;
  @Override&lt;font&gt;&lt;/font&gt;
  public boolean onCheckIsTextEditor() {&lt;font&gt;&lt;/font&gt;
    return true;&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;&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; 저는 이것을 검색하는 데 몇 시간을 보냈고 &quot;ViewGroup&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;android : descendantFocusability = &quot;blocksDescendants&quot;는 자식 레이아웃에 초점이 맞춰지지 않도록합니다.&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; webview에 android : focusable = &quot;true&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;AndroidChen의 답변이 전혀 작동하지 않았지만 제공된 링크 ( &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://code.google.com/p/android/issues/detail?id=7189&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://code.google.com/p/android/issues/detail?id=7189&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;했고 다음 클래스를 찾았습니다. 완벽하게 작동합니다 ( HTC Bravo의 Android Froyo), 텍스트뿐만 아니라 모든 버튼, 리디렉션 등 모든 것이 완벽하게 작동합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;class LiveWebView extends WebView&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    Context mContext;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public LiveWebView(Context context, String URL)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        super(context);&lt;font&gt;&lt;/font&gt;
        mContext = context;&lt;font&gt;&lt;/font&gt;
        setWebViewClient(URL);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    @Override&lt;font&gt;&lt;/font&gt;
    public boolean onCheckIsTextEditor()&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        return true;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    @SuppressLint(&quot;SetJavaScriptEnabled&quot;)&lt;font&gt;&lt;/font&gt;
    boolean setWebViewClient(String URL)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        setScrollBarStyle(SCROLLBARS_INSIDE_OVERLAY);&lt;font&gt;&lt;/font&gt;
        setFocusable(true);&lt;font&gt;&lt;/font&gt;
        setFocusableInTouchMode(true);&lt;font&gt;&lt;/font&gt;
        requestFocus(View.FOCUS_DOWN);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        WebSettings webSettings = getSettings();&lt;font&gt;&lt;/font&gt;
        webSettings.setSavePassword(false);&lt;font&gt;&lt;/font&gt;
        webSettings.setSaveFormData(false);&lt;font&gt;&lt;/font&gt;
        webSettings.setJavaScriptEnabled(true);&lt;font&gt;&lt;/font&gt;
        webSettings.setSupportZoom(false);&lt;font&gt;&lt;/font&gt;
        webSettings.setUseWideViewPort(false);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        setOnTouchListener(new View.OnTouchListener()&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            @Override&lt;font&gt;&lt;/font&gt;
            public boolean onTouch(View v, MotionEvent event)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                switch (event.getAction())&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    case MotionEvent.ACTION_DOWN:&lt;font&gt;&lt;/font&gt;
                    case MotionEvent.ACTION_UP:&lt;font&gt;&lt;/font&gt;
                        if (!v.hasFocus())&lt;font&gt;&lt;/font&gt;
                        {&lt;font&gt;&lt;/font&gt;
                            v.requestFocus();&lt;font&gt;&lt;/font&gt;
                        }&lt;font&gt;&lt;/font&gt;
                        break;&lt;font&gt;&lt;/font&gt;
                }&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;font&gt;&lt;/font&gt;
        this.setWebViewClient(new WebViewClient()&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            ProgressDialog dialog = new ProgressDialog(mContext);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            @Override&lt;font&gt;&lt;/font&gt;
            public boolean shouldOverrideUrlLoading(WebView view, String url)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                loadUrl(url);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
                return true;&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                Toast.makeText(mContext, &quot;Oh no! &quot; + description, Toast.LENGTH_SHORT).show();&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            public void onPageStarted(WebView view, String url, Bitmap favicon)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                if (dialog != null)&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    dialog.setMessage(&quot;Loading...&quot;);&lt;font&gt;&lt;/font&gt;
                    dialog.setIndeterminate(true);&lt;font&gt;&lt;/font&gt;
                    dialog.setCancelable(true);&lt;font&gt;&lt;/font&gt;
                    dialog.show();&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 void onPageFinished(WebView view, String url)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                if (dialog != null)&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    dialog.cancel();&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;
        this.setWebChromeClient(new WebChromeClient()&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            public void onProgressChanged(WebView view, int progress)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                // Activities and WebViews measure progress with different scales.&lt;font&gt;&lt;/font&gt;
                // The progress meter will automatically disappear when we reach 100%&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            @Override&lt;font&gt;&lt;/font&gt;
            public boolean onJsAlert(WebView view, String url, String message, JsResult result)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                result.confirm();&lt;font&gt;&lt;/font&gt;
                return true;&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        });&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        loadUrl(URL);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        return true;&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;AlertDialog.Builder alert = new AlertDialog.Builder(M_PaymentOptions.this);&lt;font&gt;&lt;/font&gt;
alert.setNegativeButton(&quot;Back to Payment Options&quot;, new DialogInterface.OnClickListener()&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    @Override&lt;font&gt;&lt;/font&gt;
    public void onClick(DialogInterface dialog, int id)&lt;font&gt;&lt;/font&gt;
    {}&lt;font&gt;&lt;/font&gt;
});&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
alert.setTitle(&quot;BarclayCard Payment&quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
LiveWebView liveWevViewObject = new LiveWebView(M_PaymentOptions.this, redirecturl);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
alert.setView(liveWevViewObject);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
alert.show();&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;WebView 아래에 보이지 않는 EditText를 추가하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;FrameLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;font&gt;&lt;/font&gt;
android:orientation=&quot;vertical&quot; android:layout_width=&quot;match_parent&quot;&lt;font&gt;&lt;/font&gt;
android:layout_height=&quot;match_parent&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&amp;lt;EditText&lt;font&gt;&lt;/font&gt;
    android:layout_width=&quot;wrap_content&quot;&lt;font&gt;&lt;/font&gt;
    android:layout_height=&quot;wrap_content&quot;&lt;font&gt;&lt;/font&gt;
    android:visibility=&quot;invisible&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&amp;lt;WebView&lt;font&gt;&lt;/font&gt;
    android:id=&quot;@+id/webView&quot;&lt;font&gt;&lt;/font&gt;
    android:layout_width=&quot;match_parent&quot;&lt;font&gt;&lt;/font&gt;
    android:layout_height=&quot;match_parent&quot;/&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;All these focus-related solutions didn't work on my Samsung Note 3/Android 5.0&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/4200259/tapping-form-field-in-webview-does-not-show-soft-keyboard&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/4200259/tapping-form-field-in-webview-does-not-show-soft-keyboard&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2070</guid>
      <comments>https://copycodes.tistory.com/2070#entry2070comment</comments>
      <pubDate>Sun, 10 Jan 2021 17:29:14 +0900</pubDate>
    </item>
    <item>
      <title>자바 스크립트 속성 이름에 대시가 허용 되나요?</title>
      <link>https://copycodes.tistory.com/2069</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;jQuery 용 간단한 플러그인을 만들기 위해 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://docs.jquery.com/Plugins/Authoring#Defaults_and_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;http://docs.jquery.com/Plugins/Authoring#Defaults_and_Options&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;pre&gt;&lt;code&gt;var settings = {&lt;font&gt;&lt;/font&gt;
    'location' : 'top',&lt;font&gt;&lt;/font&gt;
    'background-color': 'blue'&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
...&lt;font&gt;&lt;/font&gt;
$this.css('backgroundColor', settings.background-color); // fails here&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;var settings = {&lt;font&gt;&lt;/font&gt;
    'location' : 'top',&lt;font&gt;&lt;/font&gt;
    'backgroundColor': 'blue' // dash removed here&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
...&lt;font&gt;&lt;/font&gt;
$this.css('backgroundColor', settings.backgroundColor); &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 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;settings['background-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;/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;settings.background-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;settings['background-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;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&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;빼기 연산자로 읽히므로 &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;/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;$this.css('backgroundColor', settings['background-color']);
&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;var myObject = {&lt;font&gt;&lt;/font&gt;
  propertyOne: 'Something',&lt;font&gt;&lt;/font&gt;
  'property-two': 'Something two'  &lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
var result1 = myObject.propertyOne&lt;font&gt;&lt;/font&gt;
var result2 = myObject['propertyOne']&lt;font&gt;&lt;/font&gt;
var result3 = myObject['property-two']&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/5516106/are-dashes-allowed-in-javascript-property-names&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/5516106/are-dashes-allowed-in-javascript-property-names&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2069</guid>
      <comments>https://copycodes.tistory.com/2069#entry2069comment</comments>
      <pubDate>Sun, 10 Jan 2021 17:29:03 +0900</pubDate>
    </item>
    <item>
      <title>기본 Rails sqlite db에 액세스하는 방법은 무엇입니까?</title>
      <link>https://copycodes.tistory.com/2068</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기본 Rails sqlite db에 액세스하는 방법은 무엇입니까?&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;Rails로 개발하는 동안 DB의 데이터를보고 싶습니다 (실제로는 개발, 테스트 및 프로덕션 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;Aptana (v.3)는 Eclipse에서 알고있는 좋은 오래된 데이터 소스 탐색기보기가 부족한 것 같기 때문에 연결 문자열이 무엇인지, 어디에 입력해야할지 모르겠습니다. &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;편집 : 나는 리눅스에서 일하고 있습니다-민트 12&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;사용중인 OS를 언급하지 않았습니다.&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;sqlite3&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;pre&gt;&lt;code&gt;sqlite3 db/development.sqlite3
&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;그러나 행 검사와 같은 경우에는 rails 콘솔을 사용하는 것이 좋습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;rails c&lt;font&gt;&lt;/font&gt;
&amp;gt; User.all # Where user is your model.&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; sqlite3를 통해 직접 DB 스키마를 변경하지 마십시오. 다른 웹 스택 배경에서 왔을 경우 사용할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이는 다음에 마이그레이션을 실행할 때 상태가 Rails가 예상하는 것과 달라지기 때문입니다.&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;Rails 3는 올바른 데이터베이스 클라이언트에 액세스하고 현재 환경에 맞는 올바른 데이터베이스 이름을 전달하기위한 일반 명령을 제공합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 명령은 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;rails dbconsole&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;rails db&lt;/code&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$ rails db&lt;font&gt;&lt;/font&gt;
SQLite version 3.6.12&lt;font&gt;&lt;/font&gt;
Enter &quot;.help&quot; for instructions&lt;font&gt;&lt;/font&gt;
Enter SQL statements terminated with a &quot;;&quot;&lt;font&gt;&lt;/font&gt;
sqlite&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;이 명령은 Gazler의 답변보다 많은 것을 제공하지 않으며 실제로 콘솔 사용에 대한 그의 조언은 좋은 조언이지만이 방법의 장점은 DB가 다른 환경에서 다른 경우 올바른 클라이언트를 사용한다는 것입니다.&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;SQLite&amp;gt; .tables
&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;SQLite&amp;gt; rails dbconsole
&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;SQLite&amp;gt;.tables
&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;SQLite&amp;gt; select * from posts
&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;sqlite3 데이터베이스를 탐색하는 훌륭한 응용 프로그램이 있습니다. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://sqlitebrowser.org/&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;SQLite 데이터베이스 브라우저&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;추신 : Aptana 스튜디오를 사용하고 있다고 언급하셨습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 IDE에서도 RoR 학습을 시작했지만 나중에 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.sublimetext.com/&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Sublime Text를&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;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;activeadmin&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;gem &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://github.com/oklas/activeadmin-sqlpage&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;activeadmin-sqlpage를&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;gem 'activeadmin-sqlpage'
&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;그리고 activeadmin 페이지를 만듭니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;# file app/admin/sql.rb&lt;font&gt;&lt;/font&gt;
ActiveAdmin::SqlPage::register&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;SQL&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;SQL 명령을 입력하고 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Ctrl+Enter&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;Submit&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 style=&quot;vertical-align: inherit;&quot;&gt;그러면 데이터베이스를 쿼리 할 레일스 콘솔이 열립니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;rails c
&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;ActiveRecord::Base.connection.tables
&lt;/code&gt;&lt;/pre&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;schema_migrations&quot;, &quot;ar_internal_metadata&quot;, &quot;categories&quot;, &quot;items&quot;]&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;pre&gt;&lt;code&gt;Category.all
&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;RubyMine IDE를 사용하는 경우 여기에서 sqllite 데이터 소스에 액세스 할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;GUI를 사용하여 데이터베이스에서 쿼리를 실행하거나 데이터를 편집 할 수 있습니다.&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;DB에서 데이터를보기 위해 DB Browser for SQLite라는 SQLite 클라이언트를 사용했습니다. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://sqlitebrowser.org/dl/&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;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 앱의 Linux 버전도 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;앱 디렉토리에 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;sqlite&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;db&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;DB Browser에서 Open Database 옵션을 선택하고 해당 파일을 선택하면 데이터를 볼 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/10171673/how-to-access-default-rails-sqlite-db&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/10171673/how-to-access-default-rails-sqlite-db&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2068</guid>
      <comments>https://copycodes.tistory.com/2068#entry2068comment</comments>
      <pubDate>Sun, 10 Jan 2021 17:28:55 +0900</pubDate>
    </item>
    <item>
      <title>javascript에서 연관 항목을 배열로 푸시하는 방법은 무엇입니까?</title>
      <link>https://copycodes.tistory.com/2067</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;javascript에서 연관 항목을 배열로 푸시하는 방법은 무엇입니까?&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;/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;var arr = [];&lt;font&gt;&lt;/font&gt;
var name = &quot;name&quot;;&lt;font&gt;&lt;/font&gt;
var val = 2;&lt;font&gt;&lt;/font&gt;
arr.push(val); //works , but not associative&lt;font&gt;&lt;/font&gt;
arr[name] = val; //does not work&lt;font&gt;&lt;/font&gt;
console.log(arr);&lt;/code&gt;&lt;/pre&gt; 
 &lt;/div&gt; 
&lt;/div&gt; 
&lt;p&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;http://jsfiddle.net/bz8pK/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;jsfiddle&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&gt;&lt;a href=&quot;http://www.quirksmode.org/js/associative.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;JavaScript에서 연관 배열&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;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;var arr = {}; // {} will create an object&lt;font&gt;&lt;/font&gt;
var name = &quot;name&quot;;&lt;font&gt;&lt;/font&gt;
var val = 2;&lt;font&gt;&lt;/font&gt;
arr[name] = val;&lt;font&gt;&lt;/font&gt;
console.log(arr);​&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;a href=&quot;http://jsfiddle.net/bz8pK/1/&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/bz8pK/1/&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;JavaScript에는 연관 배열이 없습니다. &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 obj = {};&lt;font&gt;&lt;/font&gt;
var name = &quot;name&quot;;&lt;font&gt;&lt;/font&gt;
var val = 2;&lt;font&gt;&lt;/font&gt;
obj[name] = val;&lt;font&gt;&lt;/font&gt;
console.log(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;pre&gt;&lt;code&gt;console.log(obj.name);​&lt;font&gt;&lt;/font&gt;
console.log(obj[name]);​&lt;font&gt;&lt;/font&gt;
console.log(obj[&quot;name&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;Javascript &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&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;false&quot; data-babel=&quot;false&quot;&gt; 
 &lt;div class=&quot;snippet-code&quot;&gt; 
  &lt;pre class=&quot;snippet-code-html lang-html prettyprint-override&quot;&gt;&lt;code&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
  var myArray = [];&lt;font&gt;&lt;/font&gt;
  myArray['thank'] = 'you';&lt;font&gt;&lt;/font&gt;
  myArray['no'] = 'problem';&lt;font&gt;&lt;/font&gt;
  console.log(myArray);&lt;font&gt;&lt;/font&gt;
&amp;lt;/script&amp;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;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; var arr = {'name':[]};
&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 val = 2;&lt;font&gt;&lt;/font&gt;
  arr['name'].push(val);&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;var val = arr.name[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;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/10550158/how-to-push-associative-item-into-array-in-javascript&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/10550158/how-to-push-associative-item-into-array-in-javascript&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2067</guid>
      <comments>https://copycodes.tistory.com/2067#entry2067comment</comments>
      <pubDate>Sun, 10 Jan 2021 17:28:46 +0900</pubDate>
    </item>
    <item>
      <title>echo&amp;gt; &amp;amp; 2 &amp;quot;일부 텍스트&amp;quot;쉘 스크립팅에서 의미하는 바</title>
      <link>https://copycodes.tistory.com/2066</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;echo&amp;gt; &amp;amp; 2 &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;나는 &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 style=&quot;vertical-align: inherit;&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;echo &amp;gt;&amp;amp;2 message text ...
&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;code&gt;2&amp;gt;&amp;amp;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;p&gt;&lt;font style=&quot;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;echo &quot;hey&quot; &amp;gt;&amp;amp;2&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;&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;1&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;/p&gt; 
&lt;p&gt;&lt;code&gt;&amp;amp;&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;&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;/p&gt; 
&lt;p&gt;&lt;code&gt;2&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; stderr 파일 설명자 번호&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;stdout&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;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&gt;&lt;code&gt;stderr&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;echo &quot;hey&quot; &amp;gt;2&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;hey&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;2&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;&amp;gt;&amp;amp;2&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;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;&amp;gt;&amp;amp;2&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&amp;gt;&amp;amp; 2&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;2&amp;gt;&amp;amp; 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;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;stdout&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;stderr에&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;이해 &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&gt;&lt;/em&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;. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;가장 좋은 답변은 질문에 대한 직접 댓글 형식이지만, 아쉽게도 Stack Overflow는 댓글을 추가 할 가치가 있다고 생각하지 않습니다.&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/23489934/echo-2-some-text-what-does-it-mean-in-shell-scripting/#comment36020165_23489934&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;tripleee를 인용하면&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;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 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;sic&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;code&gt;&amp;gt;&amp;amp;2 echo message&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;echo &amp;gt;&amp;amp;2 message&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;echo message &amp;gt;&amp;amp;2&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;/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 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/23489934/echo-2-some-text-what-does-it-mean-in-shell-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/23489934/echo-2-some-text-what-does-it-mean-in-shell-scripting&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2066</guid>
      <comments>https://copycodes.tistory.com/2066#entry2066comment</comments>
      <pubDate>Sun, 10 Jan 2021 17:28:38 +0900</pubDate>
    </item>
    <item>
      <title>오류 : JAVA_HOME이 Maven을 올바르게 실행하도록 정의되지 않았습니다.</title>
      <link>https://copycodes.tistory.com/2065</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;오류 : JAVA_HOME이 Maven을 올바르게 실행하도록 정의되지 않았습니다.&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를 설치하고 환경에 대한 경로를 설정하고 실행 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;echo $JAVA_HOME&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;/usr/lib/jvm/java-7-oracle/jre/bin/java
&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;code&gt;apache-maven&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;environment&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;JAVA_HOME=&quot;/usr/lib/jvm/java-7-oracle/jre/bin/java&quot;&lt;font&gt;&lt;/font&gt;
M2_HOME=/usr/local/apache-maven/apache-maven-3.0.5&lt;font&gt;&lt;/font&gt;
M2=$M2_HOME/bin&lt;font&gt;&lt;/font&gt;
MAVEN_OPTS=&quot;-Xms256m -Xmx512m&quot;&lt;font&gt;&lt;/font&gt;
PATH=$M2:$PATH&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;mvn --version&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;Error: JAVA_HOME is not defined correctly.&lt;font&gt;&lt;/font&gt;
  We cannot execute /usr/lib/jvm/java-7-oracle/jre/bin/java/bin/java&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;/bin/java/bin/java&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;bash 셸을 사용하고 Oracle 설치 프로그램과 함께 Java를 설치했다고 가정하면 다음을 추가 할 수 있습니다. &lt;/font&gt;&lt;/font&gt;&lt;code&gt;.bash_profile&lt;/code&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;export JAVA_HOME=$(/usr/libexec/java_home)&lt;font&gt;&lt;/font&gt;
export PATH=$JAVA_HOME/jre/bin:$PATH&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;JAVA_HOME&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Oracle 설치 프로그램에서 정의한 &lt;/font&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 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;또한 Java를 업데이트 할 때 나중에 변경할 필요가 없습니다.&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;/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;/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 style=&quot;vertical-align: inherit;&quot;&gt;(그것이라고 가정 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;bash&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;.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;.bash_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;.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;blockquote&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;/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;code&gt;JAVA_HOME&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;$()&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;JAVA_HOME=/opt/java/openjdk&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;JAVA_HOME은 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;/usr/lib/jvm/java-7-oracle/jre/&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;터미널을 열고 java의 위치를 ​​찾습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;manuel@zonademanel:~ → whereis java
&lt;/code&gt;&lt;/pre&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;자바 : / usr / bin / java / etc / java / usr / bin / X11 / java / usr / share / java /usr/share/man/man1/java.1.gz&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;우리가 찾고있는 것은 / usr / bin / java가 심볼릭 링크 일 뿐이므로 절대 경로를 찾기 위해 명령 줄에서 계속합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;manuel@zonademanel:~ → ls -lah /usr/bin/java
&lt;/code&gt;&lt;/pre&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;lrwxrwxrwx 1 루트 루트 2015 년 5 월 22 일 / usr / bin / java-&amp;gt; / etc / alternatives / java&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;pre&gt;&lt;code&gt;manuel@zonademanel:~ → ls -lah /etc/alternatives/java
&lt;/code&gt;&lt;/pre&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;lrwxrwxrwx 1 루트 루트 39 dic 7 11:52 / etc / alternatives / java-&amp;gt; / usr / lib / jvm / java-8-oracle / jre / bin / java&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;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;/ etc / environment&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;blockquote&gt; 
 &lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;PATH = &quot;/ usr / local / sbin : / usr / local / bin : / usr / sbin : / usr / bin : / sbin : / bin : / usr / games : / usr / local / games : &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;/ usr / lib / jvm / java-8-oracle / jre / bin&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; &quot;JAVA_HOME =&quot; &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;/ usr / lib / jvm / java-8-oracle / jre&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; &quot;&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;pre&gt;&lt;code&gt;source /etc/environment 
&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;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;mvn -version을&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;pre&gt;&lt;code&gt;manuel@zonademanel:~ → mvn -version
&lt;/code&gt;&lt;/pre&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;Apache Maven 3.0.5 &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;Maven 홈 : / usr / share / maven &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;Java 버전 : 1.8.0_77, 공급 업체 : Oracle Corporation &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;Java 홈 : / usr / lib / jvm / java-8-oracle / jre &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;기본 로케일 : es_MX, 플랫폼 인코딩 : UTF-8 &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;OS 이름 : &quot;linux&quot;, 버전 : &quot;3.16.0-70-generic&quot;, arch : &quot;amd64&quot;, 제품군 : &quot;unix&quot;&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;code&gt;$JAVA_HOME&lt;/code&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;pre&gt;&lt;code&gt;export JAVA_HOME=/usr/lib/jvm/java-7-oracle
&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;먼저 자바 위치를 찾으십시오. &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;$ sudo update-alternatives --config java
&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;이제 JAVA_HOME 및 PATH를 설정하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$ export JAVA_HOME=&amp;lt;java_home&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$ export PATH=$JAVA_HOME/jre/bin:$PATH&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;$ sudo ln -s &amp;lt;java_home&amp;gt;/jre &amp;lt;java_symlink_path&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;$ sudo ln -s /usr/lib/jvm/java-7-oracle/jre /usr/lib/jvm/java-7-oracle/jre/bin/java
&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;$ mvn --version
&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;제 경우에는 java가 설치된 전체 디렉토리를 가져와야합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;export JAVA_HOME=/usr/java/jdk1.8.0_31
&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;export JAVA_HOME = / usr / java / jdk1.8.0_31.로 설정하고 sudo로 실행하면 실행됩니다 ..&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;첫째, 개발 모드에서는 JRE 대신 JDK를 사용해야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;둘째, JAVA_HOME은 Java를 설치하고 다른 모든 프레임 워크가 필요한 항목 (JRE, javac, ...)을 검색하는 곳입니다.&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;JAVA_HOME = / usr / lib / jvm / java-7-oracle / jre / bin / java&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;when you run a &quot;mvn&quot; command, Maven will try to access to the java by adding /bin/java, thinking that the JAVA_HOME is in the root directory of Java installation.&lt;/p&gt; 
&lt;p&gt;But setting &lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;JAVA_HOME=/usr/lib/jvm/java-7-oracle/&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;Maven will access add bin/java then it will work just fine.&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 solution work for me... just type &lt;code&gt;export PATH=$JAVA_HOME/jre/bin:$PATH&lt;/code&gt; in the terminal then run &lt;code&gt;mvn -version&lt;/code&gt; it will show the same error but with a log like this&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;which: no javac in (/jre/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin)&lt;font&gt;&lt;/font&gt;
Warning: JAVA_HOME environment variable is not set.&lt;font&gt;&lt;/font&gt;
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T22:59:23+05:30)&lt;font&gt;&lt;/font&gt;
Maven home: /opt/apache-maven-3.2.5&lt;font&gt;&lt;/font&gt;
Java version: 1.8.0_171, vendor: Oracle Corporation&lt;font&gt;&lt;/font&gt;
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jre&lt;font&gt;&lt;/font&gt;
Default locale: en_US, platform encoding: UTF-8&lt;font&gt;&lt;/font&gt;
OS name: &quot;linux&quot;, version: &quot;3.10.0-693.el7.x86_64&quot;, arch: &quot;amd64&quot;, family: &quot;unix&quot;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;now copy the &lt;code&gt;Java home&lt;/code&gt; path i.e. &lt;code&gt;/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jre&lt;/code&gt; in my case.&lt;/p&gt; 
&lt;p&gt;now type,&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jre
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;and the error gets resolve. NOTE: paste your own path which is shown by your machine in mvn log at export JAVA_HOME.&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 happens because of the reason mentioned below : &lt;/p&gt; 
&lt;p&gt;If you see the mvn script: The code fails here --- &lt;/p&gt; 
&lt;p&gt;Steps for debugging and fixing: &lt;/p&gt; 
&lt;p&gt;Step 1: Open the mvn script /Users/Username/apache-maven-3.0.5/bin/mvn (Open with the less command like: less /Users/Username/apache-maven-3.0.5/bin/mvn)&lt;/p&gt; 
&lt;p&gt;Step 2: Find out the below code in the script:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;  if [ -z &quot;$JAVACMD&quot; ] ; then&lt;font&gt;&lt;/font&gt;
  if [ -n &quot;$JAVA_HOME&quot;  ] ; then&lt;font&gt;&lt;/font&gt;
    if [ -x &quot;$JAVA_HOME/jre/sh/java&quot; ] ; then&lt;font&gt;&lt;/font&gt;
      # IBM's JDK on AIX uses strange locations for the executables&lt;font&gt;&lt;/font&gt;
      JAVACMD=&quot;$JAVA_HOME/jre/sh/java&quot;&lt;font&gt;&lt;/font&gt;
    else&lt;font&gt;&lt;/font&gt;
      JAVACMD=&quot;$JAVA_HOME/bin/java&quot;&lt;font&gt;&lt;/font&gt;
    fi&lt;font&gt;&lt;/font&gt;
  else&lt;font&gt;&lt;/font&gt;
    JAVACMD=&quot;`which java`&quot;&lt;font&gt;&lt;/font&gt;
  fi&lt;font&gt;&lt;/font&gt;
fi&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
if [ ! -x &quot;$JAVACMD&quot; ] ; then&lt;font&gt;&lt;/font&gt;
  echo &quot;Error: JAVA_HOME is not defined correctly.&quot;&lt;font&gt;&lt;/font&gt;
  echo &quot;  We cannot execute $JAVACMD&quot;&lt;font&gt;&lt;/font&gt;
  exit 1&lt;font&gt;&lt;/font&gt;
fi&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Step3: It is happening because &lt;code&gt;JAVACMD&lt;/code&gt; variable was not set. So it displays the error.&lt;/p&gt; 
&lt;p&gt;Note: To Fix it &lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;export JAVACMD=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/bin/java&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Key: If you want it to be permanent open emacs .profile&lt;/p&gt; 
&lt;p&gt;post the commands and press Ctrl-x Ctrl-c ( save-buffers-kill-terminal ).&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 are using mac-OS , &lt;code&gt;export JAVA_HOME=/usr/libexec/java_home&lt;/code&gt; need to be changed to &lt;code&gt;export JAVA_HOME=$(/usr/libexec/java_home)&lt;/code&gt; . Steps to do this : &lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; $ vim .bash_profile&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
 export JAVA_HOME=$(/usr/libexec/java_home)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
 $ source .bash_profile&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;where &lt;code&gt;/usr/libexec/java_home&lt;/code&gt; is the path of your jvm &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 these two commands (for Java 8):&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;sudo update-java-alternatives --set java-8-oracle&lt;font&gt;&lt;/font&gt;
java -XshowSettings 2&amp;gt;&amp;amp;1 | grep -e 'java.home' | awk '{print &quot;JAVA_HOME=&quot;$3}' | sed &quot;s/\/jre//g&quot; &amp;gt;&amp;gt; /etc/environment&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;In my case, the problem was in vscode.&lt;/p&gt; 
&lt;p&gt;I use windows and installed Ubuntu on my computer, so vscode terminal uses the Ubuntu. I just go to settings.json and change to cmd.exe again&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/27319495/error-java-home-is-not-defined-correctly-executing-maven&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/27319495/error-java-home-is-not-defined-correctly-executing-maven&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2065</guid>
      <comments>https://copycodes.tistory.com/2065#entry2065comment</comments>
      <pubDate>Sun, 10 Jan 2021 17:28:30 +0900</pubDate>
    </item>
    <item>
      <title>InetAddress.getLocalHost () 실행 속도가 느림 (30 초 이상)</title>
      <link>https://copycodes.tistory.com/2064</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;InetAddress.getLocalHost () 실행 속도가 느림 (30 초 이상)&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;try {&lt;font&gt;&lt;/font&gt;
  System.out.println(new Date());&lt;font&gt;&lt;/font&gt;
  InetAddress hostName = InetAddress.getLocalHost();&lt;font&gt;&lt;/font&gt;
  System.out.println(new Date());&lt;font&gt;&lt;/font&gt;
} catch (UnknownHostException e) {&lt;font&gt;&lt;/font&gt;
  e.printStackTrace();&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;Thu Oct 22 20:58:22 BST 2015&lt;font&gt;&lt;/font&gt;
Thu Oct 22 20:58:52 BST 2015&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;즉, 실행하는 데 30 초가 걸립니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Machine은 Java 1.8.0_60이 설치된 2015 Macbook Pro입니다.&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;이 문제는 / etc / hosts에 다음을 추가하여 해결할 수 있습니다 (호스트 이름이 다음과 같다고 가정) &lt;/font&gt;&lt;/font&gt;&lt;code&gt;macbook&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;127.0.0.1   macbook&lt;font&gt;&lt;/font&gt;
::1         macbook&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;이렇게하면 시간이 더 적합한 것으로 반환됩니다 (&amp;lt;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;이 문제는 Java8을 사용하는 MacOS Sierra에서 나타납니다. 업데이트는 60 이상 (jdk1.8.0_60.jdk, jdk1.8.0_77.jdk 등)입니다.&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://github.com/thoeni/inetTester&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://github.com/thoeni/inetTester&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;이것은 내 / etc / hosts 파일의 내용입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;127.0.0.1   localhost mac.local&lt;font&gt;&lt;/font&gt;
::1         localhost mac.local&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;strong&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;/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;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;여기서 지연은 DNS 확인 시도가 실패했기 때문이라고 생각합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;DNS 서버가 올바르게 구성되지 않았을 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;30 초는 아마도 DNS 확인의 시간 초과를 나타냅니다.&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;솔루션이 속도를 향상시킨 이유는 호스트 파일에 항목을 추가하면 호스트 이름을 로컬에서 확인할 수 있으므로 실제 (원격) DNS 서버에 대해 호스트 이름을 확인하려는 시도를 건너 뛰기 때문입니다.&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;a href=&quot;https://stackoverflow.com/questions/34842698/inetaddress-getcanonicalhostname-returns-ip-instead-of-hostname&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;InetAddress.getCanonicalHostName ()은 호스트 이름 대신 IP를 반환합니다.&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;Java 1.8.0_92 및 1.80_112가 설치된 MacBook Pro에서는이 문제가 여전히 존재하며 InetAddress.getLocalhost () 호출에 5 초 이상이 필요합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;수정 된 / etc / hosts가있는 솔루션이 작동하지 않습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Java 1.8.0_051로 다시 전환하면이 문제가 해결됩니다.&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;위의 답변은 내 Mac에서 작동하며 다음과 같이 시도해 볼 수 있습니다.&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;1 단계, &lt;/font&gt;&lt;a href=&quot;https://github.com/thoeni/inetTester&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; 에서 inetTester.jar 다운로드&lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://github.com/thoeni/inetTester&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;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;2 단계, Mac에서 실행합니다. &lt;/font&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;$ java -jar ./inetTester.jar&lt;font&gt;&lt;/font&gt;
Calling the hostname resolution method...&lt;font&gt;&lt;/font&gt;
Method called, hostname MacBook-Pro.local, elapsed time: 5009 (ms)&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;테스트를 실행하는 데 5 초가 걸리며 내 Mac의 호스트 이름이 표시됩니다.&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;3 단계, / etc / hosts를 수정합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;127.0.0.1   MacBook-Pro.local&lt;font&gt;&lt;/font&gt;
::1         MacBook-Pro.local&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;호스트는 2 단계에 표시된 것입니다. 그런 다음 테스트를 다시 실행하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$ java -jar ./inetTester.jar&lt;font&gt;&lt;/font&gt;
Calling the hostname resolution method...&lt;font&gt;&lt;/font&gt;
Method called, hostname MacBook-Pro.local, elapsed time: 6 (ms)&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;네, 6ms 만 제공됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;5 초-&amp;gt; 6ms, 좋습니다.&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/33289695/inetaddress-getlocalhost-slow-to-run-30-seconds&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/33289695/inetaddress-getlocalhost-slow-to-run-30-seconds&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2064</guid>
      <comments>https://copycodes.tistory.com/2064#entry2064comment</comments>
      <pubDate>Sun, 10 Jan 2021 17:28:20 +0900</pubDate>
    </item>
    <item>
      <title>iOS 11에서 Xcode 8 사용</title>
      <link>https://copycodes.tistory.com/2063</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;iOS 11에서 Xcode 8 사용&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;iOS 11에서 Xcode 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;Xcode를 업그레이드해야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 내 코드는 새 컴파일러로 빌드 할 수 없으므로 Xcode 8을 유지하고 싶습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/l84Gj.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/l84Gj.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;/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;Apple은 WWDC 2017에서 몇 가지 새로운 iOS 11 기능을 공개했습니다.&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;p&gt;&lt;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;현재 이것은 시뮬레이터가 아닌 iOS 장치에서의 디버깅에만 해당됩니다.&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;a href=&quot;https://developer.apple.com/download/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Apple&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 에서 SDK 다운로드&lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://developer.apple.com/download/&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;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;iOS 11.0 이미지&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;/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/에&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;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/strong&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;Xcode를 다시 시작하십시오.&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;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;현재로서는 시뮬레이터가 아닌 iOS 장치에서의 디버깅에만 해당됩니다.&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;Xcode 8은 iOS 11 버전 용 DeviceSupport 폴더가 없으면 지원할 수 없습니다.&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;Xcode 9 베타 (최신 Xcode 9)를 다운로드하거나 다른 사용자로부터 DeviceSupport 폴더를받을 수 있습니다.&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;/p&gt;&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;&lt;code&gt;sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/11.0\ \(15A372\) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/11.0&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;a href=&quot;https://stackoverflow.com/questions/37945376/use-xcode-7-with-ios-10&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;iOS 10에서 Xcode 7 사용&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;이 작업을 수행했지만 괜찮습니다. 저는 여전히 Xcode 8 + Swift 3을 사용하는 상용 앱에서 작업하고 Swift 4로 Xcode 9 베타를 탐색합니다. Xcode 9를 다운로드하고 Xcode 8 환경 설정에서 9.0을 사용하도록 명령 줄 도구를 설정합니다. .&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/U8iNH.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/U8iNH.png&quot; alt=&quot;Xcode 환경 설정&gt; 위치&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;모든 폴더를 복사하는 것을 선호했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;/Volumes/**HighSierra**/Applications/Xcode-**beta.app**/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/11.0\ \(15A5278f\)
&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; /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/**11** 
&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;iOS 11이 설치된 iPhone 7에서 실행할 수 있음을 확인할 수 있습니다.&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/44381860/use-xcode-8-with-ios-11&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/44381860/use-xcode-8-with-ios-11&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2063</guid>
      <comments>https://copycodes.tistory.com/2063#entry2063comment</comments>
      <pubDate>Sun, 10 Jan 2021 17:28:11 +0900</pubDate>
    </item>
    <item>
      <title>제네릭과 함께 Collections.emptySet ()을 사용하면 할당에서 작동하지만 메서드 매개 변수로는 작동하지 않는 이유는 무엇입니까?</title>
      <link>https://copycodes.tistory.com/2062</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;제네릭과 함께 Collections.emptySet ()을 사용하면 할당에서 작동하지만 메서드 매개 변수로는 작동하지 않는 이유는 무엇입니까?&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 FilterList(Set&amp;lt;Integer&amp;gt; labels) {&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&gt;&lt;code&gt;FilterList&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;Joshua Bloch의 저서 Effective Java에서 조언에 따라 빈 집합에 대한 새 개체를 만들고 싶지 않습니다. &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Collections.emptySet()&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;FilterList emptyList = new FilterList(Collections.emptySet());
&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;java.util.Set&amp;lt;java.lang.Object&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;java.util.Set&amp;lt;java.lang.Integer&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;/p&gt; 
&lt;pre&gt;&lt;code&gt;FilterList emptyList = new FilterList((Set&amp;lt;Integer&amp;gt;)Collections.emptySet());
&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;Set&amp;lt;Integer&amp;gt; empty = Collections.emptySet();&lt;font&gt;&lt;/font&gt;
FilterList emptyList = new FilterList(empty);&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 style=&quot;vertical-align: inherit;&quot;&gt;결국 Java에는 유형 추론이 없기 때문에 .NET &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Set&amp;lt;Integer&amp;gt; foo = new TreeSet()&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;Set&amp;lt;Integer&amp;gt; foo = new TreeSet&amp;lt;Integer&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;Set&amp;lt;Integer&amp;gt; empty = Collections.emptySet();&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;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의 제네릭 시스템에서 유형 추론의 한계입니다. &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;이것이 소유하는 객체의 런타임 클래스에 따라 메서드가 동적으로 디스패치되기 때문 &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;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 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;pre&gt;&lt;code&gt;Collections.&amp;lt;Integer&amp;gt;emptySet();
&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;Collections.&amp;lt;String, Boolean&amp;gt;emptyMap(); // Returns a Map&amp;lt;String, Boolean&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;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;FilterList emptyList = new FilterList(Collections.&amp;lt;Integer&amp;gt;emptySet());
&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;// forces use of ArrayList as parameter instead of the infered List&lt;font&gt;&lt;/font&gt;
List&amp;lt;String&amp;gt; l = someObject.&amp;lt;ArrayList&amp;lt;String&amp;gt; methodThatTakesTypeParamForReturnType();&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;FilterList emptyList = new FilterList(java.util.Collections.&amp;lt;Integer&amp;gt;emptySet());
&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;emptySet&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;Integer&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;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 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;Java에는 유형 추론이 있지만 매우 제한적입니다. &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;a href=&quot;http://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html#Type%2BArgument%2BInference&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://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html#Type%2BArgument%2BInference&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/3061837/why-does-using-collections-emptyset-with-generics-work-in-assignment-but-not-a&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/3061837/why-does-using-collections-emptyset-with-generics-work-in-assignment-but-not-a&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2062</guid>
      <comments>https://copycodes.tistory.com/2062#entry2062comment</comments>
      <pubDate>Sun, 10 Jan 2021 17:28:03 +0900</pubDate>
    </item>
    <item>
      <title>IIS URL 재 작성 및 Web.config</title>
      <link>https://copycodes.tistory.com/2061</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;IIS URL 재 작성 및 Web.config&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;IIS에 대해 아무것도 이해하지 못하지만 domain.com/page의 모든 방문자를 domain.com/page.html로 리디렉션하는 문제를 해결하려고합니다.&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;configuration&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;system.webServer&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;rewrite&amp;gt;&lt;font&gt;&lt;/font&gt;
          &amp;lt;rewriteMaps&amp;gt;&lt;font&gt;&lt;/font&gt;
              &amp;lt;rewriteMap name=&quot;StaticRedirects&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
                  &amp;lt;add key=&quot;/page&quot; value=&quot;/page.html&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
              &amp;lt;/rewriteMap&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;/rewriteMaps&amp;gt;&lt;font&gt;&lt;/font&gt;
      &amp;lt;/rewrite&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;/system.webServer&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/configuration&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;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;사용자 루트 디렉토리와 htdocs 디렉토리가 있습니다. 둘 다 시도했지만 기쁨은 없었습니다.&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;1) 기존 web.config : rewrite map ..을 선언했지만이를 사용할 규칙을 만들지 않았습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;RewriteMap 자체는 아무것도하지 않습니다.&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;2) 다음은이를 수행 할 수있는 방법입니다 (다시 쓰기 맵을 사용하지 않고 규칙 만 사용하므로 적은 양의 다시 쓰기 / 리디렉션에 적합합니다).&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;이 규칙은에 대한 SINGLE EXACT 재 작성 (내부 리디렉션) &lt;/font&gt;&lt;/font&gt;&lt;code&gt;/page&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;/page.html&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;브라우저의 URL은 변경되지 않습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;system.webServer&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;rewrite&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;rules&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;rule name=&quot;SpecificRewrite&quot; stopProcessing=&quot;true&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;match url=&quot;^page$&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;action type=&quot;Rewrite&quot; url=&quot;/page.html&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;/rule&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/rules&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/rewrite&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/system.webServer&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;이 규칙 # 2는 위와 동일하게 수행되지만 브라우저에서 URL이 변경되는 301 리디렉션 (영구 리디렉션)을 수행합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;system.webServer&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;rewrite&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;rules&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;rule name=&quot;SpecificRedirect&quot; stopProcessing=&quot;true&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;match url=&quot;^page$&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;action type=&quot;Redirect&quot; url=&quot;/page.html&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;/rule&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/rules&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/rewrite&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/system.webServer&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;규칙 # 3은 확장자가 .html 인 파일이있는 경우 모든 URL에 대해 이러한 재 작성을 시도합니다 (즉 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;, 존재 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;/page&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;/page.html&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;&amp;lt;system.webServer&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;rewrite&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;rules&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;rule name=&quot;DynamicRewrite&quot; stopProcessing=&quot;true&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;match url=&quot;(.*)&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;conditions&amp;gt;&lt;font&gt;&lt;/font&gt;
                    &amp;lt;add input=&quot;{REQUEST_FILENAME}\.html&quot; matchType=&quot;IsFile&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;/conditions&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;action type=&quot;Rewrite&quot; url=&quot;/{R:1}.html&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;/rule&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/rules&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/rewrite&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/system.webServer&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;LazyOne의 답변에서 누락 된 한 가지를 지적하고 싶었습니다 (답변 아래에 댓글을 달았지만 충분한 담당자가 없음)&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;영구 리디렉션에 대한 규칙 # 2에는 누락 된 것이 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;redirectType=&quot;Permanent&quot;&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;따라서 규칙 # 2는 다음과 같아야합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;system.webServer&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;rewrite&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;rules&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;rule name=&quot;SpecificRedirect&quot; stopProcessing=&quot;true&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;match url=&quot;^page$&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;action type=&quot;Redirect&quot; url=&quot;/page.html&quot; redirectType=&quot;Permanent&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;/rule&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/rules&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/rewrite&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/system.webServer&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;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;URL 재 작성 모듈 사용 방법에 대한 자세한 내용은 URL 재 &lt;/font&gt;&lt;a href=&quot;http://www.iis.net/learn/extensions/url-rewrite-module/url-rewrite-module-configuration-reference&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.iis.net/learn/extensions/url-rewrite-module/url-rewrite-module-configuration-reference&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;댓글의 @kneidels 질문에 대한 응답으로; &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;URL을 일치 시키려면 : &lt;/font&gt;&lt;/font&gt;&lt;code&gt;topic.php?id=39&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;&amp;lt;system.webServer&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;rewrite&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;rules&amp;gt;&lt;font&gt;&lt;/font&gt;
      &amp;lt;rule name=&quot;SpecificRedirect&quot; stopProcessing=&quot;true&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;match url=&quot;^topic.php$&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;conditions logicalGrouping=&quot;MatchAll&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
          &amp;lt;add input=&quot;{QUERY_STRING}&quot; pattern=&quot;(?:id)=(\d{2})&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/conditions&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;action type=&quot;Redirect&quot; url=&quot;/newpage/{C:1}&quot; appendQueryString=&quot;false&quot; redirectType=&quot;Permanent&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
      &amp;lt;/rule&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/rules&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;/rewrite&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/system.webServer&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;This will match &lt;code&gt;topic.php?id=ab&lt;/code&gt; where &lt;code&gt;a&lt;/code&gt; is any number between &lt;code&gt;0-9&lt;/code&gt; and b is also any number between &lt;code&gt;0-9&lt;/code&gt;. It will then redirect to &lt;code&gt;/newpage/xy&lt;/code&gt; where &lt;code&gt;xy&lt;/code&gt; comes from the original url. I have not tested this but it should work.&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;Just tried this rule, and it worked with GoDaddy hosting since they've already have the Microsoft URL Rewriting module installed for every IIS 7 account.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;rewrite&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;rules&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;rule name=&quot;enquiry&quot; stopProcessing=&quot;true&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
      &amp;lt;match url=&quot;^enquiry$&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
      &amp;lt;action type=&quot;Rewrite&quot; url=&quot;/Enquiry.aspx&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/rule&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;/rules&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/rewrite&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/4410067/iis-url-rewrite-and-web-config&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/4410067/iis-url-rewrite-and-web-config&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2061</guid>
      <comments>https://copycodes.tistory.com/2061#entry2061comment</comments>
      <pubDate>Sun, 10 Jan 2021 17:27:54 +0900</pubDate>
    </item>
    <item>
      <title>MVC 3 Razor에서 활성 페이지 링크를 얻는 더 나은 방법</title>
      <link>https://copycodes.tistory.com/2060</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;MVC 3 Razor에서 활성 페이지 링크를 얻는 더 나은 방법&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;특정 메뉴 링크가 특정 페이지에서 활성화되도록하려면 Razor에서이 접근 방식을 사용하고 있습니다.&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;var active = ViewBag.Active;&lt;font&gt;&lt;/font&gt;
const string ACTIVE_CLASS = &quot;current&quot;;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
if (active == &quot;home&quot;)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    ViewBag.ActiveHome = ACTIVE_CLASS;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
if (active == &quot;products&quot;)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    ViewBag.ActiveProducts = ACTIVE_CLASS;&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;마스터 레이아웃의 html 메뉴 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;ul&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;li class=&quot;@ViewBag.ActiveHome&quot;&amp;gt;&amp;lt;a href=&quot;/&quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;li class=&quot;@ViewBag.ActiveProducts&quot;&amp;gt;&amp;lt;a href=&quot;@Url.Action(&quot;index&quot;, &quot;products&quot;)&quot;&amp;gt;Products&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/ul&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;pre&gt;&lt;code&gt;@{&lt;font&gt;&lt;/font&gt;
    ViewBag.Active = &quot;home&quot;;&lt;font&gt;&lt;/font&gt;
    Layout = &quot;~/Views/Shared/_Layout.cshtml&quot;;&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;더 나은 방법은 HTML 도우미를 사용하는 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;using System.Web.Mvc; &lt;font&gt;&lt;/font&gt;
using System.Web.Mvc.Html;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
public static class MenuExtensions&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    public static MvcHtmlString MenuItem(&lt;font&gt;&lt;/font&gt;
        this HtmlHelper htmlHelper, &lt;font&gt;&lt;/font&gt;
        string text,&lt;font&gt;&lt;/font&gt;
        string action, &lt;font&gt;&lt;/font&gt;
        string controller&lt;font&gt;&lt;/font&gt;
    )&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var li = new TagBuilder(&quot;li&quot;);&lt;font&gt;&lt;/font&gt;
        var routeData = htmlHelper.ViewContext.RouteData;&lt;font&gt;&lt;/font&gt;
        var currentAction = routeData.GetRequiredString(&quot;action&quot;);&lt;font&gt;&lt;/font&gt;
        var currentController = routeData.GetRequiredString(&quot;controller&quot;);&lt;font&gt;&lt;/font&gt;
        if (string.Equals(currentAction, action, StringComparison.OrdinalIgnoreCase) &amp;amp;&amp;amp;&lt;font&gt;&lt;/font&gt;
            string.Equals(currentController, controller, StringComparison.OrdinalIgnoreCase))&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            li.AddCssClass(&quot;active&quot;);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        li.InnerHtml = htmlHelper.ActionLink(text, action, controller).ToHtmlString();&lt;font&gt;&lt;/font&gt;
        return MvcHtmlString.Create(li.ToString());&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;&amp;lt;ul&amp;gt;&lt;font&gt;&lt;/font&gt;
    @Html.MenuItem(&quot;Home&quot;, &quot;Home&quot;, &quot;Home&quot;)&lt;font&gt;&lt;/font&gt;
    @Html.MenuItem(&quot;Products&quot;, &quot;Index&quot;, &quot;Products&quot;)&lt;font&gt;&lt;/font&gt;
&amp;lt;/ul&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;위의 작업을 수행하려면 확장을 인식하는 뷰가 필요합니다. 뷰 폴더의 Web.config에서 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;&amp;lt;add namespace=&quot;yourNamespacehere.Helpers&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 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;active&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;Darin의 예제를 확장하면 도우미의 RouteValues ​​및 HtmlAttributes에 대한 추가 선택적 매개 변수를 추가하는 전체 클래스가 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;실제로 기본 ActionLink처럼 작동합니다.&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.Web.Mvc;&lt;font&gt;&lt;/font&gt;
using System.Web.Mvc.Html;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
namespace MYNAMESPACE.Helpers {&lt;font&gt;&lt;/font&gt;
    public static class MenuExtensions {&lt;font&gt;&lt;/font&gt;
        public static MvcHtmlString MenuItem(this HtmlHelper htmlHelper,&lt;font&gt;&lt;/font&gt;
                                             string text, string action,&lt;font&gt;&lt;/font&gt;
                                             string controller,&lt;font&gt;&lt;/font&gt;
                                             object routeValues = null,&lt;font&gt;&lt;/font&gt;
                                             object htmlAttributes = null) {&lt;font&gt;&lt;/font&gt;
            var li = new TagBuilder(&quot;li&quot;);&lt;font&gt;&lt;/font&gt;
            var routeData = htmlHelper.ViewContext.RouteData;&lt;font&gt;&lt;/font&gt;
            var currentAction = routeData.GetRequiredString(&quot;action&quot;);&lt;font&gt;&lt;/font&gt;
            var currentController = routeData.GetRequiredString(&quot;controller&quot;);&lt;font&gt;&lt;/font&gt;
            if (string.Equals(currentAction,&lt;font&gt;&lt;/font&gt;
                              action,&lt;font&gt;&lt;/font&gt;
                              StringComparison.OrdinalIgnoreCase) &amp;amp;&amp;amp;&lt;font&gt;&lt;/font&gt;
                string.Equals(currentController,&lt;font&gt;&lt;/font&gt;
                              controller,&lt;font&gt;&lt;/font&gt;
                              StringComparison.OrdinalIgnoreCase)) {&lt;font&gt;&lt;/font&gt;
                li.AddCssClass(&quot;active&quot;);&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
            if (routeValues != null) {&lt;font&gt;&lt;/font&gt;
                li.InnerHtml = (htmlAttributes != null)&lt;font&gt;&lt;/font&gt;
                    ? htmlHelper.ActionLink(text,&lt;font&gt;&lt;/font&gt;
                                            action,&lt;font&gt;&lt;/font&gt;
                                            controller,&lt;font&gt;&lt;/font&gt;
                                            routeValues,&lt;font&gt;&lt;/font&gt;
                                            htmlAttributes).ToHtmlString()&lt;font&gt;&lt;/font&gt;
                    : htmlHelper.ActionLink(text, &lt;font&gt;&lt;/font&gt;
                                            action, &lt;font&gt;&lt;/font&gt;
                                            controller, &lt;font&gt;&lt;/font&gt;
                                            routeValues).ToHtmlString();&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
            else {&lt;font&gt;&lt;/font&gt;
                li.InnerHtml = htmlHelper.ActionLink(text, &lt;font&gt;&lt;/font&gt;
                                                     action, &lt;font&gt;&lt;/font&gt;
                                                     controller).ToHtmlString();&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
            return MvcHtmlString.Create(li.ToString());&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;그리고 View 폴더의 web.config에서 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;system.web.webPages.razor&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;host ... /&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;pages ... &amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;namespaces&amp;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;
      &amp;lt;add namespace=&quot;MYNAMESPACE.Helpers&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/namespaces&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;/pages&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/system.web.webPages.razor&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;텍스트에 HTML 형식을 포함하려면이 InnerHtml을 사용하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;li.InnerHtml = &quot;&amp;lt;a href=\&quot;&quot; + new UrlHelper(htmlHelper.ViewContext.RequestContext).Action(action, controller).ToString() + &quot;\&quot;&amp;gt;&quot; + text + &quot;&amp;lt;/a&amp;gt;&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;텍스트는 &quot;&amp;lt;b&amp;gt; 굵게 &amp;lt;/ b&amp;gt; 보통&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;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;RC2 업데이트&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; -MVC6 / Asp.Net 5에서이 작업을 수행하는 방법을 궁금해하는 사람들을 위해 유사하지만 미묘하게 다릅니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 이젠 없다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;MvcHtmlString&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;RouteData&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;IHtmlContent&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;HtmlHelper&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;using System;&lt;font&gt;&lt;/font&gt;
using Microsoft.AspNet.Mvc.Rendering;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
public static class MenuExtensions&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    public static IHtmlContent MenuItem(&lt;font&gt;&lt;/font&gt;
        this IHtmlHelper htmlHelper,&lt;font&gt;&lt;/font&gt;
        string text,&lt;font&gt;&lt;/font&gt;
        string action,&lt;font&gt;&lt;/font&gt;
        string controller&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 li = new TagBuilder(&quot;li&quot;) { TagRenderMode = TagRenderMode.Normal };&lt;font&gt;&lt;/font&gt;
        var routeData = htmlHelper.ViewContext.RouteData;&lt;font&gt;&lt;/font&gt;
        var currentAction = routeData.Values[&quot;action&quot;].ToString();&lt;font&gt;&lt;/font&gt;
        var currentController = routeData.Values[&quot;controller&quot;].ToString();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (string.Equals(currentAction, action, StringComparison.OrdinalIgnoreCase) &amp;amp;&amp;amp;&lt;font&gt;&lt;/font&gt;
            string.Equals(currentController, controller, StringComparison.OrdinalIgnoreCase))&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            li.AddCssClass(&quot;active&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;
        li.InnerHtml.AppendHtml(htmlHelper.ActionLink(text, action, controller));&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        return li;&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;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;This code worked great for me, even on a new Visual Studio 2013 MVC5/Bootstrap project. Note also that you could change the li.AddCssClass(&quot;active&quot;); line to point to a custom class if you want to leave the Bootstrap &quot;active&quot; class alone. I added one called &quot;activemenu&quot; in the project's Site.css file and did any specific navbar styling changes I wanted there.&lt;/p&gt; 
&lt;p&gt;The line in the code above was just changed to this to get it all working:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;li.AddCssClass(&quot;activemenu&quot;);
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;In Site.css I added a simple class for my purpose:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;.activemenu {&lt;font&gt;&lt;/font&gt;
    text-decoration: underline;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Alternatively you could change the background color and/or border, 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;here is an extention on Darin's class to insert html in the link text rather than a simple text&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;using System;&lt;font&gt;&lt;/font&gt;
using System.Web.Mvc;&lt;font&gt;&lt;/font&gt;
using System.Web.Mvc.Html;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
namespace YourNameSpaceHere&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    public static class MenuExtensions&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        public static MvcHtmlString MenuItem(&lt;font&gt;&lt;/font&gt;
            this HtmlHelper htmlHelper,&lt;font&gt;&lt;/font&gt;
            string html,&lt;font&gt;&lt;/font&gt;
            string action,&lt;font&gt;&lt;/font&gt;
            string controller&lt;font&gt;&lt;/font&gt;
        )&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            var li = new TagBuilder(&quot;li&quot;);&lt;font&gt;&lt;/font&gt;
            var routeData = htmlHelper.ViewContext.RouteData;&lt;font&gt;&lt;/font&gt;
            var currentAction = routeData.GetRequiredString(&quot;action&quot;);&lt;font&gt;&lt;/font&gt;
            var currentController = routeData.GetRequiredString(&quot;controller&quot;);&lt;font&gt;&lt;/font&gt;
            if (string.Equals(currentAction, action, StringComparison.OrdinalIgnoreCase) &amp;amp;&amp;amp;&lt;font&gt;&lt;/font&gt;
                string.Equals(currentController, controller, StringComparison.OrdinalIgnoreCase))&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                li.AddCssClass(&quot;active&quot;);&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
            //generate a unique id for the holder and convert it to string&lt;font&gt;&lt;/font&gt;
            string holder = Guid.NewGuid().ToString();&lt;font&gt;&lt;/font&gt;
            string anchor = htmlHelper.ActionLink(holder, action, controller).ToHtmlString();&lt;font&gt;&lt;/font&gt;
            //replace the holder string with the html&lt;font&gt;&lt;/font&gt;
            li.InnerHtml = anchor.Replace(holder, html);&lt;font&gt;&lt;/font&gt;
            return MvcHtmlString.Create(li.ToString());&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;and use it like this:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;ul&amp;gt;&lt;font&gt;&lt;/font&gt;
    @Html.MenuItem(&quot;&amp;lt;span class'ClassName'&amp;gt;Home&amp;lt;/span&amp;gt;&quot;, &quot;Home&quot;, &quot;Home&quot;)&lt;font&gt;&lt;/font&gt;
&amp;lt;/ul&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/6323021/better-way-to-get-active-page-link-in-mvc-3-razor&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/6323021/better-way-to-get-active-page-link-in-mvc-3-razor&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2060</guid>
      <comments>https://copycodes.tistory.com/2060#entry2060comment</comments>
      <pubDate>Sun, 10 Jan 2021 17:27:45 +0900</pubDate>
    </item>
    <item>
      <title>다음 json 문자열을 Java 객체로 변환하는 방법은 무엇입니까?</title>
      <link>https://copycodes.tistory.com/2059</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음 json 문자열을 Java 객체로 변환하는 방법은 무엇입니까?&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;다음 JSON 문자열을 Java 개체로 변환하고 싶습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;String jsonString = &quot;{&lt;font&gt;&lt;/font&gt;
&quot;libraryname&quot;:&quot;My Library&quot;,&lt;font&gt;&lt;/font&gt;
&quot;mymusic&quot;:[{&quot;Artist Name&quot;:&quot;Aaron&quot;,&quot;Song Name&quot;:&quot;Beautiful&quot;},&lt;font&gt;&lt;/font&gt;
{&quot;Artist Name&quot;:&quot;Britney&quot;,&quot;Song Name&quot;:&quot;Oops I did It Again&quot;},&lt;font&gt;&lt;/font&gt;
{&quot;Artist Name&quot;:&quot;Britney&quot;,&quot;Song Name&quot;:&quot;Stronger&quot;}]}&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;(e.g. MyJsonObject myobj = new MyJsonObject(jsonString)&lt;font&gt;&lt;/font&gt;
myobj.mymusic[0].id would give me the ID, myobj.libraryname gives me &quot;My Library&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;잭슨에 대해 들어 봤지만 &quot;mymusic&quot;목록이 포함되어 있기 때문에 키 값 쌍이 아니기 때문에 내가 가지고있는 json 문자열에 맞게 사용하는 방법을 잘 모르겠습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Jackson과 함께 이것을 어떻게 수행 할 수 있습니까? 아니면 Jackson이 최선이 아닌 경우이를 수행 할 수있는 더 쉬운 방법이 있습니까?&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;이를 위해 GSON과 함께 갈 필요가 없습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Jackson은 일반지도 / 목록 중 하나를 수행 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;ObjectMapper mapper = new ObjectMapper();&lt;font&gt;&lt;/font&gt;
Map&amp;lt;String,Object&amp;gt; map = mapper.readValue(json, Map.class);&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;또는 더 편리한 JSON 트리 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;JsonNode rootNode = mapper.readTree(json);
&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;그건 그렇고, 실제로 Java 클래스를 생성하고 더 편리하게 수행 (IMO) 할 수없는 이유는 없습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public class Library {&lt;font&gt;&lt;/font&gt;
  @JsonProperty(&quot;libraryname&quot;)&lt;font&gt;&lt;/font&gt;
  public String name;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  @JsonProperty(&quot;mymusic&quot;)&lt;font&gt;&lt;/font&gt;
  public List&amp;lt;Song&amp;gt; songs;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
public class Song {&lt;font&gt;&lt;/font&gt;
  @JsonProperty(&quot;Artist Name&quot;) public String artistName;&lt;font&gt;&lt;/font&gt;
  @JsonProperty(&quot;Song Name&quot;) public String songName;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
Library lib = mapper.readValue(jsonString, Library.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;Google의 Gson 확인 : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://code.google.com/p/google-gson/&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://code.google.com/p/google-gson/&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;Gson gson = new Gson(); // Or use new GsonBuilder().create();&lt;font&gt;&lt;/font&gt;
MyType target2 = gson.fromJson(json, MyType.class); // deserializes json into target2&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;json 문자열의 모든 필드로 MyType 클래스 (물론 이름이 변경됨)를 만들어야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;배열을 수행 할 때 조금 더 복잡해질 수 있습니다. 모든 구문 분석을 수동으로 (또한 매우 쉽습니다) 선호하는 경우 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.json.org/&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://www.json.org/를&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;하고 Json 용 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;pre&gt;&lt;code&gt;Gson gson = new Gson();&lt;font&gt;&lt;/font&gt;
JsonParser parser = new JsonParser();&lt;font&gt;&lt;/font&gt;
JsonObject object = (JsonObject) parser.parse(response);// response will be the json String&lt;font&gt;&lt;/font&gt;
YourPojo emp = gson.fromJson(object, YourPojo.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;Gson도 좋습니다 : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://code.google.com/p/google-gson/&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://code.google.com/p/google-gson/&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;&quot;Gson은 Java 객체를 JSON 표현으로 변환하는 데 사용할 수있는 Java 라이브러리입니다. 또한 JSON 문자열을 동등한 Java 객체로 변환하는 데 사용할 수 있습니다. Gson은 기존 객체를 포함하여 임의의 Java 객체와 함께 작업 할 수 있습니다. 소스 코드가 없습니다. &quot;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;Check the API examples: &lt;a href=&quot;https://sites.google.com/site/gson/gson-user-guide#TOC-Overview&quot; rel=&quot;nofollow&quot;&gt;https://sites.google.com/site/gson/gson-user-guide#TOC-Overview&lt;/a&gt; More examples: &lt;a href=&quot;http://www.mkyong.com/java/how-do-convert-java-object-to-from-json-format-gson-api/&quot; rel=&quot;nofollow&quot;&gt;http://www.mkyong.com/java/how-do-convert-java-object-to-from-json-format-gson-api/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/10308452/how-to-convert-the-following-json-string-to-java-object&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/10308452/how-to-convert-the-following-json-string-to-java-object&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2059</guid>
      <comments>https://copycodes.tistory.com/2059#entry2059comment</comments>
      <pubDate>Sun, 10 Jan 2021 17:27:33 +0900</pubDate>
    </item>
    <item>
      <title>HTML5 UI 프레임 워크</title>
      <link>https://copycodes.tistory.com/2058</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;HTML5 UI 프레임 워크&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;다음과 같은 많은 HTML5 UI 프레임 워크를 찾았습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href=&quot;http://www.kendoui.com/&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;a href=&quot;http://wijmo.com/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Wijmo&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;http://www.jqwidgets.com/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;jqWidgets&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;http://zebra.gravitysoft.org/&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;a href=&quot;http://www.sencha.com/products/touch/&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;a href=&quot;http://sproutcore.com/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;SproutCore&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;http://yuilibrary.com/&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;a href=&quot;http://xuijs.com/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;XUI&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;http://www.shieldui.com&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Shield UI&lt;/font&gt;&lt;/font&gt;&lt;/a&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;&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;웹 앱 개발 및 클라이언트 측 JS UI 프레임 워크의 초보자 &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;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 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;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;정말로 Gmail 또는 Grooveshark와 같은 응용 프로그램을 의미 했습니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;아니면 Stackoverflow와 같은 것을 의미 했습니까? 전혀 간단하지는 않지만 여전히 웹 사이트입니다. &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;내 말은, 당신이 좋아하는 Java / PHP / Ruby를 사용하고 자바 스크립트로 많은 앱의 로직과 동작을 작성하고 싶지 않다는 뜻입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 경우 jQuery 기반 플러그인 유사 솔루션, 특히 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://jqueryui.com/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;jQuery UI&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://jquerymobile.com/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;jQuery Mobile&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;jQuery 위젯은 플러그인 시스템을 따릅니다. &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;$('#myButton').button();
&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;$('#myButton').button('disable');
&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;$('#mySlider').slider('value');&lt;font&gt;&lt;/font&gt;
$('#mySlider').slider('value', 42);&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 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;그건 그렇고, 이것이 jQuery UI 팀이 아직 그리드 컨트롤을 제공하지 않은 이유입니다. 모델 없이는 할 수 없습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;jQuery Mobile에서는 간단한 마크 업을 통해 멋진 모바일 UI를 얻을 수 있지만 페이지간에 데이터를 전달하는 공식적인 방법은 없습니다.&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;요약 : 다중 페이지 웹 사이트가있는 경우 양식을 게시하는 경우 jQuery UI 또는 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://twitter.github.com/bootstrap/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Twitter Bootstrap&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 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;모델, 데이터 바인딩 및 웹 앱을 만드는 다른 수단을 제공하는 많은 JavaScript 프레임 워크 중 하나를 사용하여 jQuery UI와 통합 할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또는 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.kendoui.com/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Kendo&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://wijmo.com/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Wijmo&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.jqwidgets.com&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;jqWidgets&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;이러한 프레임 워크는 jQuery (Wijmo는 jQuery UI에 의존)에 의존하고 데이터 조작의 추가 수단을 제공합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그들은 데이터 모델을 가지고 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Kendo는 자체 솔루션을 구현하고 (내 생각에는) Wijmo와 jqWidgets는 인기있는 Knockout 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;따라서 Kendo와 Wijmo는 위젯 / 컨트롤과 일부 지원 모델을 모두 제공하는 프레임 워크 그룹에 속합니다. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://dojotoolkit.org/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Dojo Toolkit&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; 과 같이 jQuery 기반이 아닌 다른 프레임 워크도 &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 style=&quot;vertical-align: inherit;&quot;&gt;RESTful 방식으로 서버와 통신하는 단일 페이지 앱을 빌드하려고하면 애플리케이션에 아키텍처가없는 경우 곧 엉망이 될 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이를 위해 일반적으로 필요한 기능은 일부 우려 분리 (MVC, MVVM), 템플릿, 라우팅 및 모듈 관리입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;곳이다 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://sproutcore.com/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;SproutCore를&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.sencha.com/&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;It may seem like SproutCore and Sencha are the winners here, because they are the most complete solutions that include both UI and the business logics and also structure your application. Despite all the pros, there are some cons. Some say they are too heavyweight or will require to adhere to their development model, which you might not like. For example, in Sencha you describe your GUI in JavaScript and use Sencha's type system. This adds a sort of heavy feeling that there are abstractions and wrappers, while you really like the ease of HTML, CSS and vanilla JavaScript.&lt;/p&gt; 
&lt;p&gt;But this is not the only way. The power of web is that there are many-many frameworks, libraries, tools out there, &lt;a href=&quot;http://microjs.com/&quot; rel=&quot;noreferrer&quot;&gt;smaller&lt;/a&gt; and bigger ones, that will help you craft your app the way you like it. For example, consider &lt;a href=&quot;http://angularjs.org/&quot; rel=&quot;noreferrer&quot;&gt;AngularJS&lt;/a&gt;. It doesn't provide a set of controls itself, but combined with Twitter Bootstrap becomes a complete solution for RIA. Or, for example, look at &lt;a href=&quot;http://emberjs.com/&quot; rel=&quot;noreferrer&quot;&gt;EmberJS&lt;/a&gt;, a more lightweight framework from the guy who created the heavyweight SproutCore. It doesn't provide you with a set of widgets either, but is, in my opinion, a very good base for an app.&lt;/p&gt; 
&lt;p&gt;So here is my final thought instead of conclusion. All those framework usually show you their widget set, nicely looking themes and the other visual stuff. But what really matters is how you will actually develop you application, how you will structure it, where you will implement your logic. Get to know what the framework provides and think through whether you can substitute what's missing.&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;Infeligo's answer is top notch. My experience may be of interest to some. I use Ruby on Rails as my server platform where the bulk of my business logic resides.&lt;/p&gt; 
&lt;p&gt;At the front end I use dHTMLX which is a JS library of 'objects' the most powerful of which is their grid object. Most of my apps have business/accounting information processing/display requirements and the grid object is my mainstay there. However their object set is comprehensive including the ability to create additional 'windows' within the single application to provide a MDI type interface to the end user. I typically have a login form which when successfully applied opens a single HTML page with a menu at the top. Based on selection from the menu new windows are opened and closed to display / manipulate information. These windows are within the scope of the single HTML page.&lt;/p&gt; 
&lt;p&gt;All the objects have very good events associated with them and I do quite a bit of validation at the front end using these events. However I usually duplicate all validation of data within the Rails Model as well. It's additional work but I'm just extra cautious. There are also a number of abstract objects that help to connect data between the front end visual objects e.g. grid and back end server. Most of the data connections can be done using XML or JSON. I use XML over JSON simply because of my experience with that structure and the fact that Rails provides a decent XML builder. So in my case I rarely use any Rails based views as all of my visual objects come from dHTMLX.&lt;/p&gt; 
&lt;p&gt;The other thing I like about dHTMLX is the speed of their objects. For example the grid object will quite easily handle 10,000+ rows at very acceptable speeds.&lt;/p&gt; 
&lt;p&gt;The BIG DOWNSIDE of the suite is it's documentation. The company is an eastern European developer and therefore it is often difficult to understand exactly what their documentation means. Also their documentation tends not to document everything completely and so a lot of time is wasted in trial and error type learning.&lt;/p&gt; 
&lt;p&gt;Hope this helps&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/12961536/html5-ui-frameworks&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/12961536/html5-ui-frameworks&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2058</guid>
      <comments>https://copycodes.tistory.com/2058#entry2058comment</comments>
      <pubDate>Sun, 10 Jan 2021 17:27:25 +0900</pubDate>
    </item>
    <item>
      <title>요청 객체를 수정하는 django</title>
      <link>https://copycodes.tistory.com/2057</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;요청 객체를 수정하는 django&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;이미 django 프로젝트가 있으며 다음과 같이 논리적입니다.&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 : URL? username = name &amp;amp; pwd = passwd&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;def func(request):&lt;font&gt;&lt;/font&gt;
   dic = request.GET&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
   username = dic.get(&quot;username&quot;)&lt;font&gt;&lt;/font&gt;
   pwd = dic.get(&quot;pwd&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;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;url : URL? crypt = XXXXXXXXXX (XXXXXXXX는 &quot;username = name &amp;amp; pwd = passwd&quot;에 대해 암호화 된 str입니다)&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;하지만 이제는 모든 뷰 기능을 수정하지 못하도록 django 미들웨어에서 해독을 원합니다.&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;하지만 request.GET을 수정하면 &quot;This QueryDict instance is immutable&quot;오류 메시지가 나타납니다. &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;a href=&quot;https://docs.djangoproject.com/en/dev/ref/request-response/#querydict-objects&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;django.http.QueryDict&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;request.GET&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;request.POST&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;QueryDict&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;pre&gt;&lt;code&gt;request.GET = request.GET.copy()
&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;QueryDict&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;&amp;gt;&amp;gt;&amp;gt; from django.test.client import RequestFactory&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; request = RequestFactory().get('/')&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; request.GET&lt;font&gt;&lt;/font&gt;
&amp;lt;QueryDict: {}&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; request.GET['foo'] = 'bar'&lt;font&gt;&lt;/font&gt;
AttributeError: This QueryDict instance is immutable&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; request.GET = request.GET.copy()&lt;font&gt;&lt;/font&gt;
&amp;lt;QueryDict: {}&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; request.GET['foo'] = 'bar'&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; request.GET&lt;font&gt;&lt;/font&gt;
&amp;lt;QueryDict: {'foo': 'bar'}&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;QueryDict&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;request&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 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;if not request.GET._mutable:&lt;font&gt;&lt;/font&gt;
   request.GET._mutable = True&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
# now you can spoil it&lt;font&gt;&lt;/font&gt;
request.GET['pwd'] = 'iloveyou'&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;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Django 승인 방식은 &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;request.GET.copy ()&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&gt;&lt;a href=&quot;https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.QueryDict&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;blockquote&gt; 
 &lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;request.POST 및 request.GET의 QueryDict는 일반 요청 / 응답주기에서 액세스 할 때 변경되지 않습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;변경 가능한 버전을 얻으려면 QueryDict.copy ()를 사용해야합니다.&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;향후 Django 버전이 &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;_mutable&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;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;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;copy ()&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;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;GET을 사용하여 사용자 이름과 암호를 보내서는 안됩니다. 이는 URL 표시 줄에 정보를 표시하고 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://security.stackexchange.com/questions/12531/ssl-with-get-and-post&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;대신 POST를 사용하십시오. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또한 사용자를 인증하려고 시도하고 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://docs.djangoproject.com/en/1.5/topics/auth/default/#django.contrib.auth.login&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;pre&gt;&lt;code&gt;from django.contrib.auth import authenticate, login&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
def my_view(request):&lt;font&gt;&lt;/font&gt;
    username = request.POST['username']&lt;font&gt;&lt;/font&gt;
    password = request.POST['password']&lt;font&gt;&lt;/font&gt;
    user = authenticate(username=username, password=password)&lt;font&gt;&lt;/font&gt;
    if user is not None:&lt;font&gt;&lt;/font&gt;
        if user.is_active:&lt;font&gt;&lt;/font&gt;
            login(request, user)&lt;font&gt;&lt;/font&gt;
            # Redirect to a success page.&lt;font&gt;&lt;/font&gt;
        else:&lt;font&gt;&lt;/font&gt;
            # Return a 'disabled account' error message&lt;font&gt;&lt;/font&gt;
    else:&lt;font&gt;&lt;/font&gt;
        # Return an 'invalid login' error message.&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;a href=&quot;https://docs.djangoproject.com/en/1.5/topics/auth/default/#django.contrib.auth.decorators.login_required&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;login_required 데코레이터를&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;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/18930234/django-modifying-the-request-object&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/18930234/django-modifying-the-request-object&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2057</guid>
      <comments>https://copycodes.tistory.com/2057#entry2057comment</comments>
      <pubDate>Sun, 10 Jan 2021 17:27:16 +0900</pubDate>
    </item>
    <item>
      <title>selectize.js 입력 값을 설정하는 방법은 무엇입니까?</title>
      <link>https://copycodes.tistory.com/2056</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;selectize.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 style=&quot;vertical-align: inherit;&quot;&gt;양식 입력은 selectize.js 플러그인을 사용하고 있습니다. &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;$(&quot;#my_input&quot;).val(&quot;My Default Value&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;var $select = $(&quot;#my_input&quot;).selectize();&lt;font&gt;&lt;/font&gt;
var selectize = $select[0].selectize;&lt;font&gt;&lt;/font&gt;
selectize.setValue(&quot;My Default Value&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;/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;strong&gt;&lt;a href=&quot;https://github.com/brianreavis/selectize.js/blob/master/docs/api.md&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;API 문서&lt;/font&gt;&lt;/a&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 확인&lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/brianreavis/selectize.js/blob/master/docs/api.md&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/a&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;addOption(data)&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;setValue(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;hr&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;blockquote&gt; 
 &lt;p&gt;&lt;strong&gt;&lt;code&gt;setValue(value, silent)&lt;/code&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;br&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;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;silent&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; &quot;가 사실이면 (예 : &lt;/font&gt;&lt;/font&gt;&lt;code&gt;true&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;/p&gt; 
 &lt;p&gt;&lt;strong&gt;&lt;code&gt;addOption(data)&lt;/code&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 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;code&gt;refreshOptions()&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;/blockquote&gt; 
&lt;hr&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;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 style=&quot;vertical-align: inherit;&quot;&gt;요소를 다시 만들지 않으려면 selectize 개체를 변수에 저장하면됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;// 1. Only set the below variables once (ideally)&lt;font&gt;&lt;/font&gt;
var $select = $('select').selectize(options);  // This initializes the selectize control&lt;font&gt;&lt;/font&gt;
var selectize = $select[0].selectize; // This stores the selectize object to a variable (with name 'selectize')&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// 2. Access the selectize object with methods later, for ex:&lt;font&gt;&lt;/font&gt;
selectize.addOption(data);&lt;font&gt;&lt;/font&gt;
selectize.setValue('something', false);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Side note:&lt;font&gt;&lt;/font&gt;
// You can set a variable to the previous options with&lt;font&gt;&lt;/font&gt;
var old_options = selectize.settings;&lt;font&gt;&lt;/font&gt;
// If you intend on calling $('select').selectize(old_options) or something&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;var $select = $(&quot;#my_input&quot;).selectize();&lt;font&gt;&lt;/font&gt;
var selectize = $select[0].selectize;&lt;font&gt;&lt;/font&gt;
selectize.setValue(selectize.search(&quot;My Default Value&quot;).items[0].id);&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;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&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$('select').each(function (idx) {&lt;font&gt;&lt;/font&gt;
    var selectizeInput = $(this).selectize(options);&lt;font&gt;&lt;/font&gt;
    $(this).data('selectize', selectizeInput[0].selectize);&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;var selectElement = $('#unique_selector').eq(0);&lt;font&gt;&lt;/font&gt;
var selectize = selectElement.data('selectize');&lt;font&gt;&lt;/font&gt;
if (!!selectize) selectize.setValue(&quot;My Default Value&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;사용자 'onlyblank'의 답변이 맞습니다. &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를 setValue ()에 전달하는 대신 배열을 전달하십시오. &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 $select = $(&quot;#my_input&quot;).selectize();&lt;font&gt;&lt;/font&gt;
var selectize = $select[0].selectize;&lt;font&gt;&lt;/font&gt;
var yourDefaultIds = [1,2]; # find the ids using search as shown by the user onlyblank&lt;font&gt;&lt;/font&gt;
selectize.setValue(defaultValueIds);&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;$('#myInput').selectize({&lt;font&gt;&lt;/font&gt;
valueField: 'id',&lt;font&gt;&lt;/font&gt;
labelField: 'name',&lt;font&gt;&lt;/font&gt;
searchField: 'name',&lt;font&gt;&lt;/font&gt;
options: [],&lt;font&gt;&lt;/font&gt;
delimiter: ',',&lt;font&gt;&lt;/font&gt;
persist: false,&lt;font&gt;&lt;/font&gt;
create: false,&lt;font&gt;&lt;/font&gt;
load: function(query, callback) {&lt;font&gt;&lt;/font&gt;
    if (!query.length) return callback();&lt;font&gt;&lt;/font&gt;
    $.ajax({&lt;font&gt;&lt;/font&gt;
        url: '/api/all_cities.php',&lt;font&gt;&lt;/font&gt;
        type: 'GET',&lt;font&gt;&lt;/font&gt;
        dataType: 'json',&lt;font&gt;&lt;/font&gt;
        data: {&lt;font&gt;&lt;/font&gt;
            name: query,&lt;font&gt;&lt;/font&gt;
        },&lt;font&gt;&lt;/font&gt;
        error: function() {&lt;font&gt;&lt;/font&gt;
            callback();&lt;font&gt;&lt;/font&gt;
        },&lt;font&gt;&lt;/font&gt;
        success: function(res) {&lt;font&gt;&lt;/font&gt;
            callback(res);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    });&lt;font&gt;&lt;/font&gt;
},&lt;font&gt;&lt;/font&gt;
onInitialize: function(){&lt;font&gt;&lt;/font&gt;
    var selectize = this;&lt;font&gt;&lt;/font&gt;
    $.get(&quot;/api/selected_cities.php&quot;, function( data ) {&lt;font&gt;&lt;/font&gt;
        selectize.addOption(data); // This is will add to option&lt;font&gt;&lt;/font&gt;
        var selected_items = [];&lt;font&gt;&lt;/font&gt;
        $.each(data, function( i, obj) {&lt;font&gt;&lt;/font&gt;
            selected_items.push(obj.id);&lt;font&gt;&lt;/font&gt;
        });&lt;font&gt;&lt;/font&gt;
        selectize.setValue(selected_items); //this will set option values as default&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;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;setValue&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; 는 값이 동적 일 수있는 컨트롤 (예 : 사용자가 즉석에서 값을 추가 할 수 있음, 텍스트 상자 필드)에 대해 selectize 컨트롤 (예 : select field)에 대해 미리 정의 된 값 집합이 이미있는 경우에만 작동합니다. &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;setValue&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; ai n't gonna 작업.&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;selectize 필드의 현재 값을 추가하고 설정하는 대신 &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;createItem 기능을&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;/p&gt; 
&lt;pre&gt;&lt;code&gt;$selectize[ 0 ].selectize.clear(); // Clear existing entries&lt;font&gt;&lt;/font&gt;
for ( var i = 0 ; i &amp;lt; data_source.length ; i++ ) // data_source is a dynamic source of data&lt;font&gt;&lt;/font&gt;
    $selectize[ 0 ].selectize.createItem( data_source[ i ] , false ); // false means don't trigger dropdown&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;selectize.addOption({text: &quot;My Default Value&quot;, value: &quot;My Default Value&quot;});&lt;font&gt;&lt;/font&gt;
selectize.setValue(&quot;My Default Value&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;I was having this same issue - I am using Selectize with Rails and wanted to Selectize an association field - I wanted the name of the associated record to show up in the dropdown, but I needed the value of each option to be the id of the record, since Rails uses the &lt;code&gt;value&lt;/code&gt; to set associations.&lt;/p&gt; 
&lt;p&gt;I solved this by setting a coffeescript var of &lt;code&gt;@valueAttr&lt;/code&gt; to the &lt;code&gt;id&lt;/code&gt; of each object and a var of &lt;code&gt;@dataAttr&lt;/code&gt; to the &lt;code&gt;name&lt;/code&gt; of the record. Then I went through each option and set:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; opts.labelField = @dataAttr&lt;font&gt;&lt;/font&gt;
 opts.valueField = @valueAttr&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;It helps to see the full diff: &lt;a href=&quot;https://github.com/18F/C2/pull/912/files&quot; rel=&quot;nofollow&quot;&gt;https://github.com/18F/C2/pull/912/files&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;A simplified answer:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$('#my_input').data('selectize').setValue(&quot;Option Value Here&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 had a similar problem. My data is provided by a remote server. I want some value to be entered in the selectize box, but it is not sure in advance whether this value is a valid one on the server. &lt;/p&gt; 
&lt;p&gt;So I want the value to be entered in the box, and I want selectize to show the possible options just if like the user had entered the value.&lt;/p&gt; 
&lt;p&gt;I ended up using this hack (which it is probably unsupported):&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;var $selectize = $(&quot;#my_input&quot;).selectize(/* settings with load*/);&lt;font&gt;&lt;/font&gt;
var selectize = $select[0].selectize;&lt;font&gt;&lt;/font&gt;
// get the search from the remote server&lt;font&gt;&lt;/font&gt;
selectize.onSearchChange('my value');&lt;font&gt;&lt;/font&gt;
// enter the input in the input field&lt;font&gt;&lt;/font&gt;
$selectize.parent().find('input').val('my value');&lt;font&gt;&lt;/font&gt;
// focus on the input field, to make the options visible&lt;font&gt;&lt;/font&gt;
$selectize.parent().find('input').focus();&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;First load select dropdown and then selectize it. It will work with normal $(select).val(). &lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/21962124/how-to-set-a-value-for-a-selectize-js-input&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/21962124/how-to-set-a-value-for-a-selectize-js-input&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2056</guid>
      <comments>https://copycodes.tistory.com/2056#entry2056comment</comments>
      <pubDate>Sun, 10 Jan 2021 17:27:08 +0900</pubDate>
    </item>
    <item>
      <title>GET 요청을 수행하고 Querystring을 작성하십시오.</title>
      <link>https://copycodes.tistory.com/2055</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;GET 요청을 수행하고 Querystring을 작성하십시오.&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;나는 Go를 처음 접했고 아직 모든 것을 이해하지 못합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;많은 최신 언어 Node.js, Angular, jQuery, PHP에서 추가 쿼리 문자열 매개 변수를 사용하여 GET 요청을 수행 할 수 있습니다.&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;Go에서이 작업을 수행하는 것은 겉으로보기에 그리 간단하지 않으며, 아직 파악할 수 없습니다. &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;package main&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
import (&lt;font&gt;&lt;/font&gt;
    &quot;fmt&quot;&lt;font&gt;&lt;/font&gt;
    &quot;io/ioutil&quot;&lt;font&gt;&lt;/font&gt;
    &quot;net/http&quot;&lt;font&gt;&lt;/font&gt;
)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
func main() {&lt;font&gt;&lt;/font&gt;
    client := &amp;amp;http.Client{}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    req, _ := http.NewRequest(&quot;GET&quot;, &quot;http://api.themoviedb.org/3/tv/popular&quot;, nil)&lt;font&gt;&lt;/font&gt;
    req.Header.Add(&quot;Accept&quot;, &quot;application/json&quot;)&lt;font&gt;&lt;/font&gt;
    resp, err := client.Do(req)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    if err != nil {&lt;font&gt;&lt;/font&gt;
        fmt.Println(&quot;Errored when sending request to the server&quot;)&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;
    defer resp.Body.Close()&lt;font&gt;&lt;/font&gt;
    resp_body, _ := ioutil.ReadAll(resp.Body)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    fmt.Println(resp.Status)&lt;font&gt;&lt;/font&gt;
    fmt.Println(string(resp_body))&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;이 예에서는 api 키를 값으로 사용하는 api_key의 GET 변수가 필요한 URL이 있음을 알 수 있습니다. &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;req, _ := http.NewRequest(&quot;GET&quot;, &quot;http://api.themoviedb.org/3/tv/popular?api_key=mySuperAwesomeApiKey&quot;, nil)
&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;현재 유효한 응답을 얻으려면이 단계 전에 URL을 조합해야합니다.&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;Values&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;net/url&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;Encode&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;req.URL.Query()&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;url.Values&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;package main&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
import (&lt;font&gt;&lt;/font&gt;
    &quot;fmt&quot;&lt;font&gt;&lt;/font&gt;
    &quot;log&quot;&lt;font&gt;&lt;/font&gt;
    &quot;net/http&quot;&lt;font&gt;&lt;/font&gt;
    &quot;os&quot;&lt;font&gt;&lt;/font&gt;
)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
func main() {&lt;font&gt;&lt;/font&gt;
    req, err := http.NewRequest(&quot;GET&quot;, &quot;http://api.themoviedb.org/3/tv/popular&quot;, nil)&lt;font&gt;&lt;/font&gt;
    if err != nil {&lt;font&gt;&lt;/font&gt;
        log.Print(err)&lt;font&gt;&lt;/font&gt;
        os.Exit(1)&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    q := req.URL.Query()&lt;font&gt;&lt;/font&gt;
    q.Add(&quot;api_key&quot;, &quot;key_from_environment_or_flag&quot;)&lt;font&gt;&lt;/font&gt;
    q.Add(&quot;another_thing&quot;, &quot;foo &amp;amp; bar&quot;)&lt;font&gt;&lt;/font&gt;
    req.URL.RawQuery = q.Encode()&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    fmt.Println(req.URL.String())&lt;font&gt;&lt;/font&gt;
    // Output:&lt;font&gt;&lt;/font&gt;
    // http://api.themoviedb.org/3/tv/popular?another_thing=foo+%26+bar&amp;amp;api_key=key_from_environment_or_flag&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://play.golang.org/p/L5XCrw9VIG&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://play.golang.org/p/L5XCrw9VIG&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&gt;&lt;code&gt;r.URL.Query()&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;url.Values&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;package main&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
import (&lt;font&gt;&lt;/font&gt;
    &quot;fmt&quot;&lt;font&gt;&lt;/font&gt;
    &quot;log&quot;&lt;font&gt;&lt;/font&gt;
    &quot;net/http&quot;&lt;font&gt;&lt;/font&gt;
    &quot;net/url&quot;&lt;font&gt;&lt;/font&gt;
    &quot;os&quot;&lt;font&gt;&lt;/font&gt;
)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
func main() {&lt;font&gt;&lt;/font&gt;
    req, err := http.NewRequest(&quot;GET&quot;,&quot;http://api.themoviedb.org/3/tv/popular&quot;, nil)&lt;font&gt;&lt;/font&gt;
    if err != nil {&lt;font&gt;&lt;/font&gt;
        log.Print(err)&lt;font&gt;&lt;/font&gt;
        os.Exit(1)&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    // if you appending to existing query this works fine &lt;font&gt;&lt;/font&gt;
    q := req.URL.Query()&lt;font&gt;&lt;/font&gt;
    q.Add(&quot;api_key&quot;, &quot;key_from_environment_or_flag&quot;)&lt;font&gt;&lt;/font&gt;
    q.Add(&quot;another_thing&quot;, &quot;foo &amp;amp; bar&quot;)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    // or you can create new url.Values struct and encode that like so&lt;font&gt;&lt;/font&gt;
    q := url.Values{}&lt;font&gt;&lt;/font&gt;
    q.Add(&quot;api_key&quot;, &quot;key_from_environment_or_flag&quot;)&lt;font&gt;&lt;/font&gt;
    q.Add(&quot;another_thing&quot;, &quot;foo &amp;amp; bar&quot;)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    req.URL.RawQuery = q.Encode()&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    fmt.Println(req.URL.String())&lt;font&gt;&lt;/font&gt;
    // Output:&lt;font&gt;&lt;/font&gt;
    // http://api.themoviedb.org/3/tv/popularanother_thing=foo+%26+bar&amp;amp;api_key=key_from_environment_or_flag&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;NewRequest&lt;/code&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;code&gt;net/url&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;package main&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
import (&lt;font&gt;&lt;/font&gt;
    &quot;fmt&quot;&lt;font&gt;&lt;/font&gt;
    &quot;net/url&quot;&lt;font&gt;&lt;/font&gt;
)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
func main() {&lt;font&gt;&lt;/font&gt;
    base, err := url.Parse(&quot;http://www.example.com&quot;)&lt;font&gt;&lt;/font&gt;
    if err != nil {&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;
    // Path params&lt;font&gt;&lt;/font&gt;
    base.Path += &quot;this will get automatically encoded&quot;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    // Query params&lt;font&gt;&lt;/font&gt;
    params := url.Values{}&lt;font&gt;&lt;/font&gt;
    params.Add(&quot;q&quot;, &quot;this will get encoded as well&quot;)&lt;font&gt;&lt;/font&gt;
    base.RawQuery = params.Encode() &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    fmt.Printf(&quot;Encoded URL is %q\n&quot;, base.String())&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;https://play.golang.org/p/YCTvdluws-r&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://play.golang.org/p/YCTvdluws-r&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/30652577/go-doing-a-get-request-and-building-the-querystring&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/30652577/go-doing-a-get-request-and-building-the-querystring&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2055</guid>
      <comments>https://copycodes.tistory.com/2055#entry2055comment</comments>
      <pubDate>Sat, 9 Jan 2021 10:14:26 +0900</pubDate>
    </item>
    <item>
      <title>OS의 제한을 초과하여 키 반복률을 높이려면 어떻게해야합니까?</title>
      <link>https://copycodes.tistory.com/2054</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;OS의 제한을 초과하여 키 반복률을 높이려면 어떻게해야합니까?&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;이것은 제가 15 년 동안해온 일이며, 물론 이것은 제 탐색 속도가 키보드 속도에 의해 제한된다는 것을 의미합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Vista와 OS X (MacBook을 이중 부팅)에서 키 반복률을 완전히 높였습니다. &lt;/font&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;Visual Studio 및 기타 텍스트 편집기에서 키 반복 속도를 더 빠르게 만들려면 어떻게해야합니까?&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;Mac OS X에서 Global Preferences plist를 엽니 다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;open ~/Library/Preferences/.GlobalPreferences.plist
&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;그런 다음 KeyRepeat 필드를 변경합니다. &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로만 설정하므로 0 또는 1로 이동하면 커서가 더 빨라집니다.&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;Windows에서는 시스템 호출 ( &lt;/font&gt;&lt;/font&gt;&lt;code&gt;SystemParametersInfo(SPI_SETFILTERKEYS,...)&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;keyrate &amp;lt;delay&amp;gt; &amp;lt;repeat&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;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://github.com/EricTetz/keyrate/releases&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Github 저장소&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;pre&gt;&lt;code&gt;#include &amp;lt;windows.h&amp;gt;&lt;font&gt;&lt;/font&gt;
#include &amp;lt;stdlib.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;
BOOL parseDword(const char* in, DWORD* out)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
   char* end;&lt;font&gt;&lt;/font&gt;
   long result = strtol(in, &amp;amp;end, 10);&lt;font&gt;&lt;/font&gt;
   BOOL success = (errno == 0 &amp;amp;&amp;amp; end != in);&lt;font&gt;&lt;/font&gt;
   if (success)&lt;font&gt;&lt;/font&gt;
   {&lt;font&gt;&lt;/font&gt;
       *out = result;&lt;font&gt;&lt;/font&gt;
   }&lt;font&gt;&lt;/font&gt;
   return success;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&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;
   FILTERKEYS keys = { sizeof(FILTERKEYS) };&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
   if (argc == 1)&lt;font&gt;&lt;/font&gt;
   {&lt;font&gt;&lt;/font&gt;
      puts (&quot;No parameters given: disabling.&quot;);&lt;font&gt;&lt;/font&gt;
   }&lt;font&gt;&lt;/font&gt;
   else if (argc != 3)&lt;font&gt;&lt;/font&gt;
   {&lt;font&gt;&lt;/font&gt;
      puts (&quot;Usage: keyrate &amp;lt;delay ms&amp;gt; &amp;lt;repeat ms&amp;gt;\nCall with no parameters to disable.&quot;);&lt;font&gt;&lt;/font&gt;
      return 0;&lt;font&gt;&lt;/font&gt;
   }&lt;font&gt;&lt;/font&gt;
   else if (parseDword(argv[1], &amp;amp;keys.iDelayMSec) &lt;font&gt;&lt;/font&gt;
         &amp;amp;&amp;amp; parseDword(argv[2], &amp;amp;keys.iRepeatMSec))&lt;font&gt;&lt;/font&gt;
   {&lt;font&gt;&lt;/font&gt;
      printf(&quot;Setting keyrate: delay: %d, rate: %d\n&quot;, (int) keys.iDelayMSec, (int) keys.iRepeatMSec);&lt;font&gt;&lt;/font&gt;
      keys.dwFlags = FKF_FILTERKEYSON|FKF_AVAILABLE;&lt;font&gt;&lt;/font&gt;
   }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
   if (!SystemParametersInfo (SPI_SETFILTERKEYS, 0, (LPVOID) &amp;amp;keys, 0))&lt;font&gt;&lt;/font&gt;
   {&lt;font&gt;&lt;/font&gt;
      fprintf (stderr, &quot;System call failed.\nUnable to set keyrate.&quot;);&lt;font&gt;&lt;/font&gt;
   }&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;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;또한 Ctrl-left / right는 단어가 아닌 문자가 많은 코드에서 여전히 느릴 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나는 또한 keyboardking을 사용합니다. &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;그들은 4 년 전에 6 개월 안에 소스를 공개하겠다고 말했습니다 ... :(&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;좋아, HCU \ ... \ Keyboard Response를 수정 한 사람의 제안에 따라 이것은 잘 작동합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;[HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response]&lt;font&gt;&lt;/font&gt;
&quot;AutoRepeatDelay&quot;=&quot;250&quot;&lt;font&gt;&lt;/font&gt;
&quot;AutoRepeatRate&quot;=&quot;13&quot;&lt;font&gt;&lt;/font&gt;
&quot;BounceTime&quot;=&quot;0&quot;&lt;font&gt;&lt;/font&gt;
&quot;DelayBeforeAcceptance&quot;=&quot;0&quot;&lt;font&gt;&lt;/font&gt;
&quot;Flags&quot;=&quot;59&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;Windows 표준 AutoRepeat 지연. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;13ms (77 문자 / 초) 반복 속도. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;플래그는 FilterKeys를 켭니까? &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;Windows의 경우 regedit.exe를 열고 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;HKEY_CURRENT_USER\Control Panel\Keyboard&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;원하는대로 KeyboardSpeed를 변경하십시오.&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;PC에서 KeyboardKing을 사용하고 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그것은 프리웨어이며 반복률을 200까지 높일 수 있습니다. &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 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 Assist에는 내가 항상 사용하는 Visual Studio에서 효과적인 키 이동을 두 배로 늘릴 수있는 옵션이 있습니다.&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;a href=&quot;https://i.stack.imgur.com/tqbmu.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/tqbmu.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;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;hyperlogic&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; , 맥 OS X에, 내부적으로,이 키보드 속도를 다루는 두 개의 매개 변수는 다음과 같습니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;KeyRepeat&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;InitialKeyRepeat&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;Key Repeat Rate&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;Delay Until Repeat&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;15ms 키보드 샘플링 간격의 승수 인 것 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Key Repeat Rate (KeyRepeat)                 Delay Until Repeat (InitialKeyRepeat)&lt;font&gt;&lt;/font&gt;
|--------------------------------|          |----------------------|-----------------|&lt;font&gt;&lt;/font&gt;
slow (120)                      fast (2)    off (30000)            long (120)        short (25)&lt;font&gt;&lt;/font&gt;
0.5 char/s                      33 char/s       &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;~/Library/Preferences/.GlobalPreferences.plist&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;KeyRepeat = 1         --&amp;gt; 1/(1*15 ms) = 66.7 char/s&lt;font&gt;&lt;/font&gt;
InitialKeyRepeat = 15 --&amp;gt; 15*15 ms = 225 ms&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;최신 Mac OS X 개정판에서는 슬라이더의 이름이 약간 다릅니다.&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;이 작업을 수행 할 Mac이 없기 때문에 내 지식은 Windows에만 있습니다. Ctrl + Arrow는 단어를 건너 뛰고 편집기에 따라 공백의 다음 섹션으로 건너 뛸 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Ctrl + Shift + 화살표를 사용하여 원하는 방향으로 단어를 선택할 수도 있습니다.&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 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;반면에 때때로 모든 응용 프로그램에는 자체 키보드 유형 속도가 내장되어있는 것처럼 보입니다. BIOS 속성이나 OS 설정에서는 말할 필요가 없습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그래서 저는 꽤 빠를 수있는 단축키를 모았습니다 (즉 &lt;/font&gt;&lt;/font&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 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;다음은 내가 가장 유용하다고 생각하는 몇 가지 키보드 단축키입니다 (Windows에서 작동하지만 OS X에 대해서는 잘 모르겠습니다).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;ctrl-right: Go to the end of the previous/the next word (stated before)&lt;font&gt;&lt;/font&gt;
ctrl-left:  Go to the beginning of the previous/the word before (stated before)&lt;font&gt;&lt;/font&gt;
ctrl-up:    Go to the beginning of this paragraph&lt;font&gt;&lt;/font&gt;
            (or to the next paragraph over this)&lt;font&gt;&lt;/font&gt;
ctrl-down:  Go to the end of this paragraph&lt;font&gt;&lt;/font&gt;
            (or to the next paragraph after this)&lt;font&gt;&lt;/font&gt;
ctrl-pos1:  Go to the beginning of the file&lt;font&gt;&lt;/font&gt;
ctrl-end:   Go to the end of the file&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;이 모든 것이 Shift 키와 결합되어 텍스트가 선택되도록 할 수 있습니다. &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;alt-esc:     Get the actual application into the background&lt;font&gt;&lt;/font&gt;
ctrl-esc:    This is like pressing the &quot;start-button&quot; in Windows: You can&lt;font&gt;&lt;/font&gt;
             navigate with arrow keys or shortcuts to start programs from here&lt;font&gt;&lt;/font&gt;
ctrl-l:      While using Firefox this accesses the URL-entry-field to simply&lt;font&gt;&lt;/font&gt;
             type URLs (does not work on Stack Overflow :)&lt;font&gt;&lt;/font&gt;
ctrl-tab,&lt;font&gt;&lt;/font&gt;
ctrl-pageup&lt;font&gt;&lt;/font&gt;
ctrl-pagedwn Navigate through tabs (even in your development environment)&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;OS X의 경우 커널 확장 KeyRemap4MacBook을 사용하면 모든 종류의 키보드 매개 변수를 미세 조정할 수 있으며, 그중에서 키 반복 속도 (내가 15ms로 설정했으며 잘 작동합니다).&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;Mac에서는 옵션 화살표를 사용하여 단어를 건너 뛰고 option + shift + 화살표를 선택하여 선택합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Command + 화살표는 줄의 끝이나 시작 또는 문서의 끝이나 시작으로 건너 뜁니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;페이지 위로, 페이지 아래로, 홈 및 종료 키도 있습니다.) Shift 키를 누르면 해당 키도 선택됩니다.&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 7에서는이 작업을 쉽게 수행 할 수없는 것 같습니다.&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 레지스트리 키 (HCU-&amp;gt; Control Panel-&amp;gt; Keyboard-&amp;gt; Keyboard Delay)에 의해 제어됩니다.&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 style=&quot;vertical-align: inherit;&quot;&gt;드라마는 반복 속도가 여전히 느리면 0 이하로 갈 수 없다는 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;0 지연은 반복 지연이 250ms임을 의미합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 250ms 지연은 여전히 ​​지옥처럼 느립니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것을보십시오 : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc978658.aspx&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://technet.microsoft.com/en-us/library/cc978658.aspx&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;Accesibility로 이동할 수는 있지만 이러한 옵션은 빠르게 입력하는 괴짜에게 도움을 제공하는 것이 아니라 장애인이 키보드를 사용하도록 돕는 것임을 알아야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그들은 도움이되지 않습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Linux를 사용하십시오.&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 용 솔루션은 하드웨어 제어에 있습니다. &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;그래서 저는 일상적인 개발자 작업에 사용할 대체 솔루션을 제공 할 수 있다고 생각했습니다 (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;다음은 AutoHotkey_L을 통해 실행할 수있는 작은 Autorepeat-Script (~ 125 줄)입니다 (단점은 Windows, Vista, 7, 8.1 이상에서만 실행된다는 것입니다).&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;; ====================================================================&lt;font&gt;&lt;/font&gt;
; DeveloperTools - Autorepeat Key Script&lt;font&gt;&lt;/font&gt;
;&lt;font&gt;&lt;/font&gt;
; This script provides a mechanism to do key-autorepeat way faster&lt;font&gt;&lt;/font&gt;
; than the Windows OS would allow. There are some registry settings&lt;font&gt;&lt;/font&gt;
; in Windows to tweak the key-repeat-rate, but according to widely &lt;font&gt;&lt;/font&gt;
; spread user feedback, the registry-solution does not work on all &lt;font&gt;&lt;/font&gt;
; systems.&lt;font&gt;&lt;/font&gt;
;&lt;font&gt;&lt;/font&gt;
; See the &quot;Hotkeys&quot; section below. Currently (Version 1.0), there&lt;font&gt;&lt;/font&gt;
; are only the arrow keys mapped for faster autorepeat (including &lt;font&gt;&lt;/font&gt;
; the control and shift modifiers). Feel free to add your own &lt;font&gt;&lt;/font&gt;
; hotkeys.&lt;font&gt;&lt;/font&gt;
;&lt;font&gt;&lt;/font&gt;
; You need AutoHotkey (http://www.autohotkey.com) to run this script.&lt;font&gt;&lt;/font&gt;
; Tested compatibility: AutoHotkey_L, Version v1.1.08.01&lt;font&gt;&lt;/font&gt;
; &lt;font&gt;&lt;/font&gt;
; (AutoHotkey Copyright © 2004 - 2013 Chris Mallet and &lt;font&gt;&lt;/font&gt;
; others - not me!)&lt;font&gt;&lt;/font&gt;
;&lt;font&gt;&lt;/font&gt;
; @author   Timo Rumland &amp;lt;timo.rumland ${at} gmail.com&amp;gt;, 2014-01-05&lt;font&gt;&lt;/font&gt;
; @version  1.0&lt;font&gt;&lt;/font&gt;
; @updated  2014-01-05&lt;font&gt;&lt;/font&gt;
; @license  The MIT License (MIT)&lt;font&gt;&lt;/font&gt;
;           (http://opensource.org/licenses/mit-license.php)&lt;font&gt;&lt;/font&gt;
; ====================================================================&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
; ================&lt;font&gt;&lt;/font&gt;
; Script Settings&lt;font&gt;&lt;/font&gt;
; ================&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
#NoEnv&lt;font&gt;&lt;/font&gt;
#SingleInstance     force&lt;font&gt;&lt;/font&gt;
SendMode            Input &lt;font&gt;&lt;/font&gt;
SetWorkingDir       %A_ScriptDir%&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
; Instantiate the DeveloperTools defined below the hotkey definitions&lt;font&gt;&lt;/font&gt;
developerTools      :=  new DeveloperTools()&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
; ========&lt;font&gt;&lt;/font&gt;
; Hotkeys&lt;font&gt;&lt;/font&gt;
; ========&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    ; -------------------&lt;font&gt;&lt;/font&gt;
    ; AutoRepeat Hotkeys&lt;font&gt;&lt;/font&gt;
    ; -------------------&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    ~$UP::&lt;font&gt;&lt;/font&gt;
    ~$DOWN::&lt;font&gt;&lt;/font&gt;
    ~$LEFT::&lt;font&gt;&lt;/font&gt;
    ~$RIGHT::&lt;font&gt;&lt;/font&gt;
        DeveloperTools.startAutorepeatKeyTimer( &quot;&quot; )&lt;font&gt;&lt;/font&gt;
    return&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    ~$+UP::&lt;font&gt;&lt;/font&gt;
    ~$+DOWN::&lt;font&gt;&lt;/font&gt;
    ~$+LEFT::&lt;font&gt;&lt;/font&gt;
    ~$+RIGHT::&lt;font&gt;&lt;/font&gt;
        DeveloperTools.startAutorepeatKeyTimer( &quot;+&quot; )&lt;font&gt;&lt;/font&gt;
    return&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    ~$^UP::&lt;font&gt;&lt;/font&gt;
    ~$^DOWN::&lt;font&gt;&lt;/font&gt;
    ~$^LEFT::&lt;font&gt;&lt;/font&gt;
    ~$^RIGHT::&lt;font&gt;&lt;/font&gt;
        DeveloperTools.startAutorepeatKeyTimer( &quot;^&quot; )&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;
    ; Jump label used by the hotkeys above. This is how &lt;font&gt;&lt;/font&gt;
    ; AutoHotkey provides &quot;threads&quot; or thread-like behavior.&lt;font&gt;&lt;/font&gt;
    ; -------------------------------------------------------&lt;font&gt;&lt;/font&gt;
    DeveloperTools_AutoRepeatKey:&lt;font&gt;&lt;/font&gt;
        SetTimer , , Off&lt;font&gt;&lt;/font&gt;
        DeveloperTools.startAutorepeatKey()&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;
; Classes&lt;font&gt;&lt;/font&gt;
; ========&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    class DeveloperTools&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        ; Configurable by user&lt;font&gt;&lt;/font&gt;
        autoRepeatDelayMs       :=  180&lt;font&gt;&lt;/font&gt;
        autoRepeatRateMs        :=  40&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        ; Used internally by the script&lt;font&gt;&lt;/font&gt;
        repeatKey               :=  &quot;&quot;&lt;font&gt;&lt;/font&gt;
        repeatSendString        :=  &quot;&quot;&lt;font&gt;&lt;/font&gt;
        keyModifierBaseLength   :=  2&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        ; -------------------------------------------------------------------------------&lt;font&gt;&lt;/font&gt;
        ; Starts the autorepeat of the current captured hotkey (A_ThisHotKey). The given&lt;font&gt;&lt;/font&gt;
        ; 'keyModifierString' is used for parsing the real key (without hotkey modifiers&lt;font&gt;&lt;/font&gt;
        ; like &quot;~&quot; or &quot;$&quot;).&lt;font&gt;&lt;/font&gt;
        ; -------------------------------------------------------------------------------&lt;font&gt;&lt;/font&gt;
        startAutorepeatKeyTimer( keyModifierString )&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            keyModifierLength := this.keyModifierBaseLength + StrLen( keyModifierString )&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            this.repeatKey := SubStr( A_ThisHotkey, keyModifierLength + 1 )&lt;font&gt;&lt;/font&gt;
            this.repeatSendString := keyModifierString . &quot;{&quot; . this.repeatKey . &quot;}&quot;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            SetTimer DeveloperTools_AutoRepeatKey, % this.autoRepeatDelayMs&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        ; ---------------------------------------------------------------------&lt;font&gt;&lt;/font&gt;
        ; Starts the loop which repeats the key, resulting in a much faster &lt;font&gt;&lt;/font&gt;
        ; autorepeat rate than Windows provides. Internally used by the script&lt;font&gt;&lt;/font&gt;
        ; ---------------------------------------------------------------------&lt;font&gt;&lt;/font&gt;
        startAutorepeatKey()&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            while ( GetKeyState( this.repeatKey, &quot;P&quot; ) )&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                Send % this.repeatSendString&lt;font&gt;&lt;/font&gt;
                Sleep this.autoRepeatRateMs&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;ol&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;위 코드를 텍스트 파일 (UTF-8)에 저장합니다 (예 : &quot;AutorepeatScript.ahk&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;AutoHotkey_L 설치&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;AutorepeatScript.ahk&quot;를 두 번 클릭하면 훨씬 빠른 화살표 키를 사용할 수 있습니다 (또는 파일을 자동 시작 폴더에 넣습니다).&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;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;For horizontal navigation, Home (line start), End (line end), Ctrl-Left (word left), Ctrl-Right (word right) work in all editors I know&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;For vertical navigation, Page Up, Page Down, Ctrl-Home (text start), Ctrl-End (text end) do too&lt;/p&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Also (on a side note), I would like to force my Backspace and Delete keys to non-repeat, so that the only way to delete (or replace) text would be to &lt;em&gt;first&lt;/em&gt; mark it, &lt;em&gt;then&lt;/em&gt; delete it (or type the replacement text).&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 navigate character-by-character.&lt;/p&gt; 
&lt;p&gt;In Vim (see &lt;a href=&quot;http://www.viemu.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;ViEmu&lt;/a&gt; for Visual Studio):&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;bw&lt;/code&gt; -- prev/next word&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;()&lt;/code&gt; -- prev/next sentence (full stop-delimited text)&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;{}&lt;/code&gt; -- prev/next paragraph (blank-line delimited sections of text)&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;/?&lt;/code&gt; -- move the cursor to the prev/next occurence the text found (w/ &lt;code&gt;set incsearch&lt;/code&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;ul&gt; 
 &lt;li&gt;&lt;code&gt;20j&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; -20 줄 아래로 점프&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;3}&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;code&gt;4w&lt;/code&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;/li&gt; 
 &lt;li&gt;&lt;code&gt;40G&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; -(절대) 라인 번호 40으로 이동&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 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/171326/how-can-i-increase-the-key-repeat-rate-beyond-the-oss-limit&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/171326/how-can-i-increase-the-key-repeat-rate-beyond-the-oss-limit&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2054</guid>
      <comments>https://copycodes.tistory.com/2054#entry2054comment</comments>
      <pubDate>Sat, 9 Jan 2021 10:14:16 +0900</pubDate>
    </item>
    <item>
      <title>단일 문자를 정수로 변환하는 방법</title>
      <link>https://copycodes.tistory.com/2053</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;예를 들어 &quot;123456789&quot;와 같은 숫자 문자열이 있으며 계산에 사용하기 위해 각각을 추출해야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;물론 인덱스로 각 문자에 액세스 할 수 있지만 어떻게 int로 변환합니까?&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;atoi ()를 살펴 봤지만 문자열을 인수로 사용합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따라서 각 문자를 문자열로 변환 한 다음 atoi를 호출해야합니다. &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;숫자에 대한 문자 인코딩이 모두 48 ( '0')에서 57 ( '9')의 순서로되어 있다는 사실을 활용할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 ASCII, UTF-x 및 거의 모든 다른 인코딩에 적용됩니다 (이에 &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;따라서 모든 숫자의 정수 값은 숫자 마이너스 '0'(또는 48)입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;char c = '1';&lt;font&gt;&lt;/font&gt;
int i = c - '0'; // i is now equal to 1, not '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 style=&quot;vertical-align: inherit;&quot;&gt;동의어이다&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;char c = '1';&lt;font&gt;&lt;/font&gt;
int i = c - 48; // i is now equal to 1, not '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 style=&quot;vertical-align: inherit;&quot;&gt;그러나 첫 번째가 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;c - '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;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;pre&gt;&lt;code&gt;#define toDigit(c) (c-'0')
&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;또는 원래 atoi 접근 방식과 유사하지만 대신 std :: stringstream을 사용하는 &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;(boost :: lexical_cast는 더 편리한 구문을위한 또 다른 옵션입니다)&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;(atoi는 오래된 C 함수이며 일반적으로 가능하면 더 유연하고 형식이 안전한 C ++ 등가물을 사용하는 것이 좋습니다. std :: stringstream은 문자열과의 변환을 다룹니다)&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;h3&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;atoi () 함수를 사용할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/h3&gt; 
&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;font&gt;&lt;/font&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;font&gt;&lt;/font&gt;
int main(int argc, char* argv[]){&lt;font&gt;&lt;/font&gt;
    int num ;&lt;font&gt;&lt;/font&gt;
    num = atoi(argv[1]);&lt;font&gt;&lt;/font&gt;
    printf(&quot;\n%d&quot;, num);&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;제공된 답변은 아라비아 숫자 만 처리하고 해당 숫자가 순차적이고 ASCII와 동일한 위치에있는 인코딩으로 작업하는 한 훌륭합니다.&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&gt;&lt;a href=&quot;http://site.icu-project.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;ICU&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;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;그런 다음 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://icu-project.org/apiref/icu4c/uchar_8h.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;uchar.h&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;/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;UBool u_isdigit (UChar32 c)&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;int32_t u_charDigitValue ( UChar32 c )&lt;/code&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;아니면 ICU가 당신을 위해 할 수있는 어떤 기능을 가지고있을 수도 있습니다. 자세히 살펴 보지 않았습니다.&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;#include&amp;lt;iostream&amp;gt;&lt;font&gt;&lt;/font&gt;
#include&amp;lt;stdlib&amp;gt;&lt;font&gt;&lt;/font&gt;
using namespace std;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
void main()&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
     char ch;&lt;font&gt;&lt;/font&gt;
     int x;&lt;font&gt;&lt;/font&gt;
     cin &amp;gt;&amp;gt; ch;&lt;font&gt;&lt;/font&gt;
     x = char (ar[1]);&lt;font&gt;&lt;/font&gt;
     cout &amp;lt;&amp;lt; x;&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;font style=&quot;vertical-align: inherit;&quot;&gt;된다면 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;언제든지 switch 문을 사용할 수 있습니다.&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;큰 숫자를 유지하는 형식에주의하십시오. 일부 시스템에서 정수의 최대 크기는 65,535 (부호 32,767)만큼 낮습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다른 시스템에는 2,147,483,647 (또는 4,294,967,295 서명되지 않음)이 있습니다.&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;int CharToInt(const char c)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    switch (c)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
    case '0':&lt;font&gt;&lt;/font&gt;
        return 0;&lt;font&gt;&lt;/font&gt;
    case '1':&lt;font&gt;&lt;/font&gt;
        return 1;&lt;font&gt;&lt;/font&gt;
    case '2':&lt;font&gt;&lt;/font&gt;
        return 2;&lt;font&gt;&lt;/font&gt;
    case '3':&lt;font&gt;&lt;/font&gt;
        return 3;&lt;font&gt;&lt;/font&gt;
    case '4':&lt;font&gt;&lt;/font&gt;
        return 4;&lt;font&gt;&lt;/font&gt;
    case '5':&lt;font&gt;&lt;/font&gt;
        return 5;&lt;font&gt;&lt;/font&gt;
    case '6':&lt;font&gt;&lt;/font&gt;
        return 6;&lt;font&gt;&lt;/font&gt;
    case '7':&lt;font&gt;&lt;/font&gt;
        return 7;&lt;font&gt;&lt;/font&gt;
    case '8':&lt;font&gt;&lt;/font&gt;
        return 8;&lt;font&gt;&lt;/font&gt;
    case '9':&lt;font&gt;&lt;/font&gt;
        return 9;&lt;font&gt;&lt;/font&gt;
    default:&lt;font&gt;&lt;/font&gt;
        return 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;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이렇게하면 char를 int로, int를 char로 쉽게 변환 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;int charToInt(char c)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
   int arr[]={0,1,2,3,4,5,6,7,8,9};&lt;font&gt;&lt;/font&gt;
   return arr[c-'0'];&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;QChar c = '5';&lt;font&gt;&lt;/font&gt;
int x = c.digitValue();&lt;font&gt;&lt;/font&gt;
// x is now 5&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://doc.qt.io/qt-5/qchar.html#digitValue&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;INT QChar :: digitValue () const를&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;blockquote&gt; 
 &lt;p&gt;Returns the numeric value of the digit, or -1 if the character is not a digit.&lt;/p&gt; 
&lt;/blockquote&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/439573/how-to-convert-a-single-char-into-an-int&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/439573/how-to-convert-a-single-char-into-an-int&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2053</guid>
      <comments>https://copycodes.tistory.com/2053#entry2053comment</comments>
      <pubDate>Sat, 9 Jan 2021 10:14:03 +0900</pubDate>
    </item>
    <item>
      <title>TextBox 입력 제한을 정의하는 방법은 무엇입니까?</title>
      <link>https://copycodes.tistory.com/2052</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;TextBox 입력 제한을 정의하는 방법은 무엇입니까?&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;TextBox가 대문자 또는 예를 들어 숫자 만 허용하거나 특수 문자를 넣지 못하도록 제한하려면 어떻게해야합니까?&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;물론 TextInput 이벤트를 포착하고 여기에서 텍스트를 처리하는 것은 케이크 조각이지만이 작업을 수행하는 적절한 방법입니까?&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;&amp;lt;TextBox b:Masking.Mask=&quot;^\p{Lu}*$&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;/// &amp;lt;summary&amp;gt;&lt;font&gt;&lt;/font&gt;
/// Provides masking behavior for any &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
/// &amp;lt;/summary&amp;gt;&lt;font&gt;&lt;/font&gt;
public static class Masking&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    private static readonly DependencyPropertyKey _maskExpressionPropertyKey = DependencyProperty.RegisterAttachedReadOnly(&quot;MaskExpression&quot;,&lt;font&gt;&lt;/font&gt;
        typeof(Regex),&lt;font&gt;&lt;/font&gt;
        typeof(Masking),&lt;font&gt;&lt;/font&gt;
        new FrameworkPropertyMetadata());&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// Identifies the &amp;lt;see cref=&quot;Mask&quot;/&amp;gt; dependency property.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    public static readonly DependencyProperty MaskProperty = DependencyProperty.RegisterAttached(&quot;Mask&quot;,&lt;font&gt;&lt;/font&gt;
        typeof(string),&lt;font&gt;&lt;/font&gt;
        typeof(Masking),&lt;font&gt;&lt;/font&gt;
        new FrameworkPropertyMetadata(OnMaskChanged));&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// Identifies the &amp;lt;see cref=&quot;MaskExpression&quot;/&amp;gt; dependency property.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    public static readonly DependencyProperty MaskExpressionProperty = _maskExpressionPropertyKey.DependencyProperty;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// Gets the mask for a given &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;param name=&quot;textBox&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt; whose mask is to be retrieved.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/param&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;returns&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The mask, or &amp;lt;see langword=&quot;null&quot;/&amp;gt; if no mask has been set.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/returns&amp;gt;&lt;font&gt;&lt;/font&gt;
    public static string GetMask(TextBox textBox)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (textBox == null)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            throw new ArgumentNullException(&quot;textBox&quot;);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        return textBox.GetValue(MaskProperty) as string;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// Sets the mask for a given &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;param name=&quot;textBox&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt; whose mask is to be set.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/param&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;param name=&quot;mask&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The mask to set, or &amp;lt;see langword=&quot;null&quot;/&amp;gt; to remove any existing mask from &amp;lt;paramref name=&quot;textBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/param&amp;gt;&lt;font&gt;&lt;/font&gt;
    public static void SetMask(TextBox textBox, string mask)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (textBox == null)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            throw new ArgumentNullException(&quot;textBox&quot;);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        textBox.SetValue(MaskProperty, mask);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// Gets the mask expression for the &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;remarks&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// This method can be used to retrieve the actual &amp;lt;see cref=&quot;Regex&quot;/&amp;gt; instance created as a result of setting the mask on a &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/remarks&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;param name=&quot;textBox&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt; whose mask expression is to be retrieved.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/param&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;returns&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The mask expression as an instance of &amp;lt;see cref=&quot;Regex&quot;/&amp;gt;, or &amp;lt;see langword=&quot;null&quot;/&amp;gt; if no mask has been applied to &amp;lt;paramref name=&quot;textBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/returns&amp;gt;&lt;font&gt;&lt;/font&gt;
    public static Regex GetMaskExpression(TextBox textBox)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (textBox == null)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            throw new ArgumentNullException(&quot;textBox&quot;);&lt;font&gt;&lt;/font&gt;
        } &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        return textBox.GetValue(MaskExpressionProperty) as Regex;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void SetMaskExpression(TextBox textBox, Regex regex)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        textBox.SetValue(_maskExpressionPropertyKey, regex);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void OnMaskChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var textBox = dependencyObject as TextBox;&lt;font&gt;&lt;/font&gt;
        var mask = e.NewValue as string;&lt;font&gt;&lt;/font&gt;
        textBox.PreviewTextInput -= textBox_PreviewTextInput;&lt;font&gt;&lt;/font&gt;
        textBox.PreviewKeyDown -= textBox_PreviewKeyDown;&lt;font&gt;&lt;/font&gt;
        DataObject.RemovePastingHandler(textBox, Pasting);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (mask == null)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            textBox.ClearValue(MaskProperty);&lt;font&gt;&lt;/font&gt;
            textBox.ClearValue(MaskExpressionProperty);&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;
            textBox.SetValue(MaskProperty, mask);&lt;font&gt;&lt;/font&gt;
            SetMaskExpression(textBox, new Regex(mask, RegexOptions.Compiled | RegexOptions.IgnorePatternWhitespace));&lt;font&gt;&lt;/font&gt;
            textBox.PreviewTextInput += textBox_PreviewTextInput;&lt;font&gt;&lt;/font&gt;
            textBox.PreviewKeyDown += textBox_PreviewKeyDown;&lt;font&gt;&lt;/font&gt;
            DataObject.AddPastingHandler(textBox, Pasting);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void textBox_PreviewTextInput(object sender, TextCompositionEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var textBox = sender as TextBox;&lt;font&gt;&lt;/font&gt;
        var maskExpression = GetMaskExpression(textBox);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (maskExpression == 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;
        var proposedText = GetProposedText(textBox, e.Text);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (!maskExpression.IsMatch(proposedText))&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            e.Handled = true;&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void textBox_PreviewKeyDown(object sender, KeyEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var textBox = sender as TextBox;&lt;font&gt;&lt;/font&gt;
        var maskExpression = GetMaskExpression(textBox);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (maskExpression == 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;
        //pressing space doesn't raise PreviewTextInput - no idea why, but we need to handle&lt;font&gt;&lt;/font&gt;
        //explicitly here&lt;font&gt;&lt;/font&gt;
        if (e.Key == Key.Space)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            var proposedText = GetProposedText(textBox, &quot; &quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            if (!maskExpression.IsMatch(proposedText))&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                e.Handled = true;&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;
    private static void Pasting(object sender, DataObjectPastingEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var textBox = sender as TextBox;&lt;font&gt;&lt;/font&gt;
        var maskExpression = GetMaskExpression(textBox);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (maskExpression == 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;
        if (e.DataObject.GetDataPresent(typeof(string)))&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            var pastedText = e.DataObject.GetData(typeof(string)) as string;&lt;font&gt;&lt;/font&gt;
            var proposedText = GetProposedText(textBox, pastedText);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            if (!maskExpression.IsMatch(proposedText))&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                e.CancelCommand();&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;
            e.CancelCommand();&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static string GetProposedText(TextBox textBox, string newText)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var text = textBox.Text;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (textBox.SelectionStart != -1)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            text = text.Remove(textBox.SelectionStart, textBox.SelectionLength);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        text = text.Insert(textBox.CaretIndex, newText);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        return text;&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;이전에 패턴을 위반할 수 있었던 다음 작업도 처리하여 Kent Boogaart의 답변을 개선했습니다.&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;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;예를 들어 Kent Boogaart의 답변은 사용자가 먼저 &quot;abc&quot;를 입력하여 &quot;ac&quot;를 입력하고 그 후에 다음 정규식을 위반하는 백 스페이스로 &quot;b&quot;를 삭제하도록 허용했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;^(a|ab|abc)$
&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;code&gt;&amp;lt;TextBox b:Masking.Mask=&quot;^\p{Lu}*$&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;/p&gt; 
&lt;pre&gt;&lt;code&gt;public static class Masking&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    private static readonly DependencyPropertyKey _maskExpressionPropertyKey = DependencyProperty.RegisterAttachedReadOnly(&quot;MaskExpression&quot;,&lt;font&gt;&lt;/font&gt;
            typeof(Regex),&lt;font&gt;&lt;/font&gt;
            typeof(Masking),&lt;font&gt;&lt;/font&gt;
            new FrameworkPropertyMetadata());&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// Identifies the &amp;lt;see cref=&quot;Mask&quot;/&amp;gt; dependency property.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    public static readonly DependencyProperty MaskProperty = DependencyProperty.RegisterAttached(&quot;Mask&quot;,&lt;font&gt;&lt;/font&gt;
            typeof(string),&lt;font&gt;&lt;/font&gt;
            typeof(Masking),&lt;font&gt;&lt;/font&gt;
            new FrameworkPropertyMetadata(OnMaskChanged));&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// Identifies the &amp;lt;see cref=&quot;MaskExpression&quot;/&amp;gt; dependency property.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    public static readonly DependencyProperty MaskExpressionProperty = _maskExpressionPropertyKey.DependencyProperty;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// Gets the mask for a given &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;param name=&quot;textBox&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt; whose mask is to be retrieved.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/param&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;returns&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The mask, or &amp;lt;see langword=&quot;null&quot;/&amp;gt; if no mask has been set.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/returns&amp;gt;&lt;font&gt;&lt;/font&gt;
    public static string GetMask(TextBox textBox)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (textBox == null)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            throw new ArgumentNullException(&quot;textBox&quot;);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        return textBox.GetValue(MaskProperty) as string;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// Sets the mask for a given &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;param name=&quot;textBox&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt; whose mask is to be set.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/param&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;param name=&quot;mask&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The mask to set, or &amp;lt;see langword=&quot;null&quot;/&amp;gt; to remove any existing mask from &amp;lt;paramref name=&quot;textBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/param&amp;gt;&lt;font&gt;&lt;/font&gt;
    public static void SetMask(TextBox textBox, string mask)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (textBox == null)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            throw new ArgumentNullException(&quot;textBox&quot;);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        textBox.SetValue(MaskProperty, mask);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// Gets the mask expression for the &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;remarks&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// This method can be used to retrieve the actual &amp;lt;see cref=&quot;Regex&quot;/&amp;gt; instance created as a result of setting the mask on a &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/remarks&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;param name=&quot;textBox&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt; whose mask expression is to be retrieved.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/param&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;returns&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The mask expression as an instance of &amp;lt;see cref=&quot;Regex&quot;/&amp;gt;, or &amp;lt;see langword=&quot;null&quot;/&amp;gt; if no mask has been applied to &amp;lt;paramref name=&quot;textBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/returns&amp;gt;&lt;font&gt;&lt;/font&gt;
    public static Regex GetMaskExpression(TextBox textBox)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (textBox == null)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            throw new ArgumentNullException(&quot;textBox&quot;);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        return textBox.GetValue(MaskExpressionProperty) as Regex;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void SetMaskExpression(TextBox textBox, Regex regex)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        textBox.SetValue(_maskExpressionPropertyKey, regex);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void OnMaskChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var textBox = dependencyObject as TextBox;&lt;font&gt;&lt;/font&gt;
        var mask = e.NewValue as string;&lt;font&gt;&lt;/font&gt;
        textBox.PreviewTextInput -= textBox_PreviewTextInput;&lt;font&gt;&lt;/font&gt;
        textBox.PreviewKeyDown -= textBox_PreviewKeyDown;&lt;font&gt;&lt;/font&gt;
        DataObject.RemovePastingHandler(textBox, Pasting);&lt;font&gt;&lt;/font&gt;
        DataObject.RemoveCopyingHandler(textBox, NoDragCopy);&lt;font&gt;&lt;/font&gt;
        CommandManager.RemovePreviewExecutedHandler(textBox, NoCutting);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (mask == null)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            textBox.ClearValue(MaskProperty);&lt;font&gt;&lt;/font&gt;
            textBox.ClearValue(MaskExpressionProperty);&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;
            textBox.SetValue(MaskProperty, mask);&lt;font&gt;&lt;/font&gt;
            SetMaskExpression(textBox, new Regex(mask, RegexOptions.Compiled | RegexOptions.IgnorePatternWhitespace));&lt;font&gt;&lt;/font&gt;
            textBox.PreviewTextInput += textBox_PreviewTextInput;&lt;font&gt;&lt;/font&gt;
            textBox.PreviewKeyDown += textBox_PreviewKeyDown;&lt;font&gt;&lt;/font&gt;
            DataObject.AddPastingHandler(textBox, Pasting);&lt;font&gt;&lt;/font&gt;
            DataObject.AddCopyingHandler(textBox, NoDragCopy);&lt;font&gt;&lt;/font&gt;
            CommandManager.AddPreviewExecutedHandler(textBox, NoCutting);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void NoCutting(object sender, ExecutedRoutedEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if(e.Command == ApplicationCommands.Cut)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            e.Handled = true;&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void NoDragCopy(object sender, DataObjectCopyingEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (e.IsDragDrop)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            e.CancelCommand();&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void textBox_PreviewTextInput(object sender, TextCompositionEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var textBox = sender as TextBox;&lt;font&gt;&lt;/font&gt;
        var maskExpression = GetMaskExpression(textBox);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (maskExpression == 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;
        var proposedText = GetProposedText(textBox, e.Text);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (!maskExpression.IsMatch(proposedText))&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            e.Handled = true;&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void textBox_PreviewKeyDown(object sender, KeyEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var textBox = sender as TextBox;&lt;font&gt;&lt;/font&gt;
        var maskExpression = GetMaskExpression(textBox);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (maskExpression == 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;
        string proposedText = null;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        //pressing space doesn't raise PreviewTextInput, reasons here http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/446ec083-04c8-43f2-89dc-1e2521a31f6b?prof=required&lt;font&gt;&lt;/font&gt;
        if (e.Key == Key.Space)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            proposedText = GetProposedText(textBox, &quot; &quot;);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        // Same story with backspace&lt;font&gt;&lt;/font&gt;
        else if(e.Key == Key.Back)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            proposedText = GetProposedTextBackspace(textBox);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (proposedText != null &amp;amp;&amp;amp; proposedText != string.Empty &amp;amp;&amp;amp; !maskExpression.IsMatch(proposedText))&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            e.Handled = true;&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;
    private static void Pasting(object sender, DataObjectPastingEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var textBox = sender as TextBox;&lt;font&gt;&lt;/font&gt;
        var maskExpression = GetMaskExpression(textBox);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (maskExpression == 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;
        if (e.DataObject.GetDataPresent(typeof(string)))&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            var pastedText = e.DataObject.GetData(typeof(string)) as string;&lt;font&gt;&lt;/font&gt;
            var proposedText = GetProposedText(textBox, pastedText);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            if (!maskExpression.IsMatch(proposedText))&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                e.CancelCommand();&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;
            e.CancelCommand();&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static string GetProposedTextBackspace(TextBox textBox)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var text = GetTextWithSelectionRemoved(textBox);&lt;font&gt;&lt;/font&gt;
        if (textBox.SelectionStart &amp;gt; 0 &amp;amp;&amp;amp; textBox.SelectionLength == 0)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            text = text.Remove(textBox.SelectionStart-1, 1);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        return text;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static string GetProposedText(TextBox textBox, string newText)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var text = GetTextWithSelectionRemoved(textBox);&lt;font&gt;&lt;/font&gt;
        text = text.Insert(textBox.CaretIndex, newText);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        return text;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static string GetTextWithSelectionRemoved(TextBox textBox)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var text = textBox.Text;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (textBox.SelectionStart != -1)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            text = text.Remove(textBox.SelectionStart, textBox.SelectionLength);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        return text;&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;컬러 테마를 지원하도록 VitalyB의 코드를 변경했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;RegEx 스크립트를 충족하지 않는 경우 사용자 입력을 차단하는 대신 텍스트 상자 만 강조 표시합니다. &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;b:ColorMasking.PassColor = &quot;Hexadecimal Value&quot;&lt;font&gt;&lt;/font&gt;
b:ColorMasking.FailColor = &quot;Hexadecimal Value&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;public class ColorMasking : DependencyObject&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    private static readonly DependencyPropertyKey _maskExpressionPropertyKey = DependencyProperty.RegisterAttachedReadOnly(&quot;MaskExpression&quot;,&lt;font&gt;&lt;/font&gt;
            typeof(Regex),&lt;font&gt;&lt;/font&gt;
            typeof(ColorMasking),&lt;font&gt;&lt;/font&gt;
            new FrameworkPropertyMetadata());&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// Identifies the &amp;lt;see cref=&quot;Mask&quot;/&amp;gt; dependency property.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &lt;font&gt;&lt;/font&gt;
    public static readonly DependencyProperty PassColorProperty = DependencyProperty.RegisterAttached(&quot;PassColor&quot;,&lt;font&gt;&lt;/font&gt;
            typeof(string),&lt;font&gt;&lt;/font&gt;
            typeof(ColorMasking),&lt;font&gt;&lt;/font&gt;
            new PropertyMetadata(&quot;#99FF99&quot;));&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public static void SetPassColor(DependencyObject obj, string passColor)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        obj.SetValue(PassColorProperty, passColor);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public static string GetPassColor(DependencyObject obj)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        return (string)obj.GetValue(PassColorProperty);&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 readonly DependencyProperty FailColorProperty = DependencyProperty.RegisterAttached(&quot;FailColor&quot;,&lt;font&gt;&lt;/font&gt;
            typeof(string),&lt;font&gt;&lt;/font&gt;
            typeof(ColorMasking),&lt;font&gt;&lt;/font&gt;
            new PropertyMetadata(&quot;#FFCCFF&quot;));&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public static void SetFailColor(DependencyObject obj, string failColor)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        obj.SetValue(FailColorProperty, failColor);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public static string GetFailColor(DependencyObject obj)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        return (string)obj.GetValue(FailColorProperty);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public static readonly DependencyProperty MaskProperty = DependencyProperty.RegisterAttached(&quot;Mask&quot;,&lt;font&gt;&lt;/font&gt;
            typeof(string),&lt;font&gt;&lt;/font&gt;
            typeof(ColorMasking),&lt;font&gt;&lt;/font&gt;
            new FrameworkPropertyMetadata(OnMaskChanged));&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void OnPassColorChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var textBox = dependencyObject as TextBox;&lt;font&gt;&lt;/font&gt;
        var color = e.NewValue as string;&lt;font&gt;&lt;/font&gt;
        textBox.SetValue(PassColorProperty, color);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// Identifies the &amp;lt;see cref=&quot;MaskExpression&quot;/&amp;gt; dependency property.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    public static readonly DependencyProperty MaskExpressionProperty = _maskExpressionPropertyKey.DependencyProperty;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// Gets the mask for a given &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;param name=&quot;textBox&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt; whose mask is to be retrieved.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/param&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;returns&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The mask, or &amp;lt;see langword=&quot;null&quot;/&amp;gt; if no mask has been set.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/returns&amp;gt;&lt;font&gt;&lt;/font&gt;
    public static string GetMask(TextBox textBox)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (textBox == null)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            throw new ArgumentNullException(&quot;textBox&quot;);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        return textBox.GetValue(MaskProperty) as string;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// Sets the mask for a given &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;param name=&quot;textBox&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt; whose mask is to be set.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/param&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;param name=&quot;mask&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The mask to set, or &amp;lt;see langword=&quot;null&quot;/&amp;gt; to remove any existing mask from &amp;lt;paramref name=&quot;textBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/param&amp;gt;&lt;font&gt;&lt;/font&gt;
    public static void SetMask(TextBox textBox, string mask)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (textBox == null)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            throw new ArgumentNullException(&quot;textBox&quot;);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        textBox.SetValue(MaskProperty, mask);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// Gets the mask expression for the &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/summary&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;remarks&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// This method can be used to retrieve the actual &amp;lt;see cref=&quot;Regex&quot;/&amp;gt; instance created as a result of setting the mask on a &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/remarks&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;param name=&quot;textBox&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The &amp;lt;see cref=&quot;TextBox&quot;/&amp;gt; whose mask expression is to be retrieved.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/param&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;returns&amp;gt;&lt;font&gt;&lt;/font&gt;
    /// The mask expression as an instance of &amp;lt;see cref=&quot;Regex&quot;/&amp;gt;, or &amp;lt;see langword=&quot;null&quot;/&amp;gt; if no mask has been applied to &amp;lt;paramref name=&quot;textBox&quot;/&amp;gt;.&lt;font&gt;&lt;/font&gt;
    /// &amp;lt;/returns&amp;gt;&lt;font&gt;&lt;/font&gt;
    public static Regex GetMaskExpression(TextBox textBox)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (textBox == null)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            throw new ArgumentNullException(&quot;textBox&quot;);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        return textBox.GetValue(MaskExpressionProperty) as Regex;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void SetMaskExpression(TextBox textBox, Regex regex)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        textBox.SetValue(_maskExpressionPropertyKey, regex);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void OnMaskChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var textBox = dependencyObject as TextBox;&lt;font&gt;&lt;/font&gt;
        var mask = e.NewValue as string;&lt;font&gt;&lt;/font&gt;
        textBox.PreviewTextInput -= textBox_PreviewTextInput;&lt;font&gt;&lt;/font&gt;
        textBox.PreviewKeyDown -= textBox_PreviewKeyDown;&lt;font&gt;&lt;/font&gt;
        DataObject.RemovePastingHandler(textBox, Pasting);&lt;font&gt;&lt;/font&gt;
        DataObject.RemoveCopyingHandler(textBox, NoDragCopy);&lt;font&gt;&lt;/font&gt;
        CommandManager.RemovePreviewExecutedHandler(textBox, NoCutting);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (mask == null)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            textBox.ClearValue(MaskProperty);&lt;font&gt;&lt;/font&gt;
            textBox.ClearValue(MaskExpressionProperty);&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;
            textBox.SetValue(MaskProperty, mask);&lt;font&gt;&lt;/font&gt;
            SetMaskExpression(textBox, new Regex(mask, RegexOptions.Compiled | RegexOptions.IgnorePatternWhitespace));&lt;font&gt;&lt;/font&gt;
            textBox.PreviewTextInput += textBox_PreviewTextInput;&lt;font&gt;&lt;/font&gt;
            textBox.PreviewKeyDown += textBox_PreviewKeyDown;&lt;font&gt;&lt;/font&gt;
            DataObject.AddPastingHandler(textBox, Pasting);&lt;font&gt;&lt;/font&gt;
            DataObject.AddCopyingHandler(textBox, NoDragCopy);&lt;font&gt;&lt;/font&gt;
            CommandManager.AddPreviewExecutedHandler(textBox, NoCutting);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void NoCutting(object sender, ExecutedRoutedEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (e.Command == ApplicationCommands.Cut)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            e.Handled = true;&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void NoDragCopy(object sender, DataObjectCopyingEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (e.IsDragDrop)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            e.CancelCommand();&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void textBox_PreviewTextInput(object sender, TextCompositionEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var textBox = sender as TextBox;&lt;font&gt;&lt;/font&gt;
        var maskExpression = GetMaskExpression(textBox);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        string passHex = (string)textBox.GetValue(PassColorProperty);&lt;font&gt;&lt;/font&gt;
        string failHex = (string)textBox.GetValue(FailColorProperty);&lt;font&gt;&lt;/font&gt;
        Color passColor = Extensions.ToColorFromHex(passHex);&lt;font&gt;&lt;/font&gt;
        Color failColor = Extensions.ToColorFromHex(failHex);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (maskExpression == 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;
        var proposedText = GetProposedText(textBox, e.Text);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (!maskExpression.IsMatch(proposedText))&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            textBox.Background = new SolidColorBrush(failColor);&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;
            textBox.Background = new SolidColorBrush(passColor);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static void textBox_PreviewKeyDown(object sender, KeyEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var textBox = sender as TextBox;&lt;font&gt;&lt;/font&gt;
        var maskExpression = GetMaskExpression(textBox);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        string passHex = (string)textBox.GetValue(PassColorProperty);&lt;font&gt;&lt;/font&gt;
        string failHex = (string)textBox.GetValue(FailColorProperty);&lt;font&gt;&lt;/font&gt;
        Color passColor = Extensions.ToColorFromHex(passHex);&lt;font&gt;&lt;/font&gt;
        Color failColor = Extensions.ToColorFromHex(failHex);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (maskExpression == 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;
        string proposedText = null;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        //pressing space doesn't raise PreviewTextInput, reasons here http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/446ec083-04c8-43f2-89dc-1e2521a31f6b?prof=required&lt;font&gt;&lt;/font&gt;
        if (e.Key == Key.Space)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            proposedText = GetProposedText(textBox, &quot; &quot;);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        // Same story with backspace&lt;font&gt;&lt;/font&gt;
        else if (e.Key == Key.Back)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            proposedText = GetProposedTextBackspace(textBox);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (proposedText != null &amp;amp;&amp;amp; !maskExpression.IsMatch(proposedText))&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            textBox.Background = new SolidColorBrush(failColor);&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;
            textBox.Background = new SolidColorBrush(passColor);&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;
    private static void Pasting(object sender, DataObjectPastingEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        TextBox textBox = sender as TextBox;&lt;font&gt;&lt;/font&gt;
        var maskExpression = GetMaskExpression(textBox);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        string passHex = (string)textBox.GetValue(PassColorProperty);&lt;font&gt;&lt;/font&gt;
        string failHex = (string)textBox.GetValue(FailColorProperty);&lt;font&gt;&lt;/font&gt;
        Color passColor = Extensions.ToColorFromHex(passHex);&lt;font&gt;&lt;/font&gt;
        Color failColor = Extensions.ToColorFromHex(failHex);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (maskExpression == 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;
        if (e.DataObject.GetDataPresent(typeof(string)))&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            var pastedText = e.DataObject.GetData(typeof(string)) as string;&lt;font&gt;&lt;/font&gt;
            var proposedText = GetProposedText(textBox, pastedText);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            if (!maskExpression.IsMatch(proposedText))&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                textBox.Background = new SolidColorBrush(failColor);&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;
                textBox.Background = new SolidColorBrush(passColor);&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;
            textBox.Background = new SolidColorBrush(failColor);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static string GetProposedTextBackspace(TextBox textBox)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var text = GetTextWithSelectionRemoved(textBox);&lt;font&gt;&lt;/font&gt;
        if (textBox.SelectionStart &amp;gt; 0)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            text = text.Remove(textBox.SelectionStart - 1, 1);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        return text;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static string GetProposedText(TextBox textBox, string newText)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var text = GetTextWithSelectionRemoved(textBox);&lt;font&gt;&lt;/font&gt;
        text = text.Insert(textBox.CaretIndex, newText);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        return text;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private static string GetTextWithSelectionRemoved(TextBox textBox)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var text = textBox.Text;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (textBox.SelectionStart != -1)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            text = text.Remove(textBox.SelectionStart, textBox.SelectionLength);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        return text;&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;스크립트를 실행하려면 Aaron C가 작성한 클래스가 필요합니다. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/783384/silverlight-wpf-sets-ellipse-with-hexadecimal-colour&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Silverlight / WPF는&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://stackoverflow.com/questions/783384/silverlight-wpf-sets-ellipse-with-hexadecimal-colour&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;16 진수 색상으로 타원을 설정합니다&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.wiredprairie.us/blog/index.php/archives/659&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;http://www.wiredprairie.us/blog/index.php/archives/659&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;public static class Extensions&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    public static void SetFromHex(this Color c, string hex)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        Color c1 = ToColorFromHex(hex);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        c.A = c1.A;&lt;font&gt;&lt;/font&gt;
        c.R = c1.R;&lt;font&gt;&lt;/font&gt;
        c.G = c1.G;&lt;font&gt;&lt;/font&gt;
        c.B = c1.B;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public static Color ToColorFromHex(string hex)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (string.IsNullOrEmpty(hex))&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            throw new ArgumentNullException(&quot;hex&quot;);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        // remove any &quot;#&quot; characters&lt;font&gt;&lt;/font&gt;
        while (hex.StartsWith(&quot;#&quot;))&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            hex = hex.Substring(1);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        int num = 0;&lt;font&gt;&lt;/font&gt;
        // get the number out of the string&lt;font&gt;&lt;/font&gt;
        if (!Int32.TryParse(hex, System.Globalization.NumberStyles.HexNumber, null, out num))&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            throw new ArgumentException(&quot;Color not in a recognized Hex format.&quot;);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        int[] pieces = new int[4];&lt;font&gt;&lt;/font&gt;
        if (hex.Length &amp;gt; 7)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            pieces[0] = ((num &amp;gt;&amp;gt; 24) &amp;amp; 0x000000ff);&lt;font&gt;&lt;/font&gt;
            pieces[1] = ((num &amp;gt;&amp;gt; 16) &amp;amp; 0x000000ff);&lt;font&gt;&lt;/font&gt;
            pieces[2] = ((num &amp;gt;&amp;gt; 8) &amp;amp; 0x000000ff);&lt;font&gt;&lt;/font&gt;
            pieces[3] = (num &amp;amp; 0x000000ff);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        else if (hex.Length &amp;gt; 5)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            pieces[0] = 255;&lt;font&gt;&lt;/font&gt;
            pieces[1] = ((num &amp;gt;&amp;gt; 16) &amp;amp; 0x000000ff);&lt;font&gt;&lt;/font&gt;
            pieces[2] = ((num &amp;gt;&amp;gt; 8) &amp;amp; 0x000000ff);&lt;font&gt;&lt;/font&gt;
            pieces[3] = (num &amp;amp; 0x000000ff);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        else if (hex.Length == 3)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            pieces[0] = 255;&lt;font&gt;&lt;/font&gt;
            pieces[1] = ((num &amp;gt;&amp;gt; 8) &amp;amp; 0x0000000f);&lt;font&gt;&lt;/font&gt;
            pieces[1] += pieces[1] * 16;&lt;font&gt;&lt;/font&gt;
            pieces[2] = ((num &amp;gt;&amp;gt; 4) &amp;amp; 0x000000f);&lt;font&gt;&lt;/font&gt;
            pieces[2] += pieces[2] * 16;&lt;font&gt;&lt;/font&gt;
            pieces[3] = (num &amp;amp; 0x000000f);&lt;font&gt;&lt;/font&gt;
            pieces[3] += pieces[3] * 16;&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        return Color.FromArgb((byte)pieces[0], (byte)pieces[1], (byte)pieces[2], (byte)pieces[3]);&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;pre&gt;&lt;code&gt;private void TextBox1_SelectionChanged(object sender, RoutedEventArgs e)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    string txt = TextBox1.Text;&lt;font&gt;&lt;/font&gt;
    if (txt != &quot;&quot;)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        TextBox1.Text = Regex.Replace(TextBox1.Text, &quot;[^0-9]&quot;, &quot;&quot;);&lt;font&gt;&lt;/font&gt;
        if (txt != TextBox1.Text)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            TextBox1.Select(TextBox1.Text.Length, 0);&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 style=&quot;vertical-align: inherit;&quot;&gt;변경을 취소하기위한 이전 텍스트, 새 텍스트 및 플래그를 제공하는 &quot;TextChanging&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;공백 문자에만 사용되는 &quot;PreviewKeyDown&quot;처리기를 제거했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;TextBox는 라우팅 된 명령으로 모든 것을 관리하는 것처럼 보이며 &quot;Space&quot;에는 자체 명령이 있지만 공개되지는 않습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또한 &quot;Ctrl + Backspace&quot;(이전 단어 삭제)와 같은 추가 키보드 단축키에 대한 지원을 추가했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public class TextChangingBehavior : Behavior&amp;lt;TextBox&amp;gt;&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    public event EventHandler&amp;lt;TextChangingEventArgs&amp;gt; TextChanging;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    protected override void OnAttached()&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        base.OnAttached();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        AssociatedObject.PreviewTextInput += OnPreviewTextInput;&lt;font&gt;&lt;/font&gt;
        CommandManager.AddPreviewExecutedHandler(AssociatedObject, OnPreviewExecutedHandler);&lt;font&gt;&lt;/font&gt;
        DataObject.AddCopyingHandler(AssociatedObject, OnCopying);&lt;font&gt;&lt;/font&gt;
        DataObject.AddPastingHandler(AssociatedObject, OnPasting);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    protected override void OnDetaching()&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        base.OnDetaching();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        AssociatedObject.PreviewTextInput -= OnPreviewTextInput;&lt;font&gt;&lt;/font&gt;
        CommandManager.RemovePreviewExecutedHandler(AssociatedObject, OnPreviewExecutedHandler);&lt;font&gt;&lt;/font&gt;
        DataObject.RemoveCopyingHandler(AssociatedObject, OnCopying);&lt;font&gt;&lt;/font&gt;
        DataObject.RemovePastingHandler(AssociatedObject, OnPasting);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    #region Text&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private enum CharCategory&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        LetterOrDigit,&lt;font&gt;&lt;/font&gt;
        Whitespace,&lt;font&gt;&lt;/font&gt;
        Other&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private CharCategory GetCharCategory(char c)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (char.IsLetterOrDigit(c))&lt;font&gt;&lt;/font&gt;
            return CharCategory.LetterOrDigit;&lt;font&gt;&lt;/font&gt;
        else if (char.IsWhiteSpace(c))&lt;font&gt;&lt;/font&gt;
            return CharCategory.Whitespace;&lt;font&gt;&lt;/font&gt;
        else&lt;font&gt;&lt;/font&gt;
            return CharCategory.Other;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private string GetText(string input = null)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var box = AssociatedObject;&lt;font&gt;&lt;/font&gt;
        var text = box.Text ?? string.Empty;&lt;font&gt;&lt;/font&gt;
        if (input != null)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            // Delete selection&lt;font&gt;&lt;/font&gt;
            var deleteCount = box.SelectionLength;&lt;font&gt;&lt;/font&gt;
            if (deleteCount &amp;gt; 0)&lt;font&gt;&lt;/font&gt;
                text = text.Remove(box.SelectionStart, deleteCount);&lt;font&gt;&lt;/font&gt;
            // Insert input&lt;font&gt;&lt;/font&gt;
            if (input.Length &amp;gt; 0)&lt;font&gt;&lt;/font&gt;
                text = text.Insert(box.CaretIndex, input);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        return text;&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;
    private void OnPreviewExecutedHandler(object sender, ExecutedRoutedEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var box = AssociatedObject;&lt;font&gt;&lt;/font&gt;
        var selectionExists = box.SelectionLength &amp;gt; 0;&lt;font&gt;&lt;/font&gt;
        var caretIndex = box.CaretIndex;&lt;font&gt;&lt;/font&gt;
        string newText = null;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (e.Command == ApplicationCommands.Cut)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            if (selectionExists)&lt;font&gt;&lt;/font&gt;
                newText = GetText(string.Empty);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        else if (e.Command == EditingCommands.Backspace)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            if (selectionExists)&lt;font&gt;&lt;/font&gt;
                newText = GetText(string.Empty);&lt;font&gt;&lt;/font&gt;
            else if (caretIndex &amp;gt; 0)&lt;font&gt;&lt;/font&gt;
                newText = GetText().Remove(caretIndex - 1, 1);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        else if (e.Command == EditingCommands.Delete)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            if (selectionExists)&lt;font&gt;&lt;/font&gt;
                newText = GetText(string.Empty);&lt;font&gt;&lt;/font&gt;
            else&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                newText = GetText();&lt;font&gt;&lt;/font&gt;
                if (caretIndex &amp;gt;= newText.Length)&lt;font&gt;&lt;/font&gt;
                    newText = null;&lt;font&gt;&lt;/font&gt;
                else&lt;font&gt;&lt;/font&gt;
                    newText = newText.Remove(caretIndex, 1);&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        else if (e.Command == EditingCommands.DeletePreviousWord)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            if (selectionExists)&lt;font&gt;&lt;/font&gt;
                newText = GetText(string.Empty);&lt;font&gt;&lt;/font&gt;
            else if (caretIndex &amp;gt; 0)&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                newText = GetText();&lt;font&gt;&lt;/font&gt;
                var startIndex = caretIndex;&lt;font&gt;&lt;/font&gt;
                // Include whitespaces&lt;font&gt;&lt;/font&gt;
                do&lt;font&gt;&lt;/font&gt;
                    startIndex--;&lt;font&gt;&lt;/font&gt;
                while (startIndex &amp;gt; 0 &amp;amp;&amp;amp; char.IsWhiteSpace(newText[startIndex]));&lt;font&gt;&lt;/font&gt;
                // Include the next block&lt;font&gt;&lt;/font&gt;
                var currentCategory = GetCharCategory(newText[startIndex]);&lt;font&gt;&lt;/font&gt;
                while (startIndex &amp;gt; 0 &amp;amp;&amp;amp; GetCharCategory(newText[startIndex - 1]) == currentCategory)&lt;font&gt;&lt;/font&gt;
                    startIndex--;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
                newText = newText.Remove(startIndex, caretIndex - startIndex);&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        else if (e.Command == EditingCommands.DeleteNextWord)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            if (selectionExists)&lt;font&gt;&lt;/font&gt;
                newText = GetText(string.Empty);&lt;font&gt;&lt;/font&gt;
            else&lt;font&gt;&lt;/font&gt;
            {&lt;font&gt;&lt;/font&gt;
                newText = GetText();&lt;font&gt;&lt;/font&gt;
                if (caretIndex &amp;gt;= newText.Length)&lt;font&gt;&lt;/font&gt;
                    newText = null;&lt;font&gt;&lt;/font&gt;
                else&lt;font&gt;&lt;/font&gt;
                {&lt;font&gt;&lt;/font&gt;
                    var endIndex = caretIndex + 1;&lt;font&gt;&lt;/font&gt;
                    // Include the current block&lt;font&gt;&lt;/font&gt;
                    var currentCategory = GetCharCategory(newText[caretIndex]);&lt;font&gt;&lt;/font&gt;
                    while (endIndex &amp;lt; newText.Length &amp;amp;&amp;amp; GetCharCategory(newText[endIndex]) == currentCategory)&lt;font&gt;&lt;/font&gt;
                        endIndex++;&lt;font&gt;&lt;/font&gt;
                    // Include whitespaces&lt;font&gt;&lt;/font&gt;
                    while (endIndex &amp;lt; newText.Length &amp;amp;&amp;amp; char.IsWhiteSpace(newText[endIndex]))&lt;font&gt;&lt;/font&gt;
                        endIndex++;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
                    newText = newText.Remove(caretIndex, endIndex - caretIndex);&lt;font&gt;&lt;/font&gt;
                }&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        else if (e.Command is RoutedUICommand cmd &amp;amp;&amp;amp; new[] { &quot;Space&quot;, &quot;ShiftSpace&quot; }.Contains(cmd.Name))&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            newText = GetText(&quot; &quot;);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (newText != null &amp;amp;&amp;amp; OnProcessChange(newText))&lt;font&gt;&lt;/font&gt;
            e.Handled = true;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private void OnCopying(object sender, DataObjectCopyingEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (e.IsDragDrop)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            if (OnProcessChange(GetText(string.Empty)))&lt;font&gt;&lt;/font&gt;
                e.CancelCommand();&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private void OnPasting(object sender, DataObjectPastingEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (e.DataObject.GetDataPresent(typeof(string)))&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            if (OnProcessChange(GetText((string)e.DataObject.GetData(typeof(string)))))&lt;font&gt;&lt;/font&gt;
                e.CancelCommand();&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private void OnPreviewTextInput(object sender, TextCompositionEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        if (!string.IsNullOrEmpty(e.Text))&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            if (OnProcessChange(GetText(e.Text)))&lt;font&gt;&lt;/font&gt;
                e.Handled = true;&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private bool OnProcessChange(string newValue)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var oldValue = GetText();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        if (string.Equals(oldValue, newValue, StringComparison.Ordinal))&lt;font&gt;&lt;/font&gt;
            return false;&lt;font&gt;&lt;/font&gt;
        else&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            var args = new TextChangingEventArgs(oldValue, newValue);&lt;font&gt;&lt;/font&gt;
            OnTextChanging(args);&lt;font&gt;&lt;/font&gt;
            return args.Cancel;&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    protected virtual void OnTextChanging(TextChangingEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        TextChanging?.Invoke(this, e);&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 TextChangingEventArgs : EventArgs&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    public string OldValue { get; }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public string NewValue { get; }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public bool Cancel { get; set; }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    public TextChangingEventArgs(string oldValue, string newValue)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        OldValue = oldValue;&lt;font&gt;&lt;/font&gt;
        NewValue = newValue;&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;또 다른 가능한 해결책은 Winforms의 &quot;MaskedTextBox&quot;에서 사용하는 &quot;MaskedTextProvider&quot;클래스를 사용하여 &quot;Masked TextBox&quot;wpf 구현 중 하나를 사용하는 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;Two potential solutions are found here -&amp;gt; &lt;a href=&quot;https://wpftoolkit.codeplex.com/wikipage?title=MaskedTextBox&quot; rel=&quot;nofollow&quot;&gt;https://wpftoolkit.codeplex.com/wikipage?title=MaskedTextBox&lt;/a&gt; and here -&amp;gt; &lt;a href=&quot;http://marlongrech.wordpress.com/2007/10/28/masked-textbox/&quot; rel=&quot;nofollow&quot;&gt;http://marlongrech.wordpress.com/2007/10/28/masked-textbox/&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/1103765/how-to-define-textbox-input-restrictions&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/1103765/how-to-define-textbox-input-restrictions&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2052</guid>
      <comments>https://copycodes.tistory.com/2052#entry2052comment</comments>
      <pubDate>Sat, 9 Jan 2021 10:13:54 +0900</pubDate>
    </item>
    <item>
      <title>주어진 날짜 이후 첫 번째 월요일의 날짜 찾기</title>
      <link>https://copycodes.tistory.com/2051</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;특정 날짜 (예 : 2011-07-02)가 주어지면 해당 날짜 이후의 다음 월요일 (또는 해당 문제의 평일) 날짜를 어떻게 찾을 수 있습니까?&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;import datetime&lt;font&gt;&lt;/font&gt;
def next_weekday(d, weekday):&lt;font&gt;&lt;/font&gt;
    days_ahead = weekday - d.weekday()&lt;font&gt;&lt;/font&gt;
    if days_ahead &amp;lt;= 0: # Target day already happened this week&lt;font&gt;&lt;/font&gt;
        days_ahead += 7&lt;font&gt;&lt;/font&gt;
    return d + datetime.timedelta(days_ahead)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
d = datetime.date(2011, 7, 2)&lt;font&gt;&lt;/font&gt;
next_monday = next_weekday(d, 0) # 0 = Monday, 1=Tuesday, 2=Wednesday...&lt;font&gt;&lt;/font&gt;
print(next_monday)&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;# Returns the date of the next given weekday after&lt;font&gt;&lt;/font&gt;
# the given date. For example, the date of next Monday.&lt;font&gt;&lt;/font&gt;
# NB: if it IS the day we're looking for, this returns 0.&lt;font&gt;&lt;/font&gt;
# consider then doing onDay(foo, day + 1).&lt;font&gt;&lt;/font&gt;
onDay = lambda date, day: date + datetime.timedelta(days=(day-date.weekday()+7)%7)&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;gt;&amp;gt;&amp;gt; dt = datetime(2011, 7, 2)&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; dt + timedelta(days=(7 - dt.weekday()))&lt;font&gt;&lt;/font&gt;
datetime.datetime(2011, 7, 4, 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;다음 월요일은 월요일 이후 7 일, 화요일 이후 6 일 등이며 Python의 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;datetime&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;유형은 monday를 &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;, ..., sunday로 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;6&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;&amp;gt;&amp;gt;&amp;gt; d = datetime.date(2011, 7, 2)&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; while d.weekday() != 0: #0 for monday&lt;font&gt;&lt;/font&gt;
...     d += datetime.timedelta(days=1)&lt;font&gt;&lt;/font&gt;
... &lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; d&lt;font&gt;&lt;/font&gt;
datetime.date(2011, 7, 4)&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;br&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;-첫 번째 일요일을 원하는 경우 주파수를 freq = 'W-SUN'으로 수정하십시오. &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;-Pandas 오프셋을 사용하면 휴일을 무시하고 업무 일에만 사용할 수 있습니다. &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;apply 메서드를 사용하여 전체 DataFrame에이 메서드를 쉽게 적용 할 수도 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;# Getting the closest monday from a given date&lt;font&gt;&lt;/font&gt;
closest_monday = pd.date_range(start=date, end=date + offsets.Day(6), freq='W-MON')[0]&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
# Adding a 'ClosestMonday' column with the closest monday for each row in a pandas df using apply&lt;font&gt;&lt;/font&gt;
# Require you to have a 'Date' column in your df&lt;font&gt;&lt;/font&gt;
def get_closest_monday(row):&lt;font&gt;&lt;/font&gt;
    return pd.date_range(start=row.Date, end=row.Date + offsets.Day(6), freq='W-MON')[0]&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
df['ClosestMonday'] = df.apply(lambda row: get_closest_monday(row), axis=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 style=&quot;vertical-align: inherit;&quot;&gt;이것은 ring 내 계산의 예입니다 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;mod 7&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 class=&quot;lang-py prettyprint-override&quot;&gt;&lt;code&gt;import datetime&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
def next_day(given_date, weekday):&lt;font&gt;&lt;/font&gt;
    day_shift = (weekday - given_date.weekday()) % 7&lt;font&gt;&lt;/font&gt;
    return given_date + datetime.timedelta(days=day_shift)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
now = datetime.date(2018, 4, 15) # sunday&lt;font&gt;&lt;/font&gt;
names = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday',    &lt;font&gt;&lt;/font&gt;
         'saturday', 'sunday']&lt;font&gt;&lt;/font&gt;
for weekday in range(7):&lt;font&gt;&lt;/font&gt;
    print(names[weekday], next_day(now, weekday))&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;monday 2018-04-16&lt;font&gt;&lt;/font&gt;
tuesday 2018-04-17&lt;font&gt;&lt;/font&gt;
wednesday 2018-04-18&lt;font&gt;&lt;/font&gt;
thursday 2018-04-19&lt;font&gt;&lt;/font&gt;
friday 2018-04-20&lt;font&gt;&lt;/font&gt;
saturday 2018-04-21&lt;font&gt;&lt;/font&gt;
sunday 2018-04-15&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;2018-04-15&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;I'm sure you'll find this answer extremely helpful after 7 years ;-)&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 datetime&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
d = datetime.date(2011, 7, 2)&lt;font&gt;&lt;/font&gt;
while d.weekday() != 0:&lt;font&gt;&lt;/font&gt;
    d += datetime.timedelta(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;pre&gt;&lt;code&gt;weekday = 0 ## Monday&lt;font&gt;&lt;/font&gt;
dt = datetime.datetime.now().replace(hour=0, minute=0, second=0) ## or any specific date&lt;font&gt;&lt;/font&gt;
days_remaining = (weekday - dt.weekday() - 1) % 7 + 1&lt;font&gt;&lt;/font&gt;
next_dt = dt + datetime.timedelta(days_remaining)&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;Another alternative uses rrule&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;from dateutil.rrule import rrule, WEEKLY, MO&lt;font&gt;&lt;/font&gt;
from datetime import date&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
next_monday = rrule(freq=WEEKLY, dtstart=date.today(), byweekday=MO, count=1)[0]&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;rrule docs: &lt;a href=&quot;https://dateutil.readthedocs.io/en/stable/rrule.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://dateutil.readthedocs.io/en/stable/rrule.html&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;This will give the first next Monday after given date:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;import datetime&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
def get_next_monday(year, month, day):&lt;font&gt;&lt;/font&gt;
    date0 = datetime.date(year, month, day)&lt;font&gt;&lt;/font&gt;
    next_monday = date0 + datetime.timedelta(7 - date0.weekday() or 7)&lt;font&gt;&lt;/font&gt;
    return next_monday&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
print get_next_monday(2011, 7, 2)&lt;font&gt;&lt;/font&gt;
print get_next_monday(2015, 8, 31)&lt;font&gt;&lt;/font&gt;
print get_next_monday(2015, 9, 1)&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;2011-07-04&lt;br&gt; 2015-09-07&lt;br&gt; 2015-09-07&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;via list comprehension?&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;from datetime import *&lt;font&gt;&lt;/font&gt;
[datetime.today()+timedelta(days=x) for x in range(0,7) if (datetime.today()+timedelta(days=x)).weekday() % 7 == 0]&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
(0 at the end is for next monday, returns current date when run on monday)&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/6558535/find-the-date-for-the-first-monday-after-a-given-a-date&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/6558535/find-the-date-for-the-first-monday-after-a-given-a-date&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2051</guid>
      <comments>https://copycodes.tistory.com/2051#entry2051comment</comments>
      <pubDate>Sat, 9 Jan 2021 10:13:27 +0900</pubDate>
    </item>
    <item>
      <title>Doctrine2 쿼리에서 제한 및 오프셋 사용</title>
      <link>https://copycodes.tistory.com/2050</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Doctrine2 쿼리에서 제한 및 오프셋 사용&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;blockquote&gt; 
 &lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;[구문 오류] 줄 0, 열 57 : 오류 : 예상되는 문자열 끝, '제한'&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;pre class=&quot;lang-php prettyprint-override&quot;&gt;&lt;code&gt;public function getFriendsFromTo ($user, $limit, $offset)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
     return $this-&amp;gt;getEntityManager()&lt;font&gt;&lt;/font&gt;
        -&amp;gt;createQuery('SELECT f FROM EMMyFriendsBundle:Friend f WHERE f.user='.$user.' limit '.$limit. 'offset' .$offset)&lt;font&gt;&lt;/font&gt;
        -&amp;gt;getResult();&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;친구와 사용자는 manyToOne 및 oneToMany와 관련되어 있으므로 friends 테이블에는 user_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;이것은 내 컨트롤러에 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre class=&quot;lang-php prettyprint-override&quot;&gt;&lt;code&gt;$user = $this-&amp;gt;get('security.context')-&amp;gt;getToken()-&amp;gt;getUser();&lt;font&gt;&lt;/font&gt;
$id = $user-&amp;gt;getId();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$friends = $user-&amp;gt;getFriends();&lt;font&gt;&lt;/font&gt;
$result = count($friends)&lt;font&gt;&lt;/font&gt;
$FR_PER_PAGE = 7;&lt;font&gt;&lt;/font&gt;
$pages = $result/$FR_PER_PAGE;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$em = $this-&amp;gt;getDoctrine()-&amp;gt;getEntityManager();&lt;font&gt;&lt;/font&gt;
$friends = $em-&amp;gt;getRepository('EMMyFriendsBundle:Friend')&lt;font&gt;&lt;/font&gt;
         -&amp;gt;getFriendsFromTo($id, $FR_PER_PAGE, $page*$FR_PER_PAGE); &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;$page*$FR_PER_PAGE&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 style=&quot;vertical-align: inherit;&quot;&gt;사용하다:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;  return $this-&amp;gt;getEntityManager()&lt;font&gt;&lt;/font&gt;
        -&amp;gt;createQuery('...')&lt;font&gt;&lt;/font&gt;
        -&amp;gt;setMaxResults(5)&lt;font&gt;&lt;/font&gt;
        -&amp;gt;setFirstResult(10)&lt;font&gt;&lt;/font&gt;
        -&amp;gt;getResult();&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;$towary = $this-&amp;gt;getDoctrine()&lt;font&gt;&lt;/font&gt;
   -&amp;gt;getRepository('AcmeStoreBundle:Towar') &lt;font&gt;&lt;/font&gt;
   -&amp;gt;findBy(array(),array(),10,($current-1)*$numItemsPerPage);&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;findBy&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;3,있는 교리 저장소의 방법의 4 매개 변수 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;limit&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;offset&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 class=&quot;lang-php prettyprint-override&quot;&gt;&lt;code&gt;findBy(&lt;font&gt;&lt;/font&gt;
    array        $criteria,&lt;font&gt;&lt;/font&gt;
    array        $orderBy  = null, &lt;font&gt;&lt;/font&gt;
    integer|null $limit    = null,&lt;font&gt;&lt;/font&gt;
    integer|null $offset   = null&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://www.doctrine-project.org/api/orm/2.2/class-Doctrine.ORM.EntityRepository.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;http://www.doctrine-project.org/api/orm/2.2/class-Doctrine.ORM.EntityRepository.html&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;/p&gt; 
&lt;p&gt;$query-&amp;gt;getSingleResult();&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/12198046/use-limit-and-offset-in-doctrine2-query&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/12198046/use-limit-and-offset-in-doctrine2-query&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2050</guid>
      <comments>https://copycodes.tistory.com/2050#entry2050comment</comments>
      <pubDate>Sat, 9 Jan 2021 10:13:18 +0900</pubDate>
    </item>
    <item>
      <title>Kotlin에서 예상되는 예외 테스트</title>
      <link>https://copycodes.tistory.com/2049</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Kotlin에서 예상되는 예외 테스트&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에서 프로그래머는 다음과 같이 JUnit 테스트 케이스에 대해 예상되는 예외를 지정할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;@Test(expected = ArithmeticException.class)&lt;font&gt;&lt;/font&gt;
public void omg()&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    int blackHole = 1 / 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;Kotlin에서 어떻게해야하나요? &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 org.junit.Test as test&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// ...&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
test(expected = ArithmeticException) fun omg()&lt;font&gt;&lt;/font&gt;
    Please specify constructor invocation;&lt;font&gt;&lt;/font&gt;
    classifier 'ArithmeticException' does not have a companion object&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
test(expected = ArithmeticException.class) fun omg()&lt;font&gt;&lt;/font&gt;
                           name expected ^&lt;font&gt;&lt;/font&gt;
                                           ^ expected ')'&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;@Test(expected = ArithmeticException::class)
&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;a href=&quot;https://github.com/JetBrains/kotlin/tree/master/libraries/kotlin.test&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Kotlin에는&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://github.com/JetBrains/kotlin/tree/master/libraries/kotlin.test&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;a href=&quot;https://github.com/JetBrains/kotlin/tree/master/libraries/kotlin.test&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 style=&quot;vertical-align: inherit;&quot;&gt;더하다&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;import kotlin.test.*
&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;assertFailWith&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;@Test&lt;font&gt;&lt;/font&gt;
fun test_arithmethic() {&lt;font&gt;&lt;/font&gt;
    assertFailsWith(ArithmeticException::class) {&lt;font&gt;&lt;/font&gt;
        omg()&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&gt;&lt;code&gt;kotlin-test.jar&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&gt;&lt;code&gt;@Test(expected = ArithmeticException::class)&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.NET과 같은 Kotlin의 라이브러리 메소드 중 하나를 &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;a href=&quot;http://kotlinlang.org/api/latest/jvm/stdlib/kotlin.test/fails-with.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;failsWith()&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;/p&gt; 
&lt;pre&gt;&lt;code&gt;inline fun &amp;lt;reified T : Throwable&amp;gt; failsWithX(noinline block: () -&amp;gt; Any) {&lt;font&gt;&lt;/font&gt;
    kotlin.test.failsWith(javaClass&amp;lt;T&amp;gt;(), block)&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;@Test(expected = ArithmeticException::class)&lt;font&gt;&lt;/font&gt;
fun omg() {&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&gt;&lt;a href=&quot;https://github.com/kotlintest/kotlintest&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;a href=&quot;https://github.com/kotlintest/kotlintest&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;KotlinTest&lt;/font&gt;&lt;/a&gt;&lt;font 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;테스트에서 shouldThrow 블록으로 임의 코드를 래핑 할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;shouldThrow&amp;lt;ArithmeticException&amp;gt; {&lt;font&gt;&lt;/font&gt;
  // code in here that you expect to throw a ArithmeticException&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 also use generics with kotlin.test package:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;import kotlin.test.assertFailsWith &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
@Test&lt;font&gt;&lt;/font&gt;
fun testFunction() {&lt;font&gt;&lt;/font&gt;
    assertFailsWith&amp;lt;MyException&amp;gt; {&lt;font&gt;&lt;/font&gt;
         // The code that will throw MyException&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;JUnit 5.1 has &lt;a href=&quot;https://junit.org/junit5/docs/5.1.1/release-notes/#improved-kotlin-support&quot; rel=&quot;nofollow noreferrer&quot;&gt;kotlin support&lt;/a&gt; built in.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;import org.junit.jupiter.api.Test&lt;font&gt;&lt;/font&gt;
import org.junit.jupiter.api.assertThrows&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
class MyTests {&lt;font&gt;&lt;/font&gt;
    @Test&lt;font&gt;&lt;/font&gt;
    fun `division by zero -- should throw ArithmeticException`() {&lt;font&gt;&lt;/font&gt;
        assertThrows&amp;lt;ArithmeticException&amp;gt; {  1 / 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;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/30331806/test-expected-exceptions-in-kotlin&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/30331806/test-expected-exceptions-in-kotlin&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2049</guid>
      <comments>https://copycodes.tistory.com/2049#entry2049comment</comments>
      <pubDate>Sat, 9 Jan 2021 10:13:09 +0900</pubDate>
    </item>
    <item>
      <title>NUnit Assert.AreEqual DateTime 허용 오차</title>
      <link>https://copycodes.tistory.com/2048</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;NUnit Assert.AreEqual DateTime 허용 오차&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 style=&quot;vertical-align: inherit;&quot;&gt;우리는 일반적으로 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Assert.AreEqual()&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 style=&quot;vertical-align: inherit;&quot;&gt;DateTime 속성에서 이것을 사용하기 시작할 때까지.&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 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;.ToShortDateString()&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;.ToShortTimeString()&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;Debug.Assert((date1 - date2) &amp;lt; TimeSpan.FromSeconds(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;Debug.Assert(Math.Abs((date1 - date2).TotalSeconds) &amp;lt; 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;NUnit은 또한 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.nunit.org/index.php?p=equalConstraint&amp;amp;r=2.4.8&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;Within&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;DateTime now = DateTime.Now;&lt;font&gt;&lt;/font&gt;
DateTime later = now + TimeSpan.FromHours(1.0);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
Assert.That(later, Is.EqualTo(now).Within(TimeSpan.FromHours(3.0)));&lt;font&gt;&lt;/font&gt;
Assert.That(later, Is.EqualTo(now).Within(3).Hours);&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;Assert.AreEqual&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 style=&quot;vertical-align: inherit;&quot;&gt;Assert.That&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;Is.Equal&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;아래는 Nunit 웹 사이트 자체의 코드 샘플입니다.&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;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;DateTime now = DateTime.Now;&lt;font&gt;&lt;/font&gt;
DateTime later = now + TimeSpan.FromHours(1.0);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
Assert.That(now, Is.EqualTo(now) );&lt;font&gt;&lt;/font&gt;
Assert.That(later, Is.EqualTo(now).Within(TimeSpan.FromHours(3.0)));&lt;font&gt;&lt;/font&gt;
Assert.That(later, Is.EqualTo(now).Within(3).Hours);&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;임의의 두 날짜가 1 초 허용 오차 이내와 같은지 정확하게 확인하려면 다음이 올바른 솔루션입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Debug.Assert(Math.Abs((date1 - date2).TotalSeconds) &amp;lt; 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 style=&quot;vertical-align: inherit;&quot;&gt;1 초 이상 더 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;date2&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;date1&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;되었고 솔루션이 @ SwDevMan81에 대한 내 의견에 따라 업데이트되지 않았기 &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/3577856/nunit-assert-areequal-datetime-tolerances&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/3577856/nunit-assert-areequal-datetime-tolerances&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2048</guid>
      <comments>https://copycodes.tistory.com/2048#entry2048comment</comments>
      <pubDate>Sat, 9 Jan 2021 10:13:01 +0900</pubDate>
    </item>
    <item>
      <title>MySQL tmp_table_size max_heap_table_size</title>
      <link>https://copycodes.tistory.com/2047</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;MySQL tmp_table_size max_heap_table_size&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;2 일 전 내 서버에서 my &lt;/font&gt;&lt;/font&gt;&lt;code&gt;tmp_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&gt;&lt;code&gt;max_heap_table_size(16M)&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;나는 한 시간 한 번 실행이과에서 시작하는 보고서를 생성하는 cron 작업을했다 : &lt;/font&gt;&lt;/font&gt;&lt;code&gt;created_tmp_disk_tables&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;created_tmp_files&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;created_tmp_tables&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;created_tmp_disk_tables&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;created_tmp_files&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;created_tmp_tables&lt;/code&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&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;code&gt;tmp_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&gt;&lt;code&gt;max_heap_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&gt;&lt;code&gt;16M&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;ul&gt; 
   &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;27.37 % (created_tmp_disk_tables) &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;1.16 % (created_tmp_files)&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;71.48 % (created_tmp_tables)&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
  &lt;/ul&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;ol start=&quot;2&quot;&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;tmp_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&gt;&lt;code&gt;max_heap_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&gt;&lt;code&gt;20M&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;23.48 % (created_tmp_disk_tables) &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;32.44 % (created_tmp_files)&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;44.07 % (created_tmp_tables)&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
  &lt;/ul&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;7 시간 후 (다시 시작 후) : &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;21.70 % (created_tmp_disk_tables) &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;33.75 % (created_tmp_files)&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;44.55 % (created_tmp_tables)&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;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;code&gt;27.37%&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;21.70%&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;/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;1.16%&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;33.75%&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;/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;71.48%&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;44.55%&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;/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&gt;&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_tmp_table_size&quot;&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;tmp_table_size&lt;/font&gt;&lt;/font&gt;&lt;/strong&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://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_max_heap_table_size&quot;&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;max_heap_table_size&lt;/font&gt;&lt;/font&gt;&lt;/strong&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;쿼리 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;ORDER BY&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;a href=&quot;http://dev.mysql.com/doc/refman/5.5/en/server-status-variables.html#statvar_Created_tmp_tables&quot;&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Created_tmp_tables&lt;/font&gt;&lt;/font&gt;&lt;/strong&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;a href=&quot;http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_tmp_table_size&quot;&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;tmp_table_size&lt;/font&gt;&lt;/font&gt;&lt;/strong&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;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&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;/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;a href=&quot;http://dev.mysql.com/doc/refman/5.5/en/server-status-variables.html#statvar_Created_tmp_disk_tables&quot;&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Created_tmp_disk_tables를&lt;/font&gt;&lt;/strong&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 증가시킵니다.&lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.5/en/server-status-variables.html#statvar_Created_tmp_disk_tables&quot;&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/strong&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;blockquote&gt; 
 &lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;디스크 테이블이 27.37 %에서 21.70 %로 감소-&amp;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;이는 이전에 실행 된 쿼리가 RAM에 남아있는 결과를 캐시 한 경우 쉽게 발생할 수 있습니다. &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;임시 파일이 1.16 %에서 33.75 %로 증가했습니다.-&amp;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 style=&quot;vertical-align: inherit;&quot;&gt;이것은 단순히 임시 테이블이 필요한 쿼리가 있다는 사실을 나타냅니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;먼저 RAM에서 생성되었습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이는 잘 조인되지 않는 쿼리 ( &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_join_buffer_size&quot;&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;join_buffer_size&lt;/font&gt;&lt;/font&gt;&lt;/strong&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;ORDER BY&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://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_sort_buffer_size&quot;&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;sort_buffer_size&lt;/font&gt;&lt;/font&gt;&lt;/strong&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;blockquote&gt; 
 &lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;메모리 테이블이 71.48 %에서 44.55 %로 감소-&amp;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;이것은 놀라운 일이 아닙니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;동일한 값을 가진 동일한 쿼리에 대한 충분한 호출이있는 경우 이전에 캐시 된 결과의 쿼리 이행으로 정렬 및 조인이 선점 될 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;h1&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;추천&lt;/font&gt;&lt;/font&gt;&lt;/h1&gt; 
&lt;p&gt;&lt;font style=&quot;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://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_join_buffer_size&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;join_buffer_size&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_sort_buffer_size&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;sort_buffer_size&lt;/font&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;ul&gt; 
   &lt;li&gt;in joins via eq_ref&lt;/li&gt; 
   &lt;li&gt;in sorts via index scans in order&lt;/li&gt; 
  &lt;/ul&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;The overall goal should be to prevent temp table creation as much as possible. Simply increasing &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_tmp_table_size&quot;&gt;&lt;strong&gt;tmp_table_size&lt;/strong&gt;&lt;/a&gt; and &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_max_heap_table_size&quot;&gt;&lt;strong&gt;max_heap_table_size&lt;/strong&gt;&lt;/a&gt; lets inefficient queries and tables that lack proper indexing run amok.&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/13259275/mysql-tmp-table-size-max-heap-table-size&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/13259275/mysql-tmp-table-size-max-heap-table-size&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2047</guid>
      <comments>https://copycodes.tistory.com/2047#entry2047comment</comments>
      <pubDate>Sat, 9 Jan 2021 10:12:52 +0900</pubDate>
    </item>
    <item>
      <title>Windows PowerShell에 파일이 있는지 확인 하시겠습니까?</title>
      <link>https://copycodes.tistory.com/2046</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Windows PowerShell에 파일이 있는지 확인 하시겠습니까?&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;$filestowatch=get-content C:\H\files-to-watch.txt&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$adminFiles=dir C:\H\admin\admin -recurse | ? { $fn=$_.FullName; ($filestowatch | % {$fn.contains($_)}) -contains $True}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$userFiles=dir C:\H\user\user -recurse | ? { $fn=$_.FullName; ($filestowatch | % {$fn.contains($_)}) -contains $True}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
foreach($userfile in $userFiles)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
      $exactadminfile= $adminfiles | ? {$_.Name -eq $userfile.Name} |Select -First 1&lt;font&gt;&lt;/font&gt;
      $filetext1=[System.IO.File]::ReadAllText($exactadminfile.FullName)&lt;font&gt;&lt;/font&gt;
      $filetext2=[System.IO.File]::ReadAllText($userfile.FullName)&lt;font&gt;&lt;/font&gt;
      $equal = $filetext1 -ceq $filetext2 # case sensitive comparison&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
      if ($equal) { &lt;font&gt;&lt;/font&gt;
        Write-Host &quot;Checking == : &quot; $userfile.FullName &lt;font&gt;&lt;/font&gt;
        continue; &lt;font&gt;&lt;/font&gt;
      } &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
      if($exactadminfile.LastWriteTime -gt $userfile.LastWriteTime)&lt;font&gt;&lt;/font&gt;
      {&lt;font&gt;&lt;/font&gt;
         Write-Host &quot;Checking != : &quot; $userfile.FullName &quot; &amp;gt;&amp;gt; user&quot;&lt;font&gt;&lt;/font&gt;
         Copy-Item -Path $exactadminfile.FullName -Destination $userfile.FullName -Force&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;
          Write-Host &quot;Checking != : &quot; $userfile.FullName &quot; &amp;gt;&amp;gt; admin&quot;&lt;font&gt;&lt;/font&gt;
          Copy-Item -Path $userfile.FullName -Destination $exactadminfile.FullName -Force&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;다음은 files-to-watch.txt 형식입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;content\less\_light.less&lt;font&gt;&lt;/font&gt;
content\less\_mixins.less&lt;font&gt;&lt;/font&gt;
content\less\_variables.less&lt;font&gt;&lt;/font&gt;
content\font-awesome\variables.less&lt;font&gt;&lt;/font&gt;
content\font-awesome\mixins.less&lt;font&gt;&lt;/font&gt;
content\font-awesome\path.less&lt;font&gt;&lt;/font&gt;
content\font-awesome\core.less&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;누군가 PowerShell을 사용하여 파일이 있는지 확인하는 방법을 알려줄 수 있습니까?&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;https://technet.microsoft.com/en-us/library/ee177015.aspx&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;cmdlet에 &lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/system.io.file.exists(v=vs.110).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;대한 대안&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;a href=&quot;https://technet.microsoft.com/en-us/library/ee177015.aspx&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;Test-Path&lt;/code&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;/p&gt; 
&lt;pre&gt;&lt;code&gt;[System.IO.File]::Exists($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;pre&gt;&lt;code&gt;Test-Path $path -PathType Leaf
&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;a href=&quot;https://technet.microsoft.com/en-us/library/hh849776.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;테스트 경로&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;if (!(Test-Path $exactadminfile) -and !(Test-Path $userfile)) {&lt;font&gt;&lt;/font&gt;
  Write-Warning &quot;$userFile absent from both locations&quot;&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&gt;&lt;code&gt;ForEach&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;Test-Path를 사용하려고합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Test-Path &amp;lt;path to file&amp;gt; -PathType Leaf
&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 standard way to see if a file exists is with the &lt;code&gt;Test-Path&lt;/code&gt; cmdlet.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Test-Path -path $filename
&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 the &lt;code&gt;Test-Path&lt;/code&gt; cmd-let. So something like...&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;if(!(Test-Path [oldLocation]) -and !(Test-Path [newLocation]))&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    Write-Host &quot;$file doesn't exist in both locations.&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;cls&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$exactadminfile = &quot;C:\temp\files\admin&quot; #First folder to check the file&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$userfile = &quot;C:\temp\files\user&quot; #Second folder to check the file&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$filenames=Get-Content &quot;C:\temp\files\files-to-watch.txt&quot; #Reading the names of the files to test the existance in one of the above locations&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
foreach ($filename in $filenames) {&lt;font&gt;&lt;/font&gt;
  if (!(Test-Path $exactadminfile\$filename) -and !(Test-Path $userfile\$filename)) { #if the file is not there in either of the folder&lt;font&gt;&lt;/font&gt;
    Write-Warning &quot;$filename absent from both locations&quot;&lt;font&gt;&lt;/font&gt;
  } else {&lt;font&gt;&lt;/font&gt;
    Write-Host &quot; $filename  File is there in one or both Locations&quot; #if file exists there at both locations or at least in one location&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;Test-Path may give odd answer. E.g. &quot;Test-Path c:\temp\ -PathType leaf&quot; gives false, but &quot;Test-Path c:\temp* -PathType leaf&quot; gives true. Sad :(&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/31879814/check-if-a-file-exists-or-not-in-windows-powershell&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/31879814/check-if-a-file-exists-or-not-in-windows-powershell&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2046</guid>
      <comments>https://copycodes.tistory.com/2046#entry2046comment</comments>
      <pubDate>Sat, 9 Jan 2021 10:12:44 +0900</pubDate>
    </item>
    <item>
      <title>BottomNavigationView 레이블 제거</title>
      <link>https://copycodes.tistory.com/2045</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;BottomNavigationView 레이블 제거&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;Google은 BottomNavigationView와 함께 새로운 지원 라이브러리 v25를 출시했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/R572H.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/R572H.gif&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;/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;그러나 Design Support Library 28.0.0-alpha1부터는 속성을 사용할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;app:labelVisibilityMode=&quot;unlabeled&quot;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QL6fW.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QL6fW.png&quot; alt=&quot;레이블이없는 BottomNavigationView&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;다른 값 &quot;auto&quot;, &quot;labeled&quot;및 &quot;selected&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;p&gt;&lt;img src=&quot;https://github.com/ittianyu/BottomNavigationViewEx/raw/master/read_me_images/no_animation_shifting_mode_item_shifting_mode_text.gif&quot; alt=&quot;&quot;&gt;&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;https://github.com/ittianyu/BottomNavigationViewEx/raw/master/read_me_images/no_text.gif&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;a href=&quot;https://github.com/ittianyu/BottomNavigationViewEx&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;BottomNavigationViewEx&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://github.com/ittianyu/BottomNavigationViewEx&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 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;불행히도이 첫 번째 BottomNavigationView 버전에는 많은 제한이있었습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그리고 지금은 지원 디자인 API를 사용하여 제목을 제거 할 수 없습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따라서 Google이 구현하지 않는 동안이 제한을 해결하려면 다음을 수행하십시오 (반사 사용).&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. bottom_navigation_menu.xml 파일에서 제목을 비워 둡니다.&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;2. BottomNavigationView를 확장합니다.&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;    public class MyBottomNavigationView extends BottomNavigationView {&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
      public MyBottomNavigationView(Context context, AttributeSet attrs) {&lt;font&gt;&lt;/font&gt;
          super(context, attrs);&lt;font&gt;&lt;/font&gt;
          centerMenuIcon();&lt;font&gt;&lt;/font&gt;
      }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
      private void centerMenuIcon() {&lt;font&gt;&lt;/font&gt;
          BottomNavigationMenuView menuView = getBottomMenuView();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
          if (menuView != null) {&lt;font&gt;&lt;/font&gt;
              for (int i = 0; i &amp;lt; menuView.getChildCount(); i++) {&lt;font&gt;&lt;/font&gt;
                BottomNavigationItemView menuItemView = (BottomNavigationItemView) menuView.getChildAt(i);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
                AppCompatImageView icon = (AppCompatImageView) menuItemView.getChildAt(0);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
                FrameLayout.LayoutParams params = (LayoutParams) icon.getLayoutParams();&lt;font&gt;&lt;/font&gt;
                params.gravity = Gravity.CENTER;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
                menuItemView.setShiftingMode(true);&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;
      private BottomNavigationMenuView getBottomMenuView() {&lt;font&gt;&lt;/font&gt;
          Object menuView = null;&lt;font&gt;&lt;/font&gt;
          try {&lt;font&gt;&lt;/font&gt;
              Field field = BottomNavigationView.class.getDeclaredField(&quot;mMenuView&quot;);&lt;font&gt;&lt;/font&gt;
              field.setAccessible(true);&lt;font&gt;&lt;/font&gt;
              menuView = field.get(this);&lt;font&gt;&lt;/font&gt;
          } catch (NoSuchFieldException | IllegalAccessException e) {&lt;font&gt;&lt;/font&gt;
              e.printStackTrace();&lt;font&gt;&lt;/font&gt;
          }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
          return (BottomNavigationMenuView) menuView;&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;3.이 customView를 layout.xml에 추가하십시오.&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;a href=&quot;https://github.com/DavidSanf0rd/BottomNavigationViewSample&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Github에서&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://github.com/DavidSanf0rd/BottomNavigationViewSample&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;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;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;menu / abc.xml&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;code&gt;android:title=&quot;&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;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&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;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;import android.support.design.internal.BottomNavigationMenuView;&lt;font&gt;&lt;/font&gt;
import android.support.design.widget.BottomNavigationView;&lt;font&gt;&lt;/font&gt;
import android.support.v7.widget.AppCompatImageView;&lt;font&gt;&lt;/font&gt;
import android.util.Log;&lt;font&gt;&lt;/font&gt;
import android.view.Gravity;&lt;font&gt;&lt;/font&gt;
import android.widget.FrameLayout;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
import java.lang.reflect.Field;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
public class BottomNavigationViewHelper {&lt;font&gt;&lt;/font&gt;
    public static void disableShiftMode(BottomNavigationView view) {&lt;font&gt;&lt;/font&gt;
        BottomNavigationMenuView menuView = (BottomNavigationMenuView) view.getChildAt(0);&lt;font&gt;&lt;/font&gt;
        try {&lt;font&gt;&lt;/font&gt;
            Field shiftingMode = menuView.getClass().getDeclaredField(&quot;mShiftingMode&quot;);&lt;font&gt;&lt;/font&gt;
            shiftingMode.setAccessible(true);&lt;font&gt;&lt;/font&gt;
            shiftingMode.setBoolean(menuView, false);&lt;font&gt;&lt;/font&gt;
            shiftingMode.setAccessible(false);&lt;font&gt;&lt;/font&gt;
            for (int i = 0; i &amp;lt; menuView.getChildCount(); i++) {&lt;font&gt;&lt;/font&gt;
                BottomNavigationItemView item = (BottomNavigationItemView) menuView.getChildAt(i);&lt;font&gt;&lt;/font&gt;
                //noinspection RestrictedApi&lt;font&gt;&lt;/font&gt;
                item.setShiftingMode(false);&lt;font&gt;&lt;/font&gt;
                item.setPadding(0, 15, 0, 0);&lt;font&gt;&lt;/font&gt;
                // set once again checked value, so view will be updated&lt;font&gt;&lt;/font&gt;
                //noinspection RestrictedApi&lt;font&gt;&lt;/font&gt;
                item.setChecked(item.getItemData().isChecked());&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        } catch (NoSuchFieldException e) {&lt;font&gt;&lt;/font&gt;
            Log.e(&quot;BNVHelper&quot;, &quot;Unable to get shift mode field&quot;, e);&lt;font&gt;&lt;/font&gt;
        } catch (IllegalAccessException e) {&lt;font&gt;&lt;/font&gt;
            Log.e(&quot;BNVHelper&quot;, &quot;Unable to change value of shift mode&quot;, e);&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;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; 기본 활동에서 다음 행을 추가하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;mBottomNav = (BottomNavigationView) findViewById(R.id.navigation);&lt;font&gt;&lt;/font&gt;
BottomNavigationViewHelper.disableShiftMode(mBottomNav);&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;private void removeTextLabel(@NonNull BottomNavigationView bottomNavigationView, @IdRes int menuItemId) {&lt;font&gt;&lt;/font&gt;
    View view = bottomNavigationView.findViewById(menuItemId);&lt;font&gt;&lt;/font&gt;
    if (view == null) return;&lt;font&gt;&lt;/font&gt;
    if (view instanceof MenuView.ItemView) {&lt;font&gt;&lt;/font&gt;
        ViewGroup viewGroup = (ViewGroup) view;&lt;font&gt;&lt;/font&gt;
        int padding = 0;&lt;font&gt;&lt;/font&gt;
        for (int i = 0; i &amp;lt; viewGroup.getChildCount(); i++) {&lt;font&gt;&lt;/font&gt;
            View v = viewGroup.getChildAt(i);&lt;font&gt;&lt;/font&gt;
            if (v instanceof ViewGroup) {&lt;font&gt;&lt;/font&gt;
                padding = v.getHeight();&lt;font&gt;&lt;/font&gt;
                viewGroup.removeViewAt(i);&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        viewGroup.setPadding(view.getPaddingLeft(), (viewGroup.getPaddingTop() + padding) / 2, view.getPaddingRight(), view.getPaddingBottom());&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 style=&quot;vertical-align: inherit;&quot;&gt;추가하면됩니다. &lt;/font&gt;&lt;/font&gt;&lt;code&gt;app:itemTextColor=&quot;@android:color/transparent&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;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;a href=&quot;https://stackoverflow.com/questions/40176244/how-to-disable-bottomnavigationview-shift-mode&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&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public void removeLabels(@IdRes int... menuItemIds) {&lt;font&gt;&lt;/font&gt;
    getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {&lt;font&gt;&lt;/font&gt;
        @Override public boolean onPreDraw() {&lt;font&gt;&lt;/font&gt;
            getViewTreeObserver().removeOnPreDrawListener(this);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            // this only needs to be calculated once for an unchecked item, it'll be the same value for all items&lt;font&gt;&lt;/font&gt;
            ViewGroup uncheckedItem = findFirstUncheckedItem(menuItemIds);&lt;font&gt;&lt;/font&gt;
            View icon = uncheckedItem.getChildAt(0);&lt;font&gt;&lt;/font&gt;
            int iconTopMargin = ((LayoutParams) uncheckedItem.getChildAt(0).getLayoutParams()).topMargin;&lt;font&gt;&lt;/font&gt;
            int desiredTopMargin = (uncheckedItem.getHeight() - uncheckedItem.getChildAt(0).getHeight()) / 2;&lt;font&gt;&lt;/font&gt;
            int itemTopPadding = desiredTopMargin - iconTopMargin;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            for (int id : menuItemIds) {&lt;font&gt;&lt;/font&gt;
                ViewGroup item = findViewById(id);&lt;font&gt;&lt;/font&gt;
                // remove the label&lt;font&gt;&lt;/font&gt;
                item.removeViewAt(1);&lt;font&gt;&lt;/font&gt;
                // and then center the icon&lt;font&gt;&lt;/font&gt;
                item.setPadding(item.getPaddingLeft(), itemTopPadding, item.getPaddingRight(),&lt;font&gt;&lt;/font&gt;
                        item.getPaddingBottom());&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            return true;&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;
@SuppressLint(&quot;RestrictedApi&quot;)&lt;font&gt;&lt;/font&gt;
private ViewGroup findFirstUncheckedItem(@IdRes int... menuItemIds) {&lt;font&gt;&lt;/font&gt;
    BottomNavigationItemView item = findViewById(menuItemIds[0]);&lt;font&gt;&lt;/font&gt;
    int i = 1;&lt;font&gt;&lt;/font&gt;
    while (item.getItemData().isChecked()) {&lt;font&gt;&lt;/font&gt;
        item = findViewById(menuItemIds[i++]);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    return item;&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;BottomNavigationView&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하고 메뉴 항목의 ID를 전달하여 호출하십시오.&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;a href=&quot;https://stackoverflow.com/a/40188794/1104612&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;sanf0rd가 그의 답변에서 준&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;code&gt;AppCompatImageView&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;ImageView&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;getChildAt&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;findViewById&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;private void centerMenuIcon() {&lt;font&gt;&lt;/font&gt;
    BottomNavigationMenuView menuView = getBottomMenuView();&lt;font&gt;&lt;/font&gt;
    if (menuView != null) {&lt;font&gt;&lt;/font&gt;
        for (int i = 0; i &amp;lt; menuView.getChildCount(); i++) {&lt;font&gt;&lt;/font&gt;
            BottomNavigationItemView menuItemView = (BottomNavigationItemView) menuView.getChildAt(i);&lt;font&gt;&lt;/font&gt;
            TextView smallText = (TextView) menuItemView.findViewById(R.id.smallLabel);&lt;font&gt;&lt;/font&gt;
            smallText.setVisibility(View.INVISIBLE);&lt;font&gt;&lt;/font&gt;
            //TextView largeText = (TextView) menuItemView.findViewById(R.id.largeLabel);&lt;font&gt;&lt;/font&gt;
            ImageView icon = (ImageView) menuItemView.findViewById(R.id.icon);&lt;font&gt;&lt;/font&gt;
            FrameLayout.LayoutParams params = (LayoutParams) icon.getLayoutParams();&lt;font&gt;&lt;/font&gt;
            params.gravity = Gravity.CENTER;&lt;font&gt;&lt;/font&gt;
            menuItemView.setShiftingMode(true);&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/40183239/remove-bottomnavigationview-labels&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/40183239/remove-bottomnavigationview-labels&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2045</guid>
      <comments>https://copycodes.tistory.com/2045#entry2045comment</comments>
      <pubDate>Sat, 9 Jan 2021 10:12:35 +0900</pubDate>
    </item>
    <item>
      <title>데이터 바인딩을 사용하여보기 가시성 설정</title>
      <link>https://copycodes.tistory.com/2044</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/35723823/android-data-binding-visibility-on-include-tag&quot; dir=&quot;ltr&quot;&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;/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;7 답변&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&gt;&lt;code&gt;View&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;Identifiers must have user defined types from the XML file. visible is missing it&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;data&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;variable&lt;font&gt;&lt;/font&gt;
        name=&quot;sale&quot;&lt;font&gt;&lt;/font&gt;
        type=&quot;java.lang.Boolean&quot;/&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/data&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&amp;lt;FrameLayout android:visibility=&quot;@{sale ? visible : gone}&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&gt;&lt;a href=&quot;https://developer.android.com/topic/libraries/data-binding/index.html#expression_language&quot; rel=&quot;noreferrer&quot;&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;/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;&amp;lt;data&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;import type=&quot;android.view.View&quot;/&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;variable&lt;font&gt;&lt;/font&gt;
        name=&quot;sale&quot;&lt;font&gt;&lt;/font&gt;
        type=&quot;java.lang.Boolean&quot;/&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/data&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&amp;lt;FrameLayout android:visibility=&quot;@{sale ? View.GONE : View.VISIBLE}&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;레이아웃에서 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;data&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;variable&lt;font&gt;&lt;/font&gt;
        name=&quot;viewModel&quot;&lt;font&gt;&lt;/font&gt;
        type=&quot;....&quot;/&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/data&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&amp;lt;View&lt;font&gt;&lt;/font&gt;
 android:layout_width=&quot;10dp&quot;&lt;font&gt;&lt;/font&gt;
 android:layout_height=&quot;10dp&quot;&lt;font&gt;&lt;/font&gt;
 android:visibility=&quot;@{viewModel.saleVisibility, default=gone}&quot;/&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;ViewModel Java 코드에서 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;@Bindable&lt;font&gt;&lt;/font&gt;
public int getSaleVisibility(){&lt;font&gt;&lt;/font&gt;
 return mSaleIndecator ? VISIBLE : GONE;&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;visibility&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;Integer&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;View&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;ol&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;View.VISIBLE&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;View.GONE&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;a href=&quot;https://developer.android.com/topic/libraries/data-binding/index.html#imports&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://developer.android.com/topic/libraries/data-binding/index.html#imports&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;Define a custom setter for &lt;code&gt;visibility&lt;/code&gt; that takes a &lt;code&gt;Boolean&lt;/code&gt;. &lt;a href=&quot;https://developer.android.com/topic/libraries/data-binding/index.html#custom_setters&quot; rel=&quot;noreferrer&quot;&gt;https://developer.android.com/topic/libraries/data-binding/index.html#custom_setters&lt;/a&gt;&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;Possible implementation:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;@BindingAdapter(&quot;android:visibility&quot;)&lt;font&gt;&lt;/font&gt;
public static void setVisibility(View view, Boolean value) {&lt;font&gt;&lt;/font&gt;
    view.setVisibility(value ? View.VISIBLE : View.GONE);&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Which will make &lt;code&gt;&amp;lt;FrameLayout android:visibility=&quot;@{sale}&quot;/&amp;gt;&lt;/code&gt; work.&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/44420396/use-data-binding-to-set-view-visibility&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/44420396/use-data-binding-to-set-view-visibility&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2044</guid>
      <comments>https://copycodes.tistory.com/2044#entry2044comment</comments>
      <pubDate>Sat, 9 Jan 2021 10:12:23 +0900</pubDate>
    </item>
    <item>
      <title>WPF : UserControl에서 표시하는 대화 상자의 소유자 창을 어떻게 설정합니까?</title>
      <link>https://copycodes.tistory.com/2043</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;WPF : UserControl에서 표시하는 대화 상자의 소유자 창을 어떻게 설정합니까?&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;이 세 가지 유형의 WPF 응용 프로그램이 있습니다.&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;WindowMain&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;UserControlZack&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;WindowModal&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;UserControlZack1이 내 WindowMain에 있습니다 ...&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;Window x:Class=&quot;WindowMain&quot;&lt;font&gt;&lt;/font&gt;
        xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;&lt;font&gt;&lt;/font&gt;
        xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&lt;font&gt;&lt;/font&gt;
        xmlns:local=&quot;clr-namespace:ProjectName&quot;&lt;font&gt;&lt;/font&gt;
        ...&lt;font&gt;&lt;/font&gt;
        Name=&quot;WindowMain&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;Grid&amp;gt;&lt;font&gt;&lt;/font&gt;
        ...&lt;font&gt;&lt;/font&gt;
        &amp;lt;local:UserControlZack x:Name=&quot;UserControlZack1&quot; ... /&amp;gt;&lt;font&gt;&lt;/font&gt;
        ...&lt;font&gt;&lt;/font&gt;
    &amp;lt;/Grid&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/Window&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;UserControlZack1은 WindowModal dailog 상자를 표시합니다 ...&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;부분 공용 클래스 UserControlZack&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
   ...&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
    비공개 서브 SomeButton_Click (...)&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
        '대화 상자를 인스턴스화하고 모달로 엽니 다 ...&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
        Dim box As WindowModal = New WindowModal ()&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
        box.Owner = ?????&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
        box.ShowDialog ()&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
        '대화 상자가 수락되면 사용자가 입력 한 데이터 처리 ...&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
        If (box.DialogResult.GetValueOrDefault = True) 그런 다음&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
            _SomeVar = 상자 .SomeVar&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
            ...&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
        End If&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
    End Sub&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
수업 종료&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;box.Owner를 올바른 Window, 실행중인 WindowMain 인스턴스로 설정하려면 어떻게해야합니까?&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;box.Owner = Me.Owner&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot; 'Owner'는 'ProjectName.UserControlZack'의 구성원이 아니기 때문에 &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;&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;box.Owner = Me.Parent&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Window가 아닌 ​​Grid를 반환하기 때문에 &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;box.Owner = WindowMain&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot; 'WindowMain'는 유형이고 식으로 사용할 수 없습니다.&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;.Owner = Window.GetWindow(this)
&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;(Window)PresentationSource.FromVisual(this).RootVisual
&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;Application.Current.MainWindow
&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;MyWpfDialog dialog = new MyWpfDialog();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
//remember, this is WinForms UserControl and its Handle property is&lt;font&gt;&lt;/font&gt;
//actually IntPtr containing Win32 HWND.&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
new System.Windows.Interop.WindowInteropHelper(dialog).Owner = this.Handle;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
dialog.ShowDialog();&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;댓글에서 Greg를 도우려고 업데이트 중입니다. &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;따라서 다음과 같은 클래스 Commands.cs가 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;public static class Commands&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    public static RoutedUICommand TestShowDialogCommand = new RoutedUICommand(&quot;Test command&quot;, &quot;TestShowDialog&quot;, typeof(Commands));&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;기본 창에 등록하십시오 : (canshow가 필요하지 않습니다. 기본값은 true입니다)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;    public Window1()&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        InitializeComponent();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        CommandManager.RegisterClassCommandBinding(typeof(System.Windows.Controls.Control),&lt;font&gt;&lt;/font&gt;
            new CommandBinding(Commands.TestShowDialogCommand, ShowDialogCommand, CanShowDialogCommand));&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private void ShowDialogCommand(object sender, ExecutedRoutedEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var box = new Window();&lt;font&gt;&lt;/font&gt;
        box.Owner = this;&lt;font&gt;&lt;/font&gt;
        box.ShowDialog();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    private void CanShowDialogCommand(object sender, CanExecuteRoutedEventArgs e)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        e.CanExecute = true;&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;이것은 기본 창에 대한 내 xaml입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;Window x:Class=&quot;WpfApplication1.Window1&quot;&lt;font&gt;&lt;/font&gt;
xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;&lt;font&gt;&lt;/font&gt;
xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&lt;font&gt;&lt;/font&gt;
xmlns:WpfApplication1=&quot;clr-namespace:WpfApplication1&quot;&lt;font&gt;&lt;/font&gt;
Title=&quot;Window1&quot; Height=&quot;300&quot; Width=&quot;322&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;Grid&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;StackPanel&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;Menu&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;MenuItem Header=&quot;Test&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;MenuItem Header=&quot;ShowDialog&quot; Command=&quot;{x:Static WpfApplication1:Commands.TestShowDialogCommand}&quot;/&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;/MenuItem&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/Menu&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;WpfApplication1:BazUserControl /&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/StackPanel&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/Grid&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/Window&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;This is the xaml for my user control (default code behind only)&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;UserControl x:Class=&quot;WpfApplication1.BazUserControl&quot;&lt;font&gt;&lt;/font&gt;
xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;&lt;font&gt;&lt;/font&gt;
xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&lt;font&gt;&lt;/font&gt;
xmlns:WpfApplication1=&quot;clr-namespace:WpfApplication1&quot;&lt;font&gt;&lt;/font&gt;
Height=&quot;300&quot; Width=&quot;300&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;Grid&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;StackPanel&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;Button Command=&quot;{x:Static WpfApplication1:Commands.TestShowDialogCommand}&quot; Content=&quot;ClickMe&quot; &amp;gt;&amp;lt;/Button&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;TextBox&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;TextBox.ContextMenu&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;ContextMenu&amp;gt;&lt;font&gt;&lt;/font&gt;
                    &amp;lt;MenuItem Header=&quot;ShowDialog&quot; Command=&quot;{x:Static WpfApplication1:Commands.TestShowDialogCommand}&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
                &amp;lt;/ContextMenu&amp;gt;&lt;font&gt;&lt;/font&gt;
            &amp;lt;/TextBox.ContextMenu&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;/TextBox&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/StackPanel&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/Grid&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/UserControl&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;You could take it a bit further and handle the command in a controller class instead and make it that bit more MVC.&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 got it to work by crawling all the way back up through my XAML...&lt;/p&gt; 
&lt;pre&gt;box.Owner = DirectCast(DirectCast(DirectCast(Me.Parent, Grid).Parent, Grid).Parent, Window)
&lt;/pre&gt; 
&lt;p&gt;But this seems quite inelegant. Is there a better way?&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;What about changing the name of the window to WindowMain1 or something, and setting the owner to that?&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/607370/wpf-how-do-i-set-the-owner-window-of-a-dialog-shown-by-a-usercontrol&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/607370/wpf-how-do-i-set-the-owner-window-of-a-dialog-shown-by-a-usercontrol&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2043</guid>
      <comments>https://copycodes.tistory.com/2043#entry2043comment</comments>
      <pubDate>Sat, 9 Jan 2021 10:12:14 +0900</pubDate>
    </item>
    <item>
      <title>Python Selenium으로 요소가 존재하는지 확인</title>
      <link>https://copycodes.tistory.com/2042</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Python Selenium으로 요소가 존재하는지 확인&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;문제가 있습니다. 셀레늄 (firefox) 웹 드라이버를 사용하여 웹 페이지를 열고 몇 개의 링크를 클릭 한 다음 스크린 샷을 캡처하고 있습니다.&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;내 스크립트는 CLI에서 잘 실행되지만 cronjob을 통해 실행하면 첫 번째 find_element () 테스트를 통과하지 못합니다. &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;요소의 구성은 다음과 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;a class=&quot;lnk&quot; rel=&quot;nofollow&quot; href=&quot;/login.jsp?destination=/secure/Dash.jspa&quot;&amp;gt;log in&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;find_element By LINK_TEXT 메서드를 사용하고 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;login = driver.find_element(By.LINK_TEXT, &quot;log in&quot;).click()
&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;A) 링크가 실제로 파이썬에 의해 선택되고 있는지 어떻게 확인합니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;try / catch 블록을 사용해야합니까?&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;B) LINK_TEXT보다 DOM 요소를 찾는 더 나은 / 더 신뢰할 수있는 방법이 있습니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예를 들어 JQuery에서 더 구체적인 선택기 $ ( 'a.lnk : contains (log in)'). do_something ();을 사용할 수 있습니다.&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;p&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;또한 엉뚱한 time.sleep () 호출을 사용하는 대신 암시 적 / 명시 적 대기의 예제 / 설명.&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;건배, ns&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;A) 네. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;요소가 존재하는지 확인하는 가장 쉬운 방법은 단순히 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;find_element&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;try/catch&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;B) 예, 저는 항상 두 가지 이유로 텍스트를 사용하지 않고 요소를 식별하려고합니다. &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&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;ol&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;xpath를 사용하여 ID 또는 다른 고유 식별자가있는 상위 또는 상위 요소를 찾은 다음 또는 일치하는 하위 / 하위 요소를 찾을 수 있습니다.&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;링크 자체에 대한 ID, 이름 또는 기타 고유 식별자를 요청할 수 있습니다.&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;code&gt;try/catch&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;a href=&quot;http://seleniumhq.org/docs/04_webdriver_advanced.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://seleniumhq.org/docs/04_webdriver_advanced.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://seleniumhq.org/docs/04_webdriver_advanced.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;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 selenium.common.exceptions import NoSuchElementException        &lt;font&gt;&lt;/font&gt;
def check_exists_by_xpath(xpath):&lt;font&gt;&lt;/font&gt;
    try:&lt;font&gt;&lt;/font&gt;
        webdriver.find_element_by_xpath(xpath)&lt;font&gt;&lt;/font&gt;
    except NoSuchElementException:&lt;font&gt;&lt;/font&gt;
        return False&lt;font&gt;&lt;/font&gt;
    return True&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;b) 
  &lt;/font&gt;&lt;/font&gt;&lt;strike&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;/strike&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;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; : 나는 4 년 전에 초기 답변을 썼고 당시 xpath가 최선의 선택이라고 생각했습니다. &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;css 선택기&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;나는 여전히 &quot;ID 별&quot;, &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;p&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;0이면 존재하지 않습니다. &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;if driver.find_elements_by_css_selector('#element'):&lt;font&gt;&lt;/font&gt;
    print &quot;Element exists&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&gt;&lt;code&gt;find_elements_by_css_selector&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;&quot;s&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;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;len(&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;Also, another answer says that using xpath is more reliable, which is just not true. See &lt;a href=&quot;https://stackoverflow.com/questions/16788310/what-is-the-difference-between-css-selector-xpath-which-is-betteraccording-t&quot;&gt;What is the difference between css-selector &amp;amp; Xpath? which is better(according to performance &amp;amp; for cross browser testing)?&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;Solution without try&amp;amp;catch and without new imports:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;if len(driver.find_elements_by_id('blah')) &amp;gt; 0: #pay attention: find_element*s*&lt;font&gt;&lt;/font&gt;
    driver.find_element_by_id('blah').click #pay attention: find_element&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 same as Brian, but add to this answer from tstempko:&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://sqa.stackexchange.com/questions/3481/quicker-way-to-assert-that-an-element-does-not-exist&quot;&gt;https://sqa.stackexchange.com/questions/3481/quicker-way-to-assert-that-an-element-does-not-exist&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;So I tried and it works quickly:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;driver.implicitly_wait(0)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
if driver.find_element_by_id(&quot;show_reflist&quot;):        &lt;font&gt;&lt;/font&gt;
 driver.find_element_by_id(&quot;show_reflist&quot;).find_element_by_tag_name(&quot;img&quot;).click()&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;after this I restore my default value&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;driver.implicitly_wait(30)
&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 could also do it more concisely using&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;driver.find_element_by_id(&quot;some_id&quot;).size() != 0
&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;code&gt;driver.find_element_by_id(&quot;some_id&quot;).size()&lt;/code&gt; is class method.&lt;/p&gt; 
&lt;p&gt;What we need is : &lt;/p&gt; 
&lt;p&gt;&lt;code&gt;driver.find_element_by_id(&quot;some_id&quot;).size&lt;/code&gt; which is dictionary so :&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;if driver.find_element_by_id(&quot;some_id&quot;).size['width'] != 0 : print 'button exist'&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/9567069/checking-if-element-exists-with-python-selenium&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/9567069/checking-if-element-exists-with-python-selenium&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2042</guid>
      <comments>https://copycodes.tistory.com/2042#entry2042comment</comments>
      <pubDate>Sat, 9 Jan 2021 10:12:04 +0900</pubDate>
    </item>
    <item>
      <title>C ++ (확장)의 WINMAIN 및 main ()</title>
      <link>https://copycodes.tistory.com/2041</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;C ++ (확장)의 WINMAIN 및 main ()&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;https://stackoverflow.com/questions/416739/difference-between-winmain-main-and-dllmain-in-c&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;C ++에서 WinMain, main 및 DllMain의 차이점&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;code&gt;WINMAIN&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;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 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 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;h1&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;기능에 대해.&lt;/font&gt;&lt;/font&gt;&lt;/h1&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;C 및 C ++ 표준에서는 모든 프로그램 ( &quot;호스팅 된&quot;C 또는 C ++ 구현 용)에 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;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;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;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;code&gt;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 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;0으로 초기화&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;되며 반드시 그런 것은 아니지만 (!, C ++ 11 §3.6.2 / 4) &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;font 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 main()&lt;font&gt;&lt;/font&gt;
int main( int argc, char* argv[] )&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;또한 가능한 구현 정의 서명 (C ++ 11 §3.6.1 / 2) (결과 유형이 &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&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;C ++에서 이러한 함수 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;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;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; 값, 즉 0 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;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;code&gt;exit&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;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 style=&quot;vertical-align: inherit;&quot;&gt;사용하여 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;일반 함수 return &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;strong&gt;&lt;code&gt;EXIT_SUCCESS&lt;/code&gt;&lt;/strong&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;strong&gt;&lt;code&gt;EXIT_FAILURE&lt;/code&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;&amp;lt;stdlib.h&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;code&gt;exit&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;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;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;argc&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;argv&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;argv[argc]&lt;/code&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;argc&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&amp;gt; 0 인 &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;argv[0]&lt;/code&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;이 이름은 경로를 포함 할 수 있으며 실행 파일의 이름 일 수 있습니다.&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;은 Using &lt;/font&gt;&lt;/font&gt;&lt;code&gt;main&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;C와 C ++는 * nix에서 비롯 때문에 명령 줄 인수를 얻기 위해 인수하는 것은, * nix에서 스크립트에서 잘 작동합니다. &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;i&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사실상의&lt;/font&gt;&lt;/font&gt;&lt;/i&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&gt;&lt;code&gt;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;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Windows ANSI입니다&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; . 이는 일반적인 Windows 파일 이름 (예 : 노르웨이어 Windows 설치의 경우 그리스어 또는 키릴 문자가있는 파일 이름)을 지원하지 않습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;따라서 Microsoft는 &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;UTF-16으로&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;strong&gt;&lt;code&gt;wmain&lt;/code&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;라는 Windows 관련 시작 함수를 사용하여 C 및 C ++ 언어를 확장하기로 결정했습니다 &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;font style=&quot;vertical-align: inherit;&quot;&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;wmain&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://msdn.microsoft.com/en-us/library/6wd819wh%28v=VS.80%29.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;이러한 서명 중 하나를&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;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;pre&gt;&lt;code&gt;int wmain()&lt;font&gt;&lt;/font&gt;
int wmain( int argc, wchar_t* argv[] )&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&gt;&lt;code&gt;wmain&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;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;기반 기능은 1980 년대 초에, Windows와 함께 소개되었다 :&lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;code&gt;WinMain&lt;/code&gt;&lt;/strong&gt; &lt;code&gt;char&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;int CALLBACK WinMain(&lt;font&gt;&lt;/font&gt;
    HINSTANCE   hInstance,&lt;font&gt;&lt;/font&gt;
    HINSTANCE   hPrevInstance,&lt;font&gt;&lt;/font&gt;
    LPSTR       lpCmdLine,&lt;font&gt;&lt;/font&gt;
    int         nCmdShow&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;CALLBACK&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;HINSTANCE&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;LPSTR&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;&amp;lt;windows.h&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;LPSTR&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;is just &lt;/font&gt;&lt;/font&gt;&lt;code&gt;char*&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;ul&gt; 
 &lt;li&gt;&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;hInstance&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;GetModuleHandle&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;API 함수&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;code&gt;hPrevInstance&lt;/code&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;/li&gt; 
 &lt;li&gt;&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;lpCmdLine&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;GetCommandLine&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;API 기능, 플러스 이상한 논리의 비트는 명령 줄의 프로그램 이름 부분을 생략하고,&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;code&gt;nCmdShow&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;GetStartupInfo&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;API의 기능을하지만, 현대 창문이있는 최상위 윈도우의 첫 번째 창조는 자동으로 그래서 어떤 실제 사용의 아니에요 않습니다.&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&gt;&lt;code&gt;WinMain&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;함수는 standard와 동일한 단점 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;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 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;그러나 Microsoft 도구 체인을 사용하면 링커가 GUI 하위 시스템으로 기본 설정되어 일부는 이점으로 간주합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 예를 들어 GNU 툴체인에서는 그러한 효과가 없으므로이 효과는 신뢰할 수 없습니다.&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;strong&gt;&lt;code&gt;wWinMain&lt;/code&gt;&lt;/strong&gt; &lt;code&gt;wchar_t&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;WinMain&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;wmain&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;main&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;int WINAPI wWinMain(&lt;font&gt;&lt;/font&gt;
    HINSTANCE   hInstance,&lt;font&gt;&lt;/font&gt;
    HINSTANCE   hPrevInstance,&lt;font&gt;&lt;/font&gt;
    PWSTR       lpCmdLine,&lt;font&gt;&lt;/font&gt;
    int         nCmdShow&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;WINAPI&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;CALLBACK&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;PWSTR&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;wchar_t*&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;wmain&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;GetCommandLine&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;CommandLineToArgvW&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;API 함수를 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;사용하여 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;UTF-16으로 인코딩 된 인수를 선택하는 &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;Microsoft 링커가 작동하지 않도록 (GNU 도구 체인의 링커는 작동하지 않음) &lt;/font&gt;&lt;/font&gt;&lt;code&gt;LINK&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;/entry:mainCRTStartup&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;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 style=&quot;vertical-align: inherit;&quot;&gt;호출하는 Microsoft 런타임 라이브러리 진입 점 함수입니다 &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&gt; 
&lt;h1&gt;&lt;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;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 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;/h1&gt; 
&lt;p&gt;&lt;font style=&quot;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;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;foo.cpp&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;#undef UNICODE&lt;font&gt;&lt;/font&gt;
#define UNICODE&lt;font&gt;&lt;/font&gt;
#include &amp;lt;windows.h&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
int main()&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    MessageBox( 0, L&quot;Press OK&quot;, L&quot;Hi&quot;, MB_SETFOREGROUND );&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;아래 예제에서 (먼저 GNU 도구 체인을 사용한 다음 Microsoft 도구 체인을 사용하여)이 프로그램은 먼저 &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&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;GUI 하위 시스템 프로그램&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;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;이것은 내가 사용한 모든 Windows 링커에 대한 기본 하위 시스템입니다 (확실히 많지는 않음). 모든 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;콘솔 프로그램의 경우 Windows는 &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;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 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;반대로 GUI 하위 시스템 프로그램은 콘솔 창을 필요로하지 않는 프로그램입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;명령 인터프리터는 배치 파일을 제외하고 GUI 하위 시스템 프로그램을 기다리지 않습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;두 종류의 프로그램에 대해 완료 대기를 피하는 한 가지 방법은 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;start&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;GUI 하위 시스템 프로그램에서 콘솔 창 텍스트를 표시하는 한 가지 방법은 표준 출력 스트림을 리디렉션하는 것입니다. &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 탐색기에는 표시되지 않습니다 (Windows 9x에서는 Microsoft &lt;/font&gt;&lt;/font&gt;&lt;code&gt;dumpbin&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;와 거의 동일한 정보를 제공하는 실행 파일을 &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;해당하는 C ++ 개념이 없습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;h2&gt;&lt;code&gt;main&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; GNU 툴체인으로.&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt; 
&lt;pre&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;i&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;g ++ foo.cpp&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;i&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;objdump -x a.exe | &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;/ i &quot;subsys&quot;찾기&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
MajorSubsystem 버전 4&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
MinorSubsystemVersion 0&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
하위 시스템 00000003 (Windows CUI)&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[544] (초 -1) (fl 0x00) (ty 0) (scl 2) (nx 0) 0x00000004 __major_subsystem_version__&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[612] (초 -1) (fl 0x00) (ty 0) (scl 2) (nx 0) 0x00000003 __subsystem__&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[636] (초 -1) (fl 0x00) (ty 0) (scl 2) (nx 0) 0x00000000 __minor_subsystem_version__&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;i&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;g ++ foo.cpp -mwindows&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;i&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;objdump -x a.exe | &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;/ i &quot;subsys&quot;찾기&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
MajorSubsystem 버전 4&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
MinorSubsystemVersion 0&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
하위 시스템 00000002 (Windows GUI)&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[544] (초 -1) (fl 0x00) (ty 0) (scl 2) (nx 0) 0x00000004 __major_subsystem_version__&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[612] (초 -1) (fl 0x00) (ty 0) (scl 2) (nx 0) 0x00000002 __subsystem__&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[636] (초 -1) (fl 0x00) (ty 0) (scl 2) (nx 0) 0x00000000 __minor_subsystem_version__&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;font&gt;&lt;/font&gt;
&lt;/pre&gt; 
&lt;h2&gt;&lt;code&gt;main&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;/h2&gt; 
&lt;pre&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;i&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;LINK = / entry : mainCRTStartup 설정&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;i&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;cl foo.cpp user32.lib&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
foo.cpp&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;i&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;dumpbin / headers foo.exe | &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;/ i &quot;subsys&quot;찾기&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
            6.00 하위 시스템 버전&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
               3 하위 시스템 (Windows CUI)&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;i&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;cl foo.cpp / link user32.lib / subsystem : windows&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
foo.cpp&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;i&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;dumpbin / headers foo.exe | &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;/ i &quot;subsys&quot;찾기&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
            6.00 하위 시스템 버전&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
               2 하위 시스템 (Windows GUI)&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;font&gt;&lt;/font&gt;
&lt;/pre&gt; 
&lt;hr&gt; 
&lt;h1&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;wmain&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;/h1&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음 기본 코드는 GNU 도구 모음 및 Microsoft 도구 모음 데모 모두에 공통입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;bar.cpp&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;#undef UNICODE&lt;font&gt;&lt;/font&gt;
#define UNICODE&lt;font&gt;&lt;/font&gt;
#include &amp;lt;windows.h&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
#include &amp;lt;string&amp;gt;       // std::wstring&lt;font&gt;&lt;/font&gt;
#include &amp;lt;sstream&amp;gt;      // std::wostringstream&lt;font&gt;&lt;/font&gt;
using namespace std;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
int wmain( int argc, wchar_t* argv[] )&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    wostringstream  text;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    text &amp;lt;&amp;lt; argc - 1 &amp;lt;&amp;lt; L&quot; command line arguments:\n&quot;;&lt;font&gt;&lt;/font&gt;
    for( int i = 1;  i &amp;lt; argc;  ++i )&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        text &amp;lt;&amp;lt; &quot;\n[&quot; &amp;lt;&amp;lt; argv[i] &amp;lt;&amp;lt; &quot;]&quot;;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    MessageBox( 0, text.str().c_str(), argv[0], MB_SETFOREGROUND );&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;&lt;code&gt;wmain&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; GNU 툴체인으로.&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;GNU 도구 모음은 Microsoft의 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;wmain&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;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;i&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;g ++ bar.cpp&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
d : / bin / mingw / bin /../ lib / gcc / i686-pc-mingw32 / 4.7.1 /../../../ libmingw32.a (main.o) : main.c :(. text.startup + 0xa3) :`WinMain에 대한 정의되지 않은 참조&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
@ 16 '&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
collect2.exe : 오류 : ld가 1 종료 상태를 리턴했습니다.&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;font&gt;&lt;/font&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;WinMain&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;는 GNU 도구 모음이 &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;code&gt;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;code&gt;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 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;wmain&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;wmain_support.cpp&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;extern int wmain( int, wchar_t** );&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
#undef UNICODE&lt;font&gt;&lt;/font&gt;
#define UNICODE&lt;font&gt;&lt;/font&gt;
#include &amp;lt;windows.h&amp;gt;    // GetCommandLine, CommandLineToArgvW, LocalFree&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
#include &amp;lt;stdlib.h&amp;gt;     // EXIT_FAILURE&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
int main()&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    struct Args&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        int n;&lt;font&gt;&lt;/font&gt;
        wchar_t** p;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        ~Args() {  if( p != 0 ) { ::LocalFree( p ); } }&lt;font&gt;&lt;/font&gt;
        Args(): p(  ::CommandLineToArgvW( ::GetCommandLine(), &amp;amp;n ) ) {}&lt;font&gt;&lt;/font&gt;
    };&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    Args    args;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    if( args.p == 0 )&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        return EXIT_FAILURE;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    return wmain( args.n, args.p );&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;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;i&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;g ++ bar.cpp wmain_support.cpp&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;i&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;objdump -x a.exe | &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;/ i &quot;서브 시스템&quot;찾기&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
MajorSubsystem 버전 4&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
MinorSubsystemVersion 0&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
하위 시스템 00000003 (Windows CUI)&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[13134] (초 -1) (fl 0x00) (ty 0) (scl 2) (nx 0) 0x00000004 __major_subsystem_version__&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[13576] (초 -1) (fl 0x00) (ty 0) (scl 2) (nx 0) 0x00000003 __subsystem__&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[13689] (초 -1) (fl 0x00) (ty 0) (scl 2) (nx 0) 0x00000000 __minor_subsystem_version__&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;i&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;g ++ bar.cpp wmain_support.cpp -mwindows&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;i&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;objdump -x a.exe | &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;/ i &quot;서브 시스템&quot;찾기&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
MajorSubsystem 버전 4&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
MinorSubsystemVersion 0&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
하위 시스템 00000002 (Windows GUI)&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[13134] (초 -1) (fl 0x00) (ty 0) (scl 2) (nx 0) 0x00000004 __major_subsystem_version__&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[13576] (초 -1) (fl 0x00) (ty 0) (scl 2) (nx 0) 0x00000002 __subsystem__&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[13689] (초 -1) (fl 0x00) (ty 0) (scl 2) (nx 0) 0x00000000 __minor_subsystem_version__&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;
[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&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;font&gt;&lt;/font&gt;
&lt;/pre&gt; 
&lt;h2&gt;&lt;code&gt;wmain&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;/h2&gt; 
&lt;p&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;wmainCRTStartup&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;wmain&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;code&gt;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 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;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;[D : \ dev \ test]&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;/font&gt;
&amp;gt; &lt;i&gt;set link=/entry:mainCRTStartup&lt;/i&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
[D:\dev\test]&lt;font&gt;&lt;/font&gt;
&amp;gt; &lt;i&gt;cl bar.cpp user32.lib&lt;/i&gt;&lt;font&gt;&lt;/font&gt;
bar.cpp&lt;font&gt;&lt;/font&gt;
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup&lt;font&gt;&lt;/font&gt;
bar.exe : fatal error LNK1120: 1 unresolved externals&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
[D:\dev\test]&lt;font&gt;&lt;/font&gt;
&amp;gt; &lt;i&gt;set link=&lt;/i&gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
[D:\dev\test]&lt;font&gt;&lt;/font&gt;
&amp;gt; &lt;i&gt;cl bar.cpp user32.lib&lt;/i&gt;&lt;font&gt;&lt;/font&gt;
bar.cpp&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
[D:\dev\test]&lt;font&gt;&lt;/font&gt;
&amp;gt; _&lt;font&gt;&lt;/font&gt;
&lt;/pre&gt; 
&lt;p&gt;With a non-standard startup function such as &lt;code&gt;wmain&lt;/code&gt; it is, however, probably best to specify the entry point explicitly, so as to be very clear about the intention:&lt;/p&gt; 
&lt;pre&gt;[D:\dev\test]&lt;font&gt;&lt;/font&gt;
&amp;gt; &lt;i&gt;cl bar.cpp /link user32.lib /entry:wmainCRTStartup&lt;/i&gt;&lt;font&gt;&lt;/font&gt;
bar.cpp&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
[D:\dev\test]&lt;font&gt;&lt;/font&gt;
&amp;gt; &lt;i&gt;dumpbin /headers bar.exe | find /i &quot;subsystem&quot;&lt;/i&gt;&lt;font&gt;&lt;/font&gt;
            6.00 subsystem version&lt;font&gt;&lt;/font&gt;
               3 subsystem (Windows CUI)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
[D:\dev\test]&lt;font&gt;&lt;/font&gt;
&amp;gt; &lt;i&gt;cl bar.cpp /link user32.lib /entry:wmainCRTStartup /subsystem:windows&lt;/i&gt;&lt;font&gt;&lt;/font&gt;
bar.cpp&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
[D:\dev\test]&lt;font&gt;&lt;/font&gt;
&amp;gt; &lt;i&gt;dumpbin /headers bar.exe | find /i &quot;subsystem&quot;&lt;/i&gt;&lt;font&gt;&lt;/font&gt;
            6.00 subsystem version&lt;font&gt;&lt;/font&gt;
               2 subsystem (Windows GUI)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
[D:\dev\test]&lt;font&gt;&lt;/font&gt;
&amp;gt; _&lt;font&gt;&lt;/font&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;According to @RaymondChen&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;http://blogs.msdn.com/b/oldnewthing/archive/2006/12/04/1205831.aspx&quot;&gt;The name WinMain is just a convention&lt;/a&gt;&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Although the function WinMain is documented in the Platform SDK, it's not really part of the platform. Rather, WinMain is the conventional name for the user-provided entry point to a Windows program.&lt;/p&gt; 
 &lt;p&gt;The real entry point is in the C runtime library, which initializes the runtime, runs global constructors, and then calls your WinMain function (or wWinMain if you prefer a Unicode entry point).&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;DllMain and WinMain is different in their prototypes itself. WinMain accepts commandline argument while the other one talks about how it's attached to the process.&lt;/p&gt; 
&lt;p&gt;As per &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/f9t8842e.aspx&quot;&gt;MSDN documentation&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;By default, the starting address is a function name from the C run-time library. The linker selects it according to the attributes of the program, as shown in the following table.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;p&gt;&lt;code&gt;mainCRTStartup&lt;/code&gt; (or &lt;code&gt;wmainCRTStartup&lt;/code&gt;) An application using &lt;code&gt;/SUBSYSTEM:CONSOLE;&lt;/code&gt; calls main (or &lt;code&gt;wmain&lt;/code&gt;)&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;&lt;code&gt;WinMainCRTStartup&lt;/code&gt; (or &lt;code&gt;wWinMainCRTStartup&lt;/code&gt;) An application using &lt;code&gt;/SUBSYSTEM:WINDOWS;&lt;/code&gt; calls &lt;code&gt;WinMain&lt;/code&gt; (or &lt;code&gt;wWinMain&lt;/code&gt;), which must be defined with &lt;code&gt;__stdcall&lt;/code&gt;&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;&lt;code&gt;_DllMainCRTStartup&lt;/code&gt; A DLL; calls &lt;code&gt;DllMain&lt;/code&gt;, which must be defined with &lt;code&gt;__stdcall&lt;/code&gt;, if it exists&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;A standard C program is passed 2 parameters by the command line at start up:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;int main( int argc, char** argv ) ;
&lt;/code&gt;&lt;/pre&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;code&gt;char** argv&lt;/code&gt; is an array of strings (&lt;code&gt;char*&lt;/code&gt;)&lt;/li&gt; 
 &lt;li&gt;&lt;code&gt;int argc&lt;/code&gt; is the number of &lt;code&gt;char*&lt;/code&gt; in argv&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;The booting function &lt;code&gt;WinMain&lt;/code&gt; that programmers have to write for a windows program is slightly different. &lt;code&gt;WinMain&lt;/code&gt; takes 4 parameters that are passed to the program by Win O/S at start up:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;int WINAPI WinMain( HINSTANCE hInstance,    // HANDLE TO AN INSTANCE.  This is the &quot;handle&quot; to YOUR PROGRAM ITSELF.&lt;font&gt;&lt;/font&gt;
                    HINSTANCE hPrevInstance,// USELESS on modern windows (totally ignore hPrevInstance)&lt;font&gt;&lt;/font&gt;
                    LPSTR szCmdLine,        // Command line arguments.  similar to argv in standard C programs&lt;font&gt;&lt;/font&gt;
                    int iCmdShow )          // Start window maximized, minimized, etc.&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;See my article &lt;a href=&quot;http://bobobobo.wordpress.com/2008/01/31/how-to-create-a-basic-window-in-c/&quot; rel=&quot;nofollow&quot;&gt;How to create a basic window in C&lt;/a&gt; for more&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 vaguely recall reading somewhere that Windows programs have a &lt;code&gt;main()&lt;/code&gt; function. It is just hidden in a header or library somewhere. I believe this &lt;code&gt;main()&lt;/code&gt; function initializes all of the variables needed by &lt;code&gt;WinMain()&lt;/code&gt; and then calls it.&lt;/p&gt; 
&lt;p&gt;Of course, I'm a WinAPI noob, so I hope others who are more knowledgeable will correct me if I am wrong.&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 an exe using _tWinMain and Configuration Properties.Linker.System.Subsystem: Windows (/SUBSYSTEM:WINDOWS). Later I wanted it to support cmdline args and print to the console so I added:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;// We need to printf to stdout and we don't have one, so get one&lt;font&gt;&lt;/font&gt;
AllocConsole();&lt;font&gt;&lt;/font&gt;
// Redirect pre-opened STDOUT to the console&lt;font&gt;&lt;/font&gt;
freopen_s((FILE **)stdout, &quot;CONOUT$&quot;, &quot;w&quot;, stdout);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;but that only worked by printing in another console window that went away so was not that useful. Below is the way I changed it to work with Console (/SUBSYSTEM:CONSOLE) in such a way as I could go back and forth, if I needed to.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
  UNREFERENCED_PARAMETER(argc);&lt;font&gt;&lt;/font&gt;
  UNREFERENCED_PARAMETER(argv);&lt;font&gt;&lt;/font&gt;
  UNREFERENCED_PARAMETER(envp);&lt;font&gt;&lt;/font&gt;
  return (_tWinMain(NULL, NULL, ::GetCommandLineW(), 0));&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/13871617/winmain-and-main-in-c-extended&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/13871617/winmain-and-main-in-c-extended&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2041</guid>
      <comments>https://copycodes.tistory.com/2041#entry2041comment</comments>
      <pubDate>Sat, 9 Jan 2021 10:11:55 +0900</pubDate>
    </item>
    <item>
      <title>특별한 경우로 빈 문자열?</title>
      <link>https://copycodes.tistory.com/2040</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;나는 Jon Skeet의 퀴즈를 읽고 첫 번째 샘플이 작동하는 동안 두 번째 샘플이 작동하지 않는 이유가 궁금했습니다. &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;true&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;object x = new string(&quot;&quot;.ToArray());&lt;font&gt;&lt;/font&gt;
object y = new string(&quot;&quot;.ToArray());&lt;font&gt;&lt;/font&gt;
Console.WriteLine(x == y); //true&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;var k=&quot;k&quot;;&lt;font&gt;&lt;/font&gt;
//string.intern(k); // doesn't help&lt;font&gt;&lt;/font&gt;
object x = new string(k.ToArray());&lt;font&gt;&lt;/font&gt;
object y = new string(k.ToArray());&lt;font&gt;&lt;/font&gt;
Console.WriteLine(x == y); //false&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&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;vs2010과 함께 fw 4.5를 사용하고 있습니다.&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;운 좋게도 vs2005가 설치되어 있습니다. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Z0r3l.jpg&quot; alt=&quot;여기에 이미지 설명 입력&quot;&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;다음은 Eric Lippert의 블로그 게시물로 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://blogs.msdn.com/b/ericlippert/archive/2009/09/28/string-interning-and-string-empty.aspx&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;String interning 및 String.Empty&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;object obj = &quot;Int32&quot;;&lt;font&gt;&lt;/font&gt;
string str1 = &quot;Int32&quot;;&lt;font&gt;&lt;/font&gt;
string str2 = typeof(int).Name;&lt;font&gt;&lt;/font&gt;
Console.WriteLine(obj == str1); // true&lt;font&gt;&lt;/font&gt;
Console.WriteLine(str1 == str2); // true&lt;font&gt;&lt;/font&gt;
Console.WriteLine(obj == str2); // false !?&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;string&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 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;이는 다음 코드가 true를 인쇄 함을 의미합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;var k1 = &quot;k&quot;;&lt;font&gt;&lt;/font&gt;
object k2 = &quot;k&quot;;&lt;font&gt;&lt;/font&gt;
Console.WriteLine(k1 == k2);&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 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;code&gt;&quot;k&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;문자열을 만들려고하면 &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;string(char[])&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;ToString()&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;StringBuilder&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;var k1 = &quot;k&quot;;&lt;font&gt;&lt;/font&gt;
object k2 = new string(&quot;k&quot;.ToCharArray());&lt;font&gt;&lt;/font&gt;
Console.WriteLine(k1 == k2);&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;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;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;/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;blockquote&gt; 
 &lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.NET 런타임의 일부 버전은 런타임에 빈 문자열을 자동으로 인턴하지만 일부는 그렇지 않습니다!&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&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;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;var k=&quot;k&quot;;&lt;font&gt;&lt;/font&gt;
object x = string.Intern(new string(k.ToArray()));&lt;font&gt;&lt;/font&gt;
object y = string.Intern(new string(k.ToArray()));&lt;font&gt;&lt;/font&gt;
Console.WriteLine(x == y); //true&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;예, 빈 문자열은 특수한 경우로 처리되고 자동으로 인턴됩니다. 아마도 검사가 너무 사소하여 실제 성능 저하를 추가하지 않기 때문일 것입니다 (길이가 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;code&gt;String.Empty&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;대한 2 개의 참조를 비교합니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;. &lt;/font&gt;&lt;/font&gt;&lt;code&gt;operator==&lt;/code&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;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 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;true&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;false&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;string&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;x&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;y&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;string.operator==&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;true&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 style=&quot;vertical-align: inherit;&quot;&gt;비교하는 문자열 객체는 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;string(char[])&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;string.Empty&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;MarcinJuraszek이 게시 한 답변은 &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://blogs.msdn.com/b/ericlippert/archive/2009/09/28/string-interning-and-string-empty.aspx&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Lippert의 블로그&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;앞서 언급 한 Lippert의 블로그에서 다음 예를 고려하십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;object obj = &quot;&quot;;&lt;font&gt;&lt;/font&gt;
string str1 = &quot;&quot;;&lt;font&gt;&lt;/font&gt;
string str2 = String.Empty;&lt;font&gt;&lt;/font&gt;
Console.WriteLine(obj == str1); // true&lt;font&gt;&lt;/font&gt;
Console.WriteLine(str1 == str2); // true&lt;font&gt;&lt;/font&gt;
Console.WriteLine(obj == str2); // sometimes true, sometimes false?!&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;What we see here is that the assignment from the empty string literal (&lt;code&gt;&quot;&quot;&lt;/code&gt;) is not guaranteed to produce the reference to the static readonly &lt;code&gt;System.String.Empty&lt;/code&gt; field. &lt;/p&gt; 
&lt;p&gt;Let's look at the IL for the &lt;code&gt;object x = new string(&quot;&quot;.ToArray());&lt;/code&gt; expression:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;IL_0001:  ldstr      &quot;&quot;&lt;font&gt;&lt;/font&gt;
IL_0006:  call       !!0[] [System.Core]System.Linq.Enumerable::ToArray&amp;lt;char&amp;gt;(class [mscorlib]System.Collections.Generic.IEnumerable`1&amp;lt;!!0&amp;gt;)&lt;font&gt;&lt;/font&gt;
IL_000b:  newobj     instance void [mscorlib]System.String::.ctor(char[])&lt;font&gt;&lt;/font&gt;
IL_0010:  stloc.0&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;The interning may (or may not) happen at the IL_0001 line. Whether the literal is interned or not, the &lt;code&gt;ToArray()&lt;/code&gt; method produces a new empty array and the &lt;code&gt;String::.ctor(char[])&lt;/code&gt; gives us &lt;code&gt;String.Empty&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;What we see here is not the special case of &lt;code&gt;string.Empty&lt;/code&gt; but rather is one of the side effects of the &lt;code&gt;string&lt;/code&gt; class being reference type and immutable at the same time. There are other immutable framework types which have predefined values with similar semantics (like &lt;code&gt;DateTime.MinValue&lt;/code&gt;). But as far as I know such framework types are defined as &lt;code&gt;struct&lt;/code&gt; unlike the &lt;code&gt;string&lt;/code&gt; which is a reference type. The value types are totally different story... It does not make sense to return some fixed predefined type instance from a mutable class constructor (the calling code will be able to change that instance and cause the unpredictable behavior of the type). So the &lt;em&gt;reference&lt;/em&gt; types whose constructors do not always return new instances may exist provided that those types are immutable. I am not aware of other such types in the framework though, except the &lt;code&gt;string&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;My hypothesis is why the first one yields true while the 2nd yields false:&lt;/p&gt; 
&lt;p&gt;The first result my be an optimization, take the following code code&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;Enumerable.Empty&amp;lt;char&amp;gt;() == Enumerable.Empty&amp;lt;char&amp;gt;() // true
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;So, suppose the &lt;code&gt;ToArray&lt;/code&gt; method returns &lt;code&gt;Enumerable.Empty&amp;lt;char&amp;gt;()&lt;/code&gt; when the string is empty, this would explain why the first result yields true and the 2nd doesn't, as it's doing a reference check.&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;According to &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.string.intern(v=vs.110).aspx&quot; rel=&quot;nofollow&quot;&gt;http://msdn.microsoft.com/en-us/library/system.string.intern(v=vs.110).aspx&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;In the .NET Framework 3.5 Service Pack 1, the Intern method reverts to its behavior in the .NET Framework 1.0 and 1.1 with regard to interning the empty string...&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;...In the .NET Framework 1.0, .NET Framework 1.1, and .NET Framework 3.5 SP1, ~empty strings~ are equal&lt;/code&gt;&lt;/p&gt; 
&lt;p&gt;This means, empty strings are both interned by default, even when constructing from an empty array, and are therefore equal.&lt;/p&gt; 
&lt;p&gt;Furthermore:&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;The .NET Framework version 2.0 introduces the CompilationRelaxations.NoStringInterning enumeration member&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;이것은 @BenM이 제안한 것처럼 Intern 함수를 명시 적으로 사용하고 싶지만 일관된 비교 방법을 만드는 방법을 제공합니다.&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;string.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&gt;&lt;code&gt;==&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;이것이 내가 &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;Jon Skeet의&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;a href=&quot;https://stackoverflow.com/questions/3678792/are-string-equals-and-operator-really-same&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;string.Equals () 및 == 연산자가 실제로 동일합니까?&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;        object x1 = new StringBuilder(&quot;&quot;).ToString().ToArray();&lt;font&gt;&lt;/font&gt;
        object y1 = new StringBuilder(&quot;&quot;).ToString().ToArray();&lt;font&gt;&lt;/font&gt;
        Console.WriteLine(x1 == y1); //true&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        Console.WriteLine(&quot;Address x1:&quot; + Get(x1));&lt;font&gt;&lt;/font&gt;
        Console.WriteLine(&quot;Address y1:&quot; + Get(y1));&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        var k = &quot;k&quot;;&lt;font&gt;&lt;/font&gt;
        //string.intern(k); // doesn't help&lt;font&gt;&lt;/font&gt;
        object x = new string(k.ToArray());&lt;font&gt;&lt;/font&gt;
        object y = new string(k.ToArray());&lt;font&gt;&lt;/font&gt;
        Console.WriteLine(x == y); //false&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        Console.WriteLine(&quot;Address x:&quot; + Get(x));&lt;font&gt;&lt;/font&gt;
        Console.WriteLine(&quot;Address y:&quot; + Get(y));&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        Console.Read(); &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;False&lt;font&gt;&lt;/font&gt;
Address x1:0x2613E5&lt;font&gt;&lt;/font&gt;
Address y1:0x2613E5&lt;font&gt;&lt;/font&gt;
False&lt;font&gt;&lt;/font&gt;
Address x:0x2613E5&lt;font&gt;&lt;/font&gt;
Address y:0x2613E5&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;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;object a = &quot;s&quot;;&lt;font&gt;&lt;/font&gt;
object b = &quot;d&quot;;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
a = ((string)a).Replace(&quot;s&quot;, &quot;&quot;);&lt;font&gt;&lt;/font&gt;
b = ((string)b).Replace(&quot;d&quot;, &quot;&quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
Console.WriteLine(a == b);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
object c = &quot;sa&quot;;&lt;font&gt;&lt;/font&gt;
object d = &quot;da&quot;;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
c = ((string)c).Replace(&quot;s&quot;, &quot;&quot;);&lt;font&gt;&lt;/font&gt;
d = ((string)d).Replace(&quot;d&quot;, &quot;&quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
Console.WriteLine(c == d);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
c = ((string)c).Replace(&quot;a&quot;, &quot;&quot;);&lt;font&gt;&lt;/font&gt;
d = ((string)d).Replace(&quot;a&quot;, &quot;&quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
Console.WriteLine(c == d);&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;True&lt;font&gt;&lt;/font&gt;
False&lt;font&gt;&lt;/font&gt;
True&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/22138144/empty-string-as-a-special-case&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/22138144/empty-string-as-a-special-case&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2040</guid>
      <comments>https://copycodes.tistory.com/2040#entry2040comment</comments>
      <pubDate>Fri, 8 Jan 2021 08:32:42 +0900</pubDate>
    </item>
    <item>
      <title>PHP에서 이미지 조각을 사용하여 모양을 그리는 방법</title>
      <link>https://copycodes.tistory.com/2039</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;PHP에서 이미지 조각을 사용하여 모양을 그리는 방법&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;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;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/high1.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/high1.jpg&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;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/X8qSM.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/X8qSM.jpg&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;나는 이것을 할 수있는 방법을 얻지 못하고 있으며 CSS와 html 캔버스로 이것을 시도했지만 운이 없습니다.&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;어떤 사람은 PHP, CSS 또는 HTML 또는 JavaScript 또는 기타 방법을 사용하여 어떻게이 작업을 수행 할 수 있는지 제안 해 주시겠습니까?&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;a href=&quot;http://www.eframe.co.uk/content/html/mirrorstudio.asp?ref=L0&amp;amp;TC=top3973&amp;amp;MC=mid3973&amp;amp;BC=bot3973&amp;amp;CH=mamstart&amp;amp;MP=&amp;amp;BP=0&amp;amp;SP=0&amp;amp;widescreen=yes&amp;amp;mld=670247000&amp;amp;FW=65&amp;amp;withFrame=yes&amp;amp;IDS=S0&amp;amp;scaleto=0&amp;amp;BT=0&amp;amp;BB=0&amp;amp;BL=0&amp;amp;BR=0&amp;amp;IH=508&amp;amp;IW=406&amp;amp;OT=0&amp;amp;GB=0&amp;amp;MD=userDefined&amp;amp;CMCB=top&amp;amp;ops=&amp;amp;colours=&amp;amp;colourElements=&amp;amp;GP=32.48&amp;amp;CG=G1#&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;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;수동으로 수행하든 GD 라이브러리를 통해 어떤 식 으로든 즉석에서 수행하든, 최소한 수신중인 이미지를 가져와야합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/high1.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/high1.jpg&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;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vAgqj.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vAgqj.jpg&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;/p&gt; 
&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그렇지 않으면 PURE CSS / JAVASCRIPT&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;html에서 볼 수 있듯이 요소 크기를 동적으로 설정하는 데 사용됩니다.&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;:before&lt;/code&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;및 ': after'가상 요소를 사용하지만 프레임의 동적 크기 조정이 필요하므로 여러 중첩 된 div 요소를 사용하여 너비에 대한 동적 스타일을 설정해야합니다. 일부 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;div&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;참고 : 지금까지 Chrome과 Firefox에서만 이것을 테스트했습니다. &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;false&quot; data-babel=&quot;false&quot;&gt; 
 &lt;div class=&quot;snippet-code&quot;&gt; 
  &lt;pre class=&quot;snippet-code-css lang-css prettyprint-override&quot;&gt;&lt;code&gt;/* implementation of framing */&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit {&lt;font&gt;&lt;/font&gt;
        /* width and height must be set dynamically by javascript see html */ &lt;font&gt;&lt;/font&gt;
        position: relative;&lt;font&gt;&lt;/font&gt;
        box-sizing: border-box;&lt;font&gt;&lt;/font&gt;
        overflow: hidden;&lt;font&gt;&lt;/font&gt;
        padding: 20px; /* at least border size */&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit:before,&lt;font&gt;&lt;/font&gt;
    .frameit:after,&lt;font&gt;&lt;/font&gt;
    .frameit .sides &amp;gt; div,&lt;font&gt;&lt;/font&gt;
    .frameit .corner &amp;gt; div {&lt;font&gt;&lt;/font&gt;
        position: absolute;&lt;font&gt;&lt;/font&gt;
        background-image: url(http://i.stack.imgur.com/vAgqj.jpg);&lt;font&gt;&lt;/font&gt;
        background-size: 100% 20px; /* 100% and border size */&lt;font&gt;&lt;/font&gt;
        height: 20px; /* equal to border width of frameit div */&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit:before {&lt;font&gt;&lt;/font&gt;
        content: '';&lt;font&gt;&lt;/font&gt;
        top: 0;&lt;font&gt;&lt;/font&gt;
        left: 0;&lt;font&gt;&lt;/font&gt;
        right: 0;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit:after {&lt;font&gt;&lt;/font&gt;
        content: '';&lt;font&gt;&lt;/font&gt;
        bottom: 0;&lt;font&gt;&lt;/font&gt;
        left: 0;&lt;font&gt;&lt;/font&gt;
        right: 0;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit .sides {&lt;font&gt;&lt;/font&gt;
        position: absolute;&lt;font&gt;&lt;/font&gt;
        top: 0;&lt;font&gt;&lt;/font&gt;
        right: 0;&lt;font&gt;&lt;/font&gt;
        bottom: 0;&lt;font&gt;&lt;/font&gt;
        left: 0;&lt;font&gt;&lt;/font&gt;
        z-index: 1;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit .sides &amp;gt; div {&lt;font&gt;&lt;/font&gt;
        /* width must be set dynamically by javascript see html */ &lt;font&gt;&lt;/font&gt;
        height: 20px;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit .sides &amp;gt; div:first-child {&lt;font&gt;&lt;/font&gt;
        top: 0;&lt;font&gt;&lt;/font&gt;
        left: 20px; /* border width */&lt;font&gt;&lt;/font&gt;
        transform-origin: 0 0;&lt;font&gt;&lt;/font&gt;
        transform: rotate(90deg);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit .sides &amp;gt; div:last-child  {&lt;font&gt;&lt;/font&gt;
        bottom: 0;&lt;font&gt;&lt;/font&gt;
        right: 20px; /* border width */&lt;font&gt;&lt;/font&gt;
        transform-origin: 100% 100%;&lt;font&gt;&lt;/font&gt;
        transform: rotate(90deg);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit .sides ~ .corner { /* all corners */&lt;font&gt;&lt;/font&gt;
        position: absolute;&lt;font&gt;&lt;/font&gt;
        z-index: 2;&lt;font&gt;&lt;/font&gt;
        width: 29px; /* square root of ((border-width squared) x 2) round up */&lt;font&gt;&lt;/font&gt;
        height: 29px; /* match width */&lt;font&gt;&lt;/font&gt;
        overflow: hidden;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit .TL {&lt;font&gt;&lt;/font&gt;
        top: 0;&lt;font&gt;&lt;/font&gt;
        left: 0;&lt;font&gt;&lt;/font&gt;
        transform-origin: 0 0;&lt;font&gt;&lt;/font&gt;
        transform: rotate(-45deg);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit .TL &amp;gt; div {&lt;font&gt;&lt;/font&gt;
        top: inherit;&lt;font&gt;&lt;/font&gt;
        left: inherit;&lt;font&gt;&lt;/font&gt;
        transform-origin: inherit;&lt;font&gt;&lt;/font&gt;
        transform: rotate(45deg);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit .TR {&lt;font&gt;&lt;/font&gt;
        top: 0;&lt;font&gt;&lt;/font&gt;
        right: 0;&lt;font&gt;&lt;/font&gt;
        transform-origin: 100% 0;&lt;font&gt;&lt;/font&gt;
        transform: rotate(45deg);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit .TR &amp;gt; div {&lt;font&gt;&lt;/font&gt;
        top: 0;&lt;font&gt;&lt;/font&gt;
        right: 0;&lt;font&gt;&lt;/font&gt;
        transform-origin: 100% 0;&lt;font&gt;&lt;/font&gt;
        transform: rotate(-45deg);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit .BR {&lt;font&gt;&lt;/font&gt;
        bottom: 0;&lt;font&gt;&lt;/font&gt;
        right: 0;&lt;font&gt;&lt;/font&gt;
        transform-origin: 100% 100%;&lt;font&gt;&lt;/font&gt;
        transform: rotate(-45deg);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit .BR &amp;gt; div {&lt;font&gt;&lt;/font&gt;
       bottom: inherit;&lt;font&gt;&lt;/font&gt;
       right: inherit;&lt;font&gt;&lt;/font&gt;
       transform-origin: inherit;&lt;font&gt;&lt;/font&gt;
       transform: rotate(45deg);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit .BL {&lt;font&gt;&lt;/font&gt;
        bottom: 0;&lt;font&gt;&lt;/font&gt;
        left: 0;&lt;font&gt;&lt;/font&gt;
        transform-origin: 0 100%;&lt;font&gt;&lt;/font&gt;
        transform: rotate(45deg);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .frameit .BL &amp;gt; div {&lt;font&gt;&lt;/font&gt;
        bottom: inherit;&lt;font&gt;&lt;/font&gt;
        left: inherit;&lt;font&gt;&lt;/font&gt;
        transform-origin: inherit;&lt;font&gt;&lt;/font&gt;
        transform: rotate(-45deg);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    /* Optional shading to help define the joint */&lt;font&gt;&lt;/font&gt;
    .frameit .sides &amp;gt; div:first-child:before,&lt;font&gt;&lt;/font&gt;
    .frameit .sides &amp;gt; div:last-child:before {&lt;font&gt;&lt;/font&gt;
       content: '';&lt;font&gt;&lt;/font&gt;
       position: absolute;&lt;font&gt;&lt;/font&gt;
       top: 0;&lt;font&gt;&lt;/font&gt;
       right: 0;&lt;font&gt;&lt;/font&gt;
       left: 0;&lt;font&gt;&lt;/font&gt;
       bottom: 0;&lt;font&gt;&lt;/font&gt;
       background-color: rgba(0,0,0,.07);&lt;font&gt;&lt;/font&gt;
    }&lt;/code&gt;&lt;/pre&gt; 
  &lt;pre class=&quot;snippet-code-html lang-html prettyprint-override&quot;&gt;&lt;code&gt;&amp;lt;div class=&quot;frameit&quot; style=&quot;width: 200px; height: 300px;&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
   &amp;lt;!-- top and bottom and overall container &lt;font&gt;&lt;/font&gt;
        width and height assumed to be set by javacript by user&lt;font&gt;&lt;/font&gt;
   --&amp;gt;&lt;font&gt;&lt;/font&gt;
   &amp;lt;div class=&quot;sides&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
     &amp;lt;!-- left and right sides &lt;font&gt;&lt;/font&gt;
        widths of the children are equal to HEIGHT of container and are &lt;font&gt;&lt;/font&gt;
        assumed to be set by javacript by user&lt;font&gt;&lt;/font&gt;
     --&amp;gt;&lt;font&gt;&lt;/font&gt;
     &amp;lt;div style=&quot;width: 300px;&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
     &amp;lt;div style=&quot;width: 300px;&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;
   &amp;lt;div class=&quot;TL corner&quot;&amp;gt;&amp;lt;!-- top left bevel --&amp;gt;&amp;lt;div style=&quot;width: 200px;&quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
   &amp;lt;div class=&quot;TR corner&quot;&amp;gt;&amp;lt;!-- top right bevel --&amp;gt;&amp;lt;div style=&quot;width: 200px;&quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
   &amp;lt;div class=&quot;BR corner&quot;&amp;gt;&amp;lt;!-- bottom right bevel --&amp;gt;&amp;lt;div style=&quot;width: 200px;&quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
   &amp;lt;div class=&quot;BL corner&quot;&amp;gt;&amp;lt;!-- bottom left bevel --&amp;gt;&amp;lt;div style=&quot;width: 200px;&quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/div&amp;gt;&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;&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;프레임의 수평 및 수직면에 대해 2 개의 서로 다른 이미지를 얻어야합니다. &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;false&quot; data-babel=&quot;false&quot;&gt; 
 &lt;div class=&quot;snippet-code&quot;&gt; 
  &lt;pre class=&quot;snippet-code-css lang-css prettyprint-override&quot;&gt;&lt;code&gt;.frame {&lt;font&gt;&lt;/font&gt;
      position: relative;&lt;font&gt;&lt;/font&gt;
      width: 500px;&lt;font&gt;&lt;/font&gt;
      /*width of the frame*/&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .horizontal-side {&lt;font&gt;&lt;/font&gt;
      /*use a horizontal background that can repeat properly*/&lt;font&gt;&lt;/font&gt;
      background: url(http://i.stack.imgur.com/vAgqj.jpg) repeat;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .horizontal-side {&lt;font&gt;&lt;/font&gt;
      width: 500px;&lt;font&gt;&lt;/font&gt;
      /*width of the frame*/&lt;font&gt;&lt;/font&gt;
      height: 20px;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .vertical-side {&lt;font&gt;&lt;/font&gt;
      /*use a vertical background that can repeat properly*/&lt;font&gt;&lt;/font&gt;
      background: url(http://i.stack.imgur.com/vAgqj.jpg) repeat;&lt;font&gt;&lt;/font&gt;
      width: 20px;&lt;font&gt;&lt;/font&gt;
      height: 400px;&lt;font&gt;&lt;/font&gt;
      /*height of the frame*/&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .vertical-side.right {&lt;font&gt;&lt;/font&gt;
      position: absolute;&lt;font&gt;&lt;/font&gt;
      right: 0;&lt;font&gt;&lt;/font&gt;
      top: 20px;&lt;font&gt;&lt;/font&gt;
      /*same as the horizontal side's hight*/&lt;font&gt;&lt;/font&gt;
    }&lt;/code&gt;&lt;/pre&gt; 
  &lt;pre class=&quot;snippet-code-html lang-html prettyprint-override&quot;&gt;&lt;code&gt;&amp;lt;div class=&quot;frame&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;div class=&quot;horizontal-side top&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  &amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;div class=&quot;vertical-side left&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  &amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;div class=&quot;vertical-side right&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  &amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
  &amp;lt;div class=&quot;horizontal-side bottom&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  &amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/div&amp;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;@ScottS 답변의 정리 된 이미지로 업데이트되었습니다. &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;PHP를 통해 단일 이미지를 사용하여 프레임을 만들려고 많이 시도했지만 PHP에서 솔루션을 찾지 못했습니다.&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;두 가지 답변 (Lucky Soni의 답변 및 ScottS의 답변)의 도움으로 내 요구 사항을 완전히 채우는 스크립트를 만들었습니다 (둘 다 덕분입니다).&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;First I have created 4 images from single image while uploading:&lt;/code&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$file = Input::file('image');&lt;font&gt;&lt;/font&gt;
$destinationPath    = 'test/';&lt;font&gt;&lt;/font&gt;
$filename           = time() . $file-&amp;gt;getClientOriginalName();&lt;font&gt;&lt;/font&gt;
$extension          = $file-&amp;gt;getClientOriginalExtension();&lt;font&gt;&lt;/font&gt;
$upload_success     = $file-&amp;gt;move($destinationPath, $filename);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for upper horizontal part&lt;font&gt;&lt;/font&gt;
$im = new imagick(public_path().'/test/'.$filename);&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;setImageFormat( &quot;jpg&quot; );&lt;font&gt;&lt;/font&gt;
$topUperName = 'hr-uper-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/20*20/'.$topUperName;&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;resizeImage(20,20,Imagick::FILTER_LANCZOS,1);&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for vertical right part&lt;font&gt;&lt;/font&gt;
$vrtRght = 'vrt-right-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/20*20/'.$vrtRght;&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;rotateimage('', '90');&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for bottom horizontal part&lt;font&gt;&lt;/font&gt;
$topUperBtm = 'hr-btm-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/20*20/'.$topUperBtm;&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;rotateimage('', '90');&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for vertical left part&lt;font&gt;&lt;/font&gt;
$vrtlft = 'vrt-left-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/20*20/'.$vrtlft;&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;rotateimage('', '90');&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;clear();&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;destroy();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
unlink(public_path() . '/' . $filename);&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;code&gt;HTML layout:&lt;/code&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&quot;frame&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;div class=&quot;horizontal-side top&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;div class=&quot;vertical-side left&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;div class=&quot;vertical-side right&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;div class=&quot;horizontal-side bottom&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;div class=&quot;right-top-corner corner-holder&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;img class=&quot;right-top corner&quot; src=&quot;&amp;lt;?php echo url(); ?&amp;gt;/20*20/hr-uper-1448949720a.jpg&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;div class=&quot;right-btm-corner corner-holder&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;img class=&quot;right-btm&quot; corner src=&quot;&amp;lt;?php echo url(); ?&amp;gt;/20*20/hr-btm-1448949720a.jpg&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;div class=&quot;left-top-corner corner-holder&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;img  class=&quot;left-top corner&quot; src=&quot;&amp;lt;?php echo url(); ?&amp;gt;/20*20/hr-uper-1448949720a.jpg&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;div class=&quot;left-btm-corner corner-holder&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
        &amp;lt;img  class=&quot;left-btm corner&quot; src=&quot;&amp;lt;?php echo url(); ?&amp;gt;/20*20/hr-btm-1448949720a.jpg&quot;&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
&amp;lt;/div&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;code&gt;Styling&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;.frame {&lt;font&gt;&lt;/font&gt;
        position: relative;&lt;font&gt;&lt;/font&gt;
        width: 500px; /* dynamic*/&lt;font&gt;&lt;/font&gt;
        height: 500px; /* dynamic*/&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .horizontal-side {&lt;font&gt;&lt;/font&gt;
        width: 100%;&lt;font&gt;&lt;/font&gt;
        height: 100px; /* height of image*/&lt;font&gt;&lt;/font&gt;
        position: absolute;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .horizontal-side.top {&lt;font&gt;&lt;/font&gt;
        background: url('&amp;lt;?php echo url(); ?&amp;gt;/20*20/hr-uper-1448949720a.jpg') repeat !important;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .horizontal-side.bottom {&lt;font&gt;&lt;/font&gt;
        background: url('&amp;lt;?php echo url(); ?&amp;gt;/20*20/hr-btm-1448949720a.jpg') repeat !important;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .horizontal-side.top {&lt;font&gt;&lt;/font&gt;
        top: 0 !important;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .horizontal-side.bottom {&lt;font&gt;&lt;/font&gt;
        bottom: 0 !important;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .vertical-side {&lt;font&gt;&lt;/font&gt;
        width: 100px !important; /* width of image*/&lt;font&gt;&lt;/font&gt;
        height: 100% !important;&lt;font&gt;&lt;/font&gt;
        z-index: 9 !important;&lt;font&gt;&lt;/font&gt;
        position: absolute !important;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .vertical-side.left {&lt;font&gt;&lt;/font&gt;
        left: 0 !important;&lt;font&gt;&lt;/font&gt;
        background: url('&amp;lt;?php echo url(); ?&amp;gt;/20*20/vrt-left-1448949720a.jpg') repeat !important;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .vertical-side.right {&lt;font&gt;&lt;/font&gt;
        right: 0;&lt;font&gt;&lt;/font&gt;
        background: url('&amp;lt;?php echo url(); ?&amp;gt;/20*20/vrt-right-1448949720a.jpg') repeat !important;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .corner-holder {&lt;font&gt;&lt;/font&gt;
        position: absolute !important;&lt;font&gt;&lt;/font&gt;
        z-index: 9 !important;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .right-top-corner{&lt;font&gt;&lt;/font&gt;
        right: 0px !important;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .right-btm-corner {&lt;font&gt;&lt;/font&gt;
        bottom: 0 !important;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .left-top-corner{&lt;font&gt;&lt;/font&gt;
        left: 0 !important;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .left-btm-corner{&lt;font&gt;&lt;/font&gt;
        bottom: 0 !important;&lt;font&gt;&lt;/font&gt;
        left: 0 !important;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    .corner {&lt;font&gt;&lt;/font&gt;
        height: 100px !important; /* corner height (size of image)*/&lt;font&gt;&lt;/font&gt;
        width: 100px !important; /*  corner width (size of image)*/&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .right-top {&lt;font&gt;&lt;/font&gt;
        clip: polygon(100% 0, 0% 100%, 0 0) !important;&lt;font&gt;&lt;/font&gt;
        -webkit-clip-path: polygon(100% 0, 0% 100%, 0 0) !important;&lt;font&gt;&lt;/font&gt;
        -moz-clip-path: polygon(100% 0, 0% 100%, 0 0) !important;&lt;font&gt;&lt;/font&gt;
        -ms-clip-path: polygon(100% 0, 0% 100%, 0 0) !important;&lt;font&gt;&lt;/font&gt;
        -o-clip-path: polygon(100% 0, 0% 100%, 0 0) !important;&lt;font&gt;&lt;/font&gt;
        clip-path: polygon(100% 0, 0% 100%, 0 0) !important;&lt;font&gt;&lt;/font&gt;
    } &lt;font&gt;&lt;/font&gt;
    .right-btm{&lt;font&gt;&lt;/font&gt;
        clip: polygon(0 100%, 0 0, 100% 100%) !important;&lt;font&gt;&lt;/font&gt;
        -webkit-clip-path: polygon(0 100%, 0 0, 100% 100%) !important;&lt;font&gt;&lt;/font&gt;
        -moz-clip-path: polygon(0 100%, 0 0, 100% 100%) !important;&lt;font&gt;&lt;/font&gt;
        -ms-clip-path: polygon(0 100%, 0 0, 100% 100%) !important;&lt;font&gt;&lt;/font&gt;
        -o-clip-path: polygon(0 100%, 0 0, 100% 100%) !important;&lt;font&gt;&lt;/font&gt;
        clip-path: polygon(0 100%, 0 0, 100% 100%) !important;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .left-top{&lt;font&gt;&lt;/font&gt;
        clip: polygon(100% 0, 0 0, 100% 100%) !important;   &lt;font&gt;&lt;/font&gt;
        -webkit-clip-path: polygon(100% 0, 0 0, 100% 100%) !important;   &lt;font&gt;&lt;/font&gt;
        -moz-clip-path: polygon(100% 0, 0 0, 100% 100%) !important;   &lt;font&gt;&lt;/font&gt;
        -ms-clip-path: polygon(100% 0, 0 0, 100% 100%) !important;   &lt;font&gt;&lt;/font&gt;
        -o-clip-path: polygon(100% 0, 0 0, 100% 100%) !important;   &lt;font&gt;&lt;/font&gt;
        clip-path: polygon(100% 0, 0 0, 100% 100%) !important;   &lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    .left-btm{&lt;font&gt;&lt;/font&gt;
        clip: polygon(100% 0, 0 100%, 100% 100%) !important;   &lt;font&gt;&lt;/font&gt;
        -webkit-clip-path: polygon(100% 0, 0 100%, 100% 100%) !important;   &lt;font&gt;&lt;/font&gt;
        -moz-clip-path: polygon(100% 0, 0 100%, 100% 100%) !important;   &lt;font&gt;&lt;/font&gt;
        -ms-clip-path: polygon(100% 0, 0 100%, 100% 100%) !important;   &lt;font&gt;&lt;/font&gt;
        -o-clip-path: polygon(100% 0, 0 100%, 100% 100%) !important;   &lt;font&gt;&lt;/font&gt;
        clip-path: polygon(100% 0, 0 100%, 100% 100%) !important;   &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;/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;?php&lt;font&gt;&lt;/font&gt;
header('Content-type: image/png');&lt;font&gt;&lt;/font&gt;
$png_image = imagecreate(300, 300);&lt;font&gt;&lt;/font&gt;
$grey = imagecolorallocate($png_image, 229, 229, 229);&lt;font&gt;&lt;/font&gt;
$green = imagecolorallocate($png_image, 128, 204, 204);&lt;font&gt;&lt;/font&gt;
imagefilltoborder($png_image, 0, 0, $grey, $grey);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
imagefilledrectangle ($png_image, 20, 20, 80, 80, $green);     // SQUARE&lt;font&gt;&lt;/font&gt;
imagefilledrectangle ($png_image, 100, 20, 280, 80, $green);   // RECTANGLE&lt;font&gt;&lt;/font&gt;
imagefilledellipse ($png_image, 50, 150, 75, 75, $green);      // CIRCLE&lt;font&gt;&lt;/font&gt;
imagefilledellipse ($png_image, 200, 150, 150, 75, $green);    // ELLIPSE&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$poly_points = array(150, 200, 100, 280, 200, 280);&lt;font&gt;&lt;/font&gt;
imagefilledpolygon ($png_image, $poly_points, 3, $green);      // POLYGON&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
imagepng($png_image);&lt;font&gt;&lt;/font&gt;
imagedestroy($png_image);&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&gt;&lt;a href=&quot;http://www.phpforkids.com/php/php-gd-library-drawing-shapes.php&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://www.phpforkids.com/php/php-gd-library-drawing-shapes.php입니다.&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;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;$file = Input::file('image');&lt;font&gt;&lt;/font&gt;
$destinationPath    = 'test/';&lt;font&gt;&lt;/font&gt;
$filename           = time() . $file-&amp;gt;getClientOriginalName();&lt;font&gt;&lt;/font&gt;
$extension          = $file-&amp;gt;getClientOriginalExtension();&lt;font&gt;&lt;/font&gt;
$upload_success     = $file-&amp;gt;move($destinationPath, $filename);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for upper horizontal part&lt;font&gt;&lt;/font&gt;
$im = new imagick(public_path().'/test/'.$filename);&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;setImageFormat( &quot;jpg&quot; );&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
/** Here I have created 4 side images of 20*20 **/  &lt;font&gt;&lt;/font&gt;
$topUperName = 'hr-uper-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/20*20/'.$topUperName;&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;resizeImage(20,20,Imagick::FILTER_LANCZOS,1);&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for vertical right part&lt;font&gt;&lt;/font&gt;
$vrtRght = 'vrt-right-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/20*20/'.$vrtRght;&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;rotateimage('', '90');&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for bottom horizontal part&lt;font&gt;&lt;/font&gt;
$topUperBtm = 'hr-btm-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/20*20/'.$topUperBtm;&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;rotateimage('', '90');&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for vertical left part&lt;font&gt;&lt;/font&gt;
$vrtlft = 'vrt-left-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/20*20/'.$vrtlft;&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;rotateimage('', '90');&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;clear();&lt;font&gt;&lt;/font&gt;
$im-&amp;gt;destroy();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
/** Here I have created 4 side images of 30*30 **/&lt;font&gt;&lt;/font&gt;
// This will create image for upper horizontal part&lt;font&gt;&lt;/font&gt;
$im2 = new imagick(public_path().'/test/'.$filename);&lt;font&gt;&lt;/font&gt;
$im2-&amp;gt;setImageFormat( &quot;jpg&quot; );&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$topUperName = 'hr-uper-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/30*30/'.$topUperName;&lt;font&gt;&lt;/font&gt;
$im2-&amp;gt;resizeImage(30,30,Imagick::FILTER_LANCZOS,1);&lt;font&gt;&lt;/font&gt;
$im2-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for vertical right part&lt;font&gt;&lt;/font&gt;
$vrtRght = 'vrt-right-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/30*30/'.$vrtRght;&lt;font&gt;&lt;/font&gt;
$im2-&amp;gt;rotateimage('', '90');&lt;font&gt;&lt;/font&gt;
$im2-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for bottom horizontal part&lt;font&gt;&lt;/font&gt;
$topUperBtm = 'hr-btm-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/30*30/'.$topUperBtm;&lt;font&gt;&lt;/font&gt;
$im2-&amp;gt;rotateimage('', '90');&lt;font&gt;&lt;/font&gt;
$im2-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for vertical left part&lt;font&gt;&lt;/font&gt;
$vrtlft = 'vrt-left-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/30*30/'.$vrtlft;&lt;font&gt;&lt;/font&gt;
$im2-&amp;gt;rotateimage('', '90');&lt;font&gt;&lt;/font&gt;
$im2-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$im2-&amp;gt;clear();&lt;font&gt;&lt;/font&gt;
$im2-&amp;gt;destroy();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
/** Here I have created 4 side images of 40*40 **/&lt;font&gt;&lt;/font&gt;
// This will create image for upper horizontal part&lt;font&gt;&lt;/font&gt;
$im3 = new imagick(public_path().'/test/'.$filename);&lt;font&gt;&lt;/font&gt;
$im3-&amp;gt;setImageFormat( &quot;jpg&quot; );&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$topUperName = 'hr-uper-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/40*40/'.$topUperName;&lt;font&gt;&lt;/font&gt;
$im3-&amp;gt;resizeImage(40,40,Imagick::FILTER_LANCZOS,1);&lt;font&gt;&lt;/font&gt;
$im3-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for vertical right part&lt;font&gt;&lt;/font&gt;
$vrtRght = 'vrt-right-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/40*40/'.$vrtRght;&lt;font&gt;&lt;/font&gt;
$im3-&amp;gt;rotateimage('', '90');&lt;font&gt;&lt;/font&gt;
$im3-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for bottom horizontal part&lt;font&gt;&lt;/font&gt;
$topUperBtm = 'hr-btm-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/40*40/'.$topUperBtm;&lt;font&gt;&lt;/font&gt;
$im3-&amp;gt;rotateimage('', '90');&lt;font&gt;&lt;/font&gt;
$im3-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for vertical left part&lt;font&gt;&lt;/font&gt;
$vrtlft = 'vrt-left-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/40*40/'.$vrtlft;&lt;font&gt;&lt;/font&gt;
$im3-&amp;gt;rotateimage('', '90');&lt;font&gt;&lt;/font&gt;
$im3-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$im3-&amp;gt;clear();&lt;font&gt;&lt;/font&gt;
$im3-&amp;gt;destroy();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
/** Here I have created 4 side images of 50*50 **/&lt;font&gt;&lt;/font&gt;
// This will create image for upper horizontal part&lt;font&gt;&lt;/font&gt;
$im4 = new imagick(public_path().'/test/'.$filename);&lt;font&gt;&lt;/font&gt;
$im4-&amp;gt;setImageFormat( &quot;jpg&quot; );&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$topUperName = 'hr-uper-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/50*50/'.$topUperName;&lt;font&gt;&lt;/font&gt;
$im4-&amp;gt;resizeImage(50,50,Imagick::FILTER_LANCZOS,1);&lt;font&gt;&lt;/font&gt;
$im4-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for vertical right part&lt;font&gt;&lt;/font&gt;
$vrtRght = 'vrt-right-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/50*50/'.$vrtRght;&lt;font&gt;&lt;/font&gt;
$im4-&amp;gt;rotateimage('', '90');&lt;font&gt;&lt;/font&gt;
$im4-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for bottom horizontal part&lt;font&gt;&lt;/font&gt;
$topUperBtm = 'hr-btm-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/50*50/'.$topUperBtm;&lt;font&gt;&lt;/font&gt;
$im4-&amp;gt;rotateimage('', '90');&lt;font&gt;&lt;/font&gt;
$im4-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// This will create image for vertical left part&lt;font&gt;&lt;/font&gt;
$vrtlft = 'vrt-left-'.$filename;&lt;font&gt;&lt;/font&gt;
$img_name = public_path().'/50*50/'.$vrtlft;&lt;font&gt;&lt;/font&gt;
$im4-&amp;gt;rotateimage('', '90');&lt;font&gt;&lt;/font&gt;
$im4-&amp;gt;writeImage($img_name);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
$im4-&amp;gt;clear();&lt;font&gt;&lt;/font&gt;
$im4-&amp;gt;destroy();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
unlink(public_path() . '/' . $filename);&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;이미지의 해당 부분을 4 가지 크기로 잘라서 다른 비율로 프레임을 만드는 동안 이러한 크기를 사용할 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;code&gt;For example if I am going to create a frame 1000*200, then it was breaking the css, because you were using a image of only 20*20 thick image in all sizes of frame.&lt;/code&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;//you will get this from your ajax call&lt;font&gt;&lt;/font&gt;
$width = $_GET['width'];&lt;font&gt;&lt;/font&gt;
$width = $_GET['height'];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
if($width &amp;lt;= 200){&lt;font&gt;&lt;/font&gt;
   $frameImage = 'path-of-your-20*20-image';&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
if($width &amp;gt; 200 &amp;amp;&amp;amp; $width &amp;lt;= 500){&lt;font&gt;&lt;/font&gt;
   $frameImage = 'path-of-your-30*30-image';&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
if($width &amp;gt; 500 &amp;amp;&amp;amp; $width &amp;lt;= 700){&lt;font&gt;&lt;/font&gt;
   $frameImage = 'path-of-your-40*40-image';&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
if($width &amp;gt; 700){&lt;font&gt;&lt;/font&gt;
   $frameImage = 'path-of-your-50*50-image';&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// you can set these variable as per your requirement. And then use this image path to create the html of your frame. If you need a big range of your frame then you can also crop and save image in more sizes while uploading.&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;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/33514840/how-to-draw-a-shape-using-a-piece-of-image-in-php&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/33514840/how-to-draw-a-shape-using-a-piece-of-image-in-php&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2039</guid>
      <comments>https://copycodes.tistory.com/2039#entry2039comment</comments>
      <pubDate>Fri, 8 Jan 2021 08:32:32 +0900</pubDate>
    </item>
    <item>
      <title>Java에서 런타임에 열거 요소를 추가하고 제거 할 수 있습니까?</title>
      <link>https://copycodes.tistory.com/2038</link>
      <description>&lt;h2&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;/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의 열거 형에서 요소를 추가하고 제거 할 수 있습니까?&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;@saua, 그것은 정말로 흥미로울 수 있는지 여부에 대한 질문입니다. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://bcel.sourceforge.net/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;BCEL 등을&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;enum을 사용해야 할 때가 확실하지 않다는 것을 깨달았 기 때문에이 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/481068/when-to-use-enum-or-collection-in-java&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;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;컴파일 타임에 어떤 종류의 다른 소스 파일에서 열거 형 .java 파일을 생성 할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이와 같은 .class 파일을 만들 수도 있습니다.&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;interface&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;enum&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;interface&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;switch&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;interface&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;커튼 뒤에서 열거 형은 개인 생성자와 열거 형 유형의 공개 정적 최종 값이있는 POJO입니다 ( &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예는 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://snipplr.com/view/1655/typesafe-enum-pattern/&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;사실 Java5까지는 이러한 방식으로 고유 한 열거 형을 작성하는 것이 모범 사례로 간주되었으며 Java5는 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;enum&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;a href=&quot;http://www.docjar.com/html/api/java/lang/Enum.java.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;Enum &amp;lt;T&amp;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;따라서 생성자에 의해 읽히거나 전달되는 상수의 공개 정적 최종 배열을 사용하여 고유 한 'TypeSafeEnum'을 작성하는 것은 문제가되지 않습니다.&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;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;hashCode&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;toString&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;values&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;문제는 이러한 동적 열거를 사용하는 방법입니다 ... 파일에서 &quot;PI = 3.14&quot;값을 읽어 생성 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;enum MathConstants&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;MathConstants.PI&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;(단위 테스트 목적으로) 이와 같은 작업을 수행해야했고이 EnumBuster를 발견했습니다. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.javaspecialists.eu/archive/Issue161.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;http://www.javaspecialists.eu/archive/Issue161.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;열거 형 값을 추가, 제거 및 복원 할 수 있습니다.&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; : 나는 방금 이것을 사용하기 시작했으며 현재 Java 1.5에 필요한 약간의 변경이 있음을 발견했습니다.&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;정적 도우미 메서드의 배열 사본 추가 (예 : 다음 1.6 버전 사용 : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.docjar.com/html/api/java/util/Arrays.java.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;http://www.docjar.com/html/api/java/util/Arrays.java.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&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;EnumBuster.undoStack을 스택으로 변경&lt;/font&gt;&lt;/font&gt;&lt;code&gt;&amp;lt;Memento&amp;gt;&lt;/code&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;undo ()에서 undoStack.poll ()을 undoStack.isEmpty ()로 변경합니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;null : undoStack.pop ();&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
  &lt;/ul&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;지금까지 시도한 Java 1.5 열거 형의 경우 VALUES_FIELD 문자열은 &quot;ENUM $ VALUES&quot;여야합니다.&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;a href=&quot;http://moffdub.wordpress.com/2008/04/28/introducing-the-project/&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;a href=&quot;http://moffdub.wordpress.com/2008/04/28/introducing-the-project/&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 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;enum HatType&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    BASEBALL,&lt;font&gt;&lt;/font&gt;
    BRIMLESS,&lt;font&gt;&lt;/font&gt;
    INDIANA_JONES&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
HatType mine = HatType.BASEBALL;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// prints &quot;BASEBALL&quot;&lt;font&gt;&lt;/font&gt;
System.out.println(mine.toString());&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// prints true&lt;font&gt;&lt;/font&gt;
System.out.println(mine.equals(HatType.BASEBALL));&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;// in a file somewhere:&lt;font&gt;&lt;/font&gt;
// 1 --&amp;gt; BASEBALL&lt;font&gt;&lt;/font&gt;
// 2 --&amp;gt; BRIMLESS&lt;font&gt;&lt;/font&gt;
// 3 --&amp;gt; INDIANA_JONES&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
HatDynamicEnum hats = HatEnumRepository.retrieve();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
HatEnumValue mine = hats.valueOf(&quot;BASEBALL&quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// prints &quot;BASEBALL&quot;&lt;font&gt;&lt;/font&gt;
System.out.println(mine.toString());&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// prints true&lt;font&gt;&lt;/font&gt;
System.out.println(mine.equals(hats.valueOf(&quot;BASEBALL&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;hats.addEnum(&quot;BATTING_PRACTICE&quot;);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
HatEnumRepository.storeEnum(hats);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
hats = HatEnumRepository.retrieve();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
HatEnumValue justArrived = hats.valueOf(&quot;BATTING_PRACTICE&quot;);&lt;font&gt;&lt;/font&gt;
// file now reads:&lt;font&gt;&lt;/font&gt;
// 1 --&amp;gt; BASEBALL&lt;font&gt;&lt;/font&gt;
// 2 --&amp;gt; BRIMLESS&lt;font&gt;&lt;/font&gt;
// 3 --&amp;gt; INDIANA_JONES&lt;font&gt;&lt;/font&gt;
// 4 --&amp;gt; BATTING_PRACTICE&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;나는 그것을 Dynamic Enumeration &quot;pattern&quot;이라고 불렀고, 당신 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://moffdub.wordpress.com/2008/05/09/dynamic-enumerations/&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;a href=&quot;http://moffdub.wordpress.com/2009/01/14/dynamic-enumerations-revisited/&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;The difference between the two is that the revised edition was designed after I really started to grok OO and DDD. The first one I designed when I was still writing nominally procedural DDD, under time pressure no less.&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 load a Java class from source at runtime. (Using JCI, BeanShell or JavaCompiler)&lt;/p&gt; 
&lt;p&gt;This would allow you to change the Enum values as you wish.&lt;/p&gt; 
&lt;p&gt;Note: this wouldn't change any classes which referred to these enums so this might not be very useful in reality.&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 could try to assign properties to the ENUM you're trying to create and statically contruct it by using a loaded properties file. Big hack, but it works :)&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/478403/can-i-add-and-remove-elements-of-enumeration-at-runtime-in-java&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/478403/can-i-add-and-remove-elements-of-enumeration-at-runtime-in-java&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2038</guid>
      <comments>https://copycodes.tistory.com/2038#entry2038comment</comments>
      <pubDate>Fri, 8 Jan 2021 08:32:14 +0900</pubDate>
    </item>
    <item>
      <title>Lambda Calculus를 배우기위한 리소스에는 어떤 것이 있습니까?</title>
      <link>https://copycodes.tistory.com/2037</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Lambda Calculus를 배우기위한 리소스에는 어떤 것이 있습니까?&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/Lambda_calculus&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Lambda Calculus&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; 의 Wikipedia 항목 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 흥미로 &lt;/font&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Lambda_calculus&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 style=&quot;vertical-align: inherit;&quot;&gt;좀 더 깊이 들어가서 Lambda Calculus에 대해 더 잘 이해하고 싶습니다.&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;Lambda Calculus에 대한 최고의 책이나 입문서로 생각되는 것을 추천 할 수 있습니까?&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;Wikipedia 항목을 완료 한 경우 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://mitpress.mit.edu/sicp/&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;a href=&quot;http://mitpress.mit.edu/sicp/&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 style=&quot;vertical-align: inherit;&quot;&gt;가거나 과제를 수행하거나 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://web.mit.edu/alexmv/6.037/sicp.pdf&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;a href=&quot;http://web.mit.edu/alexmv/6.037/sicp.pdf&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;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://web.archive.org/web/20170809103332if_/http://gpl.internetconnection.net/mirror-lambda-calculus.pdf&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;Lambda Calculus 소개가&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;나는 이미 대부분의 내용을 알고 있으며 수학보다는 Lisp / Scheme의 관점에서 제시된 경우 이해하는 데 더 쉬울 것이라고 느낀다. &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;Chris Hankin의 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot; &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/com/0954300653&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;An Introduction to Lambda Calculi for Computer Scientists&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; &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;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9ZJY6.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9ZJY6.jpg&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;람다 미적분 인터 페터를 작성해보십시오. 이상적으로는 구문 분석기를 통하지 않고 언어 구문을 사용하는 기능적 언어로 작성하십시오. &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;에 Greg Michaelson이 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;쓴 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/com/0486478831&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;&quot;An Introduction to Functional Programming Through Lambda Calculus&quot;&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; 라는 제목의 책을 ​​Amazon에서 구입했습니다 &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;a href=&quot;http://www.macs.hw.ac.uk/~greg/books/&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; 에서 PostScript에서 색인이없는 무료 버전을 다운로드 할 수 있습니다.&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;제가 람다 미적분학을 사용하고 이해하게 만든 책은 Blackburn과 Bos의 &quot;자연어 표현과 추론&quot;이었습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Prolog를 사용한 자연어 처리에 관한 책입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;고려할 수있는 또 다른 책은 Allen의 &quot;Natural Language Understanding&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;이를 위해 Smullyan의 퍼즐 책 &quot;To Mock A Mockingbird&quot;를 강력히 추천합니다. &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;a href=&quot;https://rads.stackoverflow.com/amzn/click/com/0444875085&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;Barendregt의 책&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;a href=&quot;https://i.stack.imgur.com/LqpEM.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LqpEM.jpg&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;그 외에도 관심있는 람다 미적분의 &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;/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;다음은 좋은 설명입니다 (Schema 사용) : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.cs.brown.edu/courses/cs173/2002/Lectures/2002-10-28-lc.pdf&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://www.cs.brown.edu/courses/cs173/2002/Lectures/2002-10-28-lc.pdf&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;a href=&quot;http://blogs.msdn.com/b/ashleyf/archive/2008/12/03/the-lambda-calculus.aspx&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://blogs.msdn.com/b/ashleyf/archive/2008/12/03/the-lambda-calculus.aspx&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;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/515413/what-are-some-resources-for-learning-lambda-calculus&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/515413/what-are-some-resources-for-learning-lambda-calculus&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2037</guid>
      <comments>https://copycodes.tistory.com/2037#entry2037comment</comments>
      <pubDate>Fri, 8 Jan 2021 08:32:04 +0900</pubDate>
    </item>
    <item>
      <title>Android에서 정적 변수 사용</title>
      <link>https://copycodes.tistory.com/2036</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;Android에서 정적 변수를 사용하는 것이 권장됩니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예를 들어 Java에서 Singleton 패턴을 구현하면 일반적으로 다음을 수행합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;private static A the_instance;&lt;font&gt;&lt;/font&gt;
public static A getInstance() {&lt;font&gt;&lt;/font&gt;
    if (the_instance == null) {&lt;font&gt;&lt;/font&gt;
       the_instance = new A();&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    return the_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;또한 Android JVM은 언제 이것을 정리합니까?&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;code&gt;static&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;Class&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;ClassLoader&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;the_instance&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;ClassLoader&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;Android가 앱을 파괴 할 때 (백그라운드로 들어가거나 일시 중지되지 않고 완전히 종료 될 때) 이런 일이 발생한다고 90 % 확신합니다.&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;Singleton이 좋은 생각인가요? &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;Android에서는 대답이 많이 바뀌지 않는다고 생각합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;메모리 사용량은 그 자체로 문제가 아닙니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;메모리에 많은 항목을로드해야하는 경우 Singleton에 데이터를 캡슐화하는지 여부에 관계없이 문제가 될 수도 있고 그렇지 않습니다.&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;이것은 Android 문서가 말하는 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;http://developer.android.com/guide/appendix/faq/framework.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;http://developer.android.com/guide/appendix/faq/framework.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;단일 애플리케이션 내에서 활동 / 서비스간에 데이터를 어떻게 전달합니까?&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 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;p&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 style=&quot;vertical-align: inherit;&quot;&gt;물론 구조가 약간 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;공식 googlesamples / android-architecture 저장소에서는 todo-mvp-clean (MVP 패턴을 구현하고 Clean Architecture 원칙을 따르는 Todo 앱)에서 사용됩니다. &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/googlesamples/android-architecture/blob/b109dd67607a549e6ceb70e9257bd7d197d367ac/todoapp/app/src/prod/java/com/example/android/architecture/blueprints/todoapp/Injection.java&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;/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;현대적이고 오류가 적고 편리한 대안은 Dagger DI 프레임 워크입니다.&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;http://www.michaelsafyan.com/tech/design/patterns/singleton&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;싱글 톤은 반 patern입니다! &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;http://google.github.io/dagger/&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;Dagger&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;https://github.com/roboguice/roboguice/&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;Roboguice&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;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/2475978/using-static-variables-in-android&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/2475978/using-static-variables-in-android&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2036</guid>
      <comments>https://copycodes.tistory.com/2036#entry2036comment</comments>
      <pubDate>Fri, 8 Jan 2021 08:31:56 +0900</pubDate>
    </item>
    <item>
      <title>cv :: Point 세트에서 가짜 왜곡 보정을 위해 cv :: warpPerspective 실행</title>
      <link>https://copycodes.tistory.com/2035</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;cv :: Point 세트에서 가짜 왜곡 보정을 위해 cv :: warpPerspective 실행&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;a href=&quot;http://felix.abecassis.me/2011/10/opencv-rotation-deskewing/&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 style=&quot;vertical-align: inherit;&quot;&gt;를 얻기 위해 포인트 세트의 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://nuigroup.com/forums/viewthread/3414/&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&gt;&lt;a href=&quot;http://felix.abecassis.me/2011/10/opencv-rotation-deskewing/&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;/p&gt; 
&lt;p&gt;&lt;a href=&quot;http://nuigroup.com/?ACT=28&amp;amp;fid=27&amp;amp;aid=1892_H6eNAaign4Mrnn30Au8d&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://nuigroup.com/?ACT=28&amp;amp;fid=27&amp;amp;aid=1892_H6eNAaign4Mrnn30Au8d&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;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;img src=&quot;https://i.stack.imgur.com/r8fmh.jpg&quot; width=&quot;300&quot; height=&quot;350&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;code&gt;cv::getPerspectiveTransform&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;cv::warpPerspective&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;img src=&quot;https://i.stack.imgur.com/206aG.jpg&quot; width=&quot;100&quot; height=&quot;130&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;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;관심 영역&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;code&gt;vector&amp;lt;cv::Point&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;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; a &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;특정 순서로 저장&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;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;code&gt;RotatedRect&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;cv::Point2f src_vertices[4];&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;cv::getPerspectiveTransform()&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;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;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;또한 a를 사용하는 &lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;code&gt;RotatedRect&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; ROI의 원래 지점을 저장 &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&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&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;pre&gt;&lt;code&gt;#include &amp;lt;cv.h&amp;gt;&lt;font&gt;&lt;/font&gt;
#include &amp;lt;highgui.h&amp;gt;&lt;font&gt;&lt;/font&gt;
#include &amp;lt;iostream&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
using namespace std;&lt;font&gt;&lt;/font&gt;
using namespace cv;&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;
    cv::Mat src = cv::imread(argv[1], 1);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    // After some magical procedure, these are points detect that represent &lt;font&gt;&lt;/font&gt;
    // the corners of the paper in the picture: &lt;font&gt;&lt;/font&gt;
    // [408, 69] [72, 2186] [1584, 2426] [1912, 291]&lt;font&gt;&lt;/font&gt;
    vector&amp;lt;Point&amp;gt; not_a_rect_shape;&lt;font&gt;&lt;/font&gt;
    not_a_rect_shape.push_back(Point(408, 69));&lt;font&gt;&lt;/font&gt;
    not_a_rect_shape.push_back(Point(72, 2186));&lt;font&gt;&lt;/font&gt;
    not_a_rect_shape.push_back(Point(1584, 2426));&lt;font&gt;&lt;/font&gt;
    not_a_rect_shape.push_back(Point(1912, 291));&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    // For debugging purposes, draw green lines connecting those points &lt;font&gt;&lt;/font&gt;
    // and save it on disk&lt;font&gt;&lt;/font&gt;
    const Point* point = &amp;amp;not_a_rect_shape[0];&lt;font&gt;&lt;/font&gt;
    int n = (int)not_a_rect_shape.size();&lt;font&gt;&lt;/font&gt;
    Mat draw = src.clone();&lt;font&gt;&lt;/font&gt;
    polylines(draw, &amp;amp;point, &amp;amp;n, 1, true, Scalar(0, 255, 0), 3, CV_AA);&lt;font&gt;&lt;/font&gt;
    imwrite(&quot;draw.jpg&quot;, draw);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    // Assemble a rotated rectangle out of that info&lt;font&gt;&lt;/font&gt;
    RotatedRect box = minAreaRect(cv::Mat(not_a_rect_shape));&lt;font&gt;&lt;/font&gt;
    std::cout &amp;lt;&amp;lt; &quot;Rotated box set to (&quot; &amp;lt;&amp;lt; box.boundingRect().x &amp;lt;&amp;lt; &quot;,&quot; &amp;lt;&amp;lt; box.boundingRect().y &amp;lt;&amp;lt; &quot;) &quot; &amp;lt;&amp;lt; box.size.width &amp;lt;&amp;lt; &quot;x&quot; &amp;lt;&amp;lt; box.size.height &amp;lt;&amp;lt; std::endl;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    // Does the order of the points matter? I assume they do NOT.&lt;font&gt;&lt;/font&gt;
    // But if it does, is there an easy way to identify and order &lt;font&gt;&lt;/font&gt;
    // them as topLeft, topRight, bottomRight, bottomLeft?&lt;font&gt;&lt;/font&gt;
    cv::Point2f src_vertices[4];&lt;font&gt;&lt;/font&gt;
    src_vertices[0] = not_a_rect_shape[0];&lt;font&gt;&lt;/font&gt;
    src_vertices[1] = not_a_rect_shape[1];&lt;font&gt;&lt;/font&gt;
    src_vertices[2] = not_a_rect_shape[2];&lt;font&gt;&lt;/font&gt;
    src_vertices[3] = not_a_rect_shape[3];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    Point2f dst_vertices[4];&lt;font&gt;&lt;/font&gt;
    dst_vertices[0] = Point(0, 0);&lt;font&gt;&lt;/font&gt;
    dst_vertices[1] = Point(0, box.boundingRect().width-1);&lt;font&gt;&lt;/font&gt;
    dst_vertices[2] = Point(0, box.boundingRect().height-1);&lt;font&gt;&lt;/font&gt;
    dst_vertices[3] = Point(box.boundingRect().width-1, box.boundingRect().height-1);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    Mat warpMatrix = getPerspectiveTransform(src_vertices, dst_vertices);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    cv::Mat rotated;&lt;font&gt;&lt;/font&gt;
    warpPerspective(src, rotated, warpMatrix, rotated.size(), INTER_LINEAR, BORDER_CONSTANT);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    imwrite(&quot;rotated.jpg&quot;, rotated);&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;/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 style=&quot;vertical-align: inherit;&quot;&gt;걱정하지 마십시오. warpPerspective의 src 및 dst 이미지는 크기가 다를 수 있습니다.&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;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;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;getAffineTransform ()&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;warpAffine ().&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;중요 참고 사항 : getAffine 변환은 3 개의 점만 필요하며 예상하며 결과 행렬은 3x3이 아닌 2x3입니다.&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;cv::warpPerspective(src, dst, dst.size(), ... );
&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;cv::Mat rotated;&lt;font&gt;&lt;/font&gt;
cv::Size size(box.boundingRect().width, box.boundingRect().height);&lt;font&gt;&lt;/font&gt;
cv::warpPerspective(src, dst, size, ... );&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 main()&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    cv::Mat src = cv::imread(&quot;r8fmh.jpg&quot;, 1);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    // After some magical procedure, these are points detect that represent &lt;font&gt;&lt;/font&gt;
    // the corners of the paper in the picture: &lt;font&gt;&lt;/font&gt;
    // [408, 69] [72, 2186] [1584, 2426] [1912, 291]&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    vector&amp;lt;Point&amp;gt; not_a_rect_shape;&lt;font&gt;&lt;/font&gt;
    not_a_rect_shape.push_back(Point(408, 69));&lt;font&gt;&lt;/font&gt;
    not_a_rect_shape.push_back(Point(72, 2186));&lt;font&gt;&lt;/font&gt;
    not_a_rect_shape.push_back(Point(1584, 2426));&lt;font&gt;&lt;/font&gt;
    not_a_rect_shape.push_back(Point(1912, 291));&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    // For debugging purposes, draw green lines connecting those points &lt;font&gt;&lt;/font&gt;
    // and save it on disk&lt;font&gt;&lt;/font&gt;
    const Point* point = &amp;amp;not_a_rect_shape[0];&lt;font&gt;&lt;/font&gt;
    int n = (int)not_a_rect_shape.size();&lt;font&gt;&lt;/font&gt;
    Mat draw = src.clone();&lt;font&gt;&lt;/font&gt;
    polylines(draw, &amp;amp;point, &amp;amp;n, 1, true, Scalar(0, 255, 0), 3, CV_AA);&lt;font&gt;&lt;/font&gt;
    imwrite(&quot;draw.jpg&quot;, draw);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    // Assemble a rotated rectangle out of that info&lt;font&gt;&lt;/font&gt;
    RotatedRect box = minAreaRect(cv::Mat(not_a_rect_shape));&lt;font&gt;&lt;/font&gt;
    std::cout &amp;lt;&amp;lt; &quot;Rotated box set to (&quot; &amp;lt;&amp;lt; box.boundingRect().x &amp;lt;&amp;lt; &quot;,&quot; &amp;lt;&amp;lt; box.boundingRect().y &amp;lt;&amp;lt; &quot;) &quot; &amp;lt;&amp;lt; box.size.width &amp;lt;&amp;lt; &quot;x&quot; &amp;lt;&amp;lt; box.size.height &amp;lt;&amp;lt; std::endl;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    Point2f pts[4];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    box.points(pts);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    // Does the order of the points matter? I assume they do NOT.&lt;font&gt;&lt;/font&gt;
    // But if it does, is there an easy way to identify and order &lt;font&gt;&lt;/font&gt;
    // them as topLeft, topRight, bottomRight, bottomLeft?&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    cv::Point2f src_vertices[3];&lt;font&gt;&lt;/font&gt;
    src_vertices[0] = pts[0];&lt;font&gt;&lt;/font&gt;
    src_vertices[1] = pts[1];&lt;font&gt;&lt;/font&gt;
    src_vertices[2] = pts[3];&lt;font&gt;&lt;/font&gt;
    //src_vertices[3] = not_a_rect_shape[3];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    Point2f dst_vertices[3];&lt;font&gt;&lt;/font&gt;
    dst_vertices[0] = Point(0, 0);&lt;font&gt;&lt;/font&gt;
    dst_vertices[1] = Point(box.boundingRect().width-1, 0); &lt;font&gt;&lt;/font&gt;
    dst_vertices[2] = Point(0, box.boundingRect().height-1);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
   /* Mat warpMatrix = getPerspectiveTransform(src_vertices, dst_vertices);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    cv::Mat rotated;&lt;font&gt;&lt;/font&gt;
    cv::Size size(box.boundingRect().width, box.boundingRect().height);&lt;font&gt;&lt;/font&gt;
    warpPerspective(src, rotated, warpMatrix, size, INTER_LINEAR, BORDER_CONSTANT);*/&lt;font&gt;&lt;/font&gt;
    Mat warpAffineMatrix = getAffineTransform(src_vertices, dst_vertices);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    cv::Mat rotated;&lt;font&gt;&lt;/font&gt;
    cv::Size size(box.boundingRect().width, box.boundingRect().height);&lt;font&gt;&lt;/font&gt;
    warpAffine(src, rotated, warpAffineMatrix, size, INTER_LINEAR, BORDER_CONSTANT);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    imwrite(&quot;rotated.jpg&quot;, rotated);&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;dst_vertices&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;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;getPerspectiveTransform()&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;1st-------2nd&lt;font&gt;&lt;/font&gt;
 |         |&lt;font&gt;&lt;/font&gt;
 |         |&lt;font&gt;&lt;/font&gt;
 |         |&lt;font&gt;&lt;/font&gt;
3rd-------4th&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;vector&amp;lt;Point&amp;gt; not_a_rect_shape;&lt;font&gt;&lt;/font&gt;
not_a_rect_shape.push_back(Point(408, 69));&lt;font&gt;&lt;/font&gt;
not_a_rect_shape.push_back(Point(1912, 291));&lt;font&gt;&lt;/font&gt;
not_a_rect_shape.push_back(Point(72, 2186));&lt;font&gt;&lt;/font&gt;
not_a_rect_shape.push_back(Point(1584, 2426));&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;Point2f dst_vertices[4];&lt;font&gt;&lt;/font&gt;
dst_vertices[0] = Point(0, 0);&lt;font&gt;&lt;/font&gt;
dst_vertices[1] = Point(box.boundingRect().width-1, 0); // Bug was: had mistakenly switched these 2 parameters&lt;font&gt;&lt;/font&gt;
dst_vertices[2] = Point(0, box.boundingRect().height-1);&lt;font&gt;&lt;/font&gt;
dst_vertices[3] = Point(box.boundingRect().width-1, box.boundingRect().height-1);&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; 결과 이미지가 내가 생각했던 것처럼 녹색 사각형 내의 영역이 아니기 때문에 &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&gt;&lt;/p&gt; 
&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/8qInG.jpg&quot; width=&quot;250&quot; height=&quot;300&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;이것이 OpenCV의 버그인지 아니면 뭔가 빠졌는지 모르겠지만 주요 문제는 해결되었습니다.&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;사각형으로 작업 할 때 OpenCV는 실제로 친구가 아닙니다. &lt;/font&gt;&lt;/font&gt;&lt;code&gt;RotatedRect&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;기본적으로해야 할 일은 다음과 같습니다.&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;모든 다각형 세그먼트를 반복하고 거의 equel 인 세그먼트를 연결합니다.&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;가장 큰 4 개의 선분을 갖도록 정렬하십시오.&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;이 선을 교차하면 가장 가능성이 높은 4 개의 코너 포인트가 있습니다.&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;code&gt;Quadrangle&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;a href=&quot;https://stackoverflow.com/questions/18036920/java-opencv-deskewing-a-contour/18041971#18041971&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;윤곽을 기울이는 Java OpenCV&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;/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;앵커 포인트를 0으로 설정하고 배율 모드 (aspectFill, 크기에 맞게 크기 조정 등)를 변경해 보았습니다.&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;img src=&quot;https://i.stack.imgur.com/MwFuP.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;img src=&quot;https://i.stack.imgur.com/a43LC.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 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;img src=&quot;https://i.stack.imgur.com/RXZAG.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;원본 이미지가 매우 멀리 (잠재적으로) 늘어나는 다각형이되므로 경계 사각형이 화면 프레임보다 훨씬 크기 때문에 -0.5, -0.5로 변환하는 것만 큼 간단하지 않습니다. &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;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;git clone &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://github.com/zakkhoyt/Quadrilateral.git&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://github.com/zakkhoyt/Quadrilateral.git&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;git checkout 데모&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;pre&gt;&lt;code&gt;- (IBAction)buttonAction:(id)sender {&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    Quadrilateral quadFrom;&lt;font&gt;&lt;/font&gt;
    float scale = 1.0;&lt;font&gt;&lt;/font&gt;
    quadFrom.topLeft.x = self.topLeftView.center.x / scale;&lt;font&gt;&lt;/font&gt;
    quadFrom.topLeft.y = self.topLeftView.center.y / scale;&lt;font&gt;&lt;/font&gt;
    quadFrom.topRight.x = self.topRightView.center.x / scale;&lt;font&gt;&lt;/font&gt;
    quadFrom.topRight.y = self.topRightView.center.y / scale;&lt;font&gt;&lt;/font&gt;
    quadFrom.bottomLeft.x = self.bottomLeftView.center.x / scale;&lt;font&gt;&lt;/font&gt;
    quadFrom.bottomLeft.y = self.bottomLeftView.center.y / scale;&lt;font&gt;&lt;/font&gt;
    quadFrom.bottomRight.x = self.bottomRightView.center.x / scale;&lt;font&gt;&lt;/font&gt;
    quadFrom.bottomRight.y = self.bottomRightView.center.y / scale;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    Quadrilateral quadTo;&lt;font&gt;&lt;/font&gt;
    quadTo.topLeft.x = self.view.bounds.origin.x;&lt;font&gt;&lt;/font&gt;
    quadTo.topLeft.y = self.view.bounds.origin.y;&lt;font&gt;&lt;/font&gt;
    quadTo.topRight.x = self.view.bounds.origin.x + self.view.bounds.size.width;&lt;font&gt;&lt;/font&gt;
    quadTo.topRight.y = self.view.bounds.origin.y;&lt;font&gt;&lt;/font&gt;
    quadTo.bottomLeft.x = self.view.bounds.origin.x;&lt;font&gt;&lt;/font&gt;
    quadTo.bottomLeft.y = self.view.bounds.origin.y + self.view.bounds.size.height;&lt;font&gt;&lt;/font&gt;
    quadTo.bottomRight.x = self.view.bounds.origin.x + self.view.bounds.size.width;&lt;font&gt;&lt;/font&gt;
    quadTo.bottomRight.y = self.view.bounds.origin.y + self.view.bounds.size.height;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    CATransform3D t = [self transformQuadrilateral:quadFrom toQuadrilateral:quadTo];&lt;font&gt;&lt;/font&gt;
//    t = CATransform3DScale(t, 0.5, 0.5, 1.0);&lt;font&gt;&lt;/font&gt;
    self.imageView.layer.anchorPoint = CGPointZero;&lt;font&gt;&lt;/font&gt;
    [UIView animateWithDuration:1.0 animations:^{&lt;font&gt;&lt;/font&gt;
        self.imageView.layer.transform = t;&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;
#pragma mark OpenCV stuff...&lt;font&gt;&lt;/font&gt;
-(CATransform3D)transformQuadrilateral:(Quadrilateral)origin toQuadrilateral:(Quadrilateral)destination {&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    CvPoint2D32f *cvsrc = [self openCVMatrixWithQuadrilateral:origin];&lt;font&gt;&lt;/font&gt;
    CvMat *src_mat = cvCreateMat( 4, 2, CV_32FC1 );&lt;font&gt;&lt;/font&gt;
    cvSetData(src_mat, cvsrc, sizeof(CvPoint2D32f));&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    CvPoint2D32f *cvdst = [self openCVMatrixWithQuadrilateral:destination];&lt;font&gt;&lt;/font&gt;
    CvMat *dst_mat = cvCreateMat( 4, 2, CV_32FC1 );&lt;font&gt;&lt;/font&gt;
    cvSetData(dst_mat, cvdst, sizeof(CvPoint2D32f));&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    CvMat *H = cvCreateMat(3,3,CV_32FC1);&lt;font&gt;&lt;/font&gt;
    cvFindHomography(src_mat, dst_mat, H);&lt;font&gt;&lt;/font&gt;
    cvReleaseMat(&amp;amp;src_mat);&lt;font&gt;&lt;/font&gt;
    cvReleaseMat(&amp;amp;dst_mat);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    CATransform3D transform = [self transform3DWithCMatrix:H-&amp;gt;data.fl];&lt;font&gt;&lt;/font&gt;
    cvReleaseMat(&amp;amp;H);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    return transform;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
- (CvPoint2D32f*)openCVMatrixWithQuadrilateral:(Quadrilateral)origin {&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    CvPoint2D32f *cvsrc = (CvPoint2D32f *)malloc(4*sizeof(CvPoint2D32f));&lt;font&gt;&lt;/font&gt;
    cvsrc[0].x = origin.topLeft.x;&lt;font&gt;&lt;/font&gt;
    cvsrc[0].y = origin.topLeft.y;&lt;font&gt;&lt;/font&gt;
    cvsrc[1].x = origin.topRight.x;&lt;font&gt;&lt;/font&gt;
    cvsrc[1].y = origin.topRight.y;&lt;font&gt;&lt;/font&gt;
    cvsrc[2].x = origin.bottomRight.x;&lt;font&gt;&lt;/font&gt;
    cvsrc[2].y = origin.bottomRight.y;&lt;font&gt;&lt;/font&gt;
    cvsrc[3].x = origin.bottomLeft.x;&lt;font&gt;&lt;/font&gt;
    cvsrc[3].y = origin.bottomLeft.y;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    return cvsrc;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
-(CATransform3D)transform3DWithCMatrix:(float *)matrix {&lt;font&gt;&lt;/font&gt;
    CATransform3D transform = CATransform3DIdentity;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    transform.m11 = matrix[0];&lt;font&gt;&lt;/font&gt;
    transform.m21 = matrix[1];&lt;font&gt;&lt;/font&gt;
    transform.m41 = matrix[2];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    transform.m12 = matrix[3];&lt;font&gt;&lt;/font&gt;
    transform.m22 = matrix[4];&lt;font&gt;&lt;/font&gt;
    transform.m42 = matrix[5];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    transform.m14 = matrix[6];&lt;font&gt;&lt;/font&gt;
    transform.m24 = matrix[7];&lt;font&gt;&lt;/font&gt;
    transform.m44 = matrix[8];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    return transform; &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 style=&quot;vertical-align: inherit;&quot;&gt;xOffset과 yOffset과 비올라를 적용했습니다. &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;같은 종류의 문제가 발생하여 OpenCV의 호모 그래피 추출 기능을 사용하여 수정했습니다.&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/9470493/transforming-a-rectangle-image-into-a-quadrilateral-using-a-catransform3d&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;CATransform3D를 사용하여 직사각형 이미지를 사변형으로 변환&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;iOS 용 Xamarin MonoTouch를 사용하여 C #으로 구현 된 @VaporwareWolf의 답변에서 많은 영감을 얻었습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;주요 차이점은 콘텐츠 모드에 대해 ScaleToFit 대신 FindHomography 및 TopLeft 대신 GetPerspectiveTransform을 사용하고 있다는 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;    void SetupWarpedImage(UIImage sourceImage, Quad sourceQuad, RectangleF destRectangle)&lt;font&gt;&lt;/font&gt;
    {&lt;font&gt;&lt;/font&gt;
        var imageContainerView = new UIView(destRectangle)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            ClipsToBounds = true,&lt;font&gt;&lt;/font&gt;
            ContentMode = UIViewContentMode.TopLeft&lt;font&gt;&lt;/font&gt;
        };&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        InsertSubview(imageContainerView, 0);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        var imageView = new UIImageView(imageContainerView.Bounds)&lt;font&gt;&lt;/font&gt;
        {&lt;font&gt;&lt;/font&gt;
            ContentMode = UIViewContentMode.TopLeft,&lt;font&gt;&lt;/font&gt;
            Image = sourceImage&lt;font&gt;&lt;/font&gt;
        };&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        var offset = new PointF(-imageView.Bounds.Width / 2, -imageView.Bounds.Height / 2);&lt;font&gt;&lt;/font&gt;
        var dest = imageView.Bounds;&lt;font&gt;&lt;/font&gt;
        dest.Offset(offset);&lt;font&gt;&lt;/font&gt;
        var destQuad = dest.ToQuad();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        var transformMatrix = Quad.GeneratePerspectiveTransformMatrixFromQuad(sourceQuad, destQuad);&lt;font&gt;&lt;/font&gt;
        CATransform3D transform = transformMatrix.ToCATransform3D();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        imageView.Layer.AnchorPoint = new PointF(0f, 0f);&lt;font&gt;&lt;/font&gt;
        imageView.Layer.Transform = transform;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        imageContainerView.Add(imageView);&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/7838487/executing-cvwarpperspective-for-a-fake-deskewing-on-a-set-of-cvpoint&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/7838487/executing-cvwarpperspective-for-a-fake-deskewing-on-a-set-of-cvpoint&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2035</guid>
      <comments>https://copycodes.tistory.com/2035#entry2035comment</comments>
      <pubDate>Fri, 8 Jan 2021 08:31:46 +0900</pubDate>
    </item>
    <item>
      <title>재구성 된 텍스트 파일에 HTML을 포함하는 방법은 무엇입니까?</title>
      <link>https://copycodes.tistory.com/2034</link>
      <description>&lt;h2&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;/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;a href=&quot;http://docutils.sourceforge.net/rst.html&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;reStructuredText를&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;code&gt;&amp;lt;embed&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;통해 인터랙티브 플래시 유형 애니메이션을 인코딩하는 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;내 .rst 문서에서이 임의의 HTML 청크의 위치를 ​​어떻게 지정할 수 있습니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같은 것 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;  .. html ::&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  &amp;lt;embed&amp;gt;&lt;font&gt;&lt;/font&gt;
  ... more html here ...&lt;font&gt;&lt;/font&gt;
  &amp;lt;/embed&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;.. raw:: html&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    &amp;lt;embed&amp;gt;&lt;font&gt;&lt;/font&gt;
        ...&lt;font&gt;&lt;/font&gt;
    &amp;lt;/embed&amp;gt;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;a href=&quot;http://docutils.sourceforge.net/docs/ref/rst/directives.html#raw-data-pass-through&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;raw&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&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/8621042/how-to-embed-html-in-restructured-text-file&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/8621042/how-to-embed-html-in-restructured-text-file&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2034</guid>
      <comments>https://copycodes.tistory.com/2034#entry2034comment</comments>
      <pubDate>Fri, 8 Jan 2021 08:31:26 +0900</pubDate>
    </item>
    <item>
      <title>작업 메뉴에서 &amp;quot;디버그 관리 메모리&amp;quot;를 찾을 수없는 이유는 무엇입니까?</title>
      <link>https://copycodes.tistory.com/2033</link>
      <description>&lt;h2&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;/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;MSDN 문서 : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dn342825.aspx&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.NET Framework 메모리 문제 분석에&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; 설명 된대로 작업 메뉴에서 &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;내 Visual Studio : &lt;/font&gt;&lt;/font&gt;&lt;img src=&quot;https://i.stack.imgur.com/SZQv7.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;img src=&quot;https://i.stack.imgur.com/m5roI.png&quot; alt=&quot;여기에 이미지 설명 입력&quot;&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://blogs.msdn.com/b/visualstudioalm/archive/2013/06/20/using-visual-studio-2013-to-diagnose-net-memory-issues-in-production.aspx&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;blockquote&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;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;Visual Studio 2013 Ultimate 버전의&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;Premium 또는 Professional을 사용하는 경우 옵션이 표시되지 않습니다.&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;덤프 파일이 수집 된 프로세스는 .NET 4.5 이상에서 실행 중이어야합니다. &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;덤프가 3.5 또는 이전 버전에서 수집 된 경우 옵션이 나타나지 않고 4.0에서 수집 된 경우 오류 메시지와 함께 시작되지 않습니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
 &lt;/ol&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;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/21241905/why-i-can-not-find-debug-managed-memory-on-actions-menu&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/21241905/why-i-can-not-find-debug-managed-memory-on-actions-menu&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2033</guid>
      <comments>https://copycodes.tistory.com/2033#entry2033comment</comments>
      <pubDate>Fri, 8 Jan 2021 08:31:18 +0900</pubDate>
    </item>
    <item>
      <title>.gitlab-ci.yml에서 와일드 카드 아티팩트 하위 디렉터리를 지정하는 방법은 무엇입니까?</title>
      <link>https://copycodes.tistory.com/2032</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.gitlab-ci.yml에서 와일드 카드 아티팩트 하위 디렉터리를 지정하는 방법은 무엇입니까?&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;GitLab CI를 사용하여 C # 솔루션을 빌드하고 한 빌드 단계에서 다른 빌드 단계로 일부 빌드 아티팩트를 전달하려고합니다.&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;bin/&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;obj/&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;.gitlab-ci.yml&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;...&lt;font&gt;&lt;/font&gt;
stages:&lt;font&gt;&lt;/font&gt;
  - build&lt;font&gt;&lt;/font&gt;
  - test&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
build:&lt;font&gt;&lt;/font&gt;
  stage: build&lt;font&gt;&lt;/font&gt;
  script:&lt;font&gt;&lt;/font&gt;
    CALL %MSBuild% ...&lt;font&gt;&lt;/font&gt;
  artifacts:&lt;font&gt;&lt;/font&gt;
    paths:&lt;font&gt;&lt;/font&gt;
      - /**/bin/&lt;font&gt;&lt;/font&gt;
      - /**/obj/&lt;font&gt;&lt;/font&gt;
    expire_in: 6 hrs&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
test:&lt;font&gt;&lt;/font&gt;
  stage: test&lt;font&gt;&lt;/font&gt;
  dependencies:&lt;font&gt;&lt;/font&gt;
    - build&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;**/bin/&lt;font&gt;&lt;/font&gt;
**/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;pre&gt;&lt;code&gt;.*/bin/&lt;font&gt;&lt;/font&gt;
.*/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;code&gt;/**/bin/&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;/**/obj/&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;Uploading artifacts...&lt;font&gt;&lt;/font&gt;
WARNING: /**/bin/: no matching files&lt;font&gt;&lt;/font&gt;
WARNING: /**/obj/: no matching files&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 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;artifacts:&lt;font&gt;&lt;/font&gt;
  untracked: true&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;packages/&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;pre&gt;&lt;code&gt;Uploading artifacts...&lt;font&gt;&lt;/font&gt;
untracked: found 4513 files                        &lt;font&gt;&lt;/font&gt;
ERROR: Uploading artifacts to coordinator... too large archive  id=36 responseStatus=413 Request Entity Too Large token=...&lt;font&gt;&lt;/font&gt;
FATAL: Too large&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;a href=&quot;https://gitlab.com/gitlab-org/gitlab-ci-multi-runner&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;gitlab-CI-멀티 러너&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;https://golang.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;이동을&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;https://golang.org/pkg/path/filepath/#Glob&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;() filepath.Glob을&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;https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/commands/helpers/file_archiver.go#L104&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;file_archiver.go&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;Go는 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://gitlab.com/gitlab-org/gitlab-ci-multi-runner&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; SO의 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다른 질문 &lt;/font&gt;&lt;a href=&quot;https://gitlab.com/gitlab-org/gitlab-ci-multi-runner&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 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;code&gt;**/bin&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;/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;artifacts:&lt;font&gt;&lt;/font&gt;
  paths:&lt;font&gt;&lt;/font&gt;
    - &quot;*/bin&quot;&lt;font&gt;&lt;/font&gt;
    - &quot;*/obj&quot;&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Note that the quotes (&lt;code&gt;&quot;&lt;/code&gt;) seem to be required, as well as &lt;strong&gt;no&lt;/strong&gt; trailing path separator at the end.&lt;/p&gt; 
&lt;p&gt;It should also be possible to explicitly add more levels by adding more globbing expressions (as described &lt;a href=&quot;https://stackoverflow.com/q/10598026/993388&quot;&gt;here&lt;/a&gt;):&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;paths:&lt;font&gt;&lt;/font&gt;
  ...&lt;font&gt;&lt;/font&gt;
  - &quot;*/obj&quot;&lt;font&gt;&lt;/font&gt;
  - &quot;*/*/bin&quot;&lt;font&gt;&lt;/font&gt;
  - &quot;*/*/obj&quot;&lt;font&gt;&lt;/font&gt;
  ...&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;GitLab is tracking this issue &lt;a href=&quot;https://gitlab.com/gitlab-org/gitlab-runner/issues/2620&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, and will possibly be fixed in a future version.&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/38009869/how-to-specify-wildcard-artifacts-subdirectories-in-gitlab-ci-yml&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/38009869/how-to-specify-wildcard-artifacts-subdirectories-in-gitlab-ci-yml&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2032</guid>
      <comments>https://copycodes.tistory.com/2032#entry2032comment</comments>
      <pubDate>Fri, 8 Jan 2021 08:31:10 +0900</pubDate>
    </item>
    <item>
      <title>PHP를 사용하여 HTML을 PDF로 변환 하시겠습니까?</title>
      <link>https://copycodes.tistory.com/2031</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;PHP를 사용하여 HTML을 PDF로 변환 하시겠습니까?&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/391005/convert-html-css-to-pdf-with-php&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;PHP를 사용하여 HTML + CSS를 PDF로 변환 하시겠습니까?&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;PHP를 사용하여 HTML 페이지를 PDF로 변환 할 수 있습니까? 그렇다면 어떻게 할 수 있습니까?&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;pre&gt;&lt;code&gt;http://example.com/invoices/3333
&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;그리고 HTML 출력은 PDF로 변환되어야합니다.&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;PHP에서 pdf &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;를 &lt;/font&gt;&lt;/font&gt;&lt;strong&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 style=&quot;vertical-align: inherit;&quot;&gt;pdflib가 도움이 될 것입니다 (다른 사람들이 제안한대로).&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;PHP를 통해 HTML 페이지를 PDF &lt;/font&gt;&lt;/font&gt;&lt;strong&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 style=&quot;vertical-align: inherit;&quot;&gt;여기에서 약간의 문제를 발견 할 수 있습니다. 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;p&gt;&lt;a href=&quot;https://github.com/dompdf/dompdf&quot; rel=&quot;noreferrer&quot; title=&quot;DOMPDF&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;DOMPDF&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; : html을 래핑하고 pdf를 빌드하는 php 클래스. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;pdflib를 기반으로 잘 작동하고 사용자 정의가 가능합니다 (php를 알고 있다면), 내가 올바르게 기억한다면 CSS도 필요합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;나쁜 소식 : html이 크거나 복잡 할 때는 느립니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;http://user.it.uu.se/~jan/html2ps.html&quot; rel=&quot;noreferrer&quot; title=&quot;HTML2PS&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;HTML2PS&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://user.it.uu.se/~jan/html2ps.html&quot; rel=&quot;noreferrer&quot; title=&quot;HTML2PS&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;DOMPDF&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 와 동일하지만 먼저 .ps (고스트 스크립트) 파일로 변환 한 다음 필요한 형식 (pdf, jpg, png)으로 변환합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;저에게는 dompdf보다 조금 낫지 만 &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;하지만 CSS와의 호환성이 더 좋습니다.&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;이 두 가지는 php 클래스이지만 서버에 일부 소프트웨어를 설치하고 passthru () 또는 system ()을 통해 액세스 할 수 있다면 이것도 살펴보십시오.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://wkhtmltopdf.org&quot; rel=&quot;noreferrer&quot; title=&quot;wkhtmltopdf&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;wkhtmltopdf&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; : 웹킷 (safari의 래퍼)을 기반으로하여 정말 빠르고 강력합니다. html 페이지를 pdf로 즉시 변환 할 수있는 가장 좋은 도구 (atm) 인 것 같습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;CSS2가있는 3 페이지 xHTML 문서의 경우 2 초 밖에 걸리지 않습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;어쨌든 google.code 페이지가 자주 업데이트되는 최근 프로젝트입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://michaelrsweet.github.io/htmldoc/&quot; rel=&quot;noreferrer&quot; title=&quot;htmldoc&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;htmldoc&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; : 이것은 탱크입니다. 절대로 멈추거나 충돌하지 않습니다 .. 프로젝트는 2007 년 이후로 죽은 것처럼 보이지만 어쨌든 CSS 호환성이 필요하지 않다면 이것은 당신에게 좋을 수 있습니다.&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;http://www.tcpdf.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;TCPDF&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;많은 기능이 있으며이를 사용하는 장점 중 하나는 즉시 html을 pdf로 변환 할 수 있습니다.&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;a href=&quot;http://www.tufat.com/script19.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;http://www.tufat.com/script19.htm&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&gt;&lt;a href=&quot;http://www.pdflib.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;PDFlib를&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;http://de2.php.net/manual/en/book.pdf.php&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;a href=&quot;http://de2.php.net/manual/en/book.pdf.php&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;php.net에&lt;/font&gt;&lt;/a&gt;&lt;font 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;아아, PDFlib에 대한 라이센스를 구입하지 않으면 다소 눈에 띄는 워터 마크를 가지고 살아야합니다.&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;또한 goog 작업을 수행하는 이것은 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://html2pdf.fr/index_en&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;html2pdf&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;dompdf : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://github.com/dompdf/dompdf&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://github.com/dompdf/dompdf&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;html 입력 문자열을 받아서 pdf- 문자열을 반환합니다.&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;브라우저 수준의 품질이 아니며 CSS에 문제가 있지만 간단한 텍스트 문서에는 충분합니다.&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;HTML 입력을 받아들이고 eh 파일을 자동으로 변환 할 수있는 기성품 솔루션이 있습니다.&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;PHP를 사용하여 PDF를 생성하는 데 사용할 수 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;있는 공통 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://us.php.net/manual/en/ref.pdf.php&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;PDFLib&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 style=&quot;vertical-align: inherit;&quot;&gt;제가 사용한 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.rustyparts.com/pdf.php&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;/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;PHP 클래스의 문제점은 AFAIK 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;속도 : PHP는 html 구조를 구문 분석하고 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;pdflib를 사용하여 pdf &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;li&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;/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;정확한 변환을하는 유일한 방법은 브라우저 래퍼 becose를 사용하는 것입니다. 정의상 항상 더 나은 html 리더가 될 것입니다.&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://leuksman.com/log/2008/03/27/html-to-pdf-why-so-hard/&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;링크&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;LINK&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; 그것은 내가 wkhtmltopdf에 대해 읽은 곳이다 .. 모든 주석도 읽어라, 다른 많은 방법이 거기에있다 ...&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/733219/converting-html-to-pdf-using-php&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/733219/converting-html-to-pdf-using-php&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2031</guid>
      <comments>https://copycodes.tistory.com/2031#entry2031comment</comments>
      <pubDate>Fri, 8 Jan 2021 08:31:01 +0900</pubDate>
    </item>
    <item>
      <title>간단한 직렬 지점 간 통신 프로토콜</title>
      <link>https://copycodes.tistory.com/2030</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;두 장치 (PC와 마이크로 컨트롤러)간에 간단한 통신 프로토콜이 필요합니다. &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&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Error_detection_and_correction&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 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;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;PPS 문법 오류에 대해 죄송합니다. 이해하시기 바랍니다.&lt;/font&gt;&lt;/font&gt;&lt;/em&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&gt;&lt;strong&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 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 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;편집 2. &lt;/font&gt;&lt;/font&gt;&lt;/strong&gt; &lt;strong&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;a href=&quot;http://en.wikipedia.org/wiki/Physical_Layer&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;/em&gt;&lt;/strong&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&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/RS-232&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;RS-232&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; C 시리얼 규격 &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/Asynchronous_serial_communication&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;RxD, TxD 및 GND 신호 만 사용하겠습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;마이크로 컨트롤러 AFAIK가 지원하지 않기 때문에 추가 전선을 사용할 수 없습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;BTW &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Atmel_AVR&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;AVR&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; ATmega128 칩을 &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;따라서 고정 전송 속도, 8 비트 데이터, 패리티 검사없이 (또는 포함?) 2 정지 비트를 사용합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Data_Link_Layer&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;/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 style=&quot;vertical-align: inherit;&quot;&gt;그것이 내 질문이 주로 우려하는 것입니다. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/High-Level_Data_Link_Control&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;HDLC&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://en.wikipedia.org/wiki/Point-to-Point_Protocol&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;PPP&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://en.wikipedia.org/wiki/Modbus&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Modbus&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;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/HDLC&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;HDLC를&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;a href=&quot;http://en.wikipedia.org/wiki/High-Level_Data_Link_Control#Asynchronous_framing&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;패킷 프레이밍을 위해 HDLC를 사용하는 것 외에도. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;다음과 같이 패킷을 포맷합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;802.11을 사용하여 옵션을 전달하는 방법입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;U8 cmd;&lt;font&gt;&lt;/font&gt;
U8 len;&lt;font&gt;&lt;/font&gt;
u8 payload[len];&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;각 명령 패킷의 총 크기는 len +2입니다.&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;#define TRIGGER_SENSOR 0x01&lt;font&gt;&lt;/font&gt;
#define SENSOR_RESPONSE 0x02&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&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; // total packet length minus flags len+4&lt;font&gt;&lt;/font&gt;
 U8 sflag;   //0x7e start of packet end of packet flag from HDLC&lt;font&gt;&lt;/font&gt;
 U8 cmd;     //tells the other side what to do.&lt;font&gt;&lt;/font&gt;
 U8 len;     // payload length&lt;font&gt;&lt;/font&gt;
 U8 payload[len];  // could be zero len&lt;font&gt;&lt;/font&gt;
 U16 crc;&lt;font&gt;&lt;/font&gt;
 U8 eflag;   //end of frame flag&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;그런 다음 시스템은 플래그 0x7e에 대한 직렬 스트림을 모니터링하고 거기에있을 때 길이를 확인하여 pklen&amp;gt; = 4 및 pklen = len + 4이고 crc가 유효한지 확인합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;작은 패킷에 대해 crc에만 의존하지 마십시오. 많은 오 탐지가 발생하고 길이도 확인됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;길이 또는 crc가 일치하지 않으면 길이와 crc를 재설정하고 새 프레임 디코딩을 시작하십시오. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;일치하는 경우 패킷을 새 버퍼에 복사하고 명령 처리 기능에 전달합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;플래그가 수신되면 항상 길이와 crc를 재설정하십시오.&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;명령 처리 기능의 경우 cmd 및 len을 잡고 스위치를 사용하여 각 유형의 명령을 처리하십시오. &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;그런 다음 패킷을 포맷하여 PC로 보내면 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;a href=&quot;https://stackoverflow.com/users/18256/foredecker&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Foredecker&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 포인트가 &lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/815758/simple-serial-point-to-point-communication-protocol/817750#817750&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://en.wikipedia.org/wiki/OSI_model&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;OSI 모델&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;HDLC에 대한 내 게시물은 &lt;/font&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/OSI_model#Layer_2:_Data_Link_Layer&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;a href=&quot;http://en.wikipedia.org/wiki/OSI_model#Layer_7:_Application_Layer&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;RPC 및 명령 처리는 응용 프로그램 계층&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://stackoverflow.com/users/18256/foredecker&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;a href=&quot;https://stackoverflow.com/questions/815758/simple-serial-point-to-point-communication-protocol/817750#817750&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;a href=&quot;http://en.wikipedia.org/wiki/OSI_model#Layer_2:_Data_Link_Layer&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;a href=&quot;http://en.wikipedia.org/wiki/OSI_model#Layer_7:_Application_Layer&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;/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;RS232 프로토콜은 까다 롭습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;HDLC 사용에 대한 제안은 좋은 제안이지만 전체 솔루션은 아닙니다. &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 style=&quot;vertical-align: inherit;&quot;&gt;Autobuad? &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 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;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;케이블에 대해 말하면 이것은 RS233에서 큰 고통입니다. &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;소프트웨어 기반 흐름 제어 메커니즘을 사용하면 가장 간단한 케이블 (TX, RX 및 공통) 만 사용할 수 있으므로 효과적 일 수 있습니다.&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;7 비트 또는 8 비트 단어를 선택합니까?&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;HW 패리티 또는 소프트웨어 오류 검사.&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;8 데이터 비트, 하드웨어 패리티 없음, 1 정지 비트를 사용하고 소프트웨어 기반 흐름 제어를 사용하는 것이 좋습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하드웨어에서 지원하는 경우 autobaud를 사용해야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그렇지 않은 경우 autobaud는 소프트웨어에서 수행하기가 매우 어렵습니다.&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 style=&quot;vertical-align: inherit;&quot;&gt;동기화 바이트는 1/255 바이트의 랜덤 노이즈 만 패킷의 첫 번째 바이트가 될 수 있음을 의미합니다. &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;패킷에 주소가 있거나 마스터 / 슬레이브 또는 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&gt;&lt;a href=&quot;https://stackoverflow.com/questions/1023181/good-free-rs232-serial-snoop-tool-for-protocol-development-debugging&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;PC에 대해 DEVICE와 다른 동기화 바이트를 사용하여이를 수행 할 수 있습니다. &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/Hamming_code&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;Hamming&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;8 비트 데이터를 12 비트 보호 바이트로 패키징합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이러한 12 비트 중 하나는 도중에 뒤집히고 원래의 8 비트를 검색 할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;데이터 저장 (CD에 사용) 또는 장치가 쉽게 재전송 할 수없는 경우 (위성 링크, 단방향 RF)에 유용합니다.&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 style=&quot;vertical-align: inherit;&quot;&gt;즉, 도착하지 않은 패킷 (동기화 손상)은 발신자가 쉽게 감지하고 느린 링크를 사용하는 전이중 모드에서는 첫 번째 응답이 수신되기 전에 두 개의 명령을 보낼 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이는 또한 프로토콜 분석을 더 쉽게 만듭니다 (제 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 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;내 제안은 modbus입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;센서 및 매개 변수 (예 : PLC)가있는 장치와의 통신을위한 효율적이고 쉬운 표준 프로토콜입니다. &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.modbus.org&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://www.modbus.org&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;1979 년부터 시작되어 인기를 얻고 있으며 예제와 라이브러리를 찾는 데 아무런 문제가 없을 것입니다.&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;나는이 질문을 몇 달 전에 읽었고 정확히 같은 문제를 가지고 있었지만 적은 양의 RAM을 가진 작은 8 비트 마이크로에 대해 충분히 효율적인 것을 찾지 못했습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그래서 CAN과 LIN에서 영감을 받아 작업을 수행 할 무언가를 만들었습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;MIN (Microcontroller Interconnect Network)이라고 부르고 여기에 GitHub에 업로드했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://github.com/min-protocol/min&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://github.com/min-protocol/min&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;두 가지 구현이 있습니다. 하나는 임베디드 C, 다른 하나는 PC 용 Python입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;또한 PC가 명령을 보내고 펌웨어가 LED를 켜는 작은 &quot;hello world&quot;테스트 프로그램도 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;여기에 Arduino 보드에서 이것을 시작하고 실행하는 것에 대해 블로그를 작성했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://kentindell.wordpress.com/2015/02/18/micrcontroller-interconnect-network-min-version-1-0/&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://kentindell.wordpress.com/2015/02/18/micrcontroller-interconnect-network-min-version-1-0/&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;MIN은 매우 간단합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;레이어 0 표현 (8 데이터 비트, 1 정지 비트, 패리티 없음)을 수정했지만 전송 속도는 열어 두었습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;각 프레임은 3 개의 0xAA 바이트로 시작하는데, 이진법은 1010101010이며, 한쪽 끝이 다른 쪽 끝에 동적으로 적응하기를 원할 경우 자동 보오율 감지를 수행하는 좋은 펄스열입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;프레임은 0 ~ 15 바이트의 페이로드이며, 16 비트 Fletcher의 체크섬, 제어 바이트 및 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;프로토콜은 문자 스터핑을 사용하므로 0xAA 0xAA 0xAA는 항상 프레임 시작을 나타냅니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;즉, 장치가 재설정에서 나오면 항상 다음 프레임의 시작과 동기화됩니다 (MIN의 설계 목표는 불완전하거나 잘못된 프레임을 전달하는 것이 결코 아닙니다). &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이는 또한 특정 바이트 간 및 프레임 간 타이밍 제약이 필요하지 않음을 의미합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;프로토콜에 대한 자세한 내용은 GitHub repo wiki에 있습니다.&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;MIN은 향후 개선 할 여지가 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;블록 메시지 전달 (제어 바이트의 4 비트가 예약 됨) 및 기능의 상위 수준 협상 (식별자 0xFF가 예약 됨)을 위해 거기에 몇 가지 후크를 남겨 두었으므로 일반적으로 필요한 기능에 대한 지원을 추가 할 수있는 범위가 충분합니다.&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;u8  Sync          // A constant value which always marks the start of a packet&lt;font&gt;&lt;/font&gt;
u16 Length        // Number of bytes in payload&lt;font&gt;&lt;/font&gt;
u8  Data[Length]  // The payload&lt;font&gt;&lt;/font&gt;
u16 Crc           // CRC&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;RS232 / UART를 PC (직렬 포트)와 프로세서 (UART)가 최소한의 번거 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1798&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;a href=&quot;http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1798&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;MAX232&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;그리고 RS232 / UART를 사용하면 관련이없는 경우 마스터 / 슬레이브에 대해 걱정할 필요가 없습니다. &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;권장 PC 소프트웨어 : 직접 작성하거나 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;간단한 모니터링 및 제어를위한 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.fuh-edv.de/docklight/&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;Docklight&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;http://en.wikipedia.org/wiki/Convolutional_code&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&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;간단하게 유지하십시오!&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; PC에서 RS232를 사용하는 것이 예전보다 훨씬 쉽습니다. 이제 USB to RS232 / TTL 변환기를 사용할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;한쪽 끝은 PC의 USB 소켓에 들어가고 일반 직렬 포트로 나타납니다. &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; 연결할 수있는 5V 또는 3.3V 신호로 나옵니다 &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;이러한 종류의 애플리케이션에 완벽하게 작동하는 FDTI 칩의 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.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;TTL-232R-3V3&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;내 유일한 제안은 소음 방지가 필요한 경우 전이중 RS-422 / 485를 사용할 수 있다는 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;당신은에 IC와 유사한 사용할 수있는 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&amp;amp;name=ADM3488ARZ-ND&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; 같은 PC 측의 AVR 측에 다음 RS-Delay Time을&amp;gt; RS-422 컨버터를 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.bb-elec.com/product_family.asp?FamilyId=17&amp;amp;TrailType=Sub&amp;amp;Trail=11&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;여기 485PTBR&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;차폐 케이블 (2 개의 꼬인 차폐 쌍)을 찾거나 만들 수 있다면 더 많은 보호를받을 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그리고이 모든 것이 마이크로와 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;무엇을 하든지 전이중 시스템을 사용하고 있는지 확인하고 읽기 / 쓰기 활성화 라인이 IC에서 어설 션되는지 확인하십시오.&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&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;조회 테이블과 함께 CRC16과 같은 가벼운 것을 사용하십시오. 각 바이트가 수신 될 때 계산할 수 있으며 기본적으로 XOR입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Steve Melnikoff의 제안은 작은 마이크로에 적합합니다.&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;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;a href=&quot;https://github.com/Overdrivr/Telemetry&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;Telemetry&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 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/Overdrivr/pytelemetry&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;Pytelemetry&lt;/code&gt;&lt;/a&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;그것은이다 &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;PubSub 기반 프로토콜&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; ,하지만 MQTT는 달리이 지점 간 프로토콜이며, &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;모든 pubsub 프로토콜과 마찬가지로 &lt;/font&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&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;topic&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;publish(&quot;someTopic&quot;,&quot;someMessage&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;publish_f32(&quot;foo&quot;,1.23e-4)&lt;font&gt;&lt;/font&gt;
publish_u32(&quot;bar&quot;,56789)&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;// Add an indexing meaning to the topic&lt;font&gt;&lt;/font&gt;
publish(&quot;foo:1&quot;,45) // foo with index = 1&lt;font&gt;&lt;/font&gt;
publish(&quot;foo:2&quot;,56) // foo with index = 2&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Add a grouping meaning to the topic&lt;font&gt;&lt;/font&gt;
publish(&quot;bar/foo&quot;,67) // foo is under group 'bar'&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Combine&lt;font&gt;&lt;/font&gt;
publish(&quot;bar/foo:45&quot;,54)&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;또한 PubSub 패턴은 유연성 때문에 훌륭합니다. &lt;/font&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;C 라이브러리 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://badge.fury.io/gh/Overdrivr%2Ftelemetry&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://badge.fury.io/gh/Overdrivr%2Ftelemetry.svg&quot; alt=&quot;GitHub 버전&quot;&gt;&lt;/a&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 라이브러리는 괜찮은 UART 라이브러리가있는 한 모든 새 장치에 추가하는 것이 매우 간단합니다. &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;TM_transport&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;Telemetry&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;하고 4 개의 함수 포인터를 할당 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하기 만하면 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;read&lt;/code&gt; &lt;code&gt;readable&lt;/code&gt; &lt;code&gt;write&lt;/code&gt; &lt;code&gt;writeable&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;// your device's uart library function signatures (usually you already have them)&lt;font&gt;&lt;/font&gt;
int32_t read(void * buf, uint32_t sizeToRead);&lt;font&gt;&lt;/font&gt;
int32_t readable();&lt;font&gt;&lt;/font&gt;
int32_t write(void * buf, uint32_t sizeToWrite);&lt;font&gt;&lt;/font&gt;
int32_t writeable();&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;Telemetry를 사용하려면 다음 코드를 추가하기 만하면됩니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;// At the beginning of main function, this is the ONLY code you have to add to support a new device with telemetry&lt;font&gt;&lt;/font&gt;
TM_transport transport;&lt;font&gt;&lt;/font&gt;
transport.read = read;&lt;font&gt;&lt;/font&gt;
transport.write = write;&lt;font&gt;&lt;/font&gt;
transport.readable = readable;&lt;font&gt;&lt;/font&gt;
transport.writeable = writeable;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// Init telemetry with the transport structure&lt;font&gt;&lt;/font&gt;
init_telemetry(&amp;amp;transport);  &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// and you're good to start publishing&lt;font&gt;&lt;/font&gt;
publish_i32(&quot;foobar&quot;,...&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&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;a href=&quot;https://badge.fury.io/py/pytelemetry&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://badge.fury.io/py/pytelemetry.svg&quot; alt=&quot;PyPI 버전&quot;&gt;&lt;/a&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&gt;&lt;code&gt;pytelemetry&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;파이썬을 알고 있다면 다음 코드는 직렬 포트에 연결하고 topic에 한 번 게시하고 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;foo&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 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 runner&lt;font&gt;&lt;/font&gt;
import pytelemetry.pytelemetry as tm&lt;font&gt;&lt;/font&gt;
import pytelemetry.transports.serialtransport as transports&lt;font&gt;&lt;/font&gt;
import time&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
transport = transports.SerialTransport()&lt;font&gt;&lt;/font&gt;
telemetry = tm.pytelemetry(transport)&lt;font&gt;&lt;/font&gt;
app = runner.Runner(transport,telemetry)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
def printer(topic, data):&lt;font&gt;&lt;/font&gt;
    print(topic,&quot; : &quot;, data)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
options = dict()&lt;font&gt;&lt;/font&gt;
options['port'] = &quot;COM20&quot;&lt;font&gt;&lt;/font&gt;
options['baudrate'] = 9600&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
app.connect(options)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
telemetry.subscribe(None, printer)&lt;font&gt;&lt;/font&gt;
telemetry.publish('bar',1354,'int32')&lt;font&gt;&lt;/font&gt;
time.sleep(3)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
app.terminate()&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;Pytelemetry CLI &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://badge.fury.io/py/pytelemetrycli&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://badge.fury.io/py/pytelemetrycli.svg&quot; alt=&quot;PyPI 버전&quot;&gt;&lt;/a&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&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;pytlm
&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;connect&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;ls&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;print&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;pub&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;plot&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/Exo7a.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Exo7a.png&quot; alt=&quot;여기에 이미지 설명 입력&quot;&gt;&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/q3rvr.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/q3rvr.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;You do not specify exactly how the microcontroller behaves, but will everything transmitted from the micro be a direct response to a command from the PC? If do then it seems like you can use a master/slave protocol of some kind (this will typically be the simplest solution). If both sides can initiate communication, you need a more general data link layer protocol. &lt;a href=&quot;http://en.wikipedia.org/wiki/High-Level_Data_Link_Control&quot; rel=&quot;nofollow noreferrer&quot;&gt;HDLC&lt;/a&gt; is a classic protocol for this. Although the full protocol probably is a overkill for your needs, you could for instance at least use the same frame format. You might also have a look at &lt;a href=&quot;http://en.wikipedia.org/wiki/Point-to-Point_Protocol&quot; rel=&quot;nofollow noreferrer&quot;&gt;PPP&lt;/a&gt; to see if there are something useful parts.&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;maybe this question can be completely stupid but has anyone considered use of one of &lt;a href=&quot;http://en.wikipedia.org/wiki/XMODEM&quot; rel=&quot;nofollow noreferrer&quot;&gt;X/Y/Z MODEM&lt;/a&gt; protocols?&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;SLIP 및 UDP. &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;모든 PC 및 유사한 장치가이를 말합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;a href=&quot;http://www.iosoft.co.uk/tcplean.php&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;TCP Lean&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.iosoft.co.uk/tcplean.php&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;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Jeremy Bentham은 작동하는 TCP / IP를 수행하는 PIC를 몰래 얻었습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;AVR은 PIC만큼 좋습니다.&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;대신 UDP를 권장합니다. 매우 쉽습니다.&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/815758/simple-serial-point-to-point-communication-protocol&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/815758/simple-serial-point-to-point-communication-protocol&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2030</guid>
      <comments>https://copycodes.tistory.com/2030#entry2030comment</comments>
      <pubDate>Fri, 8 Jan 2021 08:30:52 +0900</pubDate>
    </item>
    <item>
      <title>비동기 작업에 http 상태 202 사용</title>
      <link>https://copycodes.tistory.com/2029</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;비동기 작업에 http 상태 202 사용&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;사용자 제공 데이터를 수락하는 서비스 용 REST API를 작성 중입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;모든 작업을 완전히 비동기 적으로 유지하고 싶습니다. 여기에는 PUT, POST, DELETE 및 GET 요청이 포함됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내 생각은 요청을 수신하고 유효한 요청인지 확인한 다음 HTTP 202 허용 응답과 함께 데이터를 최종적으로 사용할 수있는 URL 및 토큰을 전달하여 후속 요청을 처리 된 데이터와 일치시킬 수 있도록하는 것입니다. . &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;요청이 유효하지 않으면 HTTP 400을 보냅니다.&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 style=&quot;vertical-align: inherit;&quot;&gt;데이터를 사용할 수있는 경우 일반 200 또는 201을 반환하지만 여전히 요청을 처리중인 경우 처리가 완료되지 않았 음을 나타내는 다른 202를 보냅니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;데이터 처리 오류의 경우 필요에 따라 4xx 또는 5xx 상태를 보냅니다.&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;풀 크기 나 사용 가능한 작업자 수를 모르기 때문에 Google App Engine의 30 초 제한을 충족 할만큼 빠르게 요청을받을 수 있는지 확신 할 수 없습니다.&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;내 질문은 : 이런 방식으로 요청을 처리하여 REST를 왜곡하고 있습니까? &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 페이지의 경우 구조화 된 페이지로 응답 한 다음 AJAX를 사용하여 데이터 요청을 처리 할 계획입니다.&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;저는 이러한 방식으로 REST를 사용하여 데이터를 처리하는 데 대한 의견이나 경험에 주로 관심이 있습니다.&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;Http status 202&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;은 IS &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html&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;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&gt;&lt;code&gt;Http status&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;이은 클라이언트가 이전 요청의 상태를 모니터링하는 데 사용해야하는 URL을 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;202 response&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;Location header&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;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Check-the-status-of-my-process&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; URL을 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;호출하면 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;프로세스가 보류중인 경우 202를 반환하는 대신 다음을 반환합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;code&gt;200 OK&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;/li&gt; 
 &lt;li&gt;&lt;code&gt;201 Created&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;GET / PUT / POST의 경우 응답에는 요청 / 생성 / 업데이트 된 리소스에 대한 위치가 포함되어야합니다.&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;오래된 질문에 내 2 센트를 더합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;내 아이디어는 systempuntoout 및 Avi Flax의 제안과 유사합니다.&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;HTTP 202&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;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&gt;&lt;/p&gt; 
&lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;code&gt;Location&lt;/code&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;code&gt;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 style=&quot;vertical-align: inherit;&quot;&gt;예를 들어 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;Location: /queue?token={unique_token}&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;Location: /task/{unique_token}&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;HTTP 200&lt;/code&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;반환해야한다고 생각합니다 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;( &lt;/font&gt;&lt;/font&gt;&lt;code&gt;HTTP 202&lt;/code&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;아닙니다 &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 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;HTTP 303&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://en.wikipedia.org/wiki/HTTP_303&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;code&gt;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&gt;&lt;code&gt;HTTP 201&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;GET&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;또한 상태를 확인하는 데 사용되는 리소스가 오류 코드를 적절하게 반환해야한다고 생각합니다. &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;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;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;초기 HTTP 요청부터 시작하겠습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;무엇보다도 요청은 POST 여야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;리소스를 만들기 위해 서버에 메시지를 보내고 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 경우 GET 및 PUT는 다음과 같은 이유로 유효하지 않습니다.&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;GET은 특정 위치에서 리소스를 얻기위한 것이기 때문에이 컨텍스트에서 GET은 유효하지 않습니다.&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;요청을 생성하지 않기 때문에 PUT가 유효하지 않습니다. 서버에 요청 생성을 요청하는 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt; 
&lt;/ul&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;이제 요청을 처리하기 위해 서버에 POST를 보내고 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;서버에는 실제로 3 개의 가능한 반환 값이 있습니다 (4xx 및 5xx 오류 제외).&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;&quot;201 Created&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;/li&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;202 Accepted&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;다른 관점은 서비스가 결과를 결정할 방법이없는 다른 비동기 작업에 의존하는 경우 &quot;202 Accepted&quot;응답을 반환해야한다는 것입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;마지막으로 일부 서비스 디자이너는 얼마나 빨리 수행 할 수 있는지에 관계없이 항상 &quot;202 Accepted&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;302 Found&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 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;HTTP 헤더는 리소스를 찾을 수있는 위치를 포함하는 클라이언트로 반환됩니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이것은 중요하며 나중에 보게 되겠지만 일부 사람들은 접근 방식이 다른 경향이 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;리소스를 다른 요청과 함께 재사용 할 수있는 경우 동일한 요청이 항상 동일한 URL을 생성하는 방식으로 &quot;위치&quot;를 생성해야합니다. &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;p&gt;&lt;font style=&quot;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 style=&quot;vertical-align: inherit;&quot;&gt;리소스가 실패 정보를 HTTP 프로토콜에 통합하는 것보다 제공하는 것이 훨씬 더 유연합니다.&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;404 Not Found&quot;를 반환해야합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot;404 찾을 수 없음&quot;이어야한다고 생각하는 이유는 실제로 존재하지 않기 때문입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;HTTP 사양은 &quot;404 찾을 수 없음&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;There is also the scenario of when a resource is supposed to only be there for a fixed time. For example, it may be data based on a source that is refreshed nightly. What should happen in these cases is that the resource should be removed, but an indicator should be provided to the service that it can know to return a &quot;410 Gone&quot; status code. This basically is telling the client that the resource was here, but is no longer available (ie: may have expired). The typical action from the client would be to resubmit the request.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;From the client perspective again&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;When the client gets the response for it's initial POST, it gets the &quot;Location&quot; and makes the request to the service using that URL using a GET (again, not POST). The service will generally response with these values:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&quot;200 OK&quot; indicates that the request did complete. The result of the request is returned in the content body, providing the content in the format defined by the Accept HTTP header.&lt;/li&gt; 
 &lt;li&gt;&quot;404 Not Found&quot; would tell the client that the request did not complete yet, the resource is not there yet, and, in this case, it should basically try again later.&lt;/li&gt; 
 &lt;li&gt;&quot;410 Gone&quot; would be returned in cases where the client may attempt to get the resource after a long period of time and it's not there anymore. In this case, it should simply resubmit the original query&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;The one thing that needs to be pointed out is that the resource that is returned is generally in a format that can define success and failure responses. The client should be able to determine from this resource if there was an error, what it was, and be able to respond accordingly.&lt;/p&gt; 
&lt;p&gt;Also, the service developer may make it so that service expires and deletes the error resource after a short period of time.&lt;/p&gt; 
&lt;p&gt;So that's my thoughts on this question. It's very late to the party, but hopefully future readers may see a slightly different view to a commonly asked 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;FWIW, Microsoft Flow uses a pattern like this.&lt;br&gt; First call returns 202 w/ Location header. Followup calls return either: 1. If still processing --&amp;gt; 202 w/ a location header. The loc header can be different, which provides a way to pass state between calls (and potentially make the server stateless!). 2. If done --&amp;gt; 200. &lt;/p&gt; 
&lt;p&gt;Details at: &lt;a href=&quot;https://github.com/jeffhollan/LogicAppsAsyncResponseSample&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/jeffhollan/LogicAppsAsyncResponseSample&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/5079367/use-http-status-202-for-asynchronous-operations&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/5079367/use-http-status-202-for-asynchronous-operations&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2029</guid>
      <comments>https://copycodes.tistory.com/2029#entry2029comment</comments>
      <pubDate>Fri, 8 Jan 2021 08:30:40 +0900</pubDate>
    </item>
    <item>
      <title>JavaScript에서 숫자를 기수 64로 변환하는 가장 빠른 방법은 무엇입니까?</title>
      <link>https://copycodes.tistory.com/2028</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;JavaScript에서 숫자를 기수 64로 변환하는 가장 빠른 방법은 무엇입니까?&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;JavaScript &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/Radix&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&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;(12345).toString(36) // &quot;9ix&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;parseInt(&quot;9ix&quot;, 36) // 12345
&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;36은 지정할 수있는 가장 높은 기수입니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;분명히 문자 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;0-9&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-z&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;숫자 (총 36 개)를 사용합니다.&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;내 질문 : 무엇 기본 64 표현으로 숫자를 변환하는 가장 빠른 방법 (예를 들어, 사용,의 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;A-Z&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;-&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;_&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;추가 28 자리의 경우)?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;hr&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; : 4 명이이 질문이 중복되었거나 Base64를 찾고 있다는 답변을 게시했습니다. &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; &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Base64&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Base64&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; &quot;는 간단한 ASCII 문자 세트로 바이너리 데이터를 인코딩하는 방법으로 네트워크 등을 통한 전송에 대해 안전합니다 (텍스트 전용 시스템이 바이너리를 왜곡하지 않도록 함).&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;숫자&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; 를 기수 64 문자열 표현으로 &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;(JavaScript &lt;/font&gt;&lt;/font&gt;&lt;code&gt;toString(radix)&lt;/code&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;는 최대 36 개의 기수에 대해이 작업을 자동으로 수행합니다. 기수 64를 얻으려면 사용자 정의 함수가 필요합니다.)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;hr&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;0   → &quot;0&quot;&lt;font&gt;&lt;/font&gt;
1   → &quot;1&quot;&lt;font&gt;&lt;/font&gt;
9   → &quot;9&quot;&lt;font&gt;&lt;/font&gt;
10  → &quot;a&quot;&lt;font&gt;&lt;/font&gt;
35  → &quot;z&quot;&lt;font&gt;&lt;/font&gt;
61  → &quot;Z&quot;&lt;font&gt;&lt;/font&gt;
62  → &quot;-&quot;&lt;font&gt;&lt;/font&gt;
63  → &quot;_&quot;&lt;font&gt;&lt;/font&gt;
64  → &quot;10&quot;&lt;font&gt;&lt;/font&gt;
65  → &quot;11&quot;&lt;font&gt;&lt;/font&gt;
128 → &quot;20&quot;&lt;font&gt;&lt;/font&gt;
etc.&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;다음은 NUMBERS에 대한 솔루션에 대한 스케치입니다 (바이트 배열 아님 :).&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;Base64 = {&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    _Rixits :&lt;font&gt;&lt;/font&gt;
//   0       8       16      24      32      40      48      56     63&lt;font&gt;&lt;/font&gt;
//   v       v       v       v       v       v       v       v      v&lt;font&gt;&lt;/font&gt;
    &quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/&quot;,&lt;font&gt;&lt;/font&gt;
    // You have the freedom, here, to choose the glyphs you want for &lt;font&gt;&lt;/font&gt;
    // representing your base-64 numbers. The ASCII encoding guys usually&lt;font&gt;&lt;/font&gt;
    // choose a set of glyphs beginning with ABCD..., but, looking at&lt;font&gt;&lt;/font&gt;
    // your update #2, I deduce that you want glyphs beginning with &lt;font&gt;&lt;/font&gt;
    // 0123..., which is a fine choice and aligns the first ten numbers&lt;font&gt;&lt;/font&gt;
    // in base 64 with the first ten numbers in decimal.&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    // This cannot handle negative numbers and only works on the &lt;font&gt;&lt;/font&gt;
    //     integer part, discarding the fractional part.&lt;font&gt;&lt;/font&gt;
    // Doing better means deciding on whether you're just representing&lt;font&gt;&lt;/font&gt;
    // the subset of javascript numbers of twos-complement 32-bit integers &lt;font&gt;&lt;/font&gt;
    // or going with base-64 representations for the bit pattern of the&lt;font&gt;&lt;/font&gt;
    // underlying IEEE floating-point number, or representing the mantissae&lt;font&gt;&lt;/font&gt;
    // and exponents separately, or some other possibility. For now, bail&lt;font&gt;&lt;/font&gt;
    fromNumber : function(number) {&lt;font&gt;&lt;/font&gt;
        if (isNaN(Number(number)) || number === null ||&lt;font&gt;&lt;/font&gt;
            number === Number.POSITIVE_INFINITY)&lt;font&gt;&lt;/font&gt;
            throw &quot;The input is not valid&quot;;&lt;font&gt;&lt;/font&gt;
        if (number &amp;lt; 0)&lt;font&gt;&lt;/font&gt;
            throw &quot;Can't represent negative numbers now&quot;;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        var rixit; // like 'digit', only in some non-decimal radix &lt;font&gt;&lt;/font&gt;
        var residual = Math.floor(number);&lt;font&gt;&lt;/font&gt;
        var result = '';&lt;font&gt;&lt;/font&gt;
        while (true) {&lt;font&gt;&lt;/font&gt;
            rixit = residual % 64&lt;font&gt;&lt;/font&gt;
            // console.log(&quot;rixit : &quot; + rixit);&lt;font&gt;&lt;/font&gt;
            // console.log(&quot;result before : &quot; + result);&lt;font&gt;&lt;/font&gt;
            result = this._Rixits.charAt(rixit) + result;&lt;font&gt;&lt;/font&gt;
            // console.log(&quot;result after : &quot; + result);&lt;font&gt;&lt;/font&gt;
            // console.log(&quot;residual before : &quot; + residual);&lt;font&gt;&lt;/font&gt;
            residual = Math.floor(residual / 64);&lt;font&gt;&lt;/font&gt;
            // console.log(&quot;residual after : &quot; + residual);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
            if (residual == 0)&lt;font&gt;&lt;/font&gt;
                break;&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
        return result;&lt;font&gt;&lt;/font&gt;
    },&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    toNumber : function(rixits) {&lt;font&gt;&lt;/font&gt;
        var result = 0;&lt;font&gt;&lt;/font&gt;
        // console.log(&quot;rixits : &quot; + rixits);&lt;font&gt;&lt;/font&gt;
        // console.log(&quot;rixits.split('') : &quot; + rixits.split(''));&lt;font&gt;&lt;/font&gt;
        rixits = rixits.split('');&lt;font&gt;&lt;/font&gt;
        for (var e = 0; e &amp;lt; rixits.length; e++) {&lt;font&gt;&lt;/font&gt;
            // console.log(&quot;_Rixits.indexOf(&quot; + rixits[e] + &quot;) : &quot; + &lt;font&gt;&lt;/font&gt;
                // this._Rixits.indexOf(rixits[e]));&lt;font&gt;&lt;/font&gt;
            // console.log(&quot;result before : &quot; + result);&lt;font&gt;&lt;/font&gt;
            result = (result * 64) + this._Rixits.indexOf(rixits[e]);&lt;font&gt;&lt;/font&gt;
            // console.log(&quot;result after : &quot; + result);&lt;font&gt;&lt;/font&gt;
        }&lt;font&gt;&lt;/font&gt;
        return result;&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;업데이트 : console.log가있는 NodeJ에서 실행하기위한 위의 (매우 가벼운) 테스트가 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;function testBase64(x) {&lt;font&gt;&lt;/font&gt;
    console.log(&quot;My number is &quot; + x);&lt;font&gt;&lt;/font&gt;
    var g = Base64.fromNumber(x);&lt;font&gt;&lt;/font&gt;
    console.log(&quot;My base-64 representation is &quot; + g);&lt;font&gt;&lt;/font&gt;
    var h = Base64.toNumber(g);&lt;font&gt;&lt;/font&gt;
    console.log(&quot;Returning from base-64, I get &quot; + h);&lt;font&gt;&lt;/font&gt;
    if (h !== Math.floor(x))&lt;font&gt;&lt;/font&gt;
        throw &quot;TEST FAILED&quot;;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
testBase64(0);&lt;font&gt;&lt;/font&gt;
try {&lt;font&gt;&lt;/font&gt;
    testBase64(-1);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
catch (err) {&lt;font&gt;&lt;/font&gt;
    console.log(&quot;caught &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;  &quot; + err);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
try {&lt;font&gt;&lt;/font&gt;
    testBase64(undefined);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
catch (err) {&lt;font&gt;&lt;/font&gt;
    console.log(&quot;caught &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;  &quot; + err);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
try {&lt;font&gt;&lt;/font&gt;
    testBase64(null);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
catch (err) {&lt;font&gt;&lt;/font&gt;
    console.log(&quot;caught &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;  &quot; + err);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
try {&lt;font&gt;&lt;/font&gt;
    testBase64(Number.NaN);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
catch (err) {&lt;font&gt;&lt;/font&gt;
    console.log(&quot;caught &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;  &quot; + err);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
try {&lt;font&gt;&lt;/font&gt;
    testBase64(Number.POSITIVE_INFINITY);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
catch (err) {&lt;font&gt;&lt;/font&gt;
    console.log(&quot;caught &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;  &quot; + err);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
try {&lt;font&gt;&lt;/font&gt;
    testBase64(Number.NEGATIVE_INFINITY);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
catch (err) {&lt;font&gt;&lt;/font&gt;
    console.log(&quot;caught &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;  &quot; + err);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
for(i=0; i&amp;lt;100; i++)&lt;font&gt;&lt;/font&gt;
    testBase64(Math.random()*1e14);&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 비트 정수용 버전입니다. 즉 -2147483648에서 2147483647 (포함) 사이의 모든 숫자입니다.&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;Reb Cabin의 상위 답변에서 버전을 수정했습니다. &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;Base64 = (function () {&lt;font&gt;&lt;/font&gt;
    var digitsStr = &lt;font&gt;&lt;/font&gt;
    //   0       8       16      24      32      40      48      56     63&lt;font&gt;&lt;/font&gt;
    //   v       v       v       v       v       v       v       v      v&lt;font&gt;&lt;/font&gt;
        &quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+-&quot;;&lt;font&gt;&lt;/font&gt;
    var digits = digitsStr.split('');&lt;font&gt;&lt;/font&gt;
    var digitsMap = {};&lt;font&gt;&lt;/font&gt;
    for (var i = 0; i &amp;lt; digits.length; i++) {&lt;font&gt;&lt;/font&gt;
        digitsMap[digits[i]] = i;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    return {&lt;font&gt;&lt;/font&gt;
        fromInt: function(int32) {&lt;font&gt;&lt;/font&gt;
            var result = '';&lt;font&gt;&lt;/font&gt;
            while (true) {&lt;font&gt;&lt;/font&gt;
                result = digits[int32 &amp;amp; 0x3f] + result;&lt;font&gt;&lt;/font&gt;
                int32 &amp;gt;&amp;gt;&amp;gt;= 6;&lt;font&gt;&lt;/font&gt;
                if (int32 === 0)&lt;font&gt;&lt;/font&gt;
                    break;&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
            return result;&lt;font&gt;&lt;/font&gt;
        },&lt;font&gt;&lt;/font&gt;
        toInt: function(digitsStr) {&lt;font&gt;&lt;/font&gt;
            var result = 0;&lt;font&gt;&lt;/font&gt;
            var digits = digitsStr.split('');&lt;font&gt;&lt;/font&gt;
            for (var i = 0; i &amp;lt; digits.length; i++) {&lt;font&gt;&lt;/font&gt;
                result = (result &amp;lt;&amp;lt; 6) + digitsMap[digits[i]];&lt;font&gt;&lt;/font&gt;
            }&lt;font&gt;&lt;/font&gt;
            return result;&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;Base64.fromInt(-2147483648); // gives &quot;200000&quot;&lt;font&gt;&lt;/font&gt;
Base64.toInt(&quot;200000&quot;); // gives -2147483648&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;function base64(value) {&lt;font&gt;&lt;/font&gt;
  if (typeof(value) === 'number') {&lt;font&gt;&lt;/font&gt;
    return base64.getChars(value, '');&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  if (typeof(value) === 'string') {&lt;font&gt;&lt;/font&gt;
    if (value === '') { return NaN; }&lt;font&gt;&lt;/font&gt;
    return value.split('').reverse().reduce(function(prev, cur, i) {&lt;font&gt;&lt;/font&gt;
      return prev + base64.chars.indexOf(cur) * Math.pow(64, i);&lt;font&gt;&lt;/font&gt;
    }, 0);&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
base64.chars = &quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_&quot;;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
base64.getChars = function(num, res) {&lt;font&gt;&lt;/font&gt;
  var mod = num % 64,&lt;font&gt;&lt;/font&gt;
      remaining = Math.floor(num / 64),&lt;font&gt;&lt;/font&gt;
      chars = base64.chars.charAt(mod) + res;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  if (remaining &amp;lt;= 0) { return chars; }&lt;font&gt;&lt;/font&gt;
  return base64.getChars(remaining, chars);&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;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;ActionScript (AS3)&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;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Base64 인코딩&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;strong&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;'base 64의 숫자'(radix 64)&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 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;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;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;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;이 상담 이전에 toString (기수) 및 parseInt (기수) 메소드를 알고 있었기 때문에 색상과 다른 기능 모두에서 16 진수 (기수 16)로 작업했습니다.&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&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;AS3&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;nbsp;또는 &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;JS&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; 에는 기수 64로 (부터) 변환을위한 수치 적 방법이 없습니다.&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&gt;&lt;strong&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;/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;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;예 : &lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;a href=&quot;http://convertxy.com/index.php/numberbases/&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;convertix.com&lt;/font&gt;&lt;/a&gt;&lt;/em&gt;&lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 및 &lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;a href=&quot;http://alfredo4570.net/src/bases.html&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;alfredo4570.net&lt;/font&gt;&lt;/a&gt;&lt;/em&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;br&gt; &lt;em&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;a href=&quot;http://convertxy.com/index.php/numberbases/&quot; rel=&quot;nofollow&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;a href=&quot;http://alfredo4570.net/src/bases.html&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;/em&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;기수 64&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; AZ, AZ, 0-9 + 및 / (I 이러한 상수를 정의 : STR64)를 지시 문자의 다음 세트에 의해 형성된다&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;toString / &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;to64String&lt;/font&gt;&lt;/font&gt;&lt;/strong&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;parseInt / &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;to64Parse&lt;/font&gt;&lt;/font&gt;&lt;/strong&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;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;AS3&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;되었지만 매우 명확합니다 (JS와 공통).&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;참고 : 1 * 10 &lt;/font&gt;&lt;sup&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;16&lt;/font&gt;&lt;/sup&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 미만의 숫자로 권장 사용&lt;/font&gt;&lt;/font&gt;&lt;sup&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/sup&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;const STR64:Array = ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/').split( '' );&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// TRANSFORM NUMBERS BETWEEN radix 10 AND radix 64&lt;font&gt;&lt;/font&gt;
/** Methods based on answers shared in:&lt;font&gt;&lt;/font&gt;
* @url   http://stackoverflow.com/questions/6213227/fastest-way-to-convert-a-number-to-radix-64-in-javascript&lt;font&gt;&lt;/font&gt;
*/&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// METHODS &lt;font&gt;&lt;/font&gt;
/** to64String: Method to transform a radix 10 number to radix 64 number (as string)&lt;font&gt;&lt;/font&gt;
* @param input   Number for transform to radix 64 (as String)&lt;font&gt;&lt;/font&gt;
* @param current String data (don't needed in request)&lt;font&gt;&lt;/font&gt;
* @return String Number in radix 64 as String;&lt;font&gt;&lt;/font&gt;
*&lt;font&gt;&lt;/font&gt;
* @based http://stackoverflow.com/users/383780/monocle&lt;font&gt;&lt;/font&gt;
* @based base64( Method for number to string - NOT string part )&lt;font&gt;&lt;/font&gt;
*/&lt;font&gt;&lt;/font&gt;
function to64String( input:Number, current:String = '' ):String&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    if ( input &amp;lt; 0 &amp;amp;&amp;amp; current.length == 0 ){&lt;font&gt;&lt;/font&gt;
        input = input * - 1;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    var modify:Number = input % 64;&lt;font&gt;&lt;/font&gt;
    var remain:Number = Math.floor( input / 64 );&lt;font&gt;&lt;/font&gt;
    var result:String = STR64[ modify ] + current;&lt;font&gt;&lt;/font&gt;
    return ( remain &amp;lt;= 0 ) ? result : to64String( remain, result );&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
/** to64Parse: Method for transform a number in radix 64 (as string) in radix 10 number&lt;font&gt;&lt;/font&gt;
* @param input   Number in radix 64 (as String) to transform in radix 10&lt;font&gt;&lt;/font&gt;
* @return Number in radix 10&lt;font&gt;&lt;/font&gt;
*&lt;font&gt;&lt;/font&gt;
* @based http://stackoverflow.com/users/520997/reb-cabin&lt;font&gt;&lt;/font&gt;
* @based Base64.toNumber( Method for string to number )&lt;font&gt;&lt;/font&gt;
*/&lt;font&gt;&lt;/font&gt;
function to64Parse ( input:String ):Number&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    var result:Number = 0;&lt;font&gt;&lt;/font&gt;
    var toProc:Array  = input.split( '' );&lt;font&gt;&lt;/font&gt;
    var e:String;&lt;font&gt;&lt;/font&gt;
    for ( e in toProc ){&lt;font&gt;&lt;/font&gt;
        result = ( result * 64 ) + STR64.indexOf( toProc[ e ] );&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    return result;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// TEST&lt;font&gt;&lt;/font&gt;
var i:int = 0;&lt;font&gt;&lt;/font&gt;
var max:Number = 1000000000000;&lt;font&gt;&lt;/font&gt;
var min:Number = 0;&lt;font&gt;&lt;/font&gt;
for ( i == 0; i &amp;lt; 20; i++ ){&lt;font&gt;&lt;/font&gt;
    var num:Number = ( Math.ceil( Math.random() * ( max - min + 1 ) ) + min );&lt;font&gt;&lt;/font&gt;
    var s64:String = to64String( num );&lt;font&gt;&lt;/font&gt;
    var ret:Number = to64Parse ( s64 );&lt;font&gt;&lt;/font&gt;
    trace( i + '\t# ' + num + '\t' + s64 + '\t' + ret + '\t' + ( ret == num ) )&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// TEST RESULT&lt;font&gt;&lt;/font&gt;
/*&lt;font&gt;&lt;/font&gt;
0   # 808936734685  LxYYv/d 808936734685    true&lt;font&gt;&lt;/font&gt;
1   # 931332556532  NjXvwb0 931332556532    true&lt;font&gt;&lt;/font&gt;
2   # 336368837395  E5RJSMT 336368837395    true&lt;font&gt;&lt;/font&gt;
3   # 862123347820  Mi6jk9s 862123347820    true&lt;font&gt;&lt;/font&gt;
4   # 174279278611  CiT2sAT 174279278611    true&lt;font&gt;&lt;/font&gt;
5   # 279361353722  EELO/f6 279361353722    true&lt;font&gt;&lt;/font&gt;
6   # 435602995568  GVr9jlw 435602995568    true&lt;font&gt;&lt;/font&gt;
7   # 547163526063  H9lfNOv 547163526063    true&lt;font&gt;&lt;/font&gt;
8   # 188017380425  CvGtYxJ 188017380425    true&lt;font&gt;&lt;/font&gt;
9   # 720098771622  KepO0Km 720098771622    true&lt;font&gt;&lt;/font&gt;
10  # 408089106903  F8EAZnX 408089106903    true&lt;font&gt;&lt;/font&gt;
11  # 293941423763  ERwRi6T 293941423763    true&lt;font&gt;&lt;/font&gt;
12  # 383302396164  Fk+mmkE 383302396164    true&lt;font&gt;&lt;/font&gt;
13  # 695998940618  KIMxQXK 695998940618    true&lt;font&gt;&lt;/font&gt;
14  # 584515331314  IgX1CTy 584515331314    true&lt;font&gt;&lt;/font&gt;
15  # 528965753970  Hso0Nxy 528965753970    true&lt;font&gt;&lt;/font&gt;
16  # 5324317143    E9WqHX  5324317143      true&lt;font&gt;&lt;/font&gt;
17  # 772389841267  LPWBalz 772389841267    true&lt;font&gt;&lt;/font&gt;
18  # 954212692102  N4rgjCG 954212692102    true&lt;font&gt;&lt;/font&gt;
19  # 867031893694  MnfIMa+ 867031893694    true&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;-9007199254740991&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;9007199254740991&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;const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// binary to string lookup table&lt;font&gt;&lt;/font&gt;
const b2s = alphabet.split('');&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// string to binary lookup table&lt;font&gt;&lt;/font&gt;
// 123 == 'z'.charCodeAt(0) + 1&lt;font&gt;&lt;/font&gt;
const s2b = new Array(123);&lt;font&gt;&lt;/font&gt;
for (let i = 0; i &amp;lt; alphabet.length; i++) {&lt;font&gt;&lt;/font&gt;
  s2b[alphabet.charCodeAt(i)] = i;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// number to base64&lt;font&gt;&lt;/font&gt;
const ntob = (number) =&amp;gt; {&lt;font&gt;&lt;/font&gt;
  if (number &amp;lt; 0) return `-${ntob(-number)}`;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  let lo = number &amp;gt;&amp;gt;&amp;gt; 0;&lt;font&gt;&lt;/font&gt;
  let hi = (number / 4294967296) &amp;gt;&amp;gt;&amp;gt; 0;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  let right = '';&lt;font&gt;&lt;/font&gt;
  while (hi &amp;gt; 0) {&lt;font&gt;&lt;/font&gt;
    right = b2s[0x3f &amp;amp; lo] + right;&lt;font&gt;&lt;/font&gt;
    lo &amp;gt;&amp;gt;&amp;gt;= 6;&lt;font&gt;&lt;/font&gt;
    lo |= (0x3f &amp;amp; hi) &amp;lt;&amp;lt; 26;&lt;font&gt;&lt;/font&gt;
    hi &amp;gt;&amp;gt;&amp;gt;= 6;&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  let left = '';&lt;font&gt;&lt;/font&gt;
  do {&lt;font&gt;&lt;/font&gt;
    left = b2s[0x3f &amp;amp; lo] + left;&lt;font&gt;&lt;/font&gt;
    lo &amp;gt;&amp;gt;&amp;gt;= 6;&lt;font&gt;&lt;/font&gt;
  } while (lo &amp;gt; 0);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  return left + right;&lt;font&gt;&lt;/font&gt;
};&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
// base64 to number&lt;font&gt;&lt;/font&gt;
const bton = (base64) =&amp;gt; {&lt;font&gt;&lt;/font&gt;
  let number = 0;&lt;font&gt;&lt;/font&gt;
  const sign = base64.charAt(0) === '-' ? 1 : 0;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  for (let i = sign; i &amp;lt; base64.length; i++) {&lt;font&gt;&lt;/font&gt;
    number = number * 64 + s2b[base64.charCodeAt(i)];&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  return sign ? -number : number;&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;npm : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://www.npmjs.com/package/number-to-base64&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;number-to-base64&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;a href=&quot;https://jsperf.com/number-to-base64-encoding&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://jsperf.com/number-to-base64-encoding&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;이 유형의 작업을위한 npm 모듈 인 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://www.npmjs.com/package/power-radix&quot; rel=&quot;nofollow&quot; title=&quot;power-radix&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;power-radix&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;var base = ['Q', 'W', 'E', 'R', 'T', 'Y', 'I', 'O', 'U'];&lt;font&gt;&lt;/font&gt;
new PowerRadix([1, 0], 10).toArray(base); // ['W', 'Q'] &lt;font&gt;&lt;/font&gt;
new PowerRadix('10', 10).toArray(base);   // ['W', 'Q'] &lt;font&gt;&lt;/font&gt;
new PowerRadix(10, 10).toArray(base);     // ['W', 'Q'] &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
new PowerRadix([1, 0], 10).toString(base); // &quot;WQ&quot; &lt;font&gt;&lt;/font&gt;
new PowerRadix('10', 10).toString(base);   // &quot;WQ&quot; &lt;font&gt;&lt;/font&gt;
new PowerRadix(10, 10).toString(base);     // &quot;WQ&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;new PowerRadix('ba', ['a', 'b']); // base 2 source radix, uses 'a' = 0 &amp;amp; 'b' = 1 character set.&lt;font&gt;&lt;/font&gt;
new PowerRadix('ba', ['a', 'b']).toString(10); // returns &quot;2&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;The following implementation converts positive, negative and non-integer numbers to an arbitrary base. The conversion back to decimal is easily implemented in a similar fashion:&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;function toAnyBase(num, base) {&lt;font&gt;&lt;/font&gt;
  if (!Number.isInteger(base) || base &amp;lt; 2) throw new RangeError(&quot;toAnyBase() base argument must be an integer &amp;gt;= 2&quot;);&lt;font&gt;&lt;/font&gt;
  if (!Number.isFinite(num)) return num.toString();&lt;font&gt;&lt;/font&gt;
  if (num &amp;lt; 0) return &quot;-&quot; + toAnyBase(-num, base);&lt;font&gt;&lt;/font&gt;
  &lt;font&gt;&lt;/font&gt;
  const digits = &quot;0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#_&quot;,&lt;font&gt;&lt;/font&gt;
        inv_base = 1 / base;&lt;font&gt;&lt;/font&gt;
  &lt;font&gt;&lt;/font&gt;
  var result = &quot;&quot;,&lt;font&gt;&lt;/font&gt;
      residual;&lt;font&gt;&lt;/font&gt;
  &lt;font&gt;&lt;/font&gt;
  // Integer part:&lt;font&gt;&lt;/font&gt;
  residual = Math.trunc(num);&lt;font&gt;&lt;/font&gt;
  do {&lt;font&gt;&lt;/font&gt;
    result = digits.charAt(residual % base) + result;&lt;font&gt;&lt;/font&gt;
    residual = Math.trunc(residual * inv_base); &lt;font&gt;&lt;/font&gt;
  } while (residual != 0);&lt;font&gt;&lt;/font&gt;
  &lt;font&gt;&lt;/font&gt;
  // Fractional part:&lt;font&gt;&lt;/font&gt;
  residual = num % 1;&lt;font&gt;&lt;/font&gt;
  if (residual != 0) {&lt;font&gt;&lt;/font&gt;
    result += &quot;.&quot;;&lt;font&gt;&lt;/font&gt;
    var max = 1000;&lt;font&gt;&lt;/font&gt;
    do {&lt;font&gt;&lt;/font&gt;
      residual *= base;&lt;font&gt;&lt;/font&gt;
      result += digits.charAt(Math.trunc(residual));&lt;font&gt;&lt;/font&gt;
      residual %= 1;&lt;font&gt;&lt;/font&gt;
    } while (residual != 0 &amp;amp;&amp;amp; --max != 0);&lt;font&gt;&lt;/font&gt;
  }&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  return result;&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
console.log(toAnyBase(  64, 64)); // &quot;10&quot;&lt;font&gt;&lt;/font&gt;
console.log(toAnyBase(-1.5, 64)); // &quot;-1.w&quot;&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;If you are using NodeJS, you can use the following code:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;var base64 = Buffer.from([i&amp;gt;&amp;gt;24,i&amp;gt;&amp;gt;16,i&amp;gt;&amp;gt;8,i]).toString('base64').substr(0,6);
&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, you could just use any Javascript Base64 library: perhaps &lt;a href=&quot;https://stackoverflow.com/questions/246801/how-can-you-encode-to-base64-using-javascript&quot;&gt;this question&lt;/a&gt; answers it?&lt;/p&gt; 
&lt;p&gt;EDIT: Binary data is essentially just a sequence of bytes. If you assume the bytes represent a single number you can represent the sequence of bytes as a base 64 string. Decode them and do some trivial math on the bytes to get a number. Convert the number to a sequence of bytes and encode to get a string. Seems quite reasonable, unless you are somehow invested in the specific characters used in the String.&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 know the question is Java Script, but here is a solution in java, you probably can easily convert it.&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;private String toShortString(BigInteger value, String language) {&lt;font&gt;&lt;/font&gt;
    StringBuilder stringBuilder = new StringBuilder();&lt;font&gt;&lt;/font&gt;
    BigInteger length = BigInteger.valueOf(language.length());&lt;font&gt;&lt;/font&gt;
    while (value.compareTo(BigInteger.ZERO) &amp;gt; 0){&lt;font&gt;&lt;/font&gt;
        int index = value.mod(length).intValue();&lt;font&gt;&lt;/font&gt;
        stringBuilder.append(language.charAt(index));&lt;font&gt;&lt;/font&gt;
        value = value.divide(length);&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    return stringBuilder.reverse().toString();&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;h2&gt;Usage&lt;/h2&gt; 
&lt;pre&gt;&lt;code&gt;    BigInteger value = BigInteger.valueOf(2).pow(128); &lt;font&gt;&lt;/font&gt;
    System.out.println(value);&lt;font&gt;&lt;/font&gt;
    System.out.println(value.toString(16));&lt;font&gt;&lt;/font&gt;
    System.out.println(toShortString(value, &quot;0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&amp;amp;*()-=_+&quot;));&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;Output&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;340282366920938463463374607431768211456&lt;br&gt; 100000000000000000000000000000000&lt;br&gt; 8hS#phQaCO3849pE+^El4 &lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;&lt;em&gt;If you convert this to Java Script please edit this question and add it below.&lt;/em&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;In a mozilla or webkit browser you can use btoa() and atob() to encode and decode base64.&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/6213227/fastest-way-to-convert-a-number-to-radix-64-in-javascript&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/6213227/fastest-way-to-convert-a-number-to-radix-64-in-javascript&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2028</guid>
      <comments>https://copycodes.tistory.com/2028#entry2028comment</comments>
      <pubDate>Fri, 8 Jan 2021 08:30:31 +0900</pubDate>
    </item>
    <item>
      <title>Spring Security의 다중 인증 공급자</title>
      <link>https://copycodes.tistory.com/2027</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Spring Security의 다중 인증 공급자&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;내 Spring Security 구성에 두 개의 인증 공급자를 구성했습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;   &amp;lt;security:authentication-manager&amp;gt;&lt;font&gt;&lt;/font&gt;
      &amp;lt;security:authentication-provider ref=&quot;XProvider&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
      &amp;lt;security:authentication-provider ref=&quot;YProvider&quot; /&amp;gt;&lt;font&gt;&lt;/font&gt;
   &amp;lt;/security:authentication-manager&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;Spring Security는 두 공급자를 모두 평가합니까? &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;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;authentication-manager 태그 내에서 선언 한 것과 동일한 순서로 확인됩니다.&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;AccountStatusException&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;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/9303502/multiple-authentication-providers-in-spring-security&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/9303502/multiple-authentication-providers-in-spring-security&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2027</guid>
      <comments>https://copycodes.tistory.com/2027#entry2027comment</comments>
      <pubDate>Fri, 8 Jan 2021 08:30:15 +0900</pubDate>
    </item>
    <item>
      <title>cURL 오류 (7) 해결 방법 : 호스트에 연결할 수 없습니까?</title>
      <link>https://copycodes.tistory.com/2026</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;cURL 오류 (7) 해결 방법 : 호스트에 연결할 수 없습니까?&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;cUrl (php)을 사용하여 xml 형식의 웹 서비스에 항목 코드를 보냅니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;localhost에서 올바른 응답을 얻었지만 언제 서버에 표시됩니까?&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;cURL 오류 (7) : 호스트에 연결할 수 없습니다.&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;pre&gt;&lt;code&gt;function xml_post($post_xml, $url)&lt;font&gt;&lt;/font&gt;
{&lt;font&gt;&lt;/font&gt;
    $user_agent = $_SERVER['HTTP_USER_AGENT'];&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    $ch = curl_init();    // initialize curl handle&lt;font&gt;&lt;/font&gt;
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);&lt;font&gt;&lt;/font&gt;
    curl_setopt($ch, CURLOPT_URL, $url); &lt;font&gt;&lt;/font&gt;
    curl_setopt($ch, CURLOPT_FAILONERROR, 1);          &lt;font&gt;&lt;/font&gt;
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);    &lt;font&gt;&lt;/font&gt;
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); &lt;font&gt;&lt;/font&gt;
    curl_setopt($ch, CURLOPT_TIMEOUT, 50); &lt;font&gt;&lt;/font&gt;
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_xml); &lt;font&gt;&lt;/font&gt;
    curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);&lt;font&gt;&lt;/font&gt;
//  curl_setopt($ch, CURLOPT_PORT, $port);          &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    $data = curl_exec($ch);&lt;font&gt;&lt;/font&gt;
    $curl_errno = curl_errno($ch);&lt;font&gt;&lt;/font&gt;
    $curl_error = curl_error($ch);&lt;font&gt;&lt;/font&gt;
    if ($curl_errno &amp;gt; 0) {&lt;font&gt;&lt;/font&gt;
            echo &quot;cURL Error ($curl_errno): $curl_error\n&quot;;&lt;font&gt;&lt;/font&gt;
    } else {&lt;font&gt;&lt;/font&gt;
            echo &quot;Data received\n&quot;;&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    curl_close($ch);&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
    echo $data;&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;php 4+ 및 php5 + 버전을 모두 사용해 보았지만 어떤 솔루션도 작동하지 않습니다.&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;blockquote&gt; 
 &lt;p&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;CURL 오류 코드 7 (CURLE_COULDNT_CONNECT)&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;code&gt;Failed to connect() to host or proxy.&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;/p&gt; 
&lt;pre&gt;&lt;code&gt;$ch = curl_init(&quot;http://google.com&quot;);    // initialize curl handle&lt;font&gt;&lt;/font&gt;
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);&lt;font&gt;&lt;/font&gt;
$data = curl_exec($ch);&lt;font&gt;&lt;/font&gt;
print($data);&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;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;문제 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;your URL is wrong&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;firewall&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;restriction&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;&quot;CURL ERROR 7 Failed to connect to Permission denied&quot;오류가 발생합니다. 어떤 이유로 든 일부 방화벽이나 이와 유사한 것에 의해 curl 요청이 차단 될 때 발생합니다.&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;curl 요청이 표준 포트가 아닌 경우이 문제가 발생합니다.&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;예를 들어 포트 1234에있는 일부 URL로 컬을 수행하면 포트 80이있는 URL이 쉽게 결과를 제공하는이 문제에 직면하게됩니다.&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;가장 일반적으로이 오류는 CentOS 및 'SElinux'가 설치된 다른 OS에서 발생했습니다.&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;허용하도록 'SElinux'를 비활성화하거나 변경해야합니다.&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;http://www.akashif.co.uk/php/curl-error-7-failed-to-connect-to-permission-denied&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;http://www.akashif.co.uk/php/curl-error-7-failed-to-connect-to-permission-denied&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;code&gt;cURL Error (7): ... Operation Timed Out&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;Linux 터미널에서 :&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;$ export https_proxy=yourProxy:80&lt;font&gt;&lt;/font&gt;
$ export http_proxy=yourProxy: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;Windows에서는 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;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style5&quot;&gt;
&lt;p&gt;Are you able to hit that URL by browser or by PHP script? The error shown is that you could not connect. So first confirm that the URL is accessible.&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;In PHP, If your network under proxy. You should set the proxy URL and port&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;curl_setopt($ch, CURLOPT_PROXY, &quot;http://url.com&quot;); //your proxy url&lt;font&gt;&lt;/font&gt;
curl_setopt($ch, CURLOPT_PROXYPORT, &quot;80&quot;); // your proxy port number&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;This is solves my problem&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;Check if port 80 and 443 are blocked. or enter - IP graph.facebook.com and enter it in etc/hosts file&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 issue can also be caused by making curl calls to https when it is not configured on the remote device. Calling over http can resolve this problem in these situations, at least until you configure ssl on the remote.&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;In my case, the problem was caused by the hosting provider I was using blocking http packets addressed to their IP block that originated from within their IP block. Un-frickin-believable!!!&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 get this if you are trying to hit the same URL with multiple HTTP request at the same time.Many curl requests wont be able to connect and so return with error&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/9922562/how-to-resolve-curl-error-7-couldnt-connect-to-host&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/9922562/how-to-resolve-curl-error-7-couldnt-connect-to-host&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2026</guid>
      <comments>https://copycodes.tistory.com/2026#entry2026comment</comments>
      <pubDate>Fri, 8 Jan 2021 08:30:08 +0900</pubDate>
    </item>
    <item>
      <title>로거에 대한 핸들러를 찾을 수 없습니다.</title>
      <link>https://copycodes.tistory.com/2025</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&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;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;import logging&lt;font&gt;&lt;/font&gt;
logger=logging.getLogger('logger')&lt;font&gt;&lt;/font&gt;
logger.warning('The system may break down')&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;strong&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;/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;logging&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;logger&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;&amp;gt;&amp;gt;&amp;gt; import logging&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; logging.warning('This is a WARNING!!!!')&lt;font&gt;&lt;/font&gt;
WARNING:root:This is a WARNING!!!!&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; &lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; logger.warning('WARNING!!!!')&lt;font&gt;&lt;/font&gt;
WARNING:logger:WARNING!!!!&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;code&gt;logger&lt;/code&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;code&gt;logger&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;debug&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;warn&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;logging&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;basicConfig&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;StreamHandler&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;root logger&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;https://lists.gt.net/python/python/863016&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;a href=&quot;https://lists.gt.net/python/python/863016&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;a href=&quot;https://docs.python.org/2/howto/logging.html&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;https://docs.python.org/2/howto/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;공식 Python 문서를&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://docs.python.org/2/howto/logging.html&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;/p&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;pre&gt;&lt;code&gt;import logging&lt;font&gt;&lt;/font&gt;
import inspect&lt;font&gt;&lt;/font&gt;
print(inspect.getsource(logging))&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;basicConfig&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 logging&lt;font&gt;&lt;/font&gt;
logging.basicConfig()&lt;font&gt;&lt;/font&gt;
logger = logging.getLogger('logger')&lt;font&gt;&lt;/font&gt;
logger.warning('The system may break down')&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;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;logging.basicConfig ()&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;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; import logging&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; logging.basicConfig()&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; logger = logging.getLogger('logger')&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt;&amp;gt; logger.warning('The system may break down')&lt;font&gt;&lt;/font&gt;
WARNING:logger:The system may break down&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;phd의 답변 외에도 전화 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;logging.basicConfig()&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;StreamHandler&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;Formatter&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;basicConfig&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;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;font style=&quot;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;pre&gt;&lt;code&gt;logger = logging.basicConfig(level=logging.DEBUG, &lt;font&gt;&lt;/font&gt;
        format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')&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;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;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;basicConfig&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;/blockquote&gt; 
&lt;pre&gt;&lt;code&gt;import logging&lt;font&gt;&lt;/font&gt;
logger = logging.getLogger(&quot;mylogger&quot;)&lt;font&gt;&lt;/font&gt;
streamHandler = logging.StreamHandler()&lt;font&gt;&lt;/font&gt;
streamHandler.setLevel(logging.DEBUG)&lt;font&gt;&lt;/font&gt;
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')&lt;font&gt;&lt;/font&gt;
streamHandler.setFormatter(formatter)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
logger.addHandler(streamHandler)&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
logger.info(&quot;Files copied&quot;)&lt;font&gt;&lt;/font&gt;
logger.warning(&quot;disk quota exceeded&quot;)&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt; 2017-12-06 11:11:12, 090 - mylogger - INFO Files copied&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt; 2017-12-06 11:11:12, 091 - mylogger - WARNING disk quota exceeded&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;로그 계층&quot;을 유지하는 것입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;logger2 = logging.getLogger(&quot;mylogger.new&quot;)&lt;font&gt;&lt;/font&gt;
logger2.info(&quot;New Logger info&quot;)&lt;font&gt;&lt;/font&gt;
&amp;gt;&amp;gt; 2017-12-06 11:11:12, 091 - mylogger.new - New logger info&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;&lt;strong&gt;A good reference is the logging cookbook:&lt;/strong&gt; &lt;a href=&quot;https://docs.python.org/2/howto/logging-cookbook.html&quot; rel=&quot;noreferrer&quot;&gt;https://docs.python.org/2/howto/logging-cookbook.html&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;If you get this error when using &lt;a href=&quot;https://github.com/getsentry/raven-python/&quot; rel=&quot;nofollow noreferrer&quot;&gt;sentry&lt;/a&gt; (&lt;code&gt;No handlers could be found for logger &quot;sentry.errors&quot;&lt;/code&gt;), it could be due to sentry bug for SNI support.&lt;/p&gt; 
&lt;p&gt;check &lt;a href=&quot;https://github.com/getsentry/raven-python/issues/523&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/getsentry/raven-python/issues/523&lt;/a&gt; for more details. a quick workaround is to replace DSN scheme by &lt;code&gt;threaded+requests+https&lt;/code&gt;:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;RAVEN_CONFIG = {&lt;font&gt;&lt;/font&gt;
    'dsn': 'threaded+requests+https://xxxxxxxxxxxx@sentry.example.com/1',&lt;font&gt;&lt;/font&gt;
}&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/44188270/no-handlers-could-be-found-for-logger&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/44188270/no-handlers-could-be-found-for-logger&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2025</guid>
      <comments>https://copycodes.tistory.com/2025#entry2025comment</comments>
      <pubDate>Thu, 7 Jan 2021 08:09:05 +0900</pubDate>
    </item>
    <item>
      <title>.NET의 디버그 대 릴리스</title>
      <link>https://copycodes.tistory.com/2024</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;.NET의 디버그 대 릴리스&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;a href=&quot;https://stackoverflow.com/questions/90751/double-and-floats-in-c&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;C # 애플리케이션, 특히 웹 애플리케이션에서 디버그 및 릴리스 모드간에 사용 가능한 모든 차이점을 나열하는 포괄적 인 문서가 있습니까?&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;&quot;Debug&quot;및 &quot;Release&quot;는 Visual Studio에서 정의한 미리 정의 된 프로젝트 구성의 이름 일뿐입니다. &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;차이점을 확인하려면 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;VS2005의 차이점은 다음과 같습니다.&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;디버그 구성에 정의 된 DEBUG 상수&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;/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;&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;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&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;/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;DEBUG 상수의 동작은 상당히 명확하다고 생각합니다 (#if 전 처리기 지시문 또는 ConditionalAttribute에서 참조 할 수 있음). &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;하지만 정확히 어떤 최적화가 활성화되어 있는지에 대한 포괄적 인 문서를 알지 못합니다. 사실 Microsoft가 사전 통지없이 최적화 프로그램을 향상시킬 수 있기를 원할 것입니다.&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;이미 나열된 몇 가지 차이점 외에도 디버그 모드에서 컴파일하면 런타임에 수행되는 대부분의 JIT 컴파일러 최적화가 해제되고 심볼 데이터베이스 파일 (.pdb)에 더 완전한 디버그 정보가 방출됩니다.&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;또 다른 큰 차이점은 JIT 컴파일러가 &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;font style=&quot;vertical-align: inherit;&quot;&gt;GC.KeepAlive () 호출을 삽입한다는 점에서 GC 동작이 다소 다르다는 것 &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;ul&gt; 
 &lt;li&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Debug.Write 호출은 릴리스에서 제거됩니다.&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;a href=&quot;http://www.hanselman.com/blog/ReleaseISNOTDebug64bitOptimizationsAndCMethodInliningInReleaseBuildCallStacks.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Scott Hanselman이&lt;/font&gt;&lt;/a&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; 설명한대로 최적화로 인해 CallStack이 약간 &quot;이상하게&quot;보일 수 있습니다.&lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.hanselman.com/blog/ReleaseISNOTDebug64bitOptimizationsAndCMethodInliningInReleaseBuildCallStacks.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;/font&gt;&lt;/a&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;원하는 경우 다른 사용자를 추가 할 수 있습니다. &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;a href=&quot;http://msdn.microsoft.com/en-us/library/kwybya3w.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;http://msdn.microsoft.com/en-us/library/kwybya3w.aspx&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;1. 디버그 dll에는 Visual Studio의 모든 소스 코드 줄에 중단 점을 설정할 수 있도록 몇 가지 추가 지침이 추가되었습니다. &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;2. PDB 파일은 관련 모드가 아닌 디버그 모드에서만 생성됩니다.&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;3. 릴리스 모드에서 cpde는 JIT 컴파일러에 내장 된 최적화 프로그램에 의해 최적화됩니다. &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;• CPU 레지스터 할당-로컬 변수 및 메서드 인수는 스택 프레임에 다시 저장되지 않고 (또는 덜 자주) CPU 레지스터에 계속 저장 될 수 있습니다.&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 컬렉션 클래스는 내부적으로 배열을 사용합니다). &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;JIT 컴파일러가 루프가 범위를 벗어난 배열을 인덱싱하지 않는지 확인할 수 있으면 인덱스 검사를 제거합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;•   Loop unrolling -  Short loops (up to 4) with small bodies are eliminated by repeating the code in the loop body. &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
•   Dead code elimination - A statement like if (false) { /.../ } gets completely eliminated. &lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
•   Code hoisting- Code inside a loop that is not affected by the loop can be moved out of the loop.&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
•   Common sub-expression elimination. x = y + 4; z = y + 4; becomes z = x&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;ASP.NET Ajax 컨트롤 중 하나를 사용하는 경우 주요 성능 영역 중 하나는 릴리스에서 실행될 때 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;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;web.config&lt;/code&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;에 의해 결정된다는 점을 기억 &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;system.web&amp;gt;&lt;font&gt;&lt;/font&gt;
    &amp;lt;compilation debug=&quot;true&quot;&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;ul&gt; 
 &lt;li&gt;&lt;em&gt;&lt;a href=&quot;http://weblogs.asp.net/scottgu/442448&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;debug =”true”가 활성화 된 상태에서 프로덕션 ASP.NET 응용 프로그램을 실행하지 마십시오.&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/em&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;Drawing with GDI+ is considerably slower in Debug mode.&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 manage some part of code that you want to run only in debug or only in release with preprocessor markups:&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; #if DEBUG&lt;font&gt;&lt;/font&gt;
    // Some code running only in debug&lt;font&gt;&lt;/font&gt;
 #endif&lt;font&gt;&lt;/font&gt;
&lt;/code&gt;&lt;/pre&gt; 
&lt;p&gt;or &lt;/p&gt; 
&lt;pre&gt;&lt;code&gt; #if NOT DEBUG&lt;font&gt;&lt;/font&gt;
    // Some code running only in release&lt;font&gt;&lt;/font&gt;
 #endif&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;Release version:&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;p&gt;is considerable faster (most important), optimized&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;can't be debuged (step by step)&lt;/p&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;p&gt;and code written in &quot;debug&quot; directive is not included&lt;/p&gt;&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;See &lt;em&gt;&lt;a href=&quot;http://haacked.com/archive/2004/02/14/difference-between-debug-vs-release-build.aspx/&quot; rel=&quot;nofollow noreferrer&quot;&gt;What's the difference between a Debug vs Release Build?&lt;/a&gt;&lt;/em&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 got an error message when I distribute executable file to another machine indicating that the system missed MSVCP110D.dll.&lt;/p&gt; 
&lt;p&gt;The solution to this issue is stated in Stack Overflow question &lt;em&gt;&lt;a href=&quot;https://stackoverflow.com/questions/10926790&quot;&gt;Visual Studio MSVCP110D.dll is missing&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt; 
&lt;p&gt;IN XXXXD.dll D means that the DLL file is a debug version of the DLL file. But MS Visual C++ Redistributable packages include only the release version of DLL files.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;That means if you need to distribute a program developed by &lt;a href=&quot;http://en.wikipedia.org/wiki/Visual_C%2B%2B#32-bit_versions&quot; rel=&quot;nofollow noreferrer&quot;&gt;Visual C++&lt;/a&gt; you need to build it in Release mode.&lt;/strong&gt; And also you need to install MS Visual C++ Redistributable (correct version) on the target machine.&lt;/p&gt; 
&lt;p&gt;So I think this a one of key difference between debug and release mode.&lt;/p&gt;
&lt;p&gt;ReferenceURL : &lt;a href=&quot;https://stackoverflow.com/questions/90871/debug-vs-release-in-net&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/90871/debug-vs-release-in-net&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2024</guid>
      <comments>https://copycodes.tistory.com/2024#entry2024comment</comments>
      <pubDate>Thu, 7 Jan 2021 08:08:56 +0900</pubDate>
    </item>
    <item>
      <title>Rails Migration (MySQL)에서 새 열의 위치를 ​​지정할 수 있습니까?</title>
      <link>https://copycodes.tistory.com/2023</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Rails Migration (MySQL)에서 새 열의 위치를 ​​지정할 수 있습니까?&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;MySQL을 통해 열을 추가하는 경우 테이블에서 해당 열이 AFTER 수정자를 사용할 위치를 지정할 수 있습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;그러나 Rails 마이그레이션을 통해 add_column을 수행하면 테이블 끝에 열이 생성됩니다.&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;이제 Rails 2.3.6+에서 : after 매개 변수를 전달하여 가능합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://rails.lighthouseapp.com/projects/8994/tickets/3286-patch-add-support-for-mysql-column-positioning-to-migrations&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://rails.lighthouseapp.com/projects/8994/tickets/3286-patch-add-support-for-mysql-column-positioning-to-migrations&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;이 기능의 이점을 보지 못하는 모든 사람에게 : ORM 외부에서 데이터베이스를 보지 않습니까? &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;어떤 종류의 UI로든 볼 때 외래 키, 상태 열, 플래그 등을 모두 함께 그룹화하는 것을 좋아합니다. &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;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&gt;&lt;/p&gt; &lt;pre&gt;&lt;code&gt;add_column :users, :gender, :string, :after =&amp;gt; :column_name
&lt;/code&gt;&lt;/pre&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;/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;&quot; &lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;users&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; &quot;테이블에 &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&quot; &lt;/font&gt;&lt;strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;username&lt;/font&gt;&lt;/strong&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt; &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;&quot; &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; &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;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;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;/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;code&gt;rails g migration AddGenderToUser gender:string&lt;/code&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;&quot; &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;after =&amp;gt; : username&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; &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;pre&gt;&lt;code&gt;class AddSlugToDictionary &amp;lt; ActiveRecord::Migration&lt;font&gt;&lt;/font&gt;
  def change&lt;font&gt;&lt;/font&gt;
    add_column :users, :gender, :string, :after =&amp;gt; :username&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;/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;이 추가 기능을 ActiveRecord Mysql 어댑터에 추가하는 패치를 만들었습니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;마스터 및 2-3-stable에서 작동합니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p&gt;&lt;a href=&quot;https://rails.lighthouseapp.com/projects/8994/tickets/3286-patch-add-support-for-mysql-column-positioning-to-migrations&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://rails.lighthouseapp.com/projects/8994/tickets/3286-patch-add-support-for-mysql-column-positioning-to-migrations&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;mysql에 따라 다를 수 있지만 마이그레이션을 덜 이식성있게 만들지는 않습니다 (다른 어댑터는 추가 위치 지정 옵션을 무시합니다).&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;add_column&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;그러나 마이그레이션은 리터럴 SQL 실행을 지원합니다. &lt;/font&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;저는 Rails 개발자는 아니지만 다음과 같습니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;class AddColumnAfterOtherColumn &amp;lt; ActiveRecord::Migration&lt;font&gt;&lt;/font&gt;
  def self.up&lt;font&gt;&lt;/font&gt;
    execute &quot;ALTER TABLE table_name ADD COLUMN column_name INTEGER &lt;font&gt;&lt;/font&gt;
      AFTER other_column&quot;&lt;font&gt;&lt;/font&gt;
  end&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
  def self.down&lt;font&gt;&lt;/font&gt;
    remove_column :table_name, :column_name&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;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;Rails 내에서 열의 위치를 ​​지정할 방법이 없습니다. &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;는 &quot;SELECT *&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;일부 플랫폼에서는 NULL이 될 가능성이 가장 높은 열을 끝까지 넣음으로써 얻을 수있는 (최소한) 공간 및 성능 절약이 있습니다 (DMBS는 &quot;후행&quot;NULL 값에 디스크 공간을 사용하지 않기 때문입니다. 눈치 채려면 1980 년대 하드웨어에서 실행해야한다고 생각합니다.&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/371796/in-a-rails-migration-mysql-can-you-specify-what-position-a-new-column-should&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/371796/in-a-rails-migration-mysql-can-you-specify-what-position-a-new-column-should&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2023</guid>
      <comments>https://copycodes.tistory.com/2023#entry2023comment</comments>
      <pubDate>Thu, 7 Jan 2021 08:08:47 +0900</pubDate>
    </item>
    <item>
      <title>Joda-Time을 사용하여 주어진 달의 일수를 어떻게 얻습니까?</title>
      <link>https://copycodes.tistory.com/2022</link>
      <description>&lt;h2&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;Joda-Time을 사용하여 주어진 달의 일수를 어떻게 얻습니까?&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;pre&gt;&lt;code&gt;30 days hath September,&lt;font&gt;&lt;/font&gt;
   April, June and November,&lt;font&gt;&lt;/font&gt;
 All the rest have 31,&lt;font&gt;&lt;/font&gt;
   Excepting February alone&lt;font&gt;&lt;/font&gt;
(And that has 28 days clear,&lt;font&gt;&lt;/font&gt;
   With 29 in each leap year).&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&gt;&lt;code&gt;DateTime&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;dayOfMonth&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;DateTime&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 style=&quot;vertical-align: inherit;&quot;&gt;다음은 샘플 함수입니다.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;pre class=&quot;lang-java prettyprint-override&quot;&gt;&lt;code&gt;public static int daysOfMonth(int year, int month) {&lt;font&gt;&lt;/font&gt;
  DateTime dateTime = new DateTime(year, month, 14, 12, 0, 0, 000);&lt;font&gt;&lt;/font&gt;
  return dateTime.dayOfMonth().getMaximumValue();&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;import org.joda.time.*;&lt;font&gt;&lt;/font&gt;
import org.joda.time.chrono.*;&lt;font&gt;&lt;/font&gt;
import org.joda.time.field.*;&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
public class Test {&lt;font&gt;&lt;/font&gt;
    public static void main(String[] args) {&lt;font&gt;&lt;/font&gt;
        GregorianChronology calendar = GregorianChronology.getInstance();&lt;font&gt;&lt;/font&gt;
        DateTimeField field = calendar.dayOfMonth();&lt;font&gt;&lt;/font&gt;
&lt;font&gt;&lt;/font&gt;
        for (int i = 1; i &amp;lt; 12; i++) {&lt;font&gt;&lt;/font&gt;
            LocalDate date = new LocalDate(2010, i, 1, calendar);&lt;font&gt;&lt;/font&gt;
            System.out.println(field.getMaximumValue(date));&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;12 개월이 있고 2010 년에 관심이 있다는 가정을 하드 코딩했습니다. &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;(그리고 &quot;12 개월&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;위해 a &lt;/font&gt;&lt;/font&gt;&lt;code&gt;LocalDate&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;DateTime&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;LocalDate&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;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; Joda 시간에 대한 일정 금액을 알고, 일을하지만, 아마 좋은 생각이 아니다 :)&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;Calendar cal = Calendar.getInstance();&lt;font&gt;&lt;/font&gt;
cal.set(Calendar.MONTH, yourMonth);&lt;font&gt;&lt;/font&gt;
cal.set(Calendar.YEAR, yourYear);&lt;font&gt;&lt;/font&gt;
cal.getActualMaximum(Calendar.DAY_OF_MONTH); // &amp;lt;-- the 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;&lt;font style=&quot;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 daysOfMonth(DateTime dt) {&lt;font&gt;&lt;/font&gt;
    int month = dt.getMonthOfYear();&lt;font&gt;&lt;/font&gt;
    int month2 = month;&lt;font&gt;&lt;/font&gt;
    int days = dt.getDay();&lt;font&gt;&lt;/font&gt;
    DateTime dt2 = dt;&lt;font&gt;&lt;/font&gt;
    while (month == month2 ) {&lt;font&gt;&lt;/font&gt;
       days++;&lt;font&gt;&lt;/font&gt;
       dt2.addDays(1);&lt;font&gt;&lt;/font&gt;
       month2 = dt2.getMonthOfYear();&lt;font&gt;&lt;/font&gt;
    }&lt;font&gt;&lt;/font&gt;
    return (days - 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;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/3772945/how-do-i-obtain-the-number-of-days-within-a-given-month-using-joda-time&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/3772945/how-do-i-obtain-the-number-of-days-within-a-given-month-using-joda-time&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2022</guid>
      <comments>https://copycodes.tistory.com/2022#entry2022comment</comments>
      <pubDate>Thu, 7 Jan 2021 08:08:39 +0900</pubDate>
    </item>
    <item>
      <title>자바에서 큰 따옴표 이스케이프</title>
      <link>https://copycodes.tistory.com/2021</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;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/3034186/in-java-is-there-a-way-to-write-a-string-literal-without-having-to-escape-quotes&quot;&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;/a&gt; &lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;pre&gt;&lt;code&gt;private static final String CREATE_TABLE_EXHIBITORS = &quot;CREATE TABLE &quot;users&quot; (&quot;_id&quot; text PRIMARY KEY ,&quot;name&quot; text,&quot;body&quot; text,&quot;image&quot; text,&quot;stand_id&quot; text,&quot;begin&quot; long,&quot;end&quot; long,&quot;changedate&quot; long,&quot;website&quot; text,&quot;facebook&quot; text,&quot;myspace&quot; text,&quot;twitter&quot; text,&quot;festivallink&quot; text,&quot;favorite&quot; integer);&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;이 쿼리가 Java에서 유효한 문자열이되기를 원한다고 가정 해 보겠습니다. &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;e.g.  = &quot;CREATE TABLE \&quot;users&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;/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;큰 따옴표를 백 슬래시로 이스케이프 처리하는 것이 Java에서이를 수행하는 유일한 방법입니다. &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://www.jetbrains.com/idea/&quot; rel=&quot;noreferrer&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;IntelliJ IDEA&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; 와 같은 일부 IDE는 이러한 &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;a href=&quot;http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#replaceAll%28java.lang.String,%20java.lang.String%29&quot;&gt;&lt;code&gt;replaceAll(String regex, String replacement)&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;예를 들어, 따옴표에 대체 문자를 사용한 다음 해당 문자를 &lt;/font&gt;&lt;/font&gt;&lt;code&gt;\&quot;&lt;/code&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;String newstring = String.replaceAll(&quot;%&quot;,&quot;\&quot;&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;\&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;\\\&quot;&lt;/code&gt;&lt;/p&gt; 
&lt;pre&gt;&lt;code&gt;String newstring = String.replaceAll(&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;어쩌면 당신은 찾을 수 &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;http://www.mybatis.org/&quot; rel=&quot;nofollow&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;&lt;font style=&quot;vertical-align: inherit;&quot;&gt;의 MyBatis&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;큰 따옴표를 이스케이프 할 필요없이 XML 구성 파일에서 SQL 쿼리를 구체화 할 수있는 JDBC보다 얇은 계층입니다.&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;참조 URL : &lt;/font&gt;&lt;/font&gt;&lt;a href=&quot;https://stackoverflow.com/questions/6277944/escape-double-quotes-in-java&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/6277944/escape-double-quotes-in-java&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <category>developer tip</category>
      <category>C#</category>
      <category>c++</category>
      <category>java</category>
      <category>javascript</category>
      <category>jquery</category>
      <category>Spring</category>
      <category>spring3</category>
      <author>copycodes</author>
      <guid isPermaLink="true">https://copycodes.tistory.com/2021</guid>
      <comments>https://copycodes.tistory.com/2021#entry2021comment</comments>
      <pubDate>Thu, 7 Jan 2021 08:08:31 +0900</pubDate>
    </item>
  </channel>
</rss>