Title-text: Saying 'what kind of an idiot doesn't know about the Yellowstone supervolcano' is so much more boring than telling someone about the Yellowstone supervolcano for the first time.
The person that programmed the /u/xkcd_transcriber bot ought to put in some code that will trigger when the reference to this comic reaches 10000, and instead of just the regular transcript it should add something special to celebrate the occasion.
Also, I think /r/mildlyinteresting would appreciate a link to the comment in which it has been linked ten thousand times once it happens.
I don't see how it truncates anything, I just tested it too and it seems fine. Am I missing something? I'm not using the -n option so it's substituting each match directly in the line buffer without changing anything else.
Well now you've edited your comment but didn't it originally say
cat reddit-master-db.csv | sed 's/\([mM]ore th\)en/\1an/g' > reddit-master-db.csv
and not
cat reddit-master-db.csv | sed 's/\([mM]ore th\)en/\1an/g' > reddit-master-db-fixed.csv
Because I'm certain it did and that's what I was talking about. Given input on the form command_a args... | ... | command_n args... > somefile, the shell will truncate the file that output is to be redirected to prior to executing any of the commands in the pipeline. Therefore, any command in the pipeline that tries to read from that same file will find that there is nothing in it to be read. Data lost.
I did edit the comment, but I didn't change anything above the 'Edit:'. I would've used the in-place sed option in the first place (which just writes to a temp file and renames it to the original anyways) but it's bad practice - in case you mung up your data - to deleted your original. Got me on the useless cat though since that also adds an unneeded sub shell because of the pipe. It should be cmd < old > new.
You already knew all this though. I was just goofing around, it's of course ridiculous that the db would be exported to a csv from Reddit's PostgreSQL and this would've likely been done with something like WHERE comment ~ 'regex' .... I'm just overcompensating now because I got embarrassed.
I misread the first time I read the post then. Sorry about that and double sorry about implying that you had sneakingly tried to hide it with an edit. In conclusion, we all make mistakes :)
Parsers go through your code and check if it's correct I think, and a Parseltongue is someone that can speak to snakes in Harry Potter. And a Python is a snake.
.. Kinda sorta. They aren't really error checking -- that's more of a side effect. The fact that you can understand what I'm writing right now is that your brain is parsing this sentence (turning it into a representation your brain can effectively manipulate)
In the context of programming languager, there are two steps here, usually:
Lexing, which just divides things up into meaningful units (for example a = 1 has three lexical units, 'name : a', 'operator : =', and 'numeric constant : 1'). It throws errors when it encounters something that is a fundamentally nonsensical symbol, like 1apples
Parsing, which in this example takes the output of lexing and turns it into an instruction to Python to 'set variable "a" to point to the integer value 1'. It throws errors when it encounters something that is, in context, impossible (for example "foo" = 11)
I think a parser is part of most compilers. It's the thing that won't let you compile code if there's syntax errors or missing semicolons or something. Or maybe I'm wrong, I have very little idea what I'm talking about.
Parsers are the main part of compilers. They don't just check for errors, they try to figure out what your code says -- an error is just what happens when they can't figure out what you were smoking when you wrote it.
Even in interpreted languages, every line has to be parsed to be translated into the lower-level instruction.
$ python
Python 3.6.0 (default, Jan 16 2017, 12:12:55)
[GCC 6.3.1 20170109] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> IMPORT OS
File "<stdin>", line 1
IMPORT OS
^
SyntaxError: invalid syntax
it's a very simple pun that someone might say as a "bad pun" joke and expect to be booed. the effort of putting it into a cartoon makes it especially painful, because the joke isn't even good enough for a throw-away line, let alone a whole comic panel of it.
i don't mean it pejoratively, but it seems like a very aspie kind of humor.
Name one good developer who isn't somewhere on the spectrum ... we all are in some way. Plus if you want to get away from bad puns and wordplay, don't touch gnu (gnus not Unix), Apache (a patchy web server), ice weasel (unbranded Firefox) or basically anything on Linux. And Google chrome. That's a pun too (Google's chrome: chrome is the UI frame around a browser rendering window).
i don't think that every good developer is on the autism spectrum . i do agree that most tech humor is completely abysmal in a similar way to this image - for instance reading tech sites on april fools day, especially slashdot, is the absolute worst. tech definitely has a higher percentage of autistic people than a lot of other industries, and a lot of the best programmers are likely autistic to some degree, but that's a far cry from every person or even most having some form of autism.
i'm not sure that any of the things you listed here are actually puns, though they are bad attempts at being clever/funny with wordplay (tho i'm not sure google chrome is).
in any case, none of that is really relevant to this being painfully unfunny to me or not. however, i should have probably kept it to myself. sorry about that. the person who posted it did ask me why though, so i tried to explain it. though asking the question of why isn't something funny is also a bit aspie :P
That code doesn't really do anything, it imports some modules and then initializes a set. If you ran it it wouldn't have any effect on anything other than a little bit of cpu and memory usage. It certainly doesn't create a memory leak, in order to have a memory leak it would have to have some kind of loop.
Doesn't do anything. It just sets a variable to a set of strings that is never used. There is no eval() executing "COUNT_SOURCELINES.PY", it's just a plain old string in a plain old list with no special meaning.
122
u/Helix_van_Boron Mar 13 '17
A lot of that syntax won't work in all caps, though.
21
u/[deleted] Mar 13 '17
I guess you could call them sourcerers
13
u/BronzeOne Mar 13 '17
Been doing python for three years, i don't get it :(
48
u/gandalfx Mar 12 '17
ancient
12
u/[deleted] Mar 13 '17
Am I missing a joke here or is the code just incomplete gibberish that has nothing to do with the task at hand?
3
u/luckystarr at 0x7fe670a7d080 Mar 13 '17
Would have been more fun if the code did something with the
astmodule. :)15
u/Deto Mar 13 '17
PSH, he's barely fluent! Should be:
5
u/[deleted] Mar 13 '17
Read this as I'm watching Chamber of Secrets
4
u/heavyheaded3 Mar 13 '17
*parser-mouth
3
u/hhh333 Mar 13 '17
I don't get it and I'm not sure I want to get it.
0
u/slapfestnest Mar 13 '17
this is painfully unfunny
1
u/[deleted] Mar 13 '17
Python amateur here. Does this result in a memory leak?
-1
u/pratik_08 Mar 13 '17
Hilarious!
0
u/[deleted] Mar 13 '17
[deleted] — view deleted comment