๋ฐ์ํ
๋ถ๋ฅ ์ ์ฒด๋ณด๊ธฐ
[Golang] x๋งํผ ๊ฐ๊ฒฉ์ด ์๋ n๊ฐ์ ์ซ์
[Golang] x๋งํผ ๊ฐ๊ฒฉ์ด ์๋ n๊ฐ์ ์ซ์
2019.09.10๋งํฌ https://programmers.co.kr/learn/courses/30/lessons/12954# ์ฝ๋ฉํ
์คํธ ์ฐ์ต - x๋งํผ ๊ฐ๊ฒฉ์ด ์๋ n๊ฐ์ ์ซ์ | ํ๋ก๊ทธ๋๋จธ์ค ํจ์ solution์ ์ ์ x์ ์์ฐ์ n์ ์
๋ ฅ ๋ฐ์, x๋ถํฐ ์์ํด x์ฉ ์ฆ๊ฐํ๋ ์ซ์๋ฅผ n๊ฐ ์ง๋๋ ๋ฆฌ์คํธ๋ฅผ ๋ฆฌํดํด์ผ ํฉ๋๋ค. ๋ค์ ์ ํ ์กฐ๊ฑด์ ๋ณด๊ณ , ์กฐ๊ฑด์ ๋ง์กฑํ๋ ํจ์, solution์ ์์ฑํด์ฃผ์ธ์. ์ ํ ์กฐ๊ฑด x๋ -10000000 ์ด์, 10000000 ์ดํ์ธ ์ ์์
๋๋ค. n์ 1000 ์ดํ์ธ ์์ฐ์์
๋๋ค. ์
์ถ๋ ฅ ์ x n answer 2 5 [2,4,6,8,10] 4 3 [4,8,12] -4 2 [-4, -8] programmers.co.kr ๋ฌธ์ ์ค๋ช
ํจ์ solution์ ์ ์ x์ ์์ฐ์ n์ ์
๋ ฅ๋ฐ์,..
[rsync] rsync๋ง๋ค ๋งค๋ฒ ํจ์ค์๋๋ฅผ ๋ฌผ์ด ๋ณผ ๋ ํด๊ฒฐ๋ฒ
[rsync] rsync๋ง๋ค ๋งค๋ฒ ํจ์ค์๋๋ฅผ ๋ฌผ์ด ๋ณผ ๋ ํด๊ฒฐ๋ฒ
2019.09.02์๋ก ์๊ฒฉ ์๋ฒ๋ก ๋ฐฐํฌํ๋ ์คํฌ๋ฆฝํธ๋ฅผ ์งฐ๋๋ฐ, ์ด ๋ฐฐํฌ ์คํฌ๋ฆฝํธ๋ rsync๋ฅผ ํตํด ์๊ฒฉ ์๋ฒ๋ก ๋ฐฐํฌํ๋ ๋ก์ง์ ๊ฐ์ง๊ณ ์๋ค. rsync๋ฅผ ํ ๋๋ง๋ค ์ฌ์ฉ์์๊ฒ ํจ์ค์๋๋ฅผ ๋ฌผ์ด๋ณด๋ฉด ์ฌ๊ฐ ๊ท์ฐฎ์ ์ผ์ด ์๋๋ฐ, ์๋์ ๊ฐ์ด ํด๊ฒฐํ๋ฉด ๋๋ค. ํด๊ฒฐ $ cd ~/.ssh $ ssh-keygen -t rsa Enter file in which to save the key (/root/.ssh/id_rsa): [enter์
๋ ฅ] Enter passphrase (empty for no passphrase): [enter์
๋ ฅ] Enter same passphrase again: [enter์
๋ ฅ] rsa ์ํธํ ๋ฐฉ์์ ๊ณต๊ฐํค๋ฅผ ์์ฑํ๋ค. ํด๋น ๊ฒฝ๋ก์(~/) id_rsa์ id_rsa.pub๋ผ๋ ํ์ผ์ด ์์ฑ๋๋ค $ ssh-c..
[Elastic Search] ์ฌ๋ฌ ๊ฐ์ Shard๋ก ์ธํด ๊ฒ์ ๊ฒฐ๊ณผ(Score)๊ฐ ์ ํํ์ง ์์ ๋
[Elastic Search] ์ฌ๋ฌ ๊ฐ์ Shard๋ก ์ธํด ๊ฒ์ ๊ฒฐ๊ณผ(Score)๊ฐ ์ ํํ์ง ์์ ๋
2019.08.27์ ์ ์กฐ๊ฑด fruit์ด๋ผ๋ index์ name์ด๋ผ๋ ํ๋๊ฐ ์๊ณ ๋ค์๊ณผ ๊ฐ์ด ์ฌ๋ฌ ๊ฐ์ document๋ค์ด ์๋ค๊ณ ๊ฐ์ ํ์. {"index":{}} {"room_name": "๋ง๊ณ "} {"index":{}} {"room_name": "๋ง๊ณ ์คํด"} {"index":{}} {"room_name": "๋ง๊ณ ๋ง๊ณ ๋ง๊ณ "} {"index":{}} {"room_name": "๋ง๊ณ ๊ฐ์ฌฌ์์ฌฌ์"} {"index":{}} {"room_name": "๋ง๊ณ ํ๋๋ฃน"} {"index":{}} {"room_name": "๊น๋ง๊ณ "} {"index":{}} {"room_name": "์ธ์์์ ์ ์ผ ๋ง์๋๊ฑด ๋ง๊ณ ์ง"} ์ค๋์ ๊ฐฏ์๋ 3๊ฐ ๊ฒ์ ์๊ณ ๋ฆฌ์ฆ์ BM25๋ฅผ ์ฌ์ฉ, tokenizer๋ ngram tokenizer(min:1) ์ฌ์ฉ...
[Elastic Search] ์ธ๋ถ์์ Elastic Search API ์ฌ์ฉํ๊ธฐ (Production mode)
[Elastic Search] ์ธ๋ถ์์ Elastic Search API ์ฌ์ฉํ๊ธฐ (Production mode)
2019.08.20๊ฐ์ ๊ธฐ๋ณธ์ ์ธ ์ค์ ๊ฐ์ผ๋ก๋ Elastic Search API๋ฅผ ์๊ธฐ ์์ ์ ํธ์คํธ(loop back address: 127.0.0.1)์์๋ง ์ฌ์ฉ ํ ์ ์๋๋ก ์ธํ
๋์ด์๋ค. ๊ณต์ ๋ ํผ๋ฐ์ค ๋ฌธ์์์๋ ๊ฐ๋ฐ์ฉ ํ
์คํธ ์๋ฒ๋ก Elastic Search๋ฅผ ์ฌ์ฉํ๊ธฐ์๋ 127.0.0.1๋ก host๋ฅผ ์ค์ ํด๋ ๋ฌด๋ฆฌ๊ฐ ์๋ค๊ณ ๋์์์ง๋ง, ๋ค์๊ณผ ๊ฐ์ ๊ฒฝ์ฐ์ ํธ์คํธ ์ฃผ์๋ฅผ ๋ฐ๊พธ์ด ์ค ํ์๊ฐ ์๋ค. VMํ๊ฒฝ์์ Elastic Search๋ฅผ ์ค์นํ๊ณ ์ธ๋ถ์์ VM Elastic Search์ ์ ๊ทผํ๊ณ ์ ํ๋ ๊ฒฝ์ฐ ์์ฉ ์๋น์ค๋ฅผ ์ด์ํ ๊ฒฝ์ฐ ์ค์ ์ค์ ์ ๊ฐ๋จํ๋ค. ์์ ์ Elastic Search ์ค์ ํด๋์ elasticsearch.yml๋ฅผ ์ฐ๋ค. ํ์์ ๊ฒฝ์ฐ /etc/elasticsearch/elasticsearch..
[Elastic Search] Linux(CentOS) ์๋ผ์คํฑ ์์น 7 ๋ฒ์ ๋ ์ค์น(elastic search 7.x install)
[Elastic Search] Linux(CentOS) ์๋ผ์คํฑ ์์น 7 ๋ฒ์ ๋ ์ค์น(elastic search 7.x install)
2019.08.20์๊ตฌ ์ฌํญ ์์ ์ ํ๊ฒฝ์์ elastic search 7.x ๋๋ฅผ ์ค์น ํ ์ ์๋์ง ์๋ ๋งํฌ์์ ํ์ธ๋ค. https://www.elastic.co/kr/support/matrix Java 8 ์ด์ ๊ถ์ฅ ์ค์น 1. Download and install the public signing key: $ rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch 2. /etc/yum.repos.d/์ elasticsearch.repo ์์ฑ [elasticsearch-7.x] name=Elasticsearch repository for 7.x packages baseurl=https://artifacts.elastic.co/packages/7.x/yum g..
[๋จธ์ ๋ฌ๋ ์
๋ฌธ] 03. Linear Regression ์ cost ์ต์ํ์ TensorFlow ๊ตฌํ
[๋จธ์ ๋ฌ๋ ์ ๋ฌธ] 03. Linear Regression ์ cost ์ต์ํ์ TensorFlow ๊ตฌํ
2019.08.08๋ชฉ์ฐจ Cost function ๊ทธ๋ํ Gradient descent algorithm ์ ์ฉ Optimizer ์ ์ฉ Cost function ๊ทธ๋ํ ์ด์ ํฌ์คํธ์์ ์ฐ๋ฆฌ๋ Cost function์ ๋ฏธ๋ถ์ ๊ฐ๋จํ๊ฒ ํ๊ธฐ ์ํด์ ์์ ๊ฐ์ ์ถ์ฝ ์์ ์ฌ์ฉํ์๋ค. 2019/08/07 - [Development/Machine Learning] - [๋จธ์ ๋ฌ๋ ์
๋ฌธ] 03. Linear Regression์ cost ์ต์ํ ์๊ณ ๋ฆฌ์ฆ์ ์๋ฆฌ ์ค๋ช
[๋จธ์ ๋ฌ๋ ์
๋ฌธ] 03. Linear Regression์ cost ์ต์ํ ์๊ณ ๋ฆฌ์ฆ์ ์๋ฆฌ ์ค๋ช
๋ชฉ์ฐจ Minimize Cost function Gradient descent algorithm Convex function Minimize Cost function ์ง๋๋ฒ ํฌ์คํธ..
[๋จธ์ ๋ฌ๋ ์
๋ฌธ] 03. Linear Regression์ cost ์ต์ํ ์๊ณ ๋ฆฌ์ฆ์ ์๋ฆฌ ์ค๋ช
[๋จธ์ ๋ฌ๋ ์ ๋ฌธ] 03. Linear Regression์ cost ์ต์ํ ์๊ณ ๋ฆฌ์ฆ์ ์๋ฆฌ ์ค๋ช
2019.08.07๋ชฉ์ฐจ Minimize Cost function Gradient descent algorithm Convex function Minimize Cost function ์ง๋๋ฒ ํฌ์คํธ์์ Hypothesis์ Cost function์ ์์๋ณด์๊ณ , ์ฐ๋ฆฌ๋ Cost function์ ์ต์ํ์ํค๋ W์ b๋ฅผ ๊ตฌํ๋ ๊ฒ์ ๊ณผ์ ๋ก ์ผ์๋ค. ์ค๋ช
์ ์ํด์, Hypothesis๋ฅผ ์์ ๊ฐ์ด ๊ฐ๋จํ๊ฒ ๋ง๋ค์๋ค. (b = 0) ๋ํ ๋ฐ์ดํฐ๊ฐ ์๋ ํ์ ๊ฐ์ด ์ฃผ์ด์ง๋ค๊ณ ๊ฐ์ ํด๋ณด์. X Y 1 1 2 2 3 3 ์ฐ๋ฆฌ๋ cost๋ฅผ ์ต์ํ ์ํค๋ ์ง์ ์ ์ฐพ์์ผ ํ๋ค.(=์ต์ํ์ํค๋ W๋ฅผ ์ฐพ์์ผ ํจ) W = 1, cost(W) = 0 W = 0, cost(W) = 4.67 W = 2, cost(W) = 4.67 W์ ๋ฐ๋ฅธ cost(..
[IDE] Jetbrains IDE์์ ์ ์ฅ๋ Git ๋น๋ฐ๋ฒํธ๋ฅผ ๋ณ๊ฒฝํ๊ณ ์ถ์ ๊ฒฝ์ฐ
[IDE] Jetbrains IDE์์ ์ ์ฅ๋ Git ๋น๋ฐ๋ฒํธ๋ฅผ ๋ณ๊ฒฝํ๊ณ ์ถ์ ๊ฒฝ์ฐ
2019.08.06[File] -> [Settings]์์ ์ ๊ทธ๋ฆผ๊ณผ ๊ฐ์ ํญ์ผ๋ก ๋ค์ด๊ฐ์ Do not save, forget passwords after restart์ ์ฒดํฌ ํ ๋น๋ฐ๋ฒํธ๋ฅผ ๋ค์ ์ค์ ํด์ค๋ค. ์ถ์ฒ: https://jongwon407.tistory.com/
[Protocol Buffer] Child Directory์์ Parent Directory ํ๋กํ ํ์ผ Import
[Protocol Buffer] Child Directory์์ Parent Directory ํ๋กํ ํ์ผ Import
2019.08.02| |--parent.proto | |--sub |--child.proto ์์ ๊ฐ์ด ๋๋ ํฐ๋ฆฌ ๊ตฌ์กฐ๊ฐ ๊ตฌ์ฑ๋์ด์๊ณ child.proto์์ ์์ ์ ์์ ํด๋์ ์์นํ parent.proto๋ฅผ import ํ๊ณ ์ถ์ ๋๊ฐ ์๋ค. ๋ฌธ์ ๋๋ ๊ฒฝ์ฐ parent.proto syntax = "proto3"; package parent; message Attribute { --- } child.proto syntax = "proto3"; package child; import "../parent.proto"; message Child { parent.Attribute attribute = 1; } (ํ์ฌ ๋ช
๋ น์ด๋ฅผ ์
๋ ฅํ๋ ์์น๊ฐ parent.proto๊ฐ ์๋ ํด๋๋ผ ๊ฐ์ ํ ๋) protoc -I=.\ .\pare..
[Git] ํน์ ๋ธ๋์น๋ฅผ ์ ์ธํ๊ณ ๋ชจ๋ ๋ธ๋์น ์ผ๊ด ์ญ์
[Git] ํน์ ๋ธ๋์น๋ฅผ ์ ์ธํ๊ณ ๋ชจ๋ ๋ธ๋์น ์ผ๊ด ์ญ์
2019.08.01git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 | xargs git branch -d grep -v "\*" grep -v master grep -v dev ํ์ฌ ๋ธ๋์น ์ ์ธ ๋ง์คํฐ ๋ธ๋์น ์ ์ธ dev ๋ธ๋์น ์ ์ธ ์ถ์ฒ: masteage
[C/C++] Socket Send/Receive Buffer์ ๋ํ ๊ณ ์ฐฐ
[C/C++] Socket Send/Receive Buffer์ ๋ํ ๊ณ ์ฐฐ
2019.07.08๋ชฉ์ฐจ Socket Buffer? (Send Socket Buffer / Receive Socket Buffer) Socket Buffer ์ฌ์ด์ฆ ๋ณ๊ฒฝ, ์ฌ์ด์ฆ ํ์ธ, ๋ฒํผ ๋ฐ์ดํฐ ํ์ธ Socket Buffer ๋์ ํ
์คํธ Socket Buffer? (Send Socket Buffer / Receive Socket Buffer) ์์ ๊ทธ๋ฆผ๊ณผ ๊ฐ์ด TCP ํต์ ์์ Application์ด ๋ฉ์์ง๋ฅผ write๋ฅผ ํ๋ค๊ณ ๋ฐ๋ก ๋ฉ์ธ์ง๊ฐ ์ ์ก๋๋ ๊ฒ์ด ์๋๋ค. ์์ผ ๋ฒํผ(Send socket buffer)๋ผ๋ ๋ฒํผ์ ์์ธ ํ ์ ์ ํ ์๊ธฐ์ ์๋๋ฐฉ์๊ฒ ๋ฉ์์ง๊ฐ ์ ์ก๋๊ณ ๋ฒํผ๊ฐ ์ง์์ง๋ค. ๋ฐ๋ ์ชฝ์์๋ ๋ง์ฐฌ๊ฐ์ง๋ก ๋ฉ์์ง๊ฐ ์ค๋ฉด ์ผ๋จ, ์์ผ ๋ฒํผ(Receive socket buffer)์ ์ ์ฅ ๋ ํ Application..
[๋จธ์ ๋ฌ๋ ์
๋ฌธ] 02. TensorFlow๋ก Linear regression ๊ตฌํ
[๋จธ์ ๋ฌ๋ ์ ๋ฌธ] 02. TensorFlow๋ก Linear regression ๊ตฌํ
2019.07.04๋ชฉ์ฐจ Build graph using TensorFlow operations Place holders Build graph using TensorFlow operations Linear regression์ ๊ตฌํํ์ฌ ๊ทธ๋ํ๋ฅผ ๋ง๋ค๊ธฐ ์ํด ์์ ๊ทธ๋ฆผ์ ๋ณด๋ฉด์ ์ง๋ ๋ด์ฉ์ ๋ณต์ตํ๋๋ก ํ์. Hypothesis์ Cost function์ ์์ [๊ทธ๋ฆผ1]๊ณผ ๊ฐ๊ณ , ํ
์ํ๋ก์ฐ์ ๋ฉ์ปค๋์ฆ์ [๊ทธ๋ฆผ 2]์ ๊ฐ๋ค. # X and Y data x_train = [1, 2, 3] y_train = [1, 2, 3] W = tf.Variable(tf.random_normal([1]), name='weight') b = tf.Variable(tf.random_normal([1]), name='bias') # Our hyph..