<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>dongsub-joung.log</title>
        <link>https://velog.io/</link>
        <description></description>
        <lastBuildDate>Wed, 19 Jan 2022 10:35:14 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>dongsub-joung.log</title>
            <url>https://images.velog.io/images/dongsub-joung/profile/83b65c17-1441-479c-9bfe-fdae93614ae1/social.jpeg</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. dongsub-joung.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/dongsub-joung" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[Code Review)Rust block-chain]]></title>
            <link>https://velog.io/@dongsub-joung/Code-ReviewRust-block-chain</link>
            <guid>https://velog.io/@dongsub-joung/Code-ReviewRust-block-chain</guid>
            <pubDate>Wed, 19 Jan 2022 10:35:14 GMT</pubDate>
            <description><![CDATA[<p><img src="https://images.velog.io/images/dongsub-joung/post/8ec6cef3-afb4-466c-b3b9-64c91156e623/miyuki.jpg" alt=""></p>
<blockquote>
<p>눈 정화용 짤방</p>
</blockquote>
<h1 id="reference">Reference</h1>
<blockquote>
<p><a href="https://github.com/tensor-programming/Rust_block_chain">https://github.com/tensor-programming/Rust_block_chain</a>
<a href="https://www.youtube.com/watch?v=U8GGZ4TqlQs&amp;t=894s">https://www.youtube.com/watch?v=U8GGZ4TqlQs&amp;t=894s</a></p>
</blockquote>
<h1 id="mainrs"><code>main.rs</code></h1>
<h2 id="use-stdwrite">use) std::Write;</h2>
<h3 id="fn-writemut-self-buf-u8---resultusize">fn write(&amp;mut self, buf: &amp;[u8]) -&gt; Result<usize></h3>
<ul>
<li><p>The write method will attempt to write some data into the object, returning how many bytes were successfully written.</p>
</li>
<li><p>완벽한 트렌잭션을 보장하지 않음. 도중 에러 시, 작업 중단이고, 버퍼의 크기 보다 같거나 작음. // Ok(n)</p>
</li>
<li><p>ErrorKind::Interrupted</p>
</li>
</ul>
<h4 id="fn-flushmut-self---result">fn flush(&amp;mut self) -&gt; Result&lt;()&gt;</h4>
<p>The flush method is useful for adapters and explicit buffers themselves for ensuring that all buffered data has been pushed out to the ‘true sink’.</p>
<pre><code class="language-rust">use std::{fs::File, io::Write};

fn main() -&gt; std::io::Result&lt;()&gt;{
    let mut buf= File::create(&quot;foo.TXT&quot;)?;
    buf.write(b&quot; Some bytes&quot;)?;
    buf.flush()?;
    Ok(())
}</code></pre>
<hr>
<h2 id="inside">inside</h2>
<pre><code class="language-rust">    let mut miner_addr = String::new();
    let mut difficulty = String::new();
    let mut choice = String::new();

  let mut chain = blockchain::Chain::new(miner_addr.trim().to_string(), diff);</code></pre>
<h3 id="loop">loop</h3>
<h4 id="match">match</h4>
<pre><code class="language-rust">  // 0
   process::exit(0);</code></pre>
<hr>
<h1 id="blockchainrs"><code>blockchain.rs</code></h1>
<p>  <a href="https://github.com/tensor-programming/Rust_block_chain/blob/master/src/blockchain.rs">https://github.com/tensor-programming/Rust_block_chain/blob/master/src/blockchain.rs</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[Note) LLVM]]></title>
            <link>https://velog.io/@dongsub-joung/Note-LLVM</link>
            <guid>https://velog.io/@dongsub-joung/Note-LLVM</guid>
            <pubDate>Thu, 13 Jan 2022 05:57:20 GMT</pubDate>
            <description><![CDATA[<h2 id="ref">Ref</h2>
<ul>
<li><a href="https://namu.wiki/w/LLVM">https://namu.wiki/w/LLVM</a></li>
<li><a href="https://en.wikipedia.org/wiki/LLVM">https://en.wikipedia.org/wiki/LLVM</a></li>
</ul>
<h3 id="velog">Velog</h3>
<ul>
<li><a href="https://velog.io/@wekdnjs/LLVM">https://velog.io/@wekdnjs/LLVM</a></li>
<li></li>
</ul>
<h3 id="etc">etc</h3>
<ul>
<li><a href="https://velog.io/@sharosoo/2.-Compiler-Structure-Overview">Compiler-Structure-Overview</a></li>
<li><a href="https://velog.io/@yeonbot/%EB%A1%9C%EC%BB%AC-%ED%99%98%EA%B2%BD%EC%84%A4%EC%A0%95%EC%9D%B4-%ED%95%84%EC%9A%94-%EC%97%86%EB%8A%94-%EC%9B%B9-%EC%96%B4%EC%85%88%EB%B8%94%EB%A6%AC-%ED%8A%9C%ED%86%A0%EB%A6%AC%EC%96%BC">로컬 환경설정이 필요 없는 웹 어셈블리 튜토리얼</a></li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[VM -Intro-]]></title>
            <link>https://velog.io/@dongsub-joung/VM-Intro-</link>
            <guid>https://velog.io/@dongsub-joung/VM-Intro-</guid>
            <pubDate>Wed, 12 Jan 2022 02:42:14 GMT</pubDate>
            <description><![CDATA[<p>Application server, Web containner clustering</p>
<ul>
<li>cafistrano, Fabric, puppet, chef, ansible, saltstack.com</li>
</ul>
<p>OVF,open virtual format</p>
<p>VM </p>
<ul>
<li>vagrantup.com &gt;&gt; packer.io</li>
<li>LXC, Docker</li>
</ul>
<p><a href="https://youtu.be/Kq849CpGd88">https://youtu.be/Kq849CpGd88</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[Velog Rust글들에서 개인적인 팁 정리]]></title>
            <link>https://velog.io/@dongsub-joung/Velog-Rust%EA%B8%80%EB%93%A4%EC%97%90%EC%84%9C-%EA%B0%9C%EC%9D%B8%EC%A0%81%EC%9D%B8-%ED%8C%81-%EC%A0%95%EB%A6%AC</link>
            <guid>https://velog.io/@dongsub-joung/Velog-Rust%EA%B8%80%EB%93%A4%EC%97%90%EC%84%9C-%EA%B0%9C%EC%9D%B8%EC%A0%81%EC%9D%B8-%ED%8C%81-%EC%A0%95%EB%A6%AC</guid>
            <pubDate>Sat, 08 Jan 2022 06:28:08 GMT</pubDate>
            <description><![CDATA[<h1 id="refs">Refs</h1>
<p><a href="https://velog.io/@peeeeeter_j/Rustlings">Rustlang solving cases</a>
<a href="https://velog.io/@sivese/%EC%9C%A0%EC%9A%A9%ED%95%9C-Rust-Repository-%EB%AA%A8%EC%9D%8C">repos</a>
<a href="https://velog.io/@koo8624/Rust%EB%A1%9C-%EB%B0%B0%EC%9A%B0%EB%8A%94-%EC%9E%90%EB%A3%8C%EA%B5%AC%EC%A1%B0-01.-%EC%97%B0%EA%B2%B0-%EB%A6%AC%EC%8A%A4%ED%8A%B8Linked-List">Data structure</a>
<a href="https://velog.io/@pandawithcat/Rust-vec%EC%97%90-%EB%8C%80%ED%95%98%EC%97%AC">Data structure2</a>
<a href="https://velog.io/@pandawithcat/RUST-%EB%A1%9C-%EA%B3%B5%EB%B6%80%ED%95%98%EB%8A%94-%EB%B9%84%EB%8F%99%EA%B8%B0-%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%B0%8D-1">async/sync</a>
<a href="https://velog.io/@peeeeeter_j/Rust-Programming-25">Rc<T>와 RefCell<T></a></p>
<h2 id="results">Results</h2>
<p><a href="https://velog.io/@dandev_sw/NEAR-protocol-Rust%EB%A1%9C-%EC%8A%A4%EB%A7%88%ED%8A%B8-%EC%BB%A8%ED%8A%B8%EB%9E%99%ED%8A%B8-%EC%9E%91%EC%84%B1%ED%95%98%EA%B3%A0-%EB%B0%B0%ED%8F%AC%ED%95%98%EA%B8%B0">NEAR protocol-Smart constract</a></p>
<h2 id="new">New</h2>
<p><a href="https://towardsdatascience.com/awesome-rust-powered-command-line-utilities-b5359c38692">utilities</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[Rust Port Sniffer) code review]]></title>
            <link>https://velog.io/@dongsub-joung/Rust-Port-Sniffer-code-review</link>
            <guid>https://velog.io/@dongsub-joung/Rust-Port-Sniffer-code-review</guid>
            <pubDate>Sat, 08 Jan 2022 05:01:13 GMT</pubDate>
            <description><![CDATA[<h1 id="code-ref">code Ref</h1>
<p><a href="https://github.com/tensor-programming/Rust_Port_Sniffer">https://github.com/tensor-programming/Rust_Port_Sniffer</a></p>
<h2 id="use-정리">use 정리</h2>
<p>use std::env
use std::io::{self, Write};
use std::net::{IpAddr, TcpStream};
use std::str::FromStr;
use std::process;
use std::sync::mpsc::{Sender, channel};
use std::thread;  </p>
<h2 id="구문-정리">구문 정리</h2>
]]></description>
        </item>
        <item>
            <title><![CDATA[Elastic Load Balancing]]></title>
            <link>https://velog.io/@dongsub-joung/Elastic-Load-Balancing</link>
            <guid>https://velog.io/@dongsub-joung/Elastic-Load-Balancing</guid>
            <pubDate>Thu, 06 Jan 2022 12:56:41 GMT</pubDate>
            <description><![CDATA[<blockquote>
<p>I&#39;m usually interest in &quot;deploy&quot; or &quot;develop Env&quot;.</p>
</blockquote>
<h2 id="elastic-load-balancing">Elastic Load Balancing</h2>
<p>will zip)
<a href="https://www.youtube.com/watch?v=VIgAT7vjol8&amp;t=2s">https://www.youtube.com/watch?v=VIgAT7vjol8&amp;t=2s</a></p>
<h2 id="auto-scaling">auto scaling</h2>
<p><a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/attach-load-balancer-asg.html">https://docs.aws.amazon.com/autoscaling/ec2/userguide/attach-load-balancer-asg.html</a></p>
<hr>
<h1 id="ref">Ref</h1>
<ol>
<li><a href="https://aws.amazon.com/elasticloadbalancing/">https://aws.amazon.com/elasticloadbalancing/</a></li>
<li><a href="https://aws.amazon.com/elasticloadbalancing/getting-started/?pg=ln&amp;sec=hs">https://aws.amazon.com/elasticloadbalancing/getting-started/?pg=ln&amp;sec=hs</a></li>
<li><a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/what-is-load-balancing.html">https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/what-is-load-balancing.html</a></li>
</ol>
<hr>
<ol start="4">
<li><a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html">https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html</a></li>
</ol>
]]></description>
        </item>
        <item>
            <title><![CDATA[std::io::* 2. Struct std::io::BufReader]]></title>
            <link>https://velog.io/@dongsub-joung/stdio-2.-Struct-stdioBufReader</link>
            <guid>https://velog.io/@dongsub-joung/stdio-2.-Struct-stdioBufReader</guid>
            <pubDate>Thu, 06 Jan 2022 10:46:54 GMT</pubDate>
            <description><![CDATA[<p><a href="https://doc.rust-lang.org/std/io/struct.BufReader.html">https://doc.rust-lang.org/std/io/struct.BufReader.html</a></p>
<h1 id="요약">요약</h1>
<blockquote>
<p>small and repeated read calls to the same file or network socket.  </p>
</blockquote>
<ul>
<li>when reading very large amounts at once, or reading just one or a few times. &gt;&gt; 별로 도움이 안된다.</li>
<li>멀티 스레딩에서 데이터 손실 위험성( <code>BufReader::into_inner</code>도)  </li>
</ul>
<pre><code class="language-rust">use std::io::prelude::*;
use std::io::BufReader;
use std::fs::File;
fn main() -&gt; std::io::Result&lt;()&gt;{
    let f= File::open(&quot;log.txt&quot;)?;
    let mut reader= BufReader::new(f);

    let mut line= String::new();
    let len= reader.read_line(&amp;mut line)?;

    println!(&quot;First line is {} bytes long&quot;, len);
    Ok(())
}</code></pre>
<hr>
<h2 id="implementations">Implementations</h2>
<h3 id="implr-read-bufreaderr">impl&lt;R: Read&gt; BufReader<R></h3>
<h4 id="pub-fn-newinner-r---bufreaderr">pub fn new(inner: R) -&gt; BufReader<R></h4>
<h4 id="pub-fn-with_capacitycapacity-usize-inner-r---bufreaderr">pub fn with_capacity(capacity: usize, inner: R) -&gt; BufReader<R></h4>
<h3 id="implr-bufreaderr">impl<R> BufReader<R></h3>
<h4 id="pub-fn-get_refself---r">pub fn get_ref(&amp;self) -&gt; &amp;R</h4>
<h4 id="pub-fn-get_mutmut-self---mut-r">pub fn get_mut(&amp;mut self) -&gt; &amp;mut R</h4>
<h4 id="pub-fn-bufferself---u8">pub fn buffer(&amp;self) -&gt; &amp;[u8]</h4>
<h4 id="pub-fn-capacityself---usize">pub fn capacity(&amp;self) -&gt; usize</h4>
<h4 id="pub-fn-into_innerself---r">pub fn into_inner(self) -&gt; R</h4>
<h3 id="implr-seek-bufreaderr">impl&lt;R: Seek&gt; BufReader<R></h3>
<h4 id="pub-fn-seek_relativemut-self-offset-i64---result">pub fn seek_relative(&amp;mut self, offset: i64) -&gt; Result&lt;()&gt;</h4>
]]></description>
        </item>
        <item>
            <title><![CDATA[std::io::* 1. Trait std::io::Read]]></title>
            <link>https://velog.io/@dongsub-joung/Rustlang-stdio-9cq5blc8</link>
            <guid>https://velog.io/@dongsub-joung/Rustlang-stdio-9cq5blc8</guid>
            <pubDate>Thu, 06 Jan 2022 07:29:28 GMT</pubDate>
            <description><![CDATA[<blockquote>
<p>io 하위의 method들을 정리한 문서</p>
</blockquote>
<h1 id="traitread"><a href="https://doc.rust-lang.org/std/io/trait.Read.html#method.read_to_string">trait.Read</a></h1>
<p>Please note that each call to read() may involve a system call, and therefore, using something that implements BufRead, such as BufReader, will be more efficient.</p>
<h2 id="file">File</h2>
<pre><code class="language-rust">use std::io;
use std::io::prelude::*;
use std::fs::File;

fn main() -&gt; io::Result&lt;()&gt; {
    let mut f = File::open(&quot;foo.txt&quot;)?;
    let mut buffer = [0; 10];

    // read up to 10 bytes
    f.read(&amp;mut buffer)?;

    let mut buffer = Vec::new();
    // read the whole file
    f.read_to_end(&amp;mut buffer)?;

    // read into a String, so that you don&#39;t need to do the conversion.
    let mut buffer = String::new();
    f.read_to_string(&amp;mut buffer)?;

    // and more! See the other methods for more details.
    Ok(())
}</code></pre>
<hr>
<h3 id="fn-readmut-self-buf-mut-u8---resultusize--required">fn read(&amp;mut self, buf: &amp;mut [u8]) -&gt; Result<usize> // Required</h3>
<ul>
<li><p>This function does not provide any guarantees about whether it blocks waiting for data, but if an object needs to block for a read and cannot, it will typically signal this via an Err return value.</p>
</li>
<li><p>An error of the ErrorKind::Interrupted kind is non-fatal and the read operation should be retried if there is nothing else to do.</p>
</li>
</ul>
<hr>
<h3 id="pub-fn-read_to_stringr-readreader-mut-r---resultstring">pub fn read_to_string&lt;R: Read&gt;(reader: &amp;mut R) -&gt; Result<String></h3>
<p><a href="https://doc.rust-lang.org/std/io/fn.read_to_string.html">https://doc.rust-lang.org/std/io/fn.read_to_string.html</a></p>
<p>(If you use Read::read_to_string you have to remember to check whether the read succeeded because otherwise your buffer will be empty or only partially full.)</p>
<ul>
<li>EOF 반환 하거나 위의 조건을 만족하면 String이 반환된다.(무제한으로 입력된 이유는 이러한 특성때문이다.)</li>
<li>Reading 중에 오류 발생시 재사용 불가</li>
<li>Safe over Performance</li>
<li>Err에 String이 wrapped되어 있는 형태의 Result type 반환.</li>
</ul>
<hr>
<h3 id="provided-methods">Provided methods</h3>
<h4 id="fn-read_vectoredmut-self-bufs-mut-ioslicemut_---resultusize">fn read_vectored(&amp;mut self, bufs: &amp;mut [IoSliceMut&lt;&quot;&#39;&quot;_&gt;] -&gt; Result<usize></h4>
<h4 id="fn-read_to_endmut-self-buf-mut-vecu8---resultusize">fn read_to_end(&amp;mut self, buf: &amp;mut Vec<u8> -&gt; Result<usize></h4>
<h4 id="fn-read_exactmut-self-buf-mut-u8---result">fn read_exact(&amp;mut self, buf: &amp;mut [u8] -&gt; Result&lt;()&gt;</h4>
<h4 id="fn-by_refmut-self---mut-self">fn by_ref(&amp;mut self) -&gt; &amp;mut Self</h4>
<h4 id="fn-bytesself---bytesself">fn bytes(self) -&gt; Bytes<Self></h4>
<h4 id="fn-chainr-readself-next-r---chainself-r">fn chain&lt;R: Read&gt;(self, next: R) -&gt; Chain&lt;Self, R&gt;</h4>
<h4 id="fn-takeself-limit-u64---takeself">fn take(self, limit: u64) -&gt; Take<Self></h4>
<blockquote>
<p>Self: Sized</p>
</blockquote>
]]></description>
        </item>
        <item>
            <title><![CDATA[Rustlang) std::io ]]></title>
            <link>https://velog.io/@dongsub-joung/Rustlang-stdio</link>
            <guid>https://velog.io/@dongsub-joung/Rustlang-stdio</guid>
            <pubDate>Wed, 05 Jan 2022 05:46:41 GMT</pubDate>
            <description><![CDATA[<blockquote>
<p>개인적으로 이 글을 읽기 위해서는 &quot;병렬 처리 및 병렬 프로세스&quot;에 관한 선행된 지식이 필요합니다.</p>
</blockquote>
<p><a href="https://doc.rust-lang.org/std/io/struct.Stdin.html">https://doc.rust-lang.org/std/io/struct.Stdin.html</a></p>
<h1 id="stdiostdin">std::io::Stdin</h1>
<p>&#39;a global buffer of input data to this process&#39;에 대한 점유를 할 수 있는 핸들러를 가리킵니다.</p>
<p>핸들러는 병렬처리에 의한 자원 독점(&#39;lock&#39;)을 이용하여 &#39;BufRead methods의 전체적인 접근 권한을 얻습니다.</p>
<p>해당 핸들러는 &#39;the Read trait&#39;을 제공하지만 병렬 처리에서의 Read는 유의해서 처리해야 합니다.</p>
<hr>
<h3 id="pub-fn-lockself---stdinlock_">pub fn lock(&amp;self) -&gt; StdinLock&lt;&#39;_&gt;</h3>
<p>(병렬 처리에 있어서의 자원 점유를 위한) readable 가드를 반환하는 표준 핸들러, scope에서 벗어나면 해제된다.
추가적인 구성요소로 아래의 trait들을 제공함.</p>
<ul>
<li><a href="https://doc.rust-lang.org/std/io/trait.Read.html">https://doc.rust-lang.org/std/io/trait.Read.html</a></li>
<li><a href="https://doc.rust-lang.org/std/io/trait.BufRead.html">https://doc.rust-lang.org/std/io/trait.BufRead.html</a></li>
</ul>
<h4 id="ex">EX</h4>
<pre><code class="language-rust">use std::io::{self, BufRead};

fn main() -&gt; {
    let mut buffer = String::new();
    let stdin = io::stdin();
    let mut handle = stdin.lock();

    handle.read_line(&amp;mut buffer).expect(&quot;Err: can&#39;t read&quot;);
}</code></pre>
<hr>
<h3 id="pub-fn-read_lineself-buf-mut-string---resultusize">pub fn read_line(&amp;self, buf: &amp;mut String) -&gt; Result<usize></h3>
<ul>
<li>&#39;a line of input&#39;, appending it to the specified buffer.</li>
<li>&#39;bytes&#39;(the 0xA byte) or EOF</li>
<li>the total number of bytes read.</li>
<li><a href="https://doc.rust-lang.org/std/io/trait.BufRead.html#method.read_line">BufRead::read_line</a></li>
</ul>
<blockquote>
<p>이 메서드에서 문제가 발생하는 것 같다. 자원 공유에서의 blocking이 문제인가? 값이 제대로 할당되지 않는 문제로 계속 input이 실행된다.</p>
</blockquote>
<pre><code class="language-rust">// *Infinit loop* 
    io::stdin().read_to_string(&amp;mut buf).expect(&quot;msg&quot;);</code></pre>
<hr>
<h3 id="pub-fn-into_lockedself---stdinlockstatic">pub fn into_locked(self) -&gt; StdinLock&lt;&quot;&#39;&quot;static&gt;</h3>
<ul>
<li>locking the shared global buffer associated with the stream and returning a readable guard.  </li>
<li>simpler to directly get a locked handle </li>
</ul>
<pre><code class="language-rust">#![feature(stdio_locked)]
  use std::io::{self, BufRead};

  fn main() -&gt; io::Result&lt;()&gt;{
      let mut buffer= String::new();
    let mut handle= io::stdin().into_locked();

      handle.read_line(&amp;mut buffer)?;
      Ok(())
  }
</code></pre>
<blockquote>
<p><code>#![feature]</code> may not be used on the stable release channel<br>   코드 실행이 안된다. <code>lock</code>을 애용하자. // #86845</p>
</blockquote>
<hr>
<h3 id="pub-fn-linesself---linesstdinlockstatic">pub fn lines(self) -&gt; Lines&lt;StdinLock&lt;&quot;&#39;&quot;static&gt;&gt;</h3>
<ul>
<li>returns an iterator   </li>
</ul>
<pre><code class="language-rust">  #![feature(stdin_forwarders)]
  use std::io;

  let lines = io::stdin().lines();
  for line in lines {
      println!(&quot;got a line: {}&quot;, line.unwrap());
  }</code></pre>
<blockquote>
<p><code>stdin_forwarders</code> 실행안됨. //  #87096</p>
</blockquote>
<hr>
<h3 id="pub-fn-splitself-byte-u8---splitstdinlockstatic">pub fn split(self, byte: u8) -&gt; Split&lt;StdinLock&lt;&quot;&#39;&quot;static&gt;&gt;</h3>
<ul>
<li>an iterator over input bytes  // #87096</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[Rustlang) std::io - 시작하기]]></title>
            <link>https://velog.io/@dongsub-joung/Rustlang-stdio-%EC%A0%95%EB%A6%AC-%ED%94%84%EB%A1%A4%EB%A1%9C%EA%B7%B8-</link>
            <guid>https://velog.io/@dongsub-joung/Rustlang-stdio-%EC%A0%95%EB%A6%AC-%ED%94%84%EB%A1%A4%EB%A1%9C%EA%B7%B8-</guid>
            <pubDate>Wed, 05 Jan 2022 04:33:19 GMT</pubDate>
            <description><![CDATA[<ol>
<li><p><a href="https://codeforces.com/blog/entry/97810?locale=en">CodeForce</a>의 코딩 테스트를 위해서는 input 변수를 정의한 후에 테스트를 돌러야 코드 검사가 가능하기 때문에 Java &#39;Scanner&#39;, C의 &#39;scanf&#39;와 같은 기능이 필요하다. 게다가 String에 대한 처리도 까다롭다.</p>
</li>
<li><p>내가 작성한 코드</p>
</li>
</ol>
<pre><code class="language-rust">use std::io::{self, Read};

#[cfg(test)]

fn get_list() -&gt; Vec&lt;u8&gt; {
    let mut buf= String::new();

    io::stdin().read_to_string(&amp;mut buf).unwrap();

    let list= buf
        .split_whitespace()
        .map(|f| f.parse::&lt;u8&gt;())
        .collect::&lt;Result&lt;Vec&lt;u8&gt;, _&gt;&gt;()
        .unwrap();

    list
}

mod tests{
    use super::*;

    #[test]
    fn one() {
        let list= vec![10,8,6,4,2,1];

        assert_eq!(
            list
            ,get_list()
        );
    }
}</code></pre>
<ol start="3">
<li>무한 반복을 벗어나기 위한 방법은 두가지 존재한다.</li>
</ol>
<ul>
<li>데이터 셋을 설정하고, 해당 경우들만 테스트하고, 제출하지 않는다.</li>
<li>그래도 좀 더 알아보고, 구현해본다.</li>
</ul>
<ol start="4">
<li>러스트를 배우는 입장에서 정리하고 cheat sheet만들기. (String에 대한 처리도)</li>
</ol>
<ol start="5">
<li>ref <ul>
<li><a href="https://hyuckkim.tistory.com/62">https://hyuckkim.tistory.com/62</a>  </li>
<li><a href="https://doc.rust-lang.org/std/io/struct.Stdin.html">https://doc.rust-lang.org/std/io/struct.Stdin.html</a></li>
</ul>
</li>
</ol>
]]></description>
        </item>
    </channel>
</rss>