Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "paperclips"
-
Bob?
Yeah?
Bob, could you hand me that paperclip?
Sure mate!
Thanks.
Oh... Bob?
Uhhh... yeah?
Could you also hand me that paperclip?
Right... sure, of course.
Thanks.
Bob?
What?
Could you also hand me the next paperclip?
Fuck off, why don't I just give you the whole fucking box!
Yeah Bob, please, throw the whole fucking box.
Wait, is that a printed screenshot of my code you're attaching the paperclips to?
It sure is, Bob.16 -
I’m surrounded by idiots.
I’m continually reminded of that fact, but today I found something that really drives that point home.
Gather ‘round, everybody, it’s story time!
While working on a slow query ticket, I perused the code, finding several causes, and decided to run git blame on the files to see what dummy authored the mental diarrhea currently befouling my screen. As it turns out, the entire feature was written by mister legendary Apple golden boy “Finder’s Keeper” dev himself.
To give you the full scope of this mess, let me start at the frontend and work my way backward.
He wrote a javascript method that tracks whatever row was/is under the mouse in a table and dynamically removes/adds a “.row_selected” class on it. At least the js uses events (jQuery…) instead of a `setTimeout()` so it could be worse. But still, has he never heard of :hover? The function literally does nothing else, and the `selectedRow` var he stores the element reference in isn’t used elsewhere.
This function allows the user to better see the rows in the API Calls table, for which there is a also search feature — the very thing I’m tasked with fixing.
It’s worth noting that above the search feature are two inputs for a date range, with some helpful links like “last week” and “last month” … and “All”. It’s also worth noting that this table is for displaying search results of all the API requests and their responses for a given merchant… this table is enormous.
This search field for this table queries the backend on every character the user types. There’s no debouncing, no submit event, etc., so it triggers on every keystroke. The actual request runs through a layer of abstraction to parse out and log the user-entered date range, figure out where the request came from, and to map out some column names or add additional ones. It also does some hard to follow (and amazingly not injectable) orm condition building. It’s a mess of functional ugly.
The important columns in the table this query ultimately searches are not indexed, despite it only looking for “create_order” records — the largest of twenty-some types in the table. It also uses partial text matching (again: on. every. single. keystroke.) across two varchar(255)s that only ever hold <16 chars — and of which users only ever care about one at a time. After all of this, it filters the results based on some uncommented regexes, and worst of all: instead of fetching only one page’s worth of results like you’d expect, it fetches all of them at once and then discards what isn’t included by the paginator. So not only is this a guaranteed full table scan with partial text matching for every query (over millions to hundreds of millions of records), it’s that same full table scan for every single keystroke while the user types, and all but 25 records (user-selectable) get discarded — and then requeried when the user looks at the next page of results.
What the bloody fucking hell? I’d swear this idiot is an intern, but his code does (amazingly) actually work.
No wonder this search field nearly crashed one of the servers when someone actually tried using it.
Asdfajsdfk.rant fucking moron even when taking down the server hey bob pass me all the paperclips mysql murder terrible code slow query idiot can do no wrong but he’s the golden boy idiots repeatedly murdered mysql in the face21 -
Gave the office a pack of paperclips.
Whole team has been playing like cats. Not much work was done today.2 -
I've spent the last day at work playing Paperclips 📎. I fucking hate the author of that time eating machine!
-
The coolest project I ever worked on wasn't programming per second, though it involved a bit of scripting. The company I worked for had an FTP over TLS backup solution and it was put together with glue and paperclips by a guy that hadn't the slightest idea what he was doing. In order to conform with the insurance, data had to be encrypted. I setup a raid-ed server with full disk encryption on the raid volume that fetched the key over the network at boot from another secure server. I wrote a series of scripts for provisioning users and so on. The backup connections was sftp using a ssh tunnel, the users were chrooted to their own home directories, and were unable to open shells. The system was 100x more robust and secure than the original. I set it up on short notice and received absolutely no recognition for saving the company's ass, but it was definitely a fun project.1
-
Do any of you have a fidget spinner or other fidget gadget? They seem to be pretty popular right now esp the fidget spinners. If you have one does it actually help you, or does it actually become more distracting? I'm fine myself fidgeting with paperclips and was looking at a fidget gadget.7
-
So I wasted about 20 minutes yesterday because I forgot to look where I was plugging in my SD card...
I use a mid-2011 model iMac (with the CD and SD ports on the side), so, thinking I knew where the correct slot was, I attempted to put my SD card into the computer. Oh the adrenaline rush when I realized that the SD card didn't normally go all the way in...
So then I spent the next 20 minutes finding and poking various tools into the CD drive in order to fish out my 32 gig SD. Eventually I just ended up using two bent paperclips, but man, was that an adventure. -
Friendly reminder that some PSUs can literally be chained together with Molex connectors and a couple paperclips.4