https://www.explainxkcd.com/wiki/api.php?action=feedcontributions&user=AfroThundr3007730&feedformat=atomexplain xkcd - User contributions [en]2024-03-29T00:10:36ZUser contributionsMediaWiki 1.30.0https://www.explainxkcd.com/wiki/index.php?title=2071:_Indirect_Detection&diff=1658222071: Indirect Detection2018-11-12T14:12:47Z<p>AfroThundr3007730: /* Explanation */ quick wikilinks in lieu of a full explanation</p>
<hr />
<div>{{comic<br />
| number = 2071<br />
| date = November 12, 2018<br />
| title = Indirect Detection<br />
| image = indirect_detection.png<br />
| titletext = I'm like a prisoner in Plato's Cave, seeing only the shade you throw on the wall.<br />
}}<br />
<br />
==Explanation==<br />
{{incomplete|Created by a PLATONIC PRISONER. Needs details on both the subject of the social media post and further exposition on what throwing shade is. Do NOT delete this tag too soon.}}<br />
<br />
The title text is a pun comparing the shadows of [[Wikipedia:Allegory of the Cave|Plato's cave]] to the practice of "[[Wikipedia:Throwing shade (slang)|throwing shade]]."<br />
<br />
==Transcript==<br />
{{incomplete transcript|Do NOT delete this tag too soon.}}<br />
<br />
: [Social media post]<br />
<br />
: Everyone on here needs to stop laughing about how "adopting pets from a shelter is for losers" and "those animals should all be hunted for sport instead." It's reprehensible on so many levels! First of all...<br />
<br />
: [Caption under the panel]<br />
<br />
: Sometimes, one of my friends posts an angry response to some terrible opinion I've never heard before, and it's a weird indirect way to learn how awful their other friends must be.<br />
<br />
{{comic discussion}}</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=2019:_An_Apple_for_a_Dollar&diff=1600402019: An Apple for a Dollar2018-07-13T17:30:56Z<p>AfroThundr3007730: /* Transcript */ not really incomplete at this point</p>
<hr />
<div>{{comic<br />
| number = 2019<br />
| date = July 13, 2018<br />
| title = An Apple for a Dollar<br />
| image = an_apple_for_a_dollar.png<br />
| titletext = I'd like 0.4608 apples, please.<br />
}}<br />
<br />
==Explanation==<br />
{{incomplete|Created by an APPLE - Please change this comment when editing this page. Do NOT delete this tag too soon.}}<br />
<br />
[[Megan]] is about to buy an apple at a grocery store when she is surprised that the price is exactly one dollar. In most cases in the US, {{w|Sales taxes in the United States|sales tax}} must be taken into account, but most states exempt food sold in grocery stores, so the price comes out to a round value. Megan begins overthinking the whole situation, so the cashier raises the price to an arbitrary non-rounded value, which seems to calm her down.<br />
<br />
Megan's "overthinking" refers to common parameters used in solving science or math questions. A {{w|Frictionless plane}} is a scenario from the writings of Galileo to calculate the movement of an object down an {{w|inclined plane}}. However, his equations did not account for {{w|friction}}.<br />
<br />
"A train leaving Chicago at 40 mph" refers to common math questions, involving trains and solving for the distance required to overtake said train, although this problem involves the rather unrealistic assumption that the train's velocity keeps constant. Like the frictionless plane, this is a common simplification that allows the problem to be solved with quite simple techniques, just like having round quantities (e.g. 1 dollar/apple) eases arithmetic problems. <br />
<br />
;Title text<br />
Apparently Megan only has a dollar, so she would not be able to buy a whole apple at the new price (0.4608 × $2.17 ≈ $1). Stores usually sell whole apples, so asking for a fraction of one is not likely to work out.<br />
<br />
==Transcript==<br />
:[Megan is at the store counter, behind which Ponytail (the cashier) is waiting.]<br />
:Megan: Just this apple, thanks.<br />
:Ponytail: That will be one dollar.<br />
:Megan: Exactly? No tax or anything?<br />
:Ponytail: That's right.<br />
<br />
:[Megan stares at the apple in a frameless panel.]<br />
<br />
:[Scene zooms in on Megan.]<br />
:Ponytail: ...Is that a problem?<br />
:Megan: It's just weird to realize that every other transaction in my life will be more complicated than this.<br />
<br />
:[Scene changes focus to Ponytail behind the counter.]<br />
:Megan: This is like a platonic ideal exchange. An apple for a dollar.<br />
:Ponytail: I see.<br />
<br />
:[Scene changes back to Megan, once again lost in profound contemplation of the apple.]<br />
:Megan: Are we on a frictionless plane? Is a train leaving Chicago at 40 mph? ''Should I solve for something??''<br />
:Ponytail: Okay, apples are $2.17 now.<br />
:Megan: That's... probably better for us both.<br />
<br />
{{comic discussion}}<br />
<br />
[[Category:Comics featuring Megan]]<br />
[[Category:Comics featuring Ponytail]]</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=2019:_An_Apple_for_a_Dollar&diff=1600392019: An Apple for a Dollar2018-07-13T17:21:08Z<p>AfroThundr3007730: /* Explanation */ comma</p>
<hr />
<div>{{comic<br />
| number = 2019<br />
| date = July 13, 2018<br />
| title = An Apple for a Dollar<br />
| image = an_apple_for_a_dollar.png<br />
| titletext = I'd like 0.4608 apples, please.<br />
}}<br />
<br />
==Explanation==<br />
{{incomplete|Created by an APPLE - Please change this comment when editing this page. Do NOT delete this tag too soon.}}<br />
<br />
[[Megan]] is about to buy an apple at a grocery store when she is surprised that the price is exactly one dollar. In most cases in the US, {{w|Sales taxes in the United States|sales tax}} must be taken into account, but most states exempt food sold in grocery stores, so the price comes out to a round value. Megan begins overthinking the whole situation, so the cashier raises the price to an arbitrary non-rounded value, which seems to calm her down.<br />
<br />
Megan's "overthinking" refers to common parameters used in solving science or math questions. A {{w|Frictionless plane}} is a scenario from the writings of Galileo to calculate the movement of an object down an {{w|inclined plane}}. However, his equations did not account for {{w|friction}}.<br />
<br />
"A train leaving Chicago at 40 mph" refers to common math questions, involving trains and solving for the distance required to overtake said train, although this problem involves the rather unrealistic assumption that the train's velocity keeps constant. Like the frictionless plane, this is a common simplification that allows the problem to be solved with quite simple techniques, just like having round quantities (e.g. 1 dollar/apple) eases arithmetic problems. <br />
<br />
;Title text<br />
Apparently Megan only has a dollar, so she would not be able to buy a whole apple at the new price (0.4608 × $2.17 ≈ $1). Stores usually sell whole apples, so asking for a fraction of one is not likely to work out.<br />
<br />
==Transcript==<br />
{{incomplete transcript|Do NOT delete this tag too soon.}}<br />
<br />
:[Megan is at the store counter, behind which Ponytail (the cashier) is waiting.]<br />
:Megan: Just this apple, thanks.<br />
:Ponytail: That will be one dollar.<br />
:Megan: Exactly? No tax or anything?<br />
:Ponytail: That's right.<br />
<br />
:[Megan stares at the apple in a frameless panel.]<br />
<br />
:[Scene zooms in on Megan.]<br />
:Ponytail: ...Is that a problem?<br />
:Megan: It's just weird to realize that every other transaction in my life will be more complicated than this.<br />
<br />
:[Scene changes focus to Ponytail behind the counter.]<br />
:Megan: This is like a platonic ideal exchange. An apple for a dollar.<br />
:Ponytail: I see.<br />
<br />
:[Scene changes back to Megan, once again lost in profound contemplation of the apple.]<br />
:Megan: Are we on a frictionless plane? Is a train leaving Chicago at 40 mph? ''Should I solve for something??''<br />
:Ponytail: Okay, apples are $2.17 now.<br />
:Megan: That's... probably better for us both.<br />
<br />
{{comic discussion}}<br />
<br />
[[Category:Comics featuring Megan]]<br />
[[Category:Comics featuring Ponytail]]</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=User:AfroThundr3007730&diff=160038User:AfroThundr30077302018-07-13T17:17:59Z<p>AfroThundr3007730: Created page with "Nothing to see here..."</p>
<hr />
<div>Nothing to see here...</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=User_talk:AfroThundr3007730&diff=160036User talk:AfroThundr30077302018-07-13T17:17:14Z<p>AfroThundr3007730: </p>
<hr />
<div></div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=2019:_An_Apple_for_a_Dollar&diff=1600352019: An Apple for a Dollar2018-07-13T17:15:38Z<p>AfroThundr3007730: /* Transcript */ typo</p>
<hr />
<div>{{comic<br />
| number = 2019<br />
| date = July 13, 2018<br />
| title = An Apple for a Dollar<br />
| image = an_apple_for_a_dollar.png<br />
| titletext = I'd like 0.4608 apples, please.<br />
}}<br />
<br />
==Explanation==<br />
{{incomplete|Created by an APPLE - Please change this comment when editing this page. Do NOT delete this tag too soon.}}<br />
<br />
[[Megan]] is about to buy an apple at a grocery store when she is surprised that the price is exactly one dollar. In most cases in the US, {{w|Sales taxes in the United States|sales tax}} must be taken into account but most states exempt food sold in grocery stores, so the price comes out to a round value. Megan begins overthinking the whole situation, so the cashier raises the price to an arbitrary non-rounded value, which seems to calm her down.<br />
<br />
Megan's "overthinking" refers to common parameters used in solving science or math questions. A {{w|Frictionless plane}} is a scenario from the writings of Galileo to calculate the movement of an object down an {{w|inclined plane}}. However, his equations did not account for {{w|friction}}.<br />
<br />
"A train leaving Chicago at 40 mph" refers to common math questions, involving trains and solving for the distance required to overtake said train, although this problem involves the rather unrealistic assumption that the train speed keeps constant. Like the frictionless plane, this is a common simplification that allows the problem to be solved with quite simple techniques, just like having round quantities (e.g. 1 dollar/apple) eases arithmetic problems. <br />
<br />
;Title text<br />
Apparently Megan only has a dollar, so she would not be able to buy a whole apple at the new price (0.4608 * $2.17 ≈ $1). Stores usually sell whole apples, so asking for a fraction of one is not likely to work out.<br />
<br />
==Transcript==<br />
{{incomplete transcript|Do NOT delete this tag too soon.}}<br />
<br />
:[Megan is at the store counter, behind which Ponytail (the cashier) is waiting.]<br />
:Megan: Just this apple, thanks.<br />
:Ponytail: That will be one dollar.<br />
:Megan: Exactly? No tax or anything?<br />
:Ponytail: That's right.<br />
<br />
:[Megan stares at the apple in a frameless panel.]<br />
<br />
:[Scene zooms in on Megan.]<br />
:Ponytail: ...Is that a problem?<br />
:Megan: It's just weird to realize that every other transaction in my life will be more complicated than this.<br />
<br />
:[Scene changes focus to Ponytail behind the counter.]<br />
:Megan: This is like a platonic ideal exchange. An apple for a dollar.<br />
:Ponytail: I see.<br />
<br />
:[Scene changes back to Megan, once again lost in profound contemplation of the apple.]<br />
:Megan: Are we on a frictionless plane? Is a train leaving Chicago at 40 mph? ''Should I solve for something??''<br />
:Ponytail: Okay, apples are $2.17 now.<br />
:Megan: That's... probably better for us both.<br />
<br />
{{comic discussion}}<br />
<br />
[[Category:Comics featuring Megan]]<br />
[[Category:Comics featuring Ponytail]]</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=2019:_An_Apple_for_a_Dollar&diff=1600342019: An Apple for a Dollar2018-07-13T17:12:54Z<p>AfroThundr3007730: /* Transcript */ format</p>
<hr />
<div>{{comic<br />
| number = 2019<br />
| date = July 13, 2018<br />
| title = An Apple for a Dollar<br />
| image = an_apple_for_a_dollar.png<br />
| titletext = I'd like 0.4608 apples, please.<br />
}}<br />
<br />
==Explanation==<br />
{{incomplete|Created by an APPLE - Please change this comment when editing this page. Do NOT delete this tag too soon.}}<br />
<br />
[[Megan]] is about to buy an apple at a grocery store when she is surprised that the price is exactly one dollar. In most cases in the US, {{w|Sales taxes in the United States|sales tax}} must be taken into account but most states exempt food sold in grocery stores, so the price comes out to a round value. Megan begins overthinking the whole situation, so the cashier raises the price to an arbitrary non-rounded value, which seems to calm her down.<br />
<br />
Megan's "overthinking" refers to common parameters used in solving science or math questions. A {{w|Frictionless plane}} is a scenario from the writings of Galileo to calculate the movement of an object down an {{w|inclined plane}}. However, his equations did not account for {{w|friction}}.<br />
<br />
"A train leaving Chicago at 40 mph" refers to common math questions, involving trains and solving for the distance required to overtake said train, although this problem involves the rather unrealistic assumption that the train speed keeps constant. Like the frictionless plane, this is a common simplification that allows the problem to be solved with quite simple techniques, just like having round quantities (e.g. 1 dollar/apple) eases arithmetic problems. <br />
<br />
;Title text<br />
Apparently Megan only has a dollar, so she would not be able to buy a whole apple at the new price (0.4608 * $2.17 ≈ $1). Stores usually sell whole apples, so asking for a fraction of one is not likely to work out.<br />
<br />
==Transcript==<br />
{{incomplete transcript|Do NOT delete this tag too soon.}}<br />
<br />
:[Megan is at the store counter, behind which Ponytail (the cashier) is waiting.]<br />
:Megan: Just this apple, thanks.<br />
:Ponytail: That will be one dollar.<br />
:Megan: Exactly? No tax or anything?<br />
:Ponytail: That's right.<br />
<br />
:[Megan stares at the apple in a frameless panel.]<br />
<br />
:[Scene zooms in on Megan.]<br />
:Ponytail: ...Is that a problem?<br />
:Megan: It's just weird to realize that every other transaction in my life will be more complicated than this.<br />
<br />
:[Scene changes focus to Ponytail behind the counter.]<br />
:Megan: This is like a platonic ideal exchange. An appke for a dollar.<br />
:Ponytail: I see.<br />
<br />
:[Scene changes back to Megan, once again lost in profound contemplation of the apple.]<br />
:Megan: Are we on a frictionless plane? Is a train leaving Chicago at 40 mph? ''Should I solve for something??''<br />
:Ponytail: Okay, apples are $2.17 now.<br />
:Megan: That's... probably better for us both.<br />
<br />
{{comic discussion}}<br />
<br />
[[Category:Comics featuring Megan]]<br />
[[Category:Comics featuring Ponytail]]</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=2019:_An_Apple_for_a_Dollar&diff=1600322019: An Apple for a Dollar2018-07-13T17:10:18Z<p>AfroThundr3007730: /* Transcript */ words</p>
<hr />
<div>{{comic<br />
| number = 2019<br />
| date = July 13, 2018<br />
| title = An Apple for a Dollar<br />
| image = an_apple_for_a_dollar.png<br />
| titletext = I'd like 0.4608 apples, please.<br />
}}<br />
<br />
==Explanation==<br />
{{incomplete|Created by an APPLE - Please change this comment when editing this page. Do NOT delete this tag too soon.}}<br />
<br />
[[Megan]] is about to buy an apple at a grocery store when she is surprised that the price is exactly one dollar. In most cases in the US, {{w|Sales taxes in the United States|sales tax}} must be taken into account but most states exempt food sold in grocery stores, so the price comes out to a round value. Megan begins overthinking the whole situation, so the cashier raises the price to an arbitrary non-rounded value, which seems to calm her down.<br />
<br />
Megan's "overthinking" refers to common parameters used in solving science or math questions. A {{w|Frictionless plane}} is a scenario from the writings of Galileo to calculate the movement of an object down an {{w|inclined plane}}. However, his equations did not account for {{w|friction}}.<br />
<br />
"A train leaving Chicago at 40 mph" refers to common math questions, involving trains and solving for the distance required to overtake said train, although this problem involves the rather unrealistic assumption that the train speed keeps constant. Like the frictionless plane, this is a common simplification that allows the problem to be solved with quite simple techniques, just like having round quantities (e.g. 1 dollar/apple) eases arithmetic problems. <br />
<br />
;Title text<br />
Apparently Megan only has a dollar, so she would not be able to buy a whole apple at the new price (0.4608 * $2.17 ≈ $1). Stores usually sell whole apples, so asking for a fraction of one is not likely to work out.<br />
<br />
==Transcript==<br />
{{incomplete transcript|Do NOT delete this tag too soon.}}<br />
<br />
:[Megan is at the store counter, behind which Ponytail (the cashier) is waiting.]<br />
:Megan: Just this apple, thanks.<br />
:Ponytail: That will be one dollar.<br />
:Megan: Exactly? No tax or anything?<br />
:Ponytail: That's right.<br />
<br />
:[Megan stares at the apple, contemplating the meaning of life.]<br />
<br />
:[Scene zooms in on Megan.]<br />
:Ponytail: ...Is that a problem?<br />
:Megan: It's just weird to realize that every other transaction in my life will be more complicated than this.<br />
<br />
:[Scene changes focus to Ponytail behind the counter.]<br />
:Megan: This is like a platonic ideal exchange. An appke for a dollar.<br />
:Ponytail: I see.<br />
<br />
:[Scene changes back to Megan, once again lost in profound contemplation of the apple.]<br />
:Megan: Are we on a frictionless plane? Is a train leaving Chicago at 40MPH? Should I solve for something??<br />
:Ponytail: Okay, apples are $2.17 now.<br />
:Megan: That's... probably better for us both.<br />
<br />
{{comic discussion}}<br />
<br />
[[Category:Comics featuring Megan]]<br />
[[Category:Comics featuring Ponytail]]</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=2019:_An_Apple_for_a_Dollar&diff=1600302019: An Apple for a Dollar2018-07-13T17:09:16Z<p>AfroThundr3007730: Undo revision 160028 by AfroThundr3007730 (talk)proper formatting this time</p>
<hr />
<div>{{comic<br />
| number = 2019<br />
| date = July 13, 2018<br />
| title = An Apple for a Dollar<br />
| image = an_apple_for_a_dollar.png<br />
| titletext = I'd like 0.4608 apples, please.<br />
}}<br />
<br />
==Explanation==<br />
{{incomplete|Created by an APPLE - Please change this comment when editing this page. Do NOT delete this tag too soon.}}<br />
<br />
[[Megan]] is about to buy an apple at a grocery store when she is surprised that the price is exactly one dollar. In most cases in the US, {{w|Sales taxes in the United States|sales tax}} must be taken into account but most states exempt food sold in grocery stores, so the price comes out to a round value. Megan begins overthinking the whole situation, so the cashier raises the price to an arbitrary non-rounded value, which seems to calm her down.<br />
<br />
Megan's "overthinking" refers to common parameters used in solving science or math questions. A {{w|Frictionless plane}} is a scenario from the writings of Galileo to calculate the movement of an object down an {{w|inclined plane}}. However, his equations did not account for {{w|friction}}.<br />
<br />
"A train leaving Chicago at 40 mph" refers to common math questions, involving trains and solving for the distance required to overtake said train, although this problem involves the rather unrealistic assumption that the train speed keeps constant. Like the frictionless plane, this is a common simplification that allows the problem to be solved with quite simple techniques, just like having round quantities (e.g. 1 dollar/apple) eases arithmetic problems. <br />
<br />
;Title text<br />
Apparently Megan only has a dollar, so she would not be able to buy a whole apple at the new price (0.4608 * $2.17 ≈ $1). Stores usually sell whole apples{{Citation needed}}, so asking for a fraction of one is not likely to work out.<br />
<br />
==Transcript==<br />
{{incomplete transcript|Do NOT delete this tag too soon.}}<br />
:[Megan is at the store counter, where Ponytail (the cashier) is waiting.]<br />
:Megan: Just this apple, thanks.<br />
:Ponytail: That will be one dollar.<br />
:Megan: Exactly? No tax or anything?<br />
:Ponytail: That's right.<br />
<br />
:[Megan stares at the apple, contemplating the meaning of life.]<br />
<br />
:[Scene zooms in on Megan.]<br />
:Ponytail: ...Is that a problem?<br />
:Megan: It's just weird to realize that every other transaction in my life will be more complicated than this.<br />
<br />
:[Scene changes focus to Ponytail behind the counter.]<br />
:Megan: This is like a platonic ideal exchange. An appke for a dollar.<br />
:Ponytail: I see.<br />
<br />
:[Scene changes back to Megan, once again lost in profound contemplation of the apple.]<br />
:Megan: Are we on a frictionless plane? Is a train leaving Chicago at 40MPH? Should I solve for something??<br />
:Ponytail: Okay, apples are $2.17 now.<br />
:Megan: That's... probably better for us both.<br />
<br />
{{comic discussion}}<br />
<br />
[[Category:Comics featuring Megan]]<br />
[[Category:Comics featuring Ponytail]]</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=2019:_An_Apple_for_a_Dollar&diff=1600282019: An Apple for a Dollar2018-07-13T17:07:24Z<p>AfroThundr3007730: /* Transcript */ formatting</p>
<hr />
<div>{{comic<br />
| number = 2019<br />
| date = July 13, 2018<br />
| title = An Apple for a Dollar<br />
| image = an_apple_for_a_dollar.png<br />
| titletext = I'd like 0.4608 apples, please.<br />
}}<br />
<br />
==Explanation==<br />
{{incomplete|Created by an APPLE - Please change this comment when editing this page. Do NOT delete this tag too soon.}}<br />
<br />
[[Megan]] is about to buy an apple at a grocery store when she is surprised that the price is exactly one dollar. In most cases in the US, {{w|Sales taxes in the United States|sales tax}} must be taken into account but most states exempt food sold in grocery stores, so the price comes out to a round value. Megan begins overthinking the whole situation, so the cashier raises the price to an arbitrary non-rounded value, which seems to calm her down.<br />
<br />
Megan's "overthinking" refers to common parameters used in solving science or math questions. A {{w|Frictionless plane}} is a scenario from the writings of Galileo to calculate the movement of an object down an {{w|inclined plane}}. However, his equations did not account for {{w|friction}}.<br />
<br />
"A train leaving Chicago at 40mph" refers to common math questions, involving trains and solving for the distance required to overtake said train, although this problem involves the rather unrealistic assumption that the train speed keeps constant. Like the frictionless plane, this is a common simplification that allows the problem to be solved with quite simple techniques, just like having round quantities (e.g. 1 dollar/apple) eases arithmetic problems. <br />
<br />
;Title text<br />
Apparently Megan only has a dollar, so she would not be able to buy a whole apple at the new price (0.4608 * $2.17 ≈ $1). Stores usually sell whole apples{{Citation needed}}, so asking for a fraction of one is not likely to work out.<br />
<br />
==Transcript==<br />
{{incomplete transcript|Do NOT delete this tag too soon.}}<br />
<br />
<br />
[Megan is at the store counter, where Ponytail (the cashier) is waiting.]<br />
<br />
Megan: Just this apple, thanks.<br />
<br />
Ponytail: That will be one dollar.<br />
<br />
Megan: Exactly? No tax or anything?<br />
<br />
Ponytail: That's right.<br />
<br />
<br />
<br />
[Megan stares at the apple, contemplating the meaning of life.]<br />
<br />
<br />
<br />
[Scene zooms in on Megan.]<br />
<br />
Ponytail: ...Is that a problem?<br />
<br />
Megan: It's just weird to realize that every other transaction in my life will be more complicated than this.<br />
<br />
<br />
<br />
[Scene changes focus to Ponytail behind the counter.]<br />
<br />
Megan: This is like a platonic ideal exchange. An appke for a dollar.<br />
<br />
Ponytail: I see.<br />
<br />
<br />
<br />
[Scene changes back to Megan, once again lost in profound contemplation of the apple.]<br />
<br />
Megan: Are we on a frictionless plane? Is a train leaving Chicago at 40MPH? Should I solve for something??<br />
<br />
Ponytail: Okay, apples are $2.17 now.<br />
<br />
Megan: That's... probably better for us both.<br />
<br />
{{comic discussion}}<br />
<br />
[[Category:Comics featuring Megan]]<br />
[[Category:Comics featuring Ponytail]]</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=2019:_An_Apple_for_a_Dollar&diff=1600272019: An Apple for a Dollar2018-07-13T17:06:00Z<p>AfroThundr3007730: /* Transcript */ added transcript</p>
<hr />
<div>{{comic<br />
| number = 2019<br />
| date = July 13, 2018<br />
| title = An Apple for a Dollar<br />
| image = an_apple_for_a_dollar.png<br />
| titletext = I'd like 0.4608 apples, please.<br />
}}<br />
<br />
==Explanation==<br />
{{incomplete|Created by an APPLE - Please change this comment when editing this page. Do NOT delete this tag too soon.}}<br />
<br />
[[Megan]] is about to buy an apple at a grocery store when she is surprised that the price is exactly one dollar. In most cases in the US, {{w|Sales taxes in the United States|sales tax}} must be taken into account but most states exempt food sold in grocery stores, so the price comes out to a round value. Megan begins overthinking the whole situation, so the cashier raises the price to an arbitrary non-rounded value, which seems to calm her down.<br />
<br />
Megan's "overthinking" refers to common parameters used in solving science or math questions. A {{w|Frictionless plane}} is a scenario from the writings of Galileo to calculate the movement of an object down an {{w|inclined plane}}. However, his equations did not account for {{w|friction}}.<br />
<br />
"A train leaving Chicago at 40mph" refers to common math questions, involving trains and solving for the distance required to overtake said train, although this problem involves the rather unrealistic assumption that the train speed keeps constant. Like the frictionless plane, this is a common simplification that allows the problem to be solved with quite simple techniques, just like having round quantities (e.g. 1 dollar/apple) eases arithmetic problems. <br />
<br />
;Title text<br />
Apparently Megan only has a dollar, so she would not be able to buy a whole apple at the new price (0.4608 * $2.17 ≈ $1). Stores usually sell whole apples{{Citation needed}}, so asking for a fraction of one is not likely to work out.<br />
<br />
==Transcript==<br />
{{incomplete transcript|Do NOT delete this tag too soon.}}<br />
[Megan is at the store counter, where Ponytail (the cashier) is waiting.]<br />
Megan: Just this apple, thanks.<br />
Ponytail: That will be one dollar.<br />
Megan: Exactly? No tax or anything?<br />
Ponytail: That's right.<br />
<br />
[Megan stares at the apple, contemplating the meaning of life.]<br />
<br />
[Scene zooms in on Megan.]<br />
Ponytail: ...Is that a problem?<br />
Megan: It's just weird to realize that every other transaction in my life will be more complicated than this.<br />
<br />
[Scene changes focus to Ponytail behind the counter.]<br />
Megan: This is like a platonic ideal exchange. An appke for a dollar.<br />
Ponytail: I see.<br />
<br />
[Scene changes back to Megan, once again lost in profound contemplation of the apple.]<br />
Megan: Are we on a frictionless plane? Is a train leaving Chicago at 40MPH? Should I solve for something??<br />
Ponytail: Okay, apples are $2.17 now.<br />
Megan: That's... probably better for us both.<br />
<br />
{{comic discussion}}<br />
<br />
[[Category:Comics featuring Megan]]<br />
[[Category:Comics featuring Ponytail]]</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=Talk:2019:_An_Apple_for_a_Dollar&diff=160022Talk:2019: An Apple for a Dollar2018-07-13T16:46:03Z<p>AfroThundr3007730: sig fixes</p>
<hr />
<div><!--Please sign your posts with ~~~~ and don't delete this text. New comments should be added at the bottom.--><br />
Is this a reference to how shops in America don't include VAT in price labels?<br />
(It's my first time trying to contribute to this so sorry if I get some format stuff wrong){{unsigned ip|141.101.107.132}}<br />
<br />
:Yeah, Randall would love it in Europe! (you should sign your posts with <nowiki>~~~~</nowiki> though) --[[Special:Contributions/172.68.51.22|172.68.51.22]] 15:53, 13 July 2018 (UTC)<br />
<br />
:It is a commentary on overly complex taxes and fees on things that really shouldn't have fees applied (I can think of hardly anything that really should have a fee applied, or be taxed really, but that's a political-philosophical discussion for another space-time coordinate) [[Special:Contributions/172.69.70.239|172.69.70.239]] 16:18, 13 July 2018 (UTC) Sam<br />
<br />
:We call it sales tax, and it doesn't have the chaining-effect on every stage of production that VAT does, but yeah. It's rarely calculated into the sticker price. [[Special:Contributions/162.158.106.246|162.158.106.246]] 16:27, 13 July 2018 (UTC)<br />
<br />
Is food taxed where Randall lives? It's not where I live and I was under the impression that it's not in most of the US. It's not uncommon for me to go to a store after working out and buying a protein bar for exactly $1. {{unsigned ip|162.158.63.22}}<br />
<br />
:Living smack-dab in the center of the US and I can tell you that pretty much everything has a sales tax. [[Special:Contributions/172.69.70.239|172.69.70.239]] 16:18, 13 July 2018 (UTC) Sam<br />
::Groceries, such as apples, should not be taxed, but I believe that processed foods are taxed. Actually, nevermind, this is state dependent: [https://blog.taxjar.com/states-grocery-items-tax-exempt/] [[Special:Contributions/172.68.46.137|172.68.46.137]] 16:27, 13 July 2018 (UTC)<br />
<br />
:In my experience food is indeed taxed like everything else, but businesses will sometimes set the actual price of the item slightly below $1, such that the tax makes it cost exactly $1. The example that comes to mind is the soft-serve ice cream at IKEA. [[User:PotatoGod|PotatoGod]] ([[User talk:PotatoGod|talk]]) 16:31, 13 July 2018 (UTC)<br />
::That has been my experience as well, although it varies by region. — AfroThundr <sup>([[User:AfroThundr3007730|u]] · [[User talk:AfroThundr3007730|t]] · [[Special:Contributions/AfroThundr3007730|c]])</sup> 16:37, 13 July 2018 (UTC)<br />
<br />
The closest thing this can relate to a for a European is buying dinners or hotel rooms if you come from a corrupt East or Southern European country where "tourists tax" is a real thing and added out of nowhere on top of the regular price, because the regular price only have to include regular taxes.[[Special:Contributions/162.158.202.58|162.158.202.58]] 16:39, 13 July 2018 (UTC)</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=Talk:2019:_An_Apple_for_a_Dollar&diff=160018Talk:2019: An Apple for a Dollar2018-07-13T16:37:50Z<p>AfroThundr3007730: comment</p>
<hr />
<div><!--Please sign your posts with ~~~~ and don't delete this text. New comments should be added at the bottom.--><br />
Is this a reference to how shops in America don't include VAT in price labels?<br />
(It's my first time trying to contribute to this so sorry if I get some format stuff wrong)<br />
<br />
:Yeah, Randall would love it in Europe! (you should sign your posts with <nowiki>~~~~</nowiki> though) --[[Special:Contributions/172.68.51.22|172.68.51.22]] 15:53, 13 July 2018 (UTC)<br />
<br />
:It is a commentary on overly complex taxes and fees on things that really shouldn't have fees applied (I can think of hardly anything that really should have a fee applied, or be taxed really, but that's a political-philosophical discussion for another space-time coordinate) [[Special:Contributions/172.69.70.239|172.69.70.239]] 16:18, 13 July 2018 (UTC) Sam<br />
<br />
:We call it sales tax, and it doesn't have the chaining-effect on every stage of production that VAT does, but yeah. It's rarely calculated into the sticker price. [[Special:Contributions/162.158.106.246|162.158.106.246]] 16:27, 13 July 2018 (UTC)<br />
<br />
Is food taxed where Randall lives? It's not where I live and I was under the impression that it's not in most of the US. It's not uncommon for me to go to a store after working out and buying a protein bar for exactly $1. <nowiki>~~~~</nowiki><br />
<br />
:Living smack-dab in the center of the US and I can tell you that pretty much everything has a sales tax. [[Special:Contributions/172.69.70.239|172.69.70.239]] 16:18, 13 July 2018 (UTC) Sam<br />
::Groceries, such as apples, should not be taxed, but I believe that processed foods are taxed. Actually, nevermind, this is state dependent: [https://blog.taxjar.com/states-grocery-items-tax-exempt/] [[Special:Contributions/172.68.46.137|172.68.46.137]] 16:27, 13 July 2018 (UTC)<br />
<br />
:In my experience food is indeed taxed like everything else, but businesses will sometimes set the actual price of the item slightly below $1, such that the tax makes it cost exactly $1. The example that comes to mind is the soft-serve ice cream at IKEA. [[User:PotatoGod|PotatoGod]] ([[User talk:PotatoGod|talk]]) 16:31, 13 July 2018 (UTC)<br />
::That has been my experience as well, although it varies by region. — AfroThundr <sup>([[User:AfroThundr3007730|u]] · [[User talk:AfroThundr3007730|t]] · [[Special:Contributions/AfroThundr3007730|c]])</sup> 16:37, 13 July 2018 (UTC)</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=2019:_An_Apple_for_a_Dollar&diff=1600142019: An Apple for a Dollar2018-07-13T16:30:40Z<p>AfroThundr3007730: /* Explanation */ text</p>
<hr />
<div>{{comic<br />
| number = 2019<br />
| date = July 13, 2018<br />
| title = An Apple for a Dollar<br />
| image = an_apple_for_a_dollar.png<br />
| titletext = I'd like 0.4608 apples, please.<br />
}}<br />
<br />
==Explanation==<br />
{{incomplete|Created by an APPLE - Please change this comment when editing this page. Do NOT delete this tag too soon.}}<br />
<br />
[[Megan]] is about to buy an apple at a grocery store when she is surprised that the price is exactly one dollar. In most cases in the US, sales tax must be taken into account, so the price rarely comes out to a round value. Megan begins overthinking the whole situation, so the cashier raises the price to an arbitrary non-rounded value, which seems to calm her down.<br />
<br />
===Title text===<br />
Apparently Megan only has a dollar, so she would not be able to buy a whole apple at the new price. (0.4608 * $2.17 = $1 (almost)) Stores usually sell whole apples, so asking for a fraction of one is not likely to work out.<br />
<br />
==Transcript==<br />
{{incomplete transcript|Do NOT delete this tag too soon.}}<br />
<br />
{{comic discussion}}</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=2019:_An_Apple_for_a_Dollar&diff=1600082019: An Apple for a Dollar2018-07-13T16:25:06Z<p>AfroThundr3007730: /* Explanation */ first attempt</p>
<hr />
<div>{{comic<br />
| number = 2019<br />
| date = July 13, 2018<br />
| title = An Apple for a Dollar<br />
| image = an_apple_for_a_dollar.png<br />
| titletext = I'd like 0.4608 apples, please.<br />
}}<br />
<br />
==Explanation==<br />
{{incomplete|Created by an APPLE - Please change this comment when editing this page. Do NOT delete this tag too soon.}}<br />
<br />
[[Megan]] is about to buy an apple at a grocery store when she is surprised that the price is exactly one dollar. In most cases sales tax must be taken into account, so the price rarely comes out to a round value. Megan begins overthinking the whole situation, so the cashier raises the price to an arbitrary non-rounded value, which seems to calm her down.<br />
<br />
===Title text===<br />
Apparently Megan only has a dollar, so she would not be able to buy a whole apple at the new price. (0.4608 * $2.17 = $1 (almost)) Stores usually sell whole apples, so asking for a fraction of one is not likely to work out.<br />
<br />
==Transcript==<br />
{{incomplete transcript|Do NOT delete this tag too soon.}}<br />
<br />
{{comic discussion}}</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=Talk:1961:_Interaction&diff=153250Talk:1961: Interaction2018-02-28T22:41:17Z<p>AfroThundr3007730: le comment</p>
<hr />
<div><!--Please sign your posts with ~~~~ and don't delete this text. New comments should be added at the bottom.--><br />
<br />
Wait... in the title text is he making fun of us!? [[User:DPS2004|DPS2004&#39;); DROP TABLE users;--]] ([[User talk:DPS2004|talk]]) 15:22, 28 February 2018 (UTC)<br />
:More like all of us socially challenged nerds in general. Who, coincidentally, make up a sizeable percentage of XKCD readers. Love the username, by the way. — [[User:AfroThundr3007730|AfroThundr]] <sup>(''[[User_talk:AfroThundr3007730|talk]]'')</sup> 22:41, 28 February 2018 (UTC)</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=Talk:1654:_Universal_Install_Script&diff=114995Talk:1654: Universal Install Script2016-03-16T12:30:18Z<p>AfroThundr3007730: Comment.</p>
<hr />
<div><!--Please sign your posts with ~~~~--><br />
<br />
A few comments:<br />
<br />
* curl | sh is still a common way to install things like package managers. Until you have Homebrew, or pip (for older versions of Python that didn't bootstrap it), etc., you can't use a package manager to install it, so they usually give you a one-liner to download and run a shell script that installs the package manager. Of course this isn't an issue for linux distros (which, unlike OS X, come with a built-in package manager).<br />
* Mac users probably only interact with Steam through its GUI, but on linux, running steamcmd is more common. And this command will install a game that's in your library but not downloaded yet.<br />
* I don't know why _only_ apt gets a sudo, but for brew, and for typical installations of Python on a Mac, you don't want or need sudo; they encourage you to leave the relevant directory writable by your normal user account.<br />
* This script only handles the popular package managers on OS X and current popular linux distros. No port for FreeBSD, no Choco for Windows, etc. In fact, if you try it on Windows, you should get an error message telling you that you've ruined the joke by trying to extend it.<br />
<br />
--[[Special:Contributions/162.158.255.82|162.158.255.82]] 10:44, 11 March 2016 (UTC)<br />
<br />
Also, docker is a deployment tool for deploying isolated, complete applications. For example, instead of just installing the Python scripts to run your web server behind nginx, you'd deploy nginx, Python, the modules you need for each, the appropriate configurations, a variety of tools the server depends on, and your scripts all as one big hunk of stuff. The docker website probably explains it better. :) --[[Special:Contributions/162.158.255.82|162.158.255.82]] 10:50, 11 March 2016 (UTC)<br />
<br />
;Errors<br />
<br />
He forgot the .git on the end of the git clone command. <br />
<br />
--[[Special:Contributions/173.245.54.53|173.245.54.53]] 11:16, 11 March 2016 (UTC)<br />
<br />
: Actually, the command works fine anyway. I don't know whether it's git or GitHub which works around this. [[Special:Contributions/141.101.75.161|141.101.75.161]] 11:46, 11 March 2016 (UTC)<br />
<br />
:: Really? I've been typing 4 more characters than I needed to all this time. [[Special:Contributions/173.245.54.10|173.245.54.10]] 16:29, 11 March 2016 (UTC)<br />
<br />
::: Yes you have -- and for information, it is git that does the work around [[User:Spongebog|Spongebob]] ([[User talk:Spongebog|talk]]) 22:44, 11 March 2016 (UTC)<br />
<br />
Also, the TLD in the curl. And, the install script would probably be at /install.sh, and use sh not bash. <br />
<br />
Sh is generally preferred in scripting anyway since it comes on all *nix systems by default. Bash is on a very large number of systems, but not all. <br />
<br />
Apt-get should have the -y flag. <br />
<br />
If installing a program, npm should be given the -g flag to install globally instead of just in this directory. <br />
<br />
Most programs print errors (as would arise if a package did not exist) to the console even if they are run with an & to indicate it should not be attached to the session. In this case, it should be &>/dev/null. <br />
<br />
The program as a whole ignores previous programs and continues anyway. If it was found in one package manager, it would be a a very bad idea to write over it with another package manager's copy. This is part of the point of the comic, as is noted in the title text, but it's still an error. <br />
--[[Special:Contributions/173.245.54.53|173.245.54.53]] 11:38, 11 March 2016 (UTC)<br />
<br />
He forgot cpanm. :) [[Special:Contributions/108.162.217.17|108.162.217.17]] 16:02, 11 March 2016 (UTC)<br />
<br />
He also left off emerge for Gentoo users. [[Special:Contributions/198.41.235.47|198.41.235.47]] 19:08, 11 March 2016 (UTC)<br />
<br />
;Question<br />
<br />
That whooshing sound you heard was the Linux-y stuff going way over my head, but could part of the joke be that he's trying to install money? With all the $1's in the script? [[Special:Contributions/173.245.54.53|173.245.54.53]] 15:47, 11 March 2016 (UTC)<br />
:No, all those $ are just part of the scripting language -- the $1's get replaced with the name of the program you're trying to install. There are so many $ simply because he's included so many install commands, each one of which needs the name of the program.[[User:N0lqu|-boB]] ([[User talk:N0lqu|talk]]) 16:00, 11 March 2016 (UTC)<br />
::On that note, would any of these fail or would it not just be easier to use `$@`? [[User:Xerxesbeat|xerxesbeat]] ([[User talk:Xerxesbeat|talk]]) 19:27, 11 March 2016 (UTC)<br />
::: `$@` and `$1` are different things -- `$@` replaces with all the parameters to the script where `$1` only does the first one -- for the script to have **any** change of working he will need just (exactly) the first one [[User:Spongebog|Spongebob]] ([[User talk:Spongebog|talk]]) 22:48, 11 March 2016 (UTC)<br />
<br />
;Inaccurate Description of &&<br />
<br />
The description formerly described the usage of &&:<br />
<br />
"This bug could be indicative that Randall wanted to use && throughout the whole script. This would make the installation trying sequentially and the first successful install stops the script and will not install multiple versions of the same software."<br />
<br />
This is false. The && operator will *quit* when it encounters the first command that *fails*. The operator that behaves as described is ||. With that said, it is obvious that Randall did not intend this, especially because the title text mentions what happens when multiple versions are installed.<br />
<br />
[[Special:Contributions/108.162.216.64|108.162.216.64]] 16:23, 11 March 2016 (UTC)<br />
<br />
Won't work on Arch [[User:Mikemk|Mikemk]] ([[User talk:Mikemk|talk]]) 00:05, 12 March 2016 (UTC)<br />
:i am very disappointed that that does not read "doesn't work..." --[[Special:Contributions/162.158.153.29|162.158.153.29]] 12:58, 14 March 2016 (UTC)<br />
<br />
; Added clarification on bash scripts<br />
<br />
I've added a few lines addressing the concerns formerly displayed in the incomplete tag. Hopefully my edits will be easier for the layman to understand. Please let me know if this needs further attention. [[User:AfroThundr3007730|AfroThundr3007730]] ([[User talk:AfroThundr3007730|talk]]) 12:30, 16 March 2016 (UTC)</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=1654:_Universal_Install_Script&diff=1149941654: Universal Install Script2016-03-16T12:26:09Z<p>AfroThundr3007730: /* Explanation */ Modified incomplete tag, see talk.</p>
<hr />
<div>{{comic<br />
| number = 1654<br />
| date = March 11, 2016<br />
| title = Universal Install Script<br />
| image = universal_install_script.png<br />
| titletext = The failures usually don't hurt anything, and if it installs several versions, it increases the chance that one of them is right. (Note: The 'yes' command and '2>/dev/null' are recommended additions.)<br />
}}<br />
<br />
==Explanation==<br />
{{incomplete|<!-- Small detail, but the file extension ".sh" in the "Install.sh" program is never explained/mentioned. For people who never uses/know of this type of file, the program name could be "read" as "Installish" - could this be a pun? What does "run this script as an argument" mean and how does this then accept the program name that substitutes "$1"? The first line of the program "#!/bin/bash" is neither mentioned or explained not even in the trivia. -->}}<br />
Most users of computers today are used to simple, easy installation of programs. You just download a {{w|.exe}} or a {{w|Installer_(OS_X)#Installer_package|.pkg}}, double click it, and do what it says. Sometimes you don't even have to install anything at all, and it runs without any installation.<br />
<br />
However, when things are more "homebrew", for example downloading source code, things are more complicated. Under {{w|Unix-like}} systems, which this universal install script is designed for, you may have to work with "build environments" and "{{w|makefiles}}", and command line tools. To make this process simpler, there exist repositories of programs which host either packages of source code and the things needed to build it or the pre-built programs. When you download the package, it automatically does most of the work of building the code into something executable if necessary and then installing it. However, there are many such repositories, such as "{{w|pip (package manager)|pip}}" and "brew", among others listed in the comic. If you only know the name of a program or package, you may not know in which repository(ies) it resides.<br />
<br />
The <code>install.sh</code> file provided in the comic is a {{w|shell script}}, which attempts to fix this problem by acting as a "universal install script" that contains a lot of common install commands used in various Unix-like systems. This script in particular is interpreted by the {{w|Bourne Again Shell}} (Bash), which is denoted by the <code>#!/bin/bash</code> in the first line. In between each of the install commands in the script is the & character, which in {{w|POSIX}}-compatible {{w|Unix shell|shells}} (including {{w|Bash (Unix shell)|Bash}}, a popular shell scripting language) means it should continue to run the next command without waiting for the first command to finish, also known as "running in the background". This has the effect of running all the install commands simultaneously; all output and error text provided by them will be mixed together as they are all displaying on the screen around the same time.<br />
<br />
The script accepts the name of a program or package as an argument when you run it. This value is then referenced as "$1" (argument number 1). Everywhere the script says "$1", it substitutes in the name of the package you gave it. The end result is the name being tried against a large number of software repositories and package managers, and hopefully, at least one of them will be appropriate and the program will be successfully installed. Near the end, it even tries changing the current working directory to that which is assumed to hold the package to be installed, and then runs several commands which build the program from source code.<br />
<br />
All in all, this script would probably work; it runs many standard popular repository programs and package managers, and runs the nearly-universal commands needed to build a program. Most of the commands would simply give an error and exit, but hopefully the correct one will proceed with the install.<br />
<br />
One of the more subtle jokes in the comic is the inclusion of <code>apt-get</code> and <code>sudo apt-get</code> in the same script. Good unix practice dictates never logging in as root; instead you stay logged in as your normal user, and run system admin accounts via <code>sudo program name</code>. This prevents accidental errors and enables logging of all sensitive commands. A side effect of this, however, is that an administrator may forget to prefix her command with <code>sudo</code>, and re-running it properly the second time. This is a common joke in the Linux community, an example of which can be found at [https://twitter.com/liamosaur/status/506975850596536320 viral tweet] which shows a humorous workaround for the issue.<br />
<br />
Since Randall's script does not use sudo for any but the <code>apt-get</code> command, there are two possibilities: the script itself was run via the root user or via sudo ,in which case the <code>sudo apt-get</code> is not needed, or the script was run as a normal user, in which case all of the commands will fail (due to lacking necessary permissions) with the possible exception of the <code>sudo apt-get</code> one.<br />
<br />
Sudo has also been used both by [[Randall]] in [[149: Sandwich]] and by Jason Fox to force Randall to let him appear on xkcd with [[824: Guest Week: Bill Amend (FoxTrot)]].<br />
<br />
The tool <code>curl</code> downloads files from the network (e.g., the Internet). For example <code>curl http://xkcd.com/</code> downloads and displays the xkcd HTML source. The pipe <code>|</code> in the script attaches the output of the command before the pipe to the input of the command after the pipe, thus running whatever commands exist in the web content. Although this "curl|sh" pattern is a common practice for conveniently installing software, it is considered extremely unwise; you are running untrusted code without validation, there may be a MITM who modifies the code you receive, or the remote system could have been hijacked and the code made malicious. Most local package managers (e.g. <code>apt</code>, <code>yum</code>) offer digitally-signed packages that thwart this problem. You can find many examples of software providers suggesting a <code>curl|sh</code> solution at [https://curlpipesh.tumblr.com/ curlpipesh]<br />
<br />
There appears to be a bug with the & at the end of the "git clone" line; since a git repository typically contains program source code, not executables, it may have been intended to retrieve the source code with git and then compile and install the program in the next line. In this case, the single & should be replaced with &&, an operator that will run the second command only if the first one has completed successfully. This plays into a second bug on the "configure" line, where the placement of the & means that only the "make install" command will be run asynchronously after the "configure" and "make" steps have finished in sequence. To make success as likely as possible, the two lines should be like this:<br />
<br />
git clone <nowiki>https://github.com/</nowiki>"$1"/"$1" && (cd "$1"; ./configure; make; make install) &<br />
<br />
Since all commands are running in the background, any command that requires user input will stop and wait until brought to the foreground. A common request would be for a database password, or if it is allowed to restart services for the installation. This could lead to packages being only partly installed or configured. (See more about using "yes" below.)<br />
<br />
The title text mentions the possibility that the same program may be in multiple repositories, so in this case, the script will download and install several versions, or it may fail on a number of repositories, in which case usually nothing bad happens. Since all the commands come from different operating systems, versions, or distributions, it is not very likely that more than one will work (with the exception of pip/easy_install and the two forms of apt-get) or even exist on the same system. It mentions that adding a way of automatically saying "yes" to questions asked during the different repository-fetching programs' running, by making them read input from another program that writes a (nearly) endless stream of "y"s, could simplify things further. This would not work for any curses-based menus, or to answer any more complicated questions. Adding <code>2>/dev/null</code> to a command redirects the second output stream (the "error stream") to the null device driver, which discards all writes to it, meaning errors (the package not existing) will not be sent to the screen.<br />
<br />
==Transcript==<br />
:[In the panel is a shell script which, unusual for xkcd, uses only lower case. At the top the title of the program is inlaid in the frame, which has been broken here.]<br />
:<big>Install.sh</big><br />
<br />
:<nowiki>#!/bin/bash</nowiki><br />
<br />
:pip install "$1" &<br />
:easy_install "$1" &<br />
:brew install "$1" &<br />
:npm install "$1" &<br />
:yum install "$1" & dnf install "$1" &<br />
:docker run "$1" &<br />
:pkg install "$1" &<br />
:apt-get install "$1" &<br />
:sudo apt-get install "$1" &<br />
:steamcmd +app_update "$1" validate &<br />
:git clone <nowiki>https://github.com/</nowiki>"$1"/"$1" &<br />
:cd "$1";./configure;make;make install &<br />
:curl "$1" | bash &<br />
<br />
==Trivia==<br />
*pip and easy install are package managers for {{w|Python (programming language)|Python}}<br />
*brew is the successor/replacement for {{w|MacPorts}} and a third-party package manager for OS X<br />
*{{w|npm (software)|npm}} is the node package manager that maintains node.js packages<br />
*{{w|Yellowdog Updater, Modified|yum}} is the package management tool for {{w|Red Hat Enterprise Linux}} and some derivatives<br />
*{{w|DNF (software)|dnf}} is the package management tool for {{w|Fedora (operating system)|Fedora}} since version 22<br />
*docker run is a {{w|Docker (software)|Docker}} command that runs a given container (similar to a virtual machine)<br />
*pkg is the package management tool on {{w|Berkeley Software Distribution|BSD systems}}<br />
*apt-get is the package management tool of {{w|Debian}} and derivatives (e.g. Ubuntu)<br />
*steamcmd refers to {{w|Steam (software)|Steam}}, the computer game client<br />
*git is the revision control software used for many projects and gained a lot of traction through the {{w|GitHub}} platform<br />
*configure/make/make install refers to the standard way of compiling software from source (on Linux/Unix)<br />
*curl is a tool for loading data via http:// (i.e. from a website), this data is then pushed to the shell interpreter (in order to install)<br />
**Note: While this is a security nightmare, some projects (like Homebrew) still use it as the preferred or only method of installation.<br />
<br />
{{comic discussion}}<br />
[[Category:Programming]]</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=1654:_Universal_Install_Script&diff=1149921654: Universal Install Script2016-03-16T12:23:52Z<p>AfroThundr3007730: /* Explanation */ grammar</p>
<hr />
<div>{{comic<br />
| number = 1654<br />
| date = March 11, 2016<br />
| title = Universal Install Script<br />
| image = universal_install_script.png<br />
| titletext = The failures usually don't hurt anything, and if it installs several versions, it increases the chance that one of them is right. (Note: The 'yes' command and '2>/dev/null' are recommended additions.)<br />
}}<br />
<br />
==Explanation==<br />
<!-- {{incomplete|Small detail, but the file extension ".sh" in the "Install.sh" program is never explained/mentioned. For people who never uses/know of this type of file, the program name could be "read" as "Installish" - could this be a pun? What does "run this script as an argument" mean and how does this then accept the program name that substitutes "$1"? The first line of the program "#!/bin/bash" is neither mentioned or explained not even in the trivia.}} --><br />
Most users of computers today are used to simple, easy installation of programs. You just download a {{w|.exe}} or a {{w|Installer_(OS_X)#Installer_package|.pkg}}, double click it, and do what it says. Sometimes you don't even have to install anything at all, and it runs without any installation.<br />
<br />
However, when things are more "homebrew", for example downloading source code, things are more complicated. Under {{w|Unix-like}} systems, which this universal install script is designed for, you may have to work with "build environments" and "{{w|makefiles}}", and command line tools. To make this process simpler, there exist repositories of programs which host either packages of source code and the things needed to build it or the pre-built programs. When you download the package, it automatically does most of the work of building the code into something executable if necessary and then installing it. However, there are many such repositories, such as "{{w|pip (package manager)|pip}}" and "brew", among others listed in the comic. If you only know the name of a program or package, you may not know in which repository(ies) it resides.<br />
<br />
The <code>install.sh</code> file provided in the comic is a {{w|shell script}}, which attempts to fix this problem by acting as a "universal install script" that contains a lot of common install commands used in various Unix-like systems. This script in particular is interpreted by the {{w|Bourne Again Shell}} (Bash), which is denoted by the <code>#!/bin/bash</code> in the first line. In between each of the install commands in the script is the & character, which in {{w|POSIX}}-compatible {{w|Unix shell|shells}} (including {{w|Bash (Unix shell)|Bash}}, a popular shell scripting language) means it should continue to run the next command without waiting for the first command to finish, also known as "running in the background". This has the effect of running all the install commands simultaneously; all output and error text provided by them will be mixed together as they are all displaying on the screen around the same time.<br />
<br />
The script accepts the name of a program or package as an argument when you run it. This value is then referenced as "$1" (argument number 1). Everywhere the script says "$1", it substitutes in the name of the package you gave it. The end result is the name being tried against a large number of software repositories and package managers, and hopefully, at least one of them will be appropriate and the program will be successfully installed. Near the end, it even tries changing the current working directory to that which is assumed to hold the package to be installed, and then runs several commands which build the program from source code.<br />
<br />
All in all, this script would probably work; it runs many standard popular repository programs and package managers, and runs the nearly-universal commands needed to build a program. Most of the commands would simply give an error and exit, but hopefully the correct one will proceed with the install.<br />
<br />
One of the more subtle jokes in the comic is the inclusion of <code>apt-get</code> and <code>sudo apt-get</code> in the same script. Good unix practice dictates never logging in as root; instead you stay logged in as your normal user, and run system admin accounts via <code>sudo program name</code>. This prevents accidental errors and enables logging of all sensitive commands. A side effect of this, however, is that an administrator may forget to prefix her command with <code>sudo</code>, and re-running it properly the second time. This is a common joke in the Linux community, an example of which can be found at [https://twitter.com/liamosaur/status/506975850596536320 viral tweet] which shows a humorous workaround for the issue.<br />
<br />
Since Randall's script does not use sudo for any but the <code>apt-get</code> command, there are two possibilities: the script itself was run via the root user or via sudo ,in which case the <code>sudo apt-get</code> is not needed, or the script was run as a normal user, in which case all of the commands will fail (due to lacking necessary permissions) with the possible exception of the <code>sudo apt-get</code> one.<br />
<br />
Sudo has also been used both by [[Randall]] in [[149: Sandwich]] and by Jason Fox to force Randall to let him appear on xkcd with [[824: Guest Week: Bill Amend (FoxTrot)]].<br />
<br />
The tool <code>curl</code> downloads files from the network (e.g., the Internet). For example <code>curl http://xkcd.com/</code> downloads and displays the xkcd HTML source. The pipe <code>|</code> in the script attaches the output of the command before the pipe to the input of the command after the pipe, thus running whatever commands exist in the web content. Although this "curl|sh" pattern is a common practice for conveniently installing software, it is considered extremely unwise; you are running untrusted code without validation, there may be a MITM who modifies the code you receive, or the remote system could have been hijacked and the code made malicious. Most local package managers (e.g. <code>apt</code>, <code>yum</code>) offer digitally-signed packages that thwart this problem. You can find many examples of software providers suggesting a <code>curl|sh</code> solution at [https://curlpipesh.tumblr.com/ curlpipesh]<br />
<br />
There appears to be a bug with the & at the end of the "git clone" line; since a git repository typically contains program source code, not executables, it may have been intended to retrieve the source code with git and then compile and install the program in the next line. In this case, the single & should be replaced with &&, an operator that will run the second command only if the first one has completed successfully. This plays into a second bug on the "configure" line, where the placement of the & means that only the "make install" command will be run asynchronously after the "configure" and "make" steps have finished in sequence. To make success as likely as possible, the two lines should be like this:<br />
<br />
git clone <nowiki>https://github.com/</nowiki>"$1"/"$1" && (cd "$1"; ./configure; make; make install) &<br />
<br />
Since all commands are running in the background, any command that requires user input will stop and wait until brought to the foreground. A common request would be for a database password, or if it is allowed to restart services for the installation. This could lead to packages being only partly installed or configured. (See more about using "yes" below.)<br />
<br />
The title text mentions the possibility that the same program may be in multiple repositories, so in this case, the script will download and install several versions, or it may fail on a number of repositories, in which case usually nothing bad happens. Since all the commands come from different operating systems, versions, or distributions, it is not very likely that more than one will work (with the exception of pip/easy_install and the two forms of apt-get) or even exist on the same system. It mentions that adding a way of automatically saying "yes" to questions asked during the different repository-fetching programs' running, by making them read input from another program that writes a (nearly) endless stream of "y"s, could simplify things further. This would not work for any curses-based menus, or to answer any more complicated questions. Adding <code>2>/dev/null</code> to a command redirects the second output stream (the "error stream") to the null device driver, which discards all writes to it, meaning errors (the package not existing) will not be sent to the screen.<br />
<br />
==Transcript==<br />
:[In the panel is a shell script which, unusual for xkcd, uses only lower case. At the top the title of the program is inlaid in the frame, which has been broken here.]<br />
:<big>Install.sh</big><br />
<br />
:<nowiki>#!/bin/bash</nowiki><br />
<br />
:pip install "$1" &<br />
:easy_install "$1" &<br />
:brew install "$1" &<br />
:npm install "$1" &<br />
:yum install "$1" & dnf install "$1" &<br />
:docker run "$1" &<br />
:pkg install "$1" &<br />
:apt-get install "$1" &<br />
:sudo apt-get install "$1" &<br />
:steamcmd +app_update "$1" validate &<br />
:git clone <nowiki>https://github.com/</nowiki>"$1"/"$1" &<br />
:cd "$1";./configure;make;make install &<br />
:curl "$1" | bash &<br />
<br />
==Trivia==<br />
*pip and easy install are package managers for {{w|Python (programming language)|Python}}<br />
*brew is the successor/replacement for {{w|MacPorts}} and a third-party package manager for OS X<br />
*{{w|npm (software)|npm}} is the node package manager that maintains node.js packages<br />
*{{w|Yellowdog Updater, Modified|yum}} is the package management tool for {{w|Red Hat Enterprise Linux}} and some derivatives<br />
*{{w|DNF (software)|dnf}} is the package management tool for {{w|Fedora (operating system)|Fedora}} since version 22<br />
*docker run is a {{w|Docker (software)|Docker}} command that runs a given container (similar to a virtual machine)<br />
*pkg is the package management tool on {{w|Berkeley Software Distribution|BSD systems}}<br />
*apt-get is the package management tool of {{w|Debian}} and derivatives (e.g. Ubuntu)<br />
*steamcmd refers to {{w|Steam (software)|Steam}}, the computer game client<br />
*git is the revision control software used for many projects and gained a lot of traction through the {{w|GitHub}} platform<br />
*configure/make/make install refers to the standard way of compiling software from source (on Linux/Unix)<br />
*curl is a tool for loading data via http:// (i.e. from a website), this data is then pushed to the shell interpreter (in order to install)<br />
**Note: While this is a security nightmare, some projects (like Homebrew) still use it as the preferred or only method of installation.<br />
<br />
{{comic discussion}}<br />
[[Category:Programming]]</div>AfroThundr3007730https://www.explainxkcd.com/wiki/index.php?title=1654:_Universal_Install_Script&diff=1149911654: Universal Install Script2016-03-16T12:20:45Z<p>AfroThundr3007730: /* Explanation */ Clarification of the bash elements of the script.</p>
<hr />
<div>{{comic<br />
| number = 1654<br />
| date = March 11, 2016<br />
| title = Universal Install Script<br />
| image = universal_install_script.png<br />
| titletext = The failures usually don't hurt anything, and if it installs several versions, it increases the chance that one of them is right. (Note: The 'yes' command and '2>/dev/null' are recommended additions.)<br />
}}<br />
<br />
==Explanation==<br />
{{incomplete|Small detail, but the file extension ".sh" in the "Install.sh" program is never explained/mentioned. For people who never uses/know of this type of file, the program name could be "read" as "Installish" - could this be a pun? What does "run this script as an argument" mean and how does this then accept the program name that substitutes "$1"? The first line of the program "#!/bin/bash" is neither mentioned or explained not even in the trivia.}}<br />
Most users of computers today are used to simple, easy installation of programs. You just download a {{w|.exe}} or a {{w|Installer_(OS_X)#Installer_package|.pkg}}, double click it, and do what it says. Sometimes you don't even have to install anything at all, and it runs without any installation.<br />
<br />
However, when things are more "homebrew", for example downloading source code, things are more complicated. Under {{w|Unix-like}} systems, which this universal install script is designed for, you may have to work with "build environments" and "{{w|makefiles}}", and command line tools. To make this process simpler, there exist repositories of programs which host either packages of source code and the things needed to build it or the pre-built programs. When you download the package, it automatically does most of the work of building the code into something executable if necessary and then installing it. However, there are many such repositories, such as "{{w|pip (package manager)|pip}}" and "brew", among others listed in the comic. If you only know the name of a program or package, you may not know in which repository(ies) it resides.<br />
<br />
The <code>install.sh</code> file provided in the comic is a {{w|shell script}}, which attempts to fix this problem by acting as a "universal install script", which contains a lot of common install commands used in various Unix-like systems. This script in particular is interpreted by the {{w|Bourne Again Shell}} (Bash), which is denoted by the <code>#!/bin/bash</code> in the first line. In between each of the install commands in the script is the & character, which in {{w|POSIX}}-compatible {{w|Unix shell|shells}} (including {{w|Bash (Unix shell)|Bash}}, a popular shell scripting language) means it should continue to run the next command without waiting for the first command to finish, also known as "running in the background". This has the effect of running all the install commands simultaneously; all output and error text provided by them will be mixed together as they are all displaying on the screen around the same time.<br />
<br />
The script accepts the name of a program or package as an argument when you run it. This value is then referenced as "$1" (argument number 1). Everywhere the script says "$1", it substitutes in the name of the package you gave it. The end result is the name being tried against a large number of software repositories and package managers, and hopefully, at least one of them will be appropriate and the program will be successfully installed. Near the end, it even tries changing the current working directory to that which is assumed to hold the package to be installed, and then runs several commands which build the program from source code.<br />
<br />
All in all, this script would probably work; it runs many standard popular repository programs and package managers, and runs the nearly-universal commands needed to build a program. Most of the commands would simply give an error and exit, but hopefully the correct one will proceed with the install.<br />
<br />
One of the more subtle jokes in the comic is the inclusion of <code>apt-get</code> and <code>sudo apt-get</code> in the same script. Good unix practice dictates never logging in as root; instead you stay logged in as your normal user, and run system admin accounts via <code>sudo program name</code>. This prevents accidental errors and enables logging of all sensitive commands. A side effect of this, however, is that an administrator may forget to prefix her command with <code>sudo</code>, and re-running it properly the second time. This is a common joke in the Linux community, an example of which can be found at [https://twitter.com/liamosaur/status/506975850596536320 viral tweet] which shows a humorous workaround for the issue.<br />
<br />
Since Randall's script does not use sudo for any but the <code>apt-get</code> command, there are two possibilities: the script itself was run via the root user or via sudo ,in which case the <code>sudo apt-get</code> is not needed, or the script was run as a normal user, in which case all of the commands will fail (due to lacking necessary permissions) with the possible exception of the <code>sudo apt-get</code> one.<br />
<br />
Sudo has also been used both by [[Randall]] in [[149: Sandwich]] and by Jason Fox to force Randall to let him appear on xkcd with [[824: Guest Week: Bill Amend (FoxTrot)]].<br />
<br />
The tool <code>curl</code> downloads files from the network (e.g., the Internet). For example <code>curl http://xkcd.com/</code> downloads and displays the xkcd HTML source. The pipe <code>|</code> in the script attaches the output of the command before the pipe to the input of the command after the pipe, thus running whatever commands exist in the web content. Although this "curl|sh" pattern is a common practice for conveniently installing software, it is considered extremely unwise; you are running untrusted code without validation, there may be a MITM who modifies the code you receive, or the remote system could have been hijacked and the code made malicious. Most local package managers (e.g. <code>apt</code>, <code>yum</code>) offer digitally-signed packages that thwart this problem. You can find many examples of software providers suggesting a <code>curl|sh</code> solution at [https://curlpipesh.tumblr.com/ curlpipesh]<br />
<br />
There appears to be a bug with the & at the end of the "git clone" line; since a git repository typically contains program source code, not executables, it may have been intended to retrieve the source code with git and then compile and install the program in the next line. In this case, the single & should be replaced with &&, an operator that will run the second command only if the first one has completed successfully. This plays into a second bug on the "configure" line, where the placement of the & means that only the "make install" command will be run asynchronously after the "configure" and "make" steps have finished in sequence. To make success as likely as possible, the two lines should be like this:<br />
<br />
git clone <nowiki>https://github.com/</nowiki>"$1"/"$1" && (cd "$1"; ./configure; make; make install) &<br />
<br />
Since all commands are running in the background, any command that requires user input will stop and wait until brought to the foreground. A common request would be for a database password, or if it is allowed to restart services for the installation. This could lead to packages being only partly installed or configured. (See more about using "yes" below.)<br />
<br />
The title text mentions the possibility that the same program may be in multiple repositories, so in this case, the script will download and install several versions, or it may fail on a number of repositories, in which case usually nothing bad happens. Since all the commands come from different operating systems, versions, or distributions, it is not very likely that more than one will work (with the exception of pip/easy_install and the two forms of apt-get) or even exist on the same system. It mentions that adding a way of automatically saying "yes" to questions asked during the different repository-fetching programs' running, by making them read input from another program that writes a (nearly) endless stream of "y"s, could simplify things further. This would not work for any curses-based menus, or to answer any more complicated questions. Adding <code>2>/dev/null</code> to a command redirects the second output stream (the "error stream") to the null device driver, which discards all writes to it, meaning errors (the package not existing) will not be sent to the screen.<br />
<br />
==Transcript==<br />
:[In the panel is a shell script which, unusual for xkcd, uses only lower case. At the top the title of the program is inlaid in the frame, which has been broken here.]<br />
:<big>Install.sh</big><br />
<br />
:<nowiki>#!/bin/bash</nowiki><br />
<br />
:pip install "$1" &<br />
:easy_install "$1" &<br />
:brew install "$1" &<br />
:npm install "$1" &<br />
:yum install "$1" & dnf install "$1" &<br />
:docker run "$1" &<br />
:pkg install "$1" &<br />
:apt-get install "$1" &<br />
:sudo apt-get install "$1" &<br />
:steamcmd +app_update "$1" validate &<br />
:git clone <nowiki>https://github.com/</nowiki>"$1"/"$1" &<br />
:cd "$1";./configure;make;make install &<br />
:curl "$1" | bash &<br />
<br />
==Trivia==<br />
*pip and easy install are package managers for {{w|Python (programming language)|Python}}<br />
*brew is the successor/replacement for {{w|MacPorts}} and a third-party package manager for OS X<br />
*{{w|npm (software)|npm}} is the node package manager that maintains node.js packages<br />
*{{w|Yellowdog Updater, Modified|yum}} is the package management tool for {{w|Red Hat Enterprise Linux}} and some derivatives<br />
*{{w|DNF (software)|dnf}} is the package management tool for {{w|Fedora (operating system)|Fedora}} since version 22<br />
*docker run is a {{w|Docker (software)|Docker}} command that runs a given container (similar to a virtual machine)<br />
*pkg is the package management tool on {{w|Berkeley Software Distribution|BSD systems}}<br />
*apt-get is the package management tool of {{w|Debian}} and derivatives (e.g. Ubuntu)<br />
*steamcmd refers to {{w|Steam (software)|Steam}}, the computer game client<br />
*git is the revision control software used for many projects and gained a lot of traction through the {{w|GitHub}} platform<br />
*configure/make/make install refers to the standard way of compiling software from source (on Linux/Unix)<br />
*curl is a tool for loading data via http:// (i.e. from a website), this data is then pushed to the shell interpreter (in order to install)<br />
**Note: While this is a security nightmare, some projects (like Homebrew) still use it as the preferred or only method of installation.<br />
<br />
{{comic discussion}}<br />
[[Category:Programming]]</div>AfroThundr3007730