Editing Talk:1685: Patch

Jump to: navigation, search
Ambox notice.png Please sign your posts with ~~~~

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
 
<!--Please sign your posts with ~~~~-->
 
<!--Please sign your posts with ~~~~-->
Hey, I'm first! Guessing the Bot only JUST created this, it was mere minutes after midnight EST when I landed on this page. Unfortunately this is a comic I'm less capable of explaining. From the looks of it, his Photoshop Patch turned what looks like C code into gobbledegook by filling in several of the spaces (and I think even changing some of the characters, possible with characters which fill more of the space). - NiceGuy1 [[Special:Contributions/108.162.218.77|108.162.218.77]] 04:24, 25 May 2016 (UTC) I finally signed up! This comment is mine. [[User:NiceGuy1|NiceGuy1]] ([[User talk:NiceGuy1|talk]]) 10:06, 9 June 2017 (UTC)
 
 
This appears to be Python code. Note the "def" keyword, how "for i in [garbled]:" is used rather than C's for syntax, and how there are no semicolons or braces. --[[User:Sherlock9|Sherlock9]] ([[User talk:Sherlock9|talk]]) 05:03, 25 May 2016 (UTC)
 
 
Photoshop has a 'patch' tool but it has a very different function from a software patch. {{unsigned ip|108.162.242.123}}
 
:An explanation of Photoshop's patch tool might be helpful in identifying patterns in what pixels were changed by it, perhaps facilitating the identification of some likely characters. [[User:Dansiman|Dansiman]] ([[User talk:Dansiman|talk]]) 05:56, 25 May 2016 (UTC)
 
 
The first function looks like "isPrime" and seems to check if a number is prime. The last function looks like "quicksort". Both are common functions you create when learning programming. Not sure about the second one, but it looks like it uses regular expressions. -- [[Special:Contributions/198.41.242.242|198.41.242.242]] 06:44, 25 May 2016 (UTC)
 
