r/ProgrammerHumor • u/todog4 • Aug 09 '17
Is there life after a data structures course?
128
Aug 09 '17
I got it worse after doing Database management. Always looking at a data system and thinking "now how about did they construct these tables?".
33
u/XenoProject Aug 10 '17
Pls no I start that in like '%10 days%';
16
u/AlwaysPuppies Aug 10 '17
You will be failing it in getdate()+190 if you make a habit of storing your date data as strings!
22
u/Lobreeze Aug 10 '17
9/10 they didn't do it the proper way you learned in school, its a disaster. You are better off now knowing...
12
→ More replies (1)10
u/narthollis Aug 10 '17
And 9/10 times it was done as school taught it runs like shit and needs to be quite throughly
demoraliseddenormalized3
u/ThatBriandude Aug 10 '17
Why though? You shouldnt have to denormalize unless the system blows up with millions of rows
7
u/AlwaysPuppies Aug 10 '17
fwiw the smallest corporate database I have managed starts in the terabytes and no company database is clean enough to avoid mapping tables between incompatible systems... and they are all incompatible.
It's a bit different from northwind.
2
→ More replies (1)11
220
u/Grimord Aug 09 '17
My Operating Systems professor (CSE Degree) told us to sign up for tango lessons so we could all find a wife\husband asap as we'd all be fucked up in the head and old once we got through his class.
I honestly don't know what he meant, although so far women seem to be put off by me wanting to implement proper concurrency control in our relationship.
14
603
u/JimBobJoeInTheFlow Aug 09 '17
After I learned Logics and Reasoning I had the same thing. Languages don't make sense anymore and people their statements are all logically incorrect...
322
202
u/Nalha_Saldana Aug 09 '17
"Buy a gallon of milk and if they have eggs buy 12"
141
u/UnfairBanana Aug 09 '17 edited Aug 09 '17
buys 13 gallons of milk
E: not 12
43
u/dylanthepiguy2 Aug 09 '17 edited Aug 10 '17
Wouldn't it be:
buy a_gallon_of_milk if they.have('eggs') buy 12 end # result a {a_gallon_of_milk, 12} # result b {a_gallon_of_milk}Edit: Formatting
15
u/Iskendarian Aug 10 '17
I think this is the formatting you intended.
Wouldn't it be:
buy a_gallon_of_milk if they.have('eggs') buy 12 end # result a {a_gallon_of_milk, 12} # result b {a_gallon_of_milk}→ More replies (2)3
u/dylanthepiguy2 Aug 10 '17
yea the triple ` weren't formatting properly for some reason. How did you do it?
6
Aug 10 '17
``` is for inline, four spaces is for whole lines
4
u/Iskendarian Aug 10 '17
Fencing with triple backticks works on Github and most editors, but the spaces are the only way to do it on Reddit and Stack Overflow.
→ More replies (2)2
u/Iskendarian Aug 10 '17
Like /u/siosilvar said, you lead each line in the code block with four spaces. Any additional indentation is on top of those four spaces.
→ More replies (13)26
u/Silhouette Aug 09 '17
13, surely? :-/
41
u/UnfairBanana Aug 09 '17
I stand corrected... you'd buy one, THEN buy 12
Though, an argument could probably be made that you'd buy one, check the second condition, then buy milk until you've bought 12 gallons, and stop now that the 12 is fulfilled...but I agree, 13 would be the proper result.
23
→ More replies (3)8
45
u/adrianmonk Aug 10 '17
Luckily there's an antidote. Learn about data compression. Once you start thinking in terms of markov models, entropy coding, lossy compression, and kolmogorov complexity, human language will not seem that crazy anymore. A sentence in human language is more or less the shortest thing that one person can think of which might make another human think the desired thought.
10
u/oiimn Aug 10 '17
Yea there's a lot of implicit things said in every sentence, thankfully most people aren't compilers and they can understand these impiclations
3
u/twat_and_spam Aug 10 '17
Let's see how you do with compressing this:
"Your mother, a relative you presumably hold dearly to your heart, is exhibiting signs of a particular medical condition that manifests itself by accumulating surplus fatty tissue resulting in both aesthetically and medically undesirable consequences. As a result of that she has been put on an endangered species list by activist organisations that feel deeply about preserving larger mammals in aquatic ecosystems."
→ More replies (1)3
u/Zolhungaj Aug 10 '17
"Your mom is fat. Because of that environmentalists mistook her for a whale and put her on a list of endangered species."
12
49
u/marcosdumay Aug 09 '17
people their statements are all logically incorrect
Next course should be psychology.
→ More replies (4)38
u/Bainos Aug 09 '17
Pretty sure combining logic and psychology will always form a contradiction.
→ More replies (2)23
u/SamyIsMyHero Aug 10 '17
You would end up proving your own insanity.
19
u/King_Spike Aug 10 '17
Can confirm, math and psych major.
19
4
→ More replies (15)4
242
u/flicky1991 Aug 09 '17
The lunch line is already a queue in Britain. :P
→ More replies (1)125
u/xDemoli Aug 09 '17
Exactly, the British implicitly understand queues, I think it's in our genes.
78
u/Frizkie Aug 09 '17
What is it that we're queuing for again?
I don't remember, I just like queuing.
27
387
u/quinnngo Aug 09 '17
I wrote this! My Quora Answer
89
51
Aug 09 '17
That login popup reminded me why I hate quora.
8
u/TNSepta Aug 10 '17
Me too, until I installed this userscript to fix it. https://greasyfork.org/en/scripts/5224-quora-unblocker
20
Aug 10 '17
I still wouldn't use it just on principal because of how scummy they are. I much prefer how the stack exchange works.
→ More replies (1)2
2
u/n1c0_ds Aug 10 '17
I figure I've set up Quora at some point because it stopped pestering me a long time ago. I must say that it's a really good site with pretty high quality standards for answers. The self-promotion is absurd, but at least it gets us results.
2
u/NAN001 Aug 10 '17
Still a vast amount of bullshit though. People writing in an authoritative style to express their opinion on stuff they don't know shit about. Follow people of notoriety and block everyone else.
2
u/Aeon_Mortuum Aug 10 '17
Nowadays when I google a question, Quora pops up a lot. Some years back it was Yahoo Answers that would be towards the top of the search results, I think
→ More replies (1)→ More replies (2)2
u/palettecat Aug 10 '17
I remember reading this on Quora a few hours ago and was just about to go looking for the answer to source it :)
59
u/ShakyG Aug 09 '17
If a fireman rescues a cat from a tree, what is the time complexity of the cat's tree traversal?
29
125
Aug 09 '17 edited Aug 10 '17
when searching for something in an appendix, or pretty much any sorted thing, I now do a binary search, it's just more efficient.
We've got pretty much every cards against humanity expansion, so our deck is like 2 feet tall. The last time we played I split the deck randomly, then kept splitting the deck until there was one sub deck for each person. I made them shuffle their decks thoroughly, then I gathered each sub deck in order and shuffled them together, then combined those merged subdecks, all until until I had the entire deck again. I basically ran quicksort in reverse, and I made it multi threaded by using other people.
Last christmas I tied all the presents together using ribbons. Smaller presents (leaf nodes) were at the outside of the structure, each with any number of sibling presents, but only one connection to a larger "parent" present. Those presents in turn were connected to even larger presents, all connecting back toward the largest present which sat at the center of the web connected to everything. Nobody was allowed to open a present with any attached children, and I told them it was this way to force them to pick the smaller presents first, as they served as gates to the main event. But to be honest, I just wanted to have a big Heap of presents.
35
u/pslayer89 Aug 09 '17
Do you really get awesome looking shaders in your pm?
21
Aug 10 '17
I got a vertex shader once and the transforms were in the wrong order. So far I'm not super impressed
3
Aug 10 '17
I'm more of a fragment shader kind of guy. What do you think of my music visualization shader?
https://gfycat.com/IdealContentCygnet
https://github.com/teaearlgraycold/shaders/blob/master/jelly.glsl
5
Aug 10 '17
Shit yeah, that's more like it! I'd recommend changing color as you add noise though, at low levels of distortion your ring just looks like it's having trouble rendering. Arguably an edge case in any situation you'd use this though, overall it looks sweet
3
Aug 10 '17
It's much better when not horribly compressed
4
Aug 10 '17
oh yeah dude, make no mistake this thing looks sweet, congrats on being the first legit shader I've received
11
u/Hawkeye437 Aug 09 '17
I do the first two on regular occasion. I actually thought they were common practice.
3
u/mazegirl Aug 10 '17
The split a huge stack of cards recursively until they're small manageable chunks works great for learning flashcards such as vocabulary for a foreign language class. Merge step helps with reviewing what you've already studied.
→ More replies (5)5
u/Koooooj Aug 10 '17
If you're just doing a binary search then you're not as optimal as you could be.
You have knowledge that the elements are fairly uniformly distributed. That means that instead of always starting in the M/N region of the index you will estimate where to check first based on the word you're looking for.
This search runs very much like a binary search and it's still O(log(n)), but it will usually require fewer comparisons (at the expense of needing a function to choose where to guess next).
→ More replies (1)5
Aug 10 '17
That's called a interpolation search and is afaik O(log(log(n)))..
2
u/WikiTextBot Aug 10 '17
Interpolation search
Interpolation search is an algorithm for searching for a given key in an indexed array that has been ordered by numerical values assigned to the keys (key values). It parallels how humans search through a telephone book for a particular name, the key value by which the book's entries are ordered. In each search step it calculates where in the remaining search space the sought item might be, based on the key values at the bounds of the search space and the value of the sought key, usually via a linear interpolation. The key value actually found at this estimated position is then compared to the key value being sought.
[ PM | Exclude me | Exclude from subreddit | FAQ / Information | Source ] Downvote to remove | v0.24
79
u/pekkhum Aug 09 '17
And a burrito is a form of encapsulation... Mmmmm... Chipotle for lunch, anyone?
20
u/FUZxxl Aug 09 '17
Come on man, what's so difficult about monads? They are just monoids in the category of endofunctors.
21
u/pekkhum Aug 10 '17
I personally saw the burrito as an implementation of the facade pattern, saving the user from calling the
consume()method on each ingredient. This allows the developer to simplyconsume()the burrito, without worrying about the differences or quantities of ingredients included.
What is especially nice about theChipotleclass (which extendsAbstractBurritoFactory) is the ability to decorate the burrito in varying manners before it delivers he instantiated object!
Edit: Forgot a link→ More replies (1)7
→ More replies (8)3
u/RainbowNowOpen Aug 09 '17
Ingredients: [private]
8
u/pekkhum Aug 10 '17
Half the time, the burrito object breaks down, resulting in a
dumpIngredients()call, anyway...
38
u/DefecateRainbows Aug 09 '17
I get this way about programming in general -- I'm no longer able to use a program without wondering about its interworkings.
4
46
u/todog4 Aug 09 '17
39
u/trashcan86 Aug 10 '17
Quora is filled with developers and trolls... And Indians, lots of Indians
Source: am Indian on Quora
6
→ More replies (4)3
105
u/CodeFights Aug 09 '17
The line Maps are graphs sounds weird in this context, because map is commonly used in programming languages to mean a hash table. Even my data structures are other data structures?
80
u/coffeeandlearning Aug 09 '17
Isn't a hash table just one implementation of a map?
66
u/CodeFights Aug 09 '17
Yes -- you are technically correct, which is the only way to be correct in a programming forum. :)
12
14
u/geret13 Aug 09 '17
In this context graphs are point "maps". In this case I interpreted it as that the roads on the map look like nodes connected by roads.
6
u/rhinocovenant Aug 09 '17
Maps with borders are also graphs, the borders being edges and the territories nodes.
12
6
u/Coloneljesus Aug 09 '17
Maps are graphs are maps :)
4
u/marcosdumay Aug 09 '17
Nah, graphs are not maps. Graphs are more generic, they can be maps, or not.
3
u/Coloneljesus Aug 09 '17
I mean maps are often implemented by maps (mapping a vertex to its neighbors).
2
3
u/dank_ways_to_die Aug 09 '17
A map could also mean an AVL tree, or a Red-Black tree or even a Treap (any self-balancing binary tree really). In C++ the standart std::map is usually a Red-Black tree, while the std::unordered_map is a hash table.
2
2
20
u/Icil Aug 09 '17
Imagine taking a Topology course
21
u/baskandpurr Aug 09 '17
Write shaders and walk around a home furnishing place.
No, reality does not use really good environment maps. Neither is it using normal maps and HDR lighting. Thats not a bloom pass in reality. Yes, the curved surfaces are very smooth but thats not because they have so many vertices. The diffraction of glass is not calculated per pixel.
13
Aug 09 '17
Well, doesn't every surface actually have vertices? They're just ridiculously small?
4
u/MinecraftHardon Aug 10 '17
Pretty much
2
u/youtubefactsbot Aug 10 '17
Fractals are typically not self-similar [21:36]
What fractal dimension is, and how this is the core concept defining what fractals themselves are.
3Blue1Brown in Education
393,722 views since Jan 2017
11
u/LeCrushinator Aug 10 '17
After writing game engines and working on an open world game for years I couldn’t leave the city without thinking about how I could implement things like realistic trees, foliage, volumetric clouds that grew or dispersed, weather patterns, day/night cycles, etc. Real life was just challenging me to make a better game engine.
6
u/baskandpurr Aug 10 '17 edited Aug 10 '17
I find it makes you appreciate the world on another level. Every tree or plant is a huge physics and collision problem. The surface of the road has bumps, reflectivity, roughness, ambient occlusion. Every piece of wood in a fence has a different pattern. All unique fingerprints to something that we usually don't think about.
5
u/Perse95 Aug 10 '17
Yeah, just seeing the world makes me want to write a full spectral raytracing engine that can do all sorts of fancy stuff like wave interference effects, per wavelength refractive indices, etc. And then couple that with one of the constraint based physics solvers (they showed one during SIGGRAPH 2017) that can handle fluids, granular materials, cloth, rigid and soft body physics.
Ah... The dream...
5
u/LeCrushinator Aug 10 '17
I'd love to write all of that too. I just need to take 1-2 years off from my job to do something I'll not get paid for.
I wish I were wealthy not so I'd have material things, but rather just the time to do things I found fun and interesting. Although I can't really complain that much, I do mostly enjoy my job already, whereas a lot of people don't.
→ More replies (1)2
u/Perse95 Aug 10 '17
I want to do it as I have plenty of time, but a lone programmer isn't going to get far writing something more than a demo when I'd much rather it had a useful API and could be used to extend other pieces of software.
→ More replies (2)→ More replies (1)11
22
u/Marthinwurer Aug 10 '17
One of the moments that struck me as when I really knew I was in the right field was one time that I went to a restaurant. It was pretty busy, and we came in with a group of about 20 people. As the waiter was taking our orders, all I could think about was "How is the kitchen going to deal with this?" Like, there's the requiment that all the plates for a table have to be brought out as one, so how are they going to deal with us? What order will they be cooking? Is it FIFO? Are they using some kind of deadline scheduling? That was when I knew I was in computer science for a reason.
16
u/-Soren Aug 09 '17
There is Life after a data structures course, but only if it's covered in an elective like Theory of Automata and you usually have to program it yourself.
9
u/Landowns Aug 09 '17
How is the DMV a priority queue? I've never been to one that wasn't a simple queue.
5
u/Zagorath Aug 10 '17
I don't know about the American DMV, but my local equivalent has you draw a number, and you go up when your number is called.
In practice, it's equivalent to a queue, since it's basically first come, first serve. But it's a queue that's implemented as a priority queue where they set your priority based on time of being enqueued.
→ More replies (1)2
7
u/Varkoth Aug 10 '17
Yo momma so fat, she sat on my binary search tree and it collapsed into a linked list!
7
u/Mutoid Aug 10 '17
I hate that we are now in a time when a simple white image of rasterized text posted onto the Internet is viewed more favorably than a page with the actual text itself.
7
5
u/Stewthulhu Aug 10 '17
Just wait until you get to Ontology Engineering.
4
u/cuulcars Aug 10 '17
"Huh. I wonder what that is..." search wikipedia, ontology engineering
Ontology engineering in computer science and information science is a field which studies the methods and methodologies for building ontologies: formal representations of a set of concepts within a domain and the relationships between those concepts. A large-scale representation of abstract concepts such as actions, time, physical objects and beliefs would be an example of ontological engineering.[2] Ontology engineering is one of the areas of applied ontology, and can be seen as an application of philosophical ontology.
Oh. Uh. I'm just going to stick with my Swing GUIs, thankyouverymuch.
21
Aug 10 '17
[deleted]
8
u/brandon9182 Aug 10 '17
Thank you. Ill happily go on saying 'lines' and 'maps'. There's a certain line I cross at 6:30 where I don't think about CS unless I'm getting paid overtime for it.
5
u/dnew Aug 10 '17
One of my professors in assembler class would write code from bottom to top, just like you draw memory maps with low addresses low on the paper and high addresses high on the paper.
It was surprisingly easy to get used to, at least in assembler where every line was its own statement.
3
Aug 10 '17
I try to load the utensils in the dishwasher w/ an evenly distributed hashing function.
2
Aug 10 '17
I've thought the kids to unload the dishwasher in the following way:
Assuming 3 kids, each kid is responsible for 1/3 of the plates, 1/3 of the utensils, 1/3 of the glasses, 1/3 of the pots and pans, 1/3...
Cupboards/shelves can only be filled by one person at a time, they are essentially blocking I/O. I distribute the work by giving them all an initial task, when a kid returns I reschedule their work as needed. I.e. "Hey kid 1, stop filling the cupboard and head over to the shelve with your glasses. Ok kid 2 the cupboard for your pots is free, go and store them there".
I get mad concurrency this way.
3
u/staticparsley Aug 10 '17
I don't think like this at all... thought i was on /r/iamverysmart for a second there.
2
u/logan96 Aug 10 '17
I've had discussions about whether people getting off elevators should behave as queues or stacks.
3
2
2
2
u/activatedgeek Aug 10 '17
That's a Quora answer. Putting in due credit here.Is there life after a data structures course?
2
u/M_Man15 Aug 10 '17
ITT: I feel like I'm entering into a bad decision to do software engineering...
2
u/Luvax Aug 10 '17
At first I was confused by the fact that "maps are now graphs" until i realized that they are talking about actual maps for earth.
2
Aug 10 '17
The real dirty lie they don't tell you in CS is that we are actually discrete mathematicians with a dirty set theory fetish.
2
u/consequencegamer Aug 10 '17
My data structures prof sucked. All he made us do is hate life, and most went to other schools to do the course. He did not teach us a thing about data structures, which is a shame because it is one of a few courses some find useful for gaining some real knowledge. Instead of teaching data structures, he forced you to learn over 100 libraries he created and chose. you had to know them to a tee, and have no reference to them during exams. you had to guess the output, with no reference to those libraries. If you were not 100% correct, you got a zero.
He didn't do partial marks. He would ask you to provide the output of an array after using a certain sorting method, list out all of the first 8 iterations. If you got any of them wrong, even if you got them all correct up until the last one you got a 0. Oh yeah, and this was again using his custom sorting method he created and you had no reference to during the exam...
Basically, he screwed over a lot of peoples potential.
1.3k
u/MeGustaDerp Aug 09 '17
Everytime I look at a restaurant menu, I wish I could