<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>78963l_sm.log</title>
        <link>https://velog.io/</link>
        <description>도전을 즐기는 김성민 개발자입니다.</description>
        <lastBuildDate>Thu, 20 Apr 2023 07:10:27 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>78963l_sm.log</title>
            <url>https://velog.velcdn.com/images/78963l_sm/profile/defbba26-0d54-4306-ad0c-40b74488fa56/social_profile.jpeg</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. 78963l_sm.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/78963l_sm" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[[오류] npm install ERR! code ERESOLVE]]></title>
            <link>https://velog.io/@78963l_sm/%EC%98%A4%EB%A5%98-npm-install-ERR-code-ERESOLVE</link>
            <guid>https://velog.io/@78963l_sm/%EC%98%A4%EB%A5%98-npm-install-ERR-code-ERESOLVE</guid>
            <pubDate>Thu, 20 Apr 2023 07:10:27 GMT</pubDate>
            <description><![CDATA[<h3 id="모듈을-받아오도록-npm-install-실행시-생긴-err">모듈을 받아오도록 npm install 실행시 생긴 ERR.</h3>
<p><img src="https://velog.velcdn.com/images/78963l_sm/post/0e186133-750e-4273-847f-100a996c5d29/image.png" alt=""></p>
<p>이런 경우엔 보통 의존성 문제가 대부분이다.
이럴때는 옵션을 주어서 모듈을 받아와야 한다.</p>
<pre><code>--fore : 충돌을 우회
--legacy-peer-deps : 무시하고 설치</code></pre><ul>
<li>해결방법</li>
</ul>
<ol>
<li><p>ERR나는 모듈의 버전을 맞춘다.</p>
</li>
<li><p>무시하고 설치한다.</p>
<pre><code> npm install --save --legacy-peer-deps</code></pre></li>
</ol>
]]></description>
        </item>
        <item>
            <title><![CDATA[react 요약집]]></title>
            <link>https://velog.io/@78963l_sm/react-%EC%9A%94%EC%95%BD%EC%A7%91</link>
            <guid>https://velog.io/@78963l_sm/react-%EC%9A%94%EC%95%BD%EC%A7%91</guid>
            <pubDate>Sat, 15 Apr 2023 13:45:58 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/78963l_sm/post/c0787dc1-098a-4a83-9881-13ab24ea62ff/image.png" alt=""></p>
<p>react의 기초적이고 중요한 이론만 정리되어 있는 요약집 입니다.</p>
<hr>

<h2 id="리엑트이란">리엑트이란?</h2>
<p>react는 javascript 라이브러리 중 하나로 UI(User Interface)를 만들기 위해 사용된다.</p>
<ul>
<li>react는 다른 프레임워크와 달리 view만 담당하는 라이브러리이다. 하여 third-party 라이브러리 (react-router-dom, redux)를 추가하여 함께 사용한다.</li>
</ul>
<br>

