<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.explainxkcd.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Egolub</id>
		<title>explain xkcd - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://www.explainxkcd.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Egolub"/>
		<link rel="alternate" type="text/html" href="https://www.explainxkcd.com/wiki/index.php/Special:Contributions/Egolub"/>
		<updated>2026-04-16T15:49:47Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://www.explainxkcd.com/wiki/index.php?title=1553:_Public_Key&amp;diff=98070</id>
		<title>1553: Public Key</title>
		<link rel="alternate" type="text/html" href="https://www.explainxkcd.com/wiki/index.php?title=1553:_Public_Key&amp;diff=98070"/>
				<updated>2015-07-20T12:33:43Z</updated>
		
		<summary type="html">&lt;p&gt;Egolub: /* Explanation */ corrected how signing works&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{comic&lt;br /&gt;
| number    = 1553&lt;br /&gt;
| date      = July 20, 2015&lt;br /&gt;
| title     = Public Key&lt;br /&gt;
| image     = public_key.png&lt;br /&gt;
| titletext = I guess I should be signing stuff, but I've never been sure what to sign. Maybe if I post my private key, I can crowdsource my decisions about what to sign.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Explanation==&lt;br /&gt;
&lt;br /&gt;
In [https://en.wikipedia.org/wiki/Public-key_cryptography Public-key cryptography], two keys are generated for a user.  The public key can be used to encrypt messages, but not decrypt them.  The private key is necessary for decryption.&lt;br /&gt;
&lt;br /&gt;
The public key is designed to be shared.  People share their public keys so anybody can send them an encrypted message.  Cueball has been following this rule.  However, nobody wants to send him encrypted messages.  Cueball contemplates sharing his private key, which would allow anyone to decrypt his messages.  This change would defeat the whole purpose of encryption, and it would not solve Cueball's problem.&lt;br /&gt;
&lt;br /&gt;
The title text refers to another feature of Public-key cryptography: messages can be &amp;quot;signed&amp;quot; with the private key.  These messages can be read by anyone, but readers with the public key can verify that the owner of the private key wrote (or at least signed) the message.  If Cueball published his private key, anybody could sign anything as him.  Once again, this would defeat the purpose of encryption.&lt;br /&gt;
&lt;br /&gt;
==Transcript==&lt;br /&gt;
{{incomplete transcript}}&lt;br /&gt;
&lt;br /&gt;
[In the first panel, Cueball is sitting in a chair and is using a laptop.]&lt;br /&gt;
&lt;br /&gt;
Cueball: I've been posting my public key for 15 years now, but no one has ever asked me for it or used it for anything as far as I can tell.&lt;br /&gt;
&lt;br /&gt;
[Two panels with Cueball thinking silently.]&lt;br /&gt;
&lt;br /&gt;
Cueball: Maybe I should try posting my ''private'' key instead.&lt;br /&gt;
&lt;br /&gt;
{{comic discussion}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cryptography]]&lt;br /&gt;
[[Category:Comics featuring Cueball]]&lt;/div&gt;</summary>
		<author><name>Egolub</name></author>	</entry>

	<entry>
		<id>https://www.explainxkcd.com/wiki/index.php?title=1537:_Types&amp;diff=95338</id>
		<title>1537: Types</title>
		<link rel="alternate" type="text/html" href="https://www.explainxkcd.com/wiki/index.php?title=1537:_Types&amp;diff=95338"/>
				<updated>2015-06-12T12:31:34Z</updated>
		
		<summary type="html">&lt;p&gt;Egolub: /* Explanation */ explaining 2+2 in context of programming languages that allow literals to be changed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{comic&lt;br /&gt;
| number    = 1537&lt;br /&gt;
| date      = June 12, 2015&lt;br /&gt;
| title     = Types&lt;br /&gt;
| image     = types.png&lt;br /&gt;
| titletext = colors.rgb(&amp;quot;blue&amp;quot;) yields &amp;quot;#0000FF&amp;quot;. colors.rgb(&amp;quot;yellowish blue&amp;quot;) yields NaN. colors.sort() yields &amp;quot;rainbow&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Explanation==&lt;br /&gt;
{{incomplete|Initial draft.}}&lt;br /&gt;
&lt;br /&gt;
This comic is a series of programming jokes about a ridiculous new programming language:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;2 + &amp;quot;2&amp;quot;&amp;lt;/code&amp;gt; uses the &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; operator on a number and a string. In a normal language, this would result either the number &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt; (addition), or &amp;lt;code&amp;gt;&amp;quot;22&amp;quot;&amp;lt;/code&amp;gt; (string concatenation); however, the new language converts the string to an integer, adds them to produce &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt; and converts back to a string.&lt;br /&gt;
# &amp;lt;code&amp;gt;&amp;quot;2&amp;quot; + []&amp;lt;/code&amp;gt; adds a string to an array (a list), this time. This first inexplicably converts the string to a number again, and then it literally adds the number to the list by appending it (this would make sense if it was &amp;lt;code&amp;gt;[] + 2&amp;lt;/code&amp;gt;, but usually not the other way around). And then the result is converted to a string again.&lt;br /&gt;
# &amp;lt;code&amp;gt;(2/0)&amp;lt;/code&amp;gt; divides &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and quite reasonably results in &amp;lt;code&amp;gt;NaN&amp;lt;/code&amp;gt; (not a number).&lt;br /&gt;
# &amp;lt;code&amp;gt;(2/0)&amp;lt;/code&amp;gt; adds &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;NaN&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; is &amp;quot;added&amp;quot; to the string &amp;lt;code&amp;gt;&amp;quot;NaN&amp;quot;&amp;lt;/code&amp;gt; (again, the number is converted to a string for apparently no reason), which produces &amp;lt;code&amp;gt;&amp;quot;NaP&amp;quot;&amp;lt;/code&amp;gt;, as if &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; was added to &amp;lt;code&amp;gt;&amp;quot;N&amp;quot;&amp;lt;/code&amp;gt; to produce &amp;lt;code&amp;gt;&amp;quot;P&amp;quot;&amp;lt;/code&amp;gt; (as per alphabetical order).&lt;br /&gt;
# &amp;lt;code&amp;gt;&amp;quot;&amp;quot;+&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; looks like it is concatenating (adding) an empty string to another empty string, which should produce an empty string. However, the entire thing is treated as one string (with the start quote being the first one and the end quote being the very last one), which produces the egregious '&amp;lt;code&amp;gt;&amp;quot;+&amp;quot;&amp;lt;/code&amp;gt;'.&lt;br /&gt;
# &amp;lt;code&amp;gt;[1,2,3]+2&amp;lt;/code&amp;gt; seems to test whether it's sound to append &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; to the list &amp;lt;code&amp;gt;[1,2,3]&amp;lt;/code&amp;gt;, and concludes that it doesn't fit the pattern, returning the boolean value &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
# &amp;lt;code&amp;gt;[1,2,3]+4&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; for much the same reason.&lt;br /&gt;
# &amp;lt;code&amp;gt;2/(2-(3/2+1/2))&amp;lt;/code&amp;gt; is a floating point joke. Floating point numbers are notoriously imprecise. With precise mathematics, &amp;lt;code&amp;gt;(3/2+1/2)&amp;lt;/code&amp;gt; would be exactly 2, hence the entire thing would evaluate to &amp;lt;code&amp;gt;2/0&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;NaN&amp;lt;/code&amp;gt; in Randall's new language. However, the result of &amp;lt;code&amp;gt;(3/2+1/2)&amp;lt;/code&amp;gt; is &amp;quot;just slightly off,&amp;quot; which makes the result &amp;quot;just slightly off&amp;quot; of &amp;lt;code&amp;gt;NaN&amp;lt;/code&amp;gt; (which would be ridiculous in a real language). The ironic thing is that fractions with 2 in the denominator are ''not'' the kind of numbers that typically suffer from floating point impreciseness.&lt;br /&gt;
# &amp;lt;code&amp;gt;range(&amp;quot; &amp;quot;)&amp;lt;/code&amp;gt; normally wouldn't make any sense. However, the new language appears to interpret it as ASCII, and in the ASCII table, character #32 is space, #33 is &amp;lt;code&amp;gt;!&amp;lt;/code&amp;gt;, and #34 is &amp;lt;code&amp;gt;&amp;quot;&amp;lt;/code&amp;gt;. So, instead of interpreting &amp;lt;code&amp;gt;&amp;quot; &amp;quot;&amp;lt;/code&amp;gt; as a string, it seems to be interpreted as &amp;lt;code&amp;gt;34, 32, 34&amp;lt;/code&amp;gt; (in ASCII), and then &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; appears to transform this into &amp;lt;code&amp;gt;34, 33, 32, 33, 34&amp;lt;/code&amp;gt; (the &amp;quot;ranges&amp;quot; between the numbers), which, interpreted as ASCII, becomes &amp;lt;code&amp;gt;['&amp;quot;', '!', ' ', '!', '&amp;quot;']&amp;lt;/code&amp;gt;.&lt;br /&gt;
# &amp;lt;code&amp;gt;+2&amp;lt;/code&amp;gt; appears to be applying a unary &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; to the number &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;, which should just be &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;. However, the code is adding  &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; to the line number &amp;lt;code&amp;gt;10&amp;lt;/code&amp;gt; in this context.&lt;br /&gt;
# &amp;lt;code&amp;gt;2+2&amp;lt;/code&amp;gt; would normally be &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;. However, the interpreter takes this instruction to mean to add the value 2 to the literal value of &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;, making it &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt; and then reports that the work is &amp;quot;Done&amp;quot;.  This can be seen in the subsequent lines where all &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;s are replaced by &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;s.  This could be a reference to languages like Fortran where literals were able to be assigned new values.&lt;br /&gt;
# &amp;lt;code&amp;gt;range(1,5)&amp;lt;/code&amp;gt; would normally return &amp;lt;code&amp;gt;[1, 2, 3, 4, 5]&amp;lt;/code&amp;gt;. However, since the value of &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; has been changed to &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;, it returns &amp;lt;code&amp;gt;[1, 4, 3, 4, 5]&amp;lt;/code&amp;gt;, and this even affects the line number (which is 14 instead of 12).&lt;br /&gt;
# &amp;lt;code&amp;gt;floor(10.5)&amp;lt;/code&amp;gt; should return &amp;lt;code&amp;gt;10&amp;lt;/code&amp;gt; (the &amp;quot;floor&amp;quot; of a decimal number is that number rounded down). However, it instead returns... a picture of the number on a &amp;quot;floor.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Transcript==&lt;br /&gt;
My new language is great, but it has a few quirks regarding type:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 [1]&amp;gt; 2+&amp;quot;2&amp;quot;&lt;br /&gt;
   =&amp;gt; &amp;quot;4&amp;quot;&lt;br /&gt;
 [2]&amp;gt; &amp;quot;2&amp;quot;+[]&lt;br /&gt;
   =&amp;gt; &amp;quot;[2]&amp;quot;&lt;br /&gt;
 [3]&amp;gt; (2/0)&lt;br /&gt;
   =&amp;gt; NaN&lt;br /&gt;
 [4]&amp;gt; (2/0)+2&lt;br /&gt;
   =&amp;gt; NaP&lt;br /&gt;
 [5]&amp;gt; &amp;quot;&amp;quot;+&amp;quot;&amp;quot;&lt;br /&gt;
   =&amp;gt; '&amp;quot;+&amp;quot;'&lt;br /&gt;
 [6]&amp;gt; [1,2,3]+2&lt;br /&gt;
   =&amp;gt; FALSE&lt;br /&gt;
 [7]&amp;gt; [1,2,3]+4&lt;br /&gt;
   =&amp;gt; TRUE&lt;br /&gt;
 [8]&amp;gt; 2/(2-(3/2+1/2))&lt;br /&gt;
   =&amp;gt; NaN.0000000000000013&lt;br /&gt;
 [9]&amp;gt; range(&amp;quot; &amp;quot;)&lt;br /&gt;
   =&amp;gt; ('&amp;quot;','!',&amp;quot; &amp;quot;,&amp;quot;!&amp;quot;,'&amp;quot;')&lt;br /&gt;
[10]&amp;gt; +2&lt;br /&gt;
   =&amp;gt; 12&lt;br /&gt;
[11]&amp;gt; 2+2&lt;br /&gt;
   =&amp;gt; DONE&lt;br /&gt;
[14]&amp;gt; RANGE(1,5)&lt;br /&gt;
   =&amp;gt; (1,4,3,4,5)&lt;br /&gt;
[13]&amp;gt; FLOOR(10.5)&lt;br /&gt;
   =&amp;gt; |&lt;br /&gt;
   =&amp;gt; |&lt;br /&gt;
   =&amp;gt; |&lt;br /&gt;
   =&amp;gt; |&lt;br /&gt;
   =&amp;gt; |___10.5___&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{comic discussion}}&lt;/div&gt;</summary>
		<author><name>Egolub</name></author>	</entry>

	</feed>