:I think the second one is "isPrimeRegex". *cringe* [[Special:Contributions/141.101.104.25|141.101.104.25]] 08:55, 25 May 2016 (UTC)
 
 
Second function looks like a function to check if number is a prime using Regex (described here http://www.noulakaz.net/2007/03/18/a-regular-expression-to-check-for-prime-numbers/). I don't know if it deserves some special mention, but at least to me (non-programmer) it looks like one of the most arcane things you can do in programming [[Special:Contributions/141.101.80.79|141.101.80.79]] 07:22, 25 May 2016 (UTC)
 
:That indeed looks very much like it. I think this is worth mentioning. --[[Special:Contributions/198.41.242.240|198.41.242.240]] 11:22, 25 May 2016 (UTC)
 
:Note that mathematically speaking, that regular expression is NOT regular expression - use of backreference in match is one of originally perl extension which makes it much more powerful (and much slower in some cases). It's just that both python and ruby already copied most of perl extensions of regular expressions. -- [[User:Hkmaly|Hkmaly]] ([[User talk:Hkmaly|talk]]) 12:39, 25 May 2016 (UTC)
 
 
Do you think the use of pi is a reference to one of the other comics(I forgot which one...)?[[User:Transuranium|Transuranium]] ([[User talk:Transuranium|talk]]) 10:35, 25 May 2016 (UTC)Transuranium
 
:I rather guess it is short for pivot. See {{w|quicksort}} for what the pivot does. --[[Special:Contributions/198.41.242.240|198.41.242.240]] 11:22, 25 May 2016 (UTC)
 
 
You know, it's theoretically possible for Photoshop to create compilable code in [https://esolangs.org/wiki/Piet the esoteric programming language] "[http://www.dangermouse.net/esoteric/piet.html Piet]". But unless there's a way to turn off the Patch tool's antialiasing, it'll be practically impossible for patches larger than a single pixel. [[Special:Contributions/108.162.237.220|108.162.237.220]] 14:15, 25 May 2016 (UTC)
 
 
I don't really know anything about programming, but it looks like it's checking for factors of n from 2 to sqrt(n)+1. Why would it need to check any number larger than sqrt(n) though? If i>sqrt(n), then ij=n implies that j<sqrt(n), and j should already have been found. So the largest integer you need to check is floor( sqrt(n) ), which is in the range from 2 to sqrt(n). Checking ceiling( sqrt(n) ) for a non-square number seems redundant. [[Special:Contributions/108.162.237.250|108.162.237.250]] 15:25, 25 May 2016 (UTC)
 
:It's because <code>range(a, b)</code> in Python means the interval [a, b) (excluding b). [[Special:Contributions/108.162.222.29|108.162.222.29]] 15:41, 25 May 2016 (UTC)
 
::That mismatched bracket in your comment is hurting me. [[Special:Contributions/162.158.68.71|162.158.68.71]] 17:02, 25 May 2016 (UTC)
 
:: It's not mismatched; the right paren indicates the value's the upper limit but excluded. I'd include a right bracket in my response but I think that might make a compiler curse. [[User:Elvenivle|Elvenivle]] ([[User talk:Elvenivle|talk]])
 
 
The line with re.match in the likely original code should have an "r" for "raw" before the first string thus:
 
  if re.match(r'^1?$|^(11+?)\1+$', '1'*n):
 
I am not changing it in the main explanation because I don't know what colour it should be and it's my first time contributing. - Charles W. [[Special:Contributions/141.101.98.42|141.101.98.42]] 22:24, 25 May 2016 (UTC)
 
:Seems like it has been changed by now. --[[User:Kynde|Kynde]] ([[User talk:Kynde|talk]]) 07:13, 26 May 2016 (UTC)
 
 
Has someone added this to the Protip category?[[Special:Contributions/162.158.2.139|162.158.2.139]] 23:53, 25 May 2016 (UTC)
 
:Uhm yes, it should be clear right below these comment on the main page? All categories are listed at the bottom of each page. --[[User:Kynde|Kynde]] ([[User talk:Kynde|talk]]) 07:01, 26 May 2016 (UTC)
 
 
It might be worth explaining the [pivot] * (len(a) - (len(l) + len(r))) since that threw me when I first saw it. Since l has the elements of a < pivot, and r has the elements of a > pivot, len(a) - (len(l) + len(r)) will be the number of elements in a that = pivot (which must be in the range [1, len(a)]), and these are then 'spliced' into the result between the result of quicksorting l and r.
 
[[User:Jstout|Jstout]] ([[User talk:Jstout|talk]]) 19:48, 26 May 2016 (UTC)
 
 
Photoshop is available for a much lower price than mentioned in the explanation. Adobe offers an Photography Creative Cloud plan (currently US$9.99/month). This includes Photoshop CC, Lightroom CC and additional apps and online storage. http://www.adobe.com/creativecloud/photography.html[[User:These Are Not The Comments You Are Looking For|These Are Not The Comments You Are Looking For]] ([[User talk:These Are Not The Comments You Are Looking For|talk]]) 22:44, 29 May 2016 (UTC)
 
 
;Resemblance to Xerox number mangling issue
 
 
To me, this reminds me of the problem that a large set of Xerox copiers had. Their faulty use of image compression when scanning could cause portions of images to be replaced with similar portions, but the threshold of similarity was loose enough that numeric data would be subtly corrupted. For example, building plans and spreadsheet data could have numbers copied incorrectly, either of which could certainly have disastrous consequences. Documents were corrupted for a period as much as eight years before the problem was corrected, making legal archive data unreliable for this period, and some of the faulty machines may still be in use. http://www.dkriesel.com/en/blog/2013/0802_xerox-workcentres_are_switching_written_numbers_when_scanning {{unsigned ip|162.158.252.185}}
 
:Now that you mention it... Although here it's a person intentionally doing harm to the image.[[Special:Contributions/173.245.52.69|173.245.52.69]] 22:20, 26 May 2016 (UTC)
 
::So ''that's'' what it was! I wondered why all the copies I could find of ''Concrete Mathematics'' had random font changes all over (and half the formulas came out wrong). [[Special:Contributions/141.101.80.121|141.101.80.121]] 22:26, 26 May 2016 (UTC)
 
:::Wow. that's intense.[[Special:Contributions/173.245.52.69|173.245.52.69]] 00:04, 27 May 2016 (UTC)
 
:A couple of decades ago, the firm I was working for suddenly realised that one of its dot-matrix printers was causing problems. It was being used to print out specific validation information for archival, but the centre pin of the (vertical)print-head pin array was no longer striking. Out of 9 or perhaps 13 pins, it didn't represent much difference in the output ''normally'', but the difference between a 0 and a 8 was whether that pin's contribution was two separated pixels, the middle of the two long verticals in the zero*, or a short horizontal sequence of dots representing the contact between the two small circles in the eight. The way the hardly-noticed absent row caused the character to be read meant that both read as zero, with no difference. (Other characters had problems, but usually did not look like anything else. There were no hyphens/minus-signs, but they might have rendered as whitespace if there had been.) This was not an ideal situation, and a different printer was swapped in ASAP.
 
: * - This typeface's zero did not have a diagonal bar, of the type I even habitually ''handwrite'', but confusion with O-for-Oscar characters was already not an issue due to context... [[Special:Contributions/141.101.98.43|141.101.98.43]] 03:37, 27 May 2016 (UTC)
 
 
I think the party of the explanation that details OCR is more in depth than it really needs to be. Considering that the comic itself makes no reference to OCR, these details should be trimmed down considerably, or at least moved to a later point in the explanation after the more salient details. [[User:Dansiman|Dansiman]] ([[User talk:Dansiman|talk]]) 15:48, 28 May 2016 (UTC)
 
 
== he predicted dall-e ai ==
 
 
ain't no way--[[Special:Contributions/172.70.91.153|172.70.91.153]] 14:34, 4 December 2023 (UTC)
 

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)

Templates used on this page: