-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
eopche
committed
Sep 24, 2024
1 parent
e0f532c
commit 7774ad1
Showing
21 changed files
with
543 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"sponge-0006":{"title":"Sponge lab 3: the TCP sender","taxon":null,"tags":[],"route":"sponge-0006.xml","metas":{}},"sponge-0004":{"title":"Sponge Lab 2: the TCP Receiver","taxon":null,"tags":[],"route":"sponge-0004.xml","metas":{}},"sponge-0005":{"title":"TCP Segment","taxon":"Figure","tags":[],"route":"sponge-0005.xml","metas":{}},"ocmst-0004":{"title":"Insertion (Okaskaki's algorithm)","taxon":null,"tags":[],"route":"ocmst-0004.xml","metas":{}},"ocmst-0003":{"title":"Red-Black Tree","taxon":null,"tags":[],"route":"ocmst-0003.xml","metas":{}},"sponge-0001":{"title":"Sponge Lab Notes","taxon":null,"tags":[],"route":"sponge-0001.xml","metas":{}},"sponge-0002":{"title":"Sponge Lab 0: networking warmup","taxon":null,"tags":[],"route":"sponge-0002.xml","metas":{}},"sponge-0003":{"title":"Sponge Lab 1: stitching substrings into a byte stream","taxon":null,"tags":[],"route":"sponge-0003.xml","metas":{}},"ocmst-0002":{"title":"Binary Search Tree","taxon":null,"tags":[],"route":"ocmst-0002.xml","metas":{}},"epoche-0001":{"title":"Epoche’s forest","taxon":null,"tags":[],"route":"index.xml","metas":{}},"ocmst-0001":{"title":"Functional Red-Black Tree Implementation","taxon":null,"tags":[],"route":"ocmst-0001.xml","metas":{}},"epoche-0002":{"title":"Learning progress on evergreen notes in forester","taxon":null,"tags":[],"route":"epoche-0002.xml","metas":{}},"epoche":{"title":"Epoche","taxon":"Person","tags":[],"route":"epoche.xml","metas":{"institution":"Zhengzhou University of Light Industry","position":"Bachelor Student","external":"Https://github.com/suspenss"}},"poem-0001":{"title":"What can I hold you with?","taxon":null,"tags":[],"route":"poem-0001.xml","metas":{}},"common":{"title":"Common import","taxon":null,"tags":[],"route":"common.xml","metas":{}}} | ||
{"move-0001":{"title":"Move Semantics in cpp","taxon":null,"tags":[],"route":"move-0001.xml","metas":{}},"move-0002":{"title":"Value Categories","taxon":null,"tags":[],"route":"move-0002.xml","metas":{}},"move-0003":{"title":"The std::move function","taxon":null,"tags":[],"route":"move-0003.xml","metas":{}},"sponge-0006":{"title":"Sponge lab 3: the TCP sender","taxon":null,"tags":[],"route":"sponge-0006.xml","metas":{}},"sponge-0004":{"title":"Sponge Lab 2: the TCP Receiver","taxon":null,"tags":[],"route":"sponge-0004.xml","metas":{}},"sponge-0005":{"title":"TCP Segment","taxon":"Figure","tags":[],"route":"sponge-0005.xml","metas":{}},"ocmst-0004":{"title":"Insertion (Okaskaki's algorithm)","taxon":null,"tags":[],"route":"ocmst-0004.xml","metas":{}},"ocmst-0003":{"title":"Red-Black Tree","taxon":null,"tags":[],"route":"ocmst-0003.xml","metas":{}},"sponge-0001":{"title":"Sponge Lab Notes","taxon":null,"tags":[],"route":"sponge-0001.xml","metas":{}},"sponge-0002":{"title":"Sponge Lab 0: networking warmup","taxon":null,"tags":[],"route":"sponge-0002.xml","metas":{}},"sponge-0003":{"title":"Sponge Lab 1: stitching substrings into a byte stream","taxon":null,"tags":[],"route":"sponge-0003.xml","metas":{}},"ocmst-0002":{"title":"Binary Search Tree","taxon":null,"tags":[],"route":"ocmst-0002.xml","metas":{}},"epoche-0001":{"title":"Epoche’s forest","taxon":null,"tags":[],"route":"index.xml","metas":{}},"ocmst-0001":{"title":"Functional Red-Black Tree Implementation","taxon":null,"tags":[],"route":"ocmst-0001.xml","metas":{}},"epoche-0002":{"title":"Learning progress on evergreen notes in forester","taxon":null,"tags":[],"route":"epoche-0002.xml","metas":{}},"epoche":{"title":"Epoche","taxon":"Person","tags":[],"route":"epoche.xml","metas":{"institution":"Zhengzhou University of Light Industry","position":"Bachelor Student","external":"Https://github.com/suspenss"}},"poem-0001":{"title":"What can I hold you with?","taxon":null,"tags":[],"route":"poem-0001.xml","metas":{}},"common":{"title":"Common import","taxon":null,"tags":[],"route":"common.xml","metas":{}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?xml-stylesheet type="text/xsl" href="default.xsl"?> | ||
<fr:tree | ||
toc="true" | ||
numbered="true" | ||
show-heading="true" | ||
show-metadata="true" | ||
expanded="true" | ||
root="false" | ||
xmlns:fr="http://www.jonmsterling.com/jms-005P.xml"><fr:frontmatter><fr:anchor>239</fr:anchor><fr:addr | ||
type="user">move-0001</fr:addr><fr:route>move-0001.xml</fr:route><fr:title | ||
text="Move Semantics in cpp">Move Semantics in cpp</fr:title><fr:date><fr:year>2024</fr:year><fr:month>9</fr:month><fr:day>22</fr:day></fr:date><fr:authors><fr:author><fr:link | ||
type="local" | ||
href="epoche.xml" | ||
addr="epoche" | ||
title="Epoche">Epoche</fr:link></fr:author></fr:authors></fr:frontmatter><fr:mainmatter><fr:p>In <fr:link | ||
type="external" | ||
href="https://github.com/suspenss/Sponge/blob/master/libsponge/util/buffer.hh">cs144 libsponge buffer header</fr:link> has a very strange constructor that I never seen before: | ||
|
||
<fr:pre><![CDATA[ Buffer(std::string &&str) noexcept | ||
: _storage(std::make_shared<std::string>(std::move(str))) {}]]></fr:pre> | ||
|
||
When I'm trying to construct a buffer using <fr:code>Buffer payload = Buffer(str);</fr:code>, it doesn't work. So I searched this question on the web and I finally found that correct way to use the constructor is <fr:code>Buffer payload = Buffer(std::move(str));</fr:code>. So I'm going to make some notes about "<fr:strong>Move Semantics</fr:strong>".</fr:p><fr:tree | ||
toc="true" | ||
numbered="true" | ||
show-heading="true" | ||
show-metadata="false" | ||
expanded="true" | ||
root="false" | ||
xmlns:fr="http://www.jonmsterling.com/jms-005P.xml"><fr:frontmatter><fr:anchor>241</fr:anchor><fr:addr | ||
type="user">move-0002</fr:addr><fr:route>move-0002.xml</fr:route><fr:title | ||
text="Value Categories">Value Categories</fr:title><fr:date><fr:year>2024</fr:year><fr:month>9</fr:month><fr:day>22</fr:day></fr:date><fr:authors><fr:author><fr:link | ||
type="local" | ||
href="epoche.xml" | ||
addr="epoche" | ||
title="Epoche">Epoche</fr:link></fr:author></fr:authors></fr:frontmatter><fr:mainmatter><fr:p>Before C++11, this language has only two kinds of value: lvalue and rvalue. And only lvalue has reference. | ||
<fr:ul><fr:li><fr:strong>lvalue</fr:strong>: lvalue is an object that can get its address like variable and array.</fr:li> | ||
<fr:li><fr:strong>rvalue</fr:strong>: rvalue is an object that can't get its address like literal and temporary variable.</fr:li></fr:ul></fr:p><fr:p>C++11 adds the rvalue reference, we can use <fr:code>Type&&</fr:code> to make a rvalue reference. Rvalue reference binds the rvalue object rather than copy it, while the object that be binded will be destoryed.</fr:p></fr:mainmatter><fr:backmatter /></fr:tree><fr:tree | ||
toc="true" | ||
numbered="true" | ||
show-heading="true" | ||
show-metadata="false" | ||
expanded="true" | ||
root="false" | ||
xmlns:fr="http://www.jonmsterling.com/jms-005P.xml"><fr:frontmatter><fr:anchor>243</fr:anchor><fr:addr | ||
type="user">move-0003</fr:addr><fr:route>move-0003.xml</fr:route><fr:title | ||
text="The std::move function">The std::move function</fr:title><fr:date><fr:year>2024</fr:year><fr:month>9</fr:month><fr:day>22</fr:day></fr:date><fr:authors><fr:author><fr:link | ||
type="local" | ||
href="epoche.xml" | ||
addr="epoche" | ||
title="Epoche">Epoche</fr:link></fr:author></fr:authors></fr:frontmatter><fr:mainmatter><fr:p><fr:code>std::move</fr:code> is a function template in cpp standred library. It converts a lvalue to rvalue reference.</fr:p></fr:mainmatter><fr:backmatter /></fr:tree></fr:mainmatter><fr:backmatter><fr:tree | ||
toc="false" | ||
numbered="false" | ||
show-heading="true" | ||
show-metadata="false" | ||
expanded="true" | ||
root="false" | ||
xmlns:fr="http://www.jonmsterling.com/jms-005P.xml"><fr:frontmatter><fr:title | ||
text="Backlinks">Backlinks</fr:title><fr:authors /></fr:frontmatter><fr:mainmatter><fr:tree | ||
toc="true" | ||
numbered="false" | ||
show-heading="true" | ||
show-metadata="true" | ||
expanded="false" | ||
root="true" | ||
xmlns:fr="http://www.jonmsterling.com/jms-005P.xml"><fr:frontmatter><fr:anchor>245</fr:anchor><fr:addr | ||
type="user">epoche-0001</fr:addr><fr:route>index.xml</fr:route><fr:title | ||
text="Epoche’s forest">Epoche’s forest</fr:title><fr:date><fr:year>2024</fr:year><fr:month>9</fr:month><fr:day>16</fr:day></fr:date><fr:authors><fr:author><fr:link | ||
type="local" | ||
href="epoche.xml" | ||
addr="epoche" | ||
title="Epoche">Epoche</fr:link></fr:author></fr:authors></fr:frontmatter><fr:mainmatter><fr:p>This is my forest, which is <fr:link | ||
type="external" | ||
href="https://www.jonmsterling.com/jms-005P.xml">a way of organizing notes</fr:link>. Here is <fr:link | ||
type="external" | ||
href="https://www.jonmsterling.com/jms-009H.xml">a list of other websites organized as forests</fr:link>. Some of the contents here:</fr:p><fr:ul><fr:li><fr:link | ||
type="local" | ||
href="sponge-0001.xml" | ||
addr="sponge-0001" | ||
title="Sponge Lab Notes">Sponge Lab Notes</fr:link></fr:li> | ||
<fr:li><fr:link | ||
type="local" | ||
href="move-0001.xml" | ||
addr="move-0001" | ||
title="Move Semantics in cpp">Move Semantics in cpp</fr:link></fr:li></fr:ul><fr:p>You can also visit my <fr:link | ||
type="local" | ||
href="epoche.xml" | ||
addr="epoche" | ||
title="Epoche">contributor page</fr:link> to see a list of my trees.</fr:p><fr:tree | ||
toc="true" | ||
numbered="true" | ||
show-heading="true" | ||
show-metadata="false" | ||
expanded="true" | ||
root="false" | ||
xmlns:fr="http://www.jonmsterling.com/jms-005P.xml"><fr:frontmatter><fr:anchor>247</fr:anchor><fr:addr | ||
type="user">epoche-0002</fr:addr><fr:route>epoche-0002.xml</fr:route><fr:title | ||
text="Learning progress on evergreen notes in forester">Learning progress on evergreen notes in forester</fr:title><fr:date><fr:year>2024</fr:year><fr:month>9</fr:month><fr:day>16</fr:day></fr:date><fr:authors><fr:author><fr:link | ||
type="local" | ||
href="epoche.xml" | ||
addr="epoche" | ||
title="Epoche">Epoche</fr:link></fr:author></fr:authors></fr:frontmatter><fr:mainmatter><fr:p><fr:ul><fr:li><fr:link | ||
type="external" | ||
href="http://www.jonmsterling.com/jms-007N.xml">Overview of the Forester markup language</fr:link></fr:li> | ||
<fr:li><fr:link | ||
type="external" | ||
href="http://www.jonmsterling.com/jms-007K.xml">Creating your personal biographical tree</fr:link></fr:li></fr:ul></fr:p></fr:mainmatter><fr:backmatter /></fr:tree></fr:mainmatter><fr:backmatter /></fr:tree></fr:mainmatter><fr:backmatter /></fr:tree></fr:backmatter></fr:tree> |
Oops, something went wrong.