<h2 id="리엑트-특징">리엑트 특징</h2>
<ol>
<li>Data Flow</li>
<li>Props 와 State</li>
<li>Component 구조</li>
<li>Virtual Dom</li>
<li>JSX</li>
</ol>
<h3 id="1-data-flow">1. Data Flow</h3>
<p>react는 데이터의 방향이 양방향 구조가 아닌 단반향 구조이다.</p>
<h3 id="2-props-와-state">2. Props 와 State</h3>
<ul>
<li>props(properties) 는 상위 컴포넌트가 하위 컴포넌트에 값을 전달할때 사용함.
쉽게 말해서 매개변수를 전달한다고 볼 수 있다.
단방향 구조로 하위 컴포넌트는 상위 컴포넌트의 데이터를 읽기만 가능하다.</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[python 요약집]]></title>
            <link>https://velog.io/@78963l_sm/pythonsummary</link>
            <guid>https://velog.io/@78963l_sm/pythonsummary</guid>
            <pubDate>Thu, 06 Apr 2023 14:43:08 GMT</pubDate>
            <description><![CDATA[<p><img src="https://velog.velcdn.com/images/78963l_sm/post/36f3f7c7-6ade-496b-8b9d-66e09d16ef3e/image.png" alt=""></p>
<p>기초적이고 중요한 이론만 정리되어 있는 요약집 입니다.</p>
<hr>

<h2 id="1-파이썬이란">1. 파이썬이란?</h2>
<br>

<h3 id="--특징">- <strong>특징</strong></h3>
<pre><code>1. 스크립트 언어 (컴파일 과정 X)
2. 동적 타이핑 (자료형 선언 X)
3. 플랫폼 독립적 (컴파일이 필요없어 3OS 전부 구동 O)
4. 모든 요소가 객체 (객체지향 프로그래밍)</code></pre><br>

<h3 id="--사용되는-분야">- <strong>사용되는 분야</strong></h3>
<pre><code>1. GUI 프로그래밍
2. DB 연동 프로그래밍
3. 연산, 통계
4. 소프트웨어 제작
5. 빅데이터 프로그래밍
6. 네트워크 장비제어</code></pre><br>

<h3 id="--파이썬-인터프리터-종류">- <strong>파이썬 인터프리터 종류</strong></h3>
<pre><code>- Python(CPython) : C로 작성된 인터프리터(Default)
- Jython : 자바 가상머신용 인터프리터
- IronPython : .NET 플랫폼용 인터프리터
- PyPy : 파이썬으로 작성된 인터프리터로 속도 개선 목적
- IPython : 파이썬 + 리눅스, 병렬 컴퓨팅 등을 지원하는 인터프리터</code></pre> <br>
<hr></hr>

<h2 id="2-객체-type-dir-help">2. 객체 (type, dir, help)</h2>
<br>

<ul>
<li><p><strong>type() : 객체타입 확인</strong></p>
<pre><code class="language-python">  n = 10
  type(n)</code></pre>
</li>
<li><p><strong>dir() : 속성값 확인</strong></p>
<pre><code class="language-python">  n = 10
  dir(n)</code></pre>
</li>
<li><p><strong>help() ： 속성정보 확인</strong></p>
<pre><code class="language-python">  n = 10
  help(10)</code></pre>
</li>
</ul>
<br>
<hr></hr>

<h2 id="3-타입과-연산자">3. 타입과 연산자</h2>
<br>

<ul>
<li><h3 id="타입"><strong>타입</strong></h3>
<pre><code class="language-python">int / float / str / bool</code></pre>
<br>
</li>
<li><h3 id="연산자"><strong>연산자</strong></h3>
</li>
</ul>
<pre><code>| Description | Operator |
| --- | --- |
| 산술 연산자 | +, -, *, /, **, //, % |
| 비교  | ==, !=, &lt;, &lt;=, &gt;, &gt;= |
| 논리 | and, or, not |
| 멤버쉽 | in |
| 식별 | is |</code></pre><br>
<hr></hr>

<h2 id="4-변수와-입출력-print-input">4. 변수와 입출력 (print, input)</h2>
<br>

<ul>
<li><h3 id="변수"><strong>변수</strong></h3>
<ul>
<li><h4 id="변수이름-규칙">변수이름 규칙</h4>
<ol>
<li>문자, 숫자, _ 로 구성된 이름 O</li>
<li>처음 시작으로 숫자 X</li>
<li>파이썬 keyword 사용 X<br></li>
</ol>
</li>
<li><h4 id="del-키워드-변수와-객체-연결을-끊을-수-있다">del 키워드 (변수와 객체 연결을 끊을 수 있다.)</h4>
<pre><code class="language-python">  var = 123
  del var</code></pre>
</li>
</ul>
</li>
</ul>
<br>

<ul>
<li><h3 id="입출력"><strong>입출력</strong></h3>
<ul>
<li><h4 id="출력">출력</h4>
<pre><code class="language-python">print(&quot;123&quot;) // 123
print(&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, sep=&quot;,&quot;) // 1,2,3
print(&quot;Hello&quot;, end=&quot;~ &quot;) // Hello~ &gt;&gt;

“{}는 {}입니다.”.format(’저’, ‘개발자’)

“저는 {job}입니다. {job}는 항상 {mean} 해야합니다.”
.format(job = ”개발자”, mean = “공부”)</code></pre>
</li>
<li><h4 id="입력">입력</h4>
<pre><code class="language-python">name = input(&#39;이름을 입력 : &#39;)</code></pre>
</li>
</ul>
</li>
</ul>
<br>
<hr></hr>

<h2 id="5-조건문과-반복문-if-while">5. 조건문과 반복문 (if, while)</h2>
<br>

<ul>
<li><h3 id="조건문"><strong>조건문</strong></h3>
<ul>
<li><h4 id="default">default</h4>
<pre><code class="language-python">  if 표현식1:
      코드 블록
  elif 표현식2:
      코드 블록
  else:
      코드 블록</code></pre>
</li>
</ul>
<br>

<ul>
<li><p>pass (아무것도 작성 X)</p>
<pre><code class="language-python">  if False:
      pass
  else:
      코드블록</code></pre>
</li>
</ul>
<br>

<ul>
<li><p>3항 연산자</p>
<pre><code class="language-python">  표현식1 if 표현식2 else 표현식3</code></pre>
</li>
</ul>
</li>
</ul>
<br>

<ul>
<li><h3 id="반복문"><strong>반복문</strong></h3>
</li>
</ul>
<br>

<ul>
<li><p>for 문</p>
<pre><code class="language-python">for 변수 in 객체:
  코드블록</code></pre>
</li>
<li><p>range 함수</p>
<pre><code class="language-python">range(start, end, step)</code></pre>
</li>
<li><p>while 문        </p>
<pre><code class="language-python">while 조건식:
  코드블록</code></pre>
</li>
<li><p>재귀 함수   </p>
<pre><code class="language-python">def a():
  코드블록...
  a()

  // ex) 등차수열
  def a(n):
      if n == 1:
          return 0
      return a(n-1) + 2

  // ex) 피보나치 수열
  def a(n):
      if n &lt; 2:
          return n
      return a(n-1) + a(n-2)</code></pre>
</li>
<li><p>반복문 키워드</p>
<ul>
<li>continue</li>
<li>break</li>
</ul>
</li>
</ul>
<br>
<hr></hr>

<h2 id="6-시퀀스-데이터-list-tuple-set-dict">6. 시퀀스 데이터 (list, tuple, set, dict)</h2>
<br>

<h3 id="1-list---대괄호-">1. list - 대괄호 []</h3>
<ul>
<li>여러개의 데이터를 저장하고 대괄호로 감싸진 mutable 타입</li>
</ul>
<br>

<h4 id="--default">- default</h4>
<pre><code>```python
# 생성
list1 = [] # 빈리스트 생성 방법1
list1 = list() #빈리스트 생성 방법2

list1 = [1,2,3] # 생성, 초기화 방법1
list1 = list(1,2,3) # 생성, 초기화 방법2
```</code></pre><br>

<h4 id="1-인덱싱">1. 인덱싱</h4>
<pre><code>```python
s1 = list(&#39;abcd&#39;)

print(s1[1]) # b
print(s1[-1]) # d
```</code></pre><br>

<h4 id="2-슬라이싱">2. 슬라이싱</h4>
<pre><code>```python
s1 = list(&#39;abcd&#39;)

print(s1[1:3]) # bc
```</code></pre><br>

<h4 id="3-unpacking">3. unpacking</h4>
<pre><code>```python
s1 = list(&#39;abc&#39;)

e1, e2, e3 = s1 #unpacking
print(e1, e2, e3) # a b c
```</code></pre><br>

<h4 id="4-주요-메소드">4. 주요 메소드</h4>
<ul>
<li><p>len() : 리스트 길이</p>
<pre><code class="language-python">  s1 = list(&#39;abcde&#39;)

  print(len(s1)) # 5</code></pre>
</li>
<li><p>del() : 리스트 요소 삭제    </p>
<pre><code class="language-python">  s1 = list(&#39;abcde&#39;)

  del s1[0]
  print(s1) # [bcde]</code></pre>
</li>
<li><p>append() : 맨뒤 추가</p>
<pre><code class="language-python">  s1 = list(&#39;abcde&#39;)

  s1.append(f) # abcdef</code></pre>
</li>
<li><p>insert() : 특정 인텍스에 추가</p>
<pre><code class="language-python">  s1 = list(&#39;abcde&#39;)

  s1.insert(1, A) # aAbcde</code></pre>
</li>
<li><p>remove : 먼저만나는 요소 삭제</p>
<pre><code class="language-python">  s1 = list(&#39;abcabc&#39;)

  s1.remove(&#39;b&#39;) # acabc</code></pre>
</li>
<li><p>pop : 리스트 맨마지막 리턴 및 삭제</p>
<pre><code class="language-python">  s1 = list(&#39;abcde&#39;)

  res = s1.pop() # e</code></pre>
</li>
<li><p>extend (+연산자동일)</p>
<pre><code class="language-python">  s1 = [1,2,3]
  s2 = [4,5]

  s1.extend(s2) # [1, 2, 3, 4, 5]</code></pre>
</li>
<li><p>count : 개수 리턴</p>
<pre><code class="language-python">  s1 = [1, 2, 3, 2, 3]

  s1.count(2) # 2</code></pre>
</li>
<li><p>index : 가장 처음만나는 요소 인덱스 리턴</p>
<pre><code class="language-python">  s1 = [1, 2, 3, 2, 3]

  s1.index(2) # 1</code></pre>
</li>
<li><p>reverse : 반대로</p>
<pre><code class="language-python">  s1 = [1, 2, 3, 4, 5]

  s1.reverse() # [5, 4, 3, 2, 1]</code></pre>
</li>
<li><p>sort, sorted : 오름차순 정렬</p>
<pre><code class="language-python">  s1 = [2, 4, 2, 5, 1]

  s2 = sorted(s1) # s1의 값는 변하지않음
  s1.sort() # s1 의 값이 변함 [1, 2, 3, 4, 5]</code></pre>
</li>
<li><p>얕은복사, 깊은복사</p>
<ul>
<li><p>얕은복사</p>
<pre><code class="language-python">  s1 = [1, 2, [3, 4]]
  s2 = s1
  s3 = copy(s1)

  s1[0] = &#39;a&#39;
  print(s1) # [&#39;a&#39;, 2, [3, 4]]
  print(s2) # [&#39;a&#39;, 2, [3, 4]]
  print(s3) # [1, 2, [3, 4]]

  s1[2].append(5)
  print(s1) # [&#39;a&#39;, 2, [3, 4, 5]]
  print(s2) # [&#39;a&#39;, 2, [3, 4, 5]]
  print(s3) # [1, 2, [3, 4, 5]]</code></pre>
</li>
<li><p>얕은복사시 복사본 요소중 객체가 있을 경우 의도치 않은 변경이 생길 수 있음</p>
</li>
</ul>
</li>
</ul>
<ul>
<li><p>깊은복사</p>
<pre><code>```python
s1 = [1, 2, [3, 4]]
s2 = s1
s3 = copy.deepcopy(s1)

s1[2].append(5)
print(s1) # [1, 2, [3, 4, 5]]
print(s2) # [1, 2, [3, 4, 5]]
print(s3) # [1, 2, [3, 4]]
```</code></pre></li>
</ul>
<br>

<ul>
<li><p>주요 메소드 정리 </p>
<table>
<thead>
<tr>
<th>function</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>cmp(list1, list2)</td>
<td>두 리스트의 요소 비교</td>
</tr>
<tr>
<td>len(list)</td>
<td>리스트 전체 길이</td>
</tr>
<tr>
<td>max(list)</td>
<td>최대값 반환</td>
</tr>
<tr>
<td>min(list)</td>
<td>최소값 반환</td>
</tr>
<tr>
<td>list(seq)</td>
<td>튜플 → 리스트 변환</td>
</tr>
<tr>
<td>list.append(obj)</td>
<td>obj를 list에 추가</td>
</tr>
<tr>
<td>list.count(obj)</td>
<td>list에 있는 obj의 개수 반환</td>
</tr>
<tr>
<td>list.extend(seq)</td>
<td>+ 연산과 동일</td>
</tr>
<tr>
<td>list.index(obj)</td>
<td>list에 있는 obj index반환 (가장적은 index)</td>
</tr>
<tr>
<td>list.insert(index, obj)</td>
<td>list의 해당 index에 obj 추가</td>
</tr>
<tr>
<td>list.pop()</td>
<td>맨끝 삭제 및 반환</td>
</tr>
<tr>
<td>list.remove(obj)</td>
<td>해당 obj 제거</td>
</tr>
<tr>
<td>list.reverse()</td>
<td>반전</td>
</tr>
<tr>
<td>list.sort()</td>
<td>정렬</td>
</tr>
</tbody></table>
</li>
</ul>
<br>

<h3 id="2-tuple---소괄호-">2. tuple - 소괄호 ()</h3>
<ul>
<li>여러개의 데이터를 저장하고 소괄호로 감싸진 immutable 타입.</li>
<li>리스트와 동일하지만 차이점은 한번 생성되면 읽기만 가능하고 수정이 불가.</li>
</ul>
<br>

<ul>
<li><p>default</p>
<pre><code class="language-python">  # 생성
  t1 = () # 빈 튜플 생성 방법1
  t1  = tuple() # 빈 튜플 생성 방법2

  t1 = (1, 2, 3) # 생성, 초기화 방법 1
  t1 = tuple([1,2,3]) # 생성, 초기화 방법2</code></pre>
</li>
</ul>
<ol>
<li><p>인덱싱</p>
<pre><code class="language-python"> t1 = (1, 2, 3, [4, 5, 6])

 print(t1[0]) # 1
 print(t1[-1]) # [4, 5, 6]</code></pre>
</li>
<li><p>슬라이싱</p>
<pre><code class="language-python"> t1 = (1, 2, 3, 4, 5)

 print(t1[1:3]) # (2, 3)</code></pre>
</li>
<li><p>unpacking</p>
<pre><code class="language-python"> t1 = (1, 2, 3)

 e1, e2, e3 = t1 # 1 2 3</code></pre>
</li>
</ol>
<ol start="4">
<li><p>주요 메소드</p>
<ul>
<li><p>len() : 튜플 전체 길이 반환</p>
<pre><code class="language-python">  t1 = (1, 2, 3)

  print(len(t1)) # 3</code></pre>
</li>
<li><p>count : 개수 리턴</p>
<pre><code class="language-python">  t1 = (1, 2, 3, 2, 3)

  t1.count(2) # 2</code></pre>
</li>
<li><p>index : 가장 처음만나는 요소 인덱스 리턴</p>
<pre><code class="language-python">  t1 = (1, 2, 3, 2, 3)

  t1.index(2) # 1</code></pre>
</li>
</ul>
</li>
</ol>
<br>

<h3 id="3-set---중괄호-">3. set - 중괄호 {}</h3>
<ul>
<li><p>여러개의 데이터를 저장한다.</p>
</li>
<li><p>순서를 유지하지 않는다.</p>
</li>
<li><p>같은데이터는 1개로 처리한다.</p>
</li>
<li><p>중괄호를 사용한다.</p>
</li>
<li><p>default</p>
<pre><code class="language-python">  # 생성
  s1 = {&#39;hello&#39;} # 생성방법 1
  s1 = set(&#39;hello&#39;) # 생성방법 2

  print(s1) # {&#39;l&#39;, &#39;o&#39;, &#39;e&#39;, &#39;h&#39;}</code></pre>
</li>
</ul>
<ol>
<li><p>인덱싱</p>
<pre><code class="language-python"> s1 = {&#39;hello&#39;}

 print(s1[0]) # error 접근불가</code></pre>
</li>
<li><p>주요메소드 (len, add, update, remove)</p>
<pre><code class="language-python"> s1 = {1, 2, 3, 2, 3}

 # len (요소개수) - 중복된 요소는 count 되지 않는다.
 print(len(s1)) # 3 

 # add (단일요소추가)
 s1.add(4)

 # update (다중요소추가)
 s2 = {7,8}
 s1.update(s2)

 # remove (요소 제거)
 s1.remove(3)</code></pre>
</li>
<li><p>set은 집합 연산이 가능</p>
<ul>
<li>교집합 - &amp;</li>
<li>합집합 = |</li>
<li>차집합 = -</li>
<li>대칭 차집합 = ^</li>
</ul>
</li>
</ol>
<br>

<h3 id="4-dict---중괄호-">4. dict - 중괄호 {}</h3>
<ul>
<li><p>딕셔너리는 사전으로 고유한(key), 변경되는(value)로 맵핑되어 있는 집합.</p>
</li>
<li><p>각 키와 값은 콜론(:)으로 구분.</p>
</li>
<li><p>value를 가져오려면 대괄호를 사용함.</p>
</li>
<li><p>중복키는 허용하지 않음.</p>
</li>
<li><p>수정이 가능한 mutable 타입.</p>
</li>
<li><p>default</p>
<pre><code class="language-python">  # 생성
  d1 = {&#39;Name&#39; : &#39;SM&#39;, &#39;Age&#39; : 30}

  # get (방법2가지)
  print(d1[&#39;Name&#39;]) # SM
  print(d1.get(&#39;Age&#39;)) # 30

  # insert
  d1[&#39;weight&#39;] = 60

  # del
  del d1[&#39;weight&#39;]</code></pre>
</li>
</ul>
<ul>
<li><p>주요 메소드</p>
<ul>
<li><p>keys() : 모든 key 가져오기</p>
<pre><code class="language-python">  d1 = {&#39;Name&#39; : &#39;SM&#39;, &#39;Age&#39; : 30}

  keys = d1.keys() # ([&#39;Name&#39;, &#39;Age&#39;])</code></pre>
</li>
</ul>
</li>
</ul>
<pre><code>- values() : 모든 value 가져오기

    ```python
    d1 = {&#39;Name&#39; : &#39;SM&#39;, &#39;Age&#39; : 30}

    keys = d1.keys() # ([&#39;SM&#39;, 30])
    ```


- items() : 모든 key와 모든 value 가져오기

    ```python
    d1 = {&#39;Name&#39; : &#39;SM&#39;, &#39;Age&#39; : 30}

    items = d1.items() # ([(&#39;Name&#39;, &#39;SM&#39;), (&#39;Age&#39;, 30)])
    ```


- value in array : key 존재 판단

    ```python
    d1 = {&#39;Name&#39; : &#39;SM&#39;, &#39;Age&#39; : 30}

    print(&#39;Age&#39; in d1) # True
    ```


- clear() : 모든 요소 지우기

    ```python
    d1 = {&#39;Name&#39; : &#39;SM&#39;, &#39;Age&#39; : 30}

    d1.clear()
    ```</code></pre><hr></hr>

<h2 id="7-함수">7. 함수</h2>
]]></description>
        </item>
    </channel>
</rss>