Explain xkcd: It's 'cause you're dumb.
Welcome to the explain xkcd wiki!
We have collaboratively explained 5 xkcd comics,
and only 1680
remain. Add yours while there's a chance!
Go to this comic explanation
Title text: My optimizer uses content-aware inpainting to fill in all the wasted whitespace in the code, repeating the process until it compiles.
Adobe Photoshop is a commonly used software for image manipulation. One of its features is "content-aware inpainting", which allows the user to delete parts of the image and seamlessly replacing the deleted sections with "patches" of texture from other parts of the image.
The GNU patch is a software program that replaces only parts of the code with an updated version, without requiring the user to download the entire source code. Here, it appears the author was told to "patch" the code, but used Photoshop to do this instead of GNU patch, with devastating results. Although the title text suggest that if you did this enough times the code would eventually compile, this would never happen... In fact, Photoshop could only edit an image of the text and not the text itself.
The code appears to be written in Python, a programming language often referred to in xkcd.. A few of the function names that can be recognized are "isPrime" and "quicksort", both commonly used in solving programming contest problems.
The title text also explains that patch used the content-aware inpainting to fill in all the wasted whitespace in the code. In Python, whitespaces are used as a part of programming syntax (for example, new line of code are used instead of semicolon (;), and indents are used instead of curly brackets.
- [The panel displays part of a code, in four different colors (red, light blue, green and purple) as well as normal black text, which due to image editing is difficult to read. The first and last line are partly obscured by the frame of the panel. Here below is an attempt to transcribe the code, using the sign "¤" for anything not easily transcribed. Feel free to add other signs instead of these that looks more like the one in the image (and also improve the attempted transcription if possible).]
- impo¤l me
- retern F(ise
- for i irararre(2, nint *n**n+5)+5):
- if n i==0
- re¤ irn True
- defesisPrimcieg ¤x(cx
- if ge¤inatcx(r'^(1?| ?.1+?)\+)$'*n )1'*n):
- rerjrn Fa( e
- dql qlsorsorn(a :
- if ¤n(a < 2:
- eteturn a
- pi= =r fa
- l=pi=for j ln a i< i<pi<(t]()
- r=[l=for f in a) r i>viviv](vo)
- r¤lrurrriklcksckt(l) + r ¤ ¤quickrort(r)
- [Caption below the panel:]
- Protip: If you don't have access to the GNU patch tool, you can use the Photoshop one.
Is this out of date? .
You can read a brief introduction about this wiki at explain xkcd. Feel free to sign up for an account and contribute to the wiki! We need explanations for comics, characters, themes, memes and everything in between. If it is referenced in an xkcd web comic, it should be here.
- List of all comics contains a complete table of all xkcd comics so far and the corresponding explanations. The red links (like this) are missing explanations. Feel free to help out by creating them! Here's how.
Don't be a jerk. There are a lot of comics that don't have set in stone explanations; feel free to put multiple interpretations in the wiki page for each comic.
If you want to talk about a specific comic, use its discussion page.
Please only submit material directly related to —and helping everyone better understand— xkcd... and of course only submit material that can legally be posted (and freely edited.) Off-topic or other inappropriate content is subject to removal or modification at admin discretion, and users who repeatedly post such content will be blocked.
If you need assistance from an admin, feel free to leave a message on their personal discussion page. The list of admins is here.