Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Get a devDuck
Rubber duck debugging has never been so cute! Get your favorite coding language devDuckBuy Now
Search - "merge sort"
I was showing my girlfriend how merge sort works... Halfway through my visual explanation, she took the pen from me and finished the algorithm.
I think I have chosen wisely :')9
To become an engineer (CS/IT) in India, you have to study:
1. 3 papers in Physics (2 mechanics, 1 optics)
2. 1 paper in Chemistry
3. 2 papers in English (1 grammar, 1 professional communication). Sometimes 3 papers will be there.
4. 6 papers in Mathematics (sequences, series, linear algebra, complex numbers and related stuff, vectors and 3D geometry, differential calculus, integral calculus, maxima/minima, differential equations, descrete mathematics)
5. 1 paper in Economics
6. 1 paper in Business Management
7. 1 paper in Engineering Drawing (drawing random nuts and bolts, locus of point etc)
8. 1 paper in Electronics
9. 1 paper in Mechanical Workshop (sheet metal, wooden work, moulding, metal casting, fitting, lathe machine, milling machine, various drills)
And when you jump in real life scenario, you encounter source/revision/version control, profilers, build server, automated build toolchains, scripts, refactoring, debugging, optimizations etc. As a matter of fact none of these are touched in the course.
Sure, they teach you a large set of algorithms, but they don't tell you when to prefer insertion sort over quick sort, quick sort over merge sort etc. They teach you Las Vegas and Monte Carlo algorithms, but they don't tell you that the randomizer in question should pass Die Hard test (and then you wonder why algorithm is not working as expected). They teach compiler theory, but you cannot write a simple parser after passing the course. They taught you multicore architecture and multicore programming, but you don't know how to detect and fix a race condition. You passed entire engineering course with flying colors, and yet you don't know ABC of debugging (I wish you encounter some notorious heisenbug really soon). They taught 2-3 programming languages, and yet you cannot explain simple variable declaration.
And then, they say that you should have knowledge of multiple fields. Oh well! you don't have any damn idea about your major, and now you are talking about knowledge in multiple fields?
What is the point of such education?
PS: I am tired of interviewing shitty candidates with flying colours in their marksheets. Go kids, learn some real stuff first, and then talk some random bullshit.18
Perhaps not "best", but certainly most amusing, so what the heck!
Years ago as an intern, I applied to a large pharmaceutical company. On part of the application form, you had to enter the code of the department you were applying to.
What I *should have* put down was "IT", which is the department that houses all their devs. However, I didn't actually read any of what the codes meant, assumed that was the department for helping people with how to mail merge, and put down "COMPSCI" instead. This was computational sciences - loosely summarised as computational data analysis on various druggable molecules.
I do *not* have any sort of biology or chemistry background, so the interview was rather... interesting, and I muddled through on the basis of getting some more interview practice assuming it was a no go.
To my amazement, got a phone call saying that they'd been thinking they wanted someone more technical on the team, and despite my lack of scientific experience they thought I'd be a good fit. I was unsure as to whether I should accept for a while, but then decided to just go for it - and had a fantastic internship there, working on a great variety of stuff, and learning tons all under a supervisor who I'm still in touch with to this day.
tl;dr - Applied for the wrong job. Coincidentally got it anyway, and miraculously had a fantastic year working there.8
The exact moment when I understood what programming actually was.
I was getting hard times at my 3rd college grade, trying to implement the recursive sudoku solver in python. Teacher spent a lot of time trying to explain me things like referential transparency, recursion and returning the new value instead of modifying the old one and everything related. I just couldn't get it.
I was one of the least productive students, i couldn't even understand merge sort.
I was struggling with for loops and indexes, and then suddenly something clicked in my head, like someone flipped a switch, and i understood everything i was explained, all at once. It was like enlightenment, like pure magic.
I had sudoku solver implemented by the end of the lecture. Linked list, hash map, sets, social graphs, i got all of these implemented later, it wasn't a problem anymore. I later got an A for my diploma.
Thank you @dementiy, you were the reason for my career to blast off.7
This is simply beautiful. Visualized sorting algorithms using colors.
Just discovered it on twitter (@galka_max)
If you have capped mobile data, search for WiFi first. Could be pretty much data...
Watch them here:
The videos and gifs pretty much disable any compression technique.
Attached is their merge sort example heavily compressed from 16 to 5 megabytes to fit devRant's limits...4
Just finished my first game jam officially, it was fun and our game though being not working 100% was well done, we had art people and a sound guy, who btw made some amazing music for the game. A couple of us plan to work on the game after the jam (because we have time) and since it's more of a local jam our deadline for submission is extended until a week after the jam finishes. (Game broke after merge issues :D)
Glad I decided to go and try it out.
Hah but my issue was that moreso my time was spent on getting unity and a git gui or some sort to work on Linux mint, by half way through Saturday I did lol. Also not much for me to do since we had a total of six programmers.
So if I don't get a new laptop for the next game jam, it's setup to work, which is awesome.2
When I interview a super cocky candidate:
"Write a merge sort algorithm that works in linear time complexity."5
I know this sounds odd, but I really find algorithms things of delightful beauty.
A creative solution to some very deceptively complex problems.
Sure, some implementations aren't the best, but seeing them after just makes me appreciate the time and effort that must have gone into designing things like Merge Sort, Binary Search, Greedy Algorithms, BST, and Dijkstra's Algorithm.
So! If your code is unoptimal, looks terrible, or is a sheer abomination, take a moment to appreciate the little piece of art you've made before you go and make it better.1
So me and some colleagues joined a hackathon. We already agreed on our project architecture, UI design, and features to build and showcase. Halfway through development new features kept getting added without my inputs, I said to myself it's ok maybe they're just small insertions. But nope, they kept breaking my CSS and UI design and kept causing merge issues on our repo because, well, no one could seem to agree on the project scope. The last straw was, with a couple of hours left, someone went and added new screens and changed the application flow entirely, which entailed some rather nasty rework of my code to fix. Fuck that, I decided to just stop and let them sort the mess.
When it was our turn to present our project, the fucking cunts assumed I would do all the talking - even if they never sent over the slides they put together. Why the fuck am I going to present something drastically different from the initial, agreed-upon scope? I told them to do it themselves and I remained silent throughout the entire debacle.
Of course, we lost. But I wasn't surprised. The guys who presented kept on contradicting each other and were not unified in their vision. I'm never teaming up with them ever again. Fucking asshole douchebag fucks.
Just happened today!
So since this morning we've been trying to get our website ready for UAT deployment Monday next week, even though we only were told of it yesterday. Since we had some critical merge conflicts to unscrew on our dev branch for promoting to UAT, we sent a warning to everyone on our hipchat group
Dev team: @all please don't commit anything to the repo for an hour or so while we get the branch good for dev and uat build
Tech lead: ok
That should be enough warning, right? Surely our tech lead, who has been piling up our scope creep trying to please our stakeholders, understands well enough not to do a single goddamn thing on our repo until we sort it out, right?
10 minutes later our tech lead pushes several changes that not only break our builds but also remove all our configuration transformations. I just stormed out of the office to avoid sending her on a one-way ticket to slapsville and fuckyoutown. Geez goddamn louise.
At an interview, interviewer keep on hitting me with theoretical questions, why python don't have switch cases, what is default sorting in java etc... I told him I don't bother about theory, then this conversation happened.
I: do you know time complexities?
I: okay, tell me a few sorting or searching algorithms which have logarithmic complexity?
me: binary search (with loud and confident voice)
I: he told, in worst case it will have O(n) tell me any other
I: what are you thinking? what is time complexity of merge sort
i: it's logarithmic....
TL;DR When talking about caching, is it even worth considering try and br as memory efficient as possible?
I recently chatted with a developer who wanted to improve a frameworks memory usage. It's a framework creating discord bots, providing hooks to events such as message creation. He compared it too 2 other frameworks, where is ranked last with 240mb memory usage for a bot with around 10.5k users iirc. The best framework memory wise used around 120mb, all running on the same amount of users.
So he set out to reduce the memory consumption of that framework. He alone reduced the memory usage by quite some bit. Then he wanted to try out ttl for the cache or rather cache with expirations times, adding no overhead, besides checking every interval of there are so few records that should be deleted. (Somebody in the chat called that sort of cache a meme. Would be happy , if you coukd also explain why that is so😅).
Afterwards the memory usage droped down to 100mb after a Around 3-5 minutes.
The maintainer of the package won't merge his changes, because sone of them really introduce some stuff that might be troublesome later on, such as modifying the default argument for processes, something along these lines. Haven't looked at these changes.
So I'm asking myself whether it's worth saving that much memory. Because at the end of the day, it's cache. Imo cache can be as big as it wants to be, but should stay within borders and of course return memory of needed. Otherwise there should be no problem.
But maybe I just need other people point of view to consider. The other devs reasoning was simple because "it shouldn't consume that much memory", which doesn't really help, so I'm seeking you guys out😁
TFW you know you're going to be seen as a sort of code anarch or unenlightened (foo)barbarian for even suggesting that there are other git workflows more suitable than GitFlow, but you do it anyway.
Saying that I keep my master unprotected feels like telling Grandma I worship Satan.
I work with a very small team that's always physically nearby, we all get along well, trust each other and communicate to know what everyone is up to, which I guess is hard to believe in and of itself, but is it so fucking hard to believe that we'd be okay without redundant eternal branches or a vomitload of unbisectable history-warping merge commits?1
Currently debugging a project that was written over 4 years ago...
At first all was well in the world, besides the ever present issue off our goddamn legacy framework. This framework was written 7 years ago on top of an existing open source one, because the existing one was 'lacking some features' & 'did not feel right'.
Now those might be perfectly fine reasons to write a layer on top of a framework, but please, for all future devs sanities, write fucking documentation and maintain it if you're going to use said framework in all major projects!!
Anyhow back to the situation at hand, I'm getting familiar with the project, sighing at the use of our stupid legacy framework, attempting to recreate the reported bugs...
Turns out I can't, well I get other bugs & errors, but not the reported ones. I go to the production server, where I suddenly do can reproduce them...
Already thinking, fuck my life, and scared for the results... I try a 'git status' on the production server....
And yep, there it is, lo and behold, fucking changes on production, that are not in git, fuck you previous dev who worked on this and your stupid lazy ass modifcations on production!
Bleh, already feeling royally pissed, there's only 1 thing I can do, push changes back to git in a seperate branch, and pray I can merge them back in master on my dev environment without to much issues...
Only I first have to get our sysadmi. to allow pushing from a production server back to our git server...
Sigh, going to put on my headphones, retreat to my me space and try to sort out this shitpile now...
How come when implementing merge sort the mid doesn't need to deal with odd/even division?
I know int will always go down if there is decimal but how will it cover the whole array?
I guess in general, array indexing that involves dynamic cutoffs always confuse me.
How do you think about them without having to try things out on paper?7