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 - "space cake"
-
Lead dev: Hey boss, you really do like Python right?
Me: No
Lead dev: Well it's cuz I was think....wait what? WTF do you mean no, you have automated a fuckload of BS with Python and we are still using it, why tf would you use Python if you don't like it?
Me: I like it enough for the automation scripts that we have and for parsing documents or generating glue scripts, its already installed in every server that we have, so testing bs in dev and then using them in prod is cake, it doesn't mean I LOVE python, I like it for what we use it.
Lead dev: Well ain't already bash and perl installed as well?
Me: Do you know bash and or perl?
Lead dev: No, don't you?....
Me: No......
L Dev: (using a Jim Carrey impersonation) WELLL ALLRIGTHY THEN! What is the other language that you used for X project?
Me: Clojure, do you remember that one?
* he said paren paren paren paren yes paren i space paren do close paren close paren etc etc
L Dev: (((((((yes (i (do)))))))) and nevermind, I'll get back to working more with Python
Me: das what I fucking thought esse6 -
So I just spent the last few hours trying to get an intro of given Wikipedia articles into my Telegram bot. It turns out that Wikipedia does have an API! But unfortunately it's born as a retard.
First I looked at https://www.mediawiki.org/wiki/API and almost thought that that was a Wikipedia article about API's. I almost skipped right over it on the search results (and it turns out that I should've). Upon opening and reading that, I found a shitload of endpoints that frankly I didn't give a shit about. Come on Wikipedia, just give me the fucking data to read out.
Ctrl-F in that page and I find a tiny little link to https://mediawiki.org/wiki/... which is basically what I needed. There's an example that.. gets the data in XML form. Because JSON is clearly too much to ask for. Are you fucking braindead Wikipedia? If my application was able to parse XML/HTML/whatevers, that would be called a browser. With all due respect but I'm not gonna embed a fucking web browser in a bot. I'll leave that to the Electron "devs" that prefer raping my RAM instead.
OK so after that I found on third-party documentation (always a good sign when that's more useful, isn't it) that it does support JSON. Retardpedia just doesn't use it by default. In fact in the example query that was a parameter that wasn't even in there. Not including something crucial like that surely is a good way to let people know the feature is there. Massive kudos to you Wikipedia.. but not really. But a parameter that was in there - for fucking CORS - that was in there by default and broke the whole goddamn thing unless I REMOVED it. Yeah because CORS is so useful in a goddamn fucking API.
So I finally get to a functioning JSON response, now all that's left is parsing it. Again, I only care about the content on the page. So I curl the endpoint and trim off the bits I don't need with jq... I was left with this monstrosity.
curl "https://en.wikipedia.org/w/api.php/...=*" | jq -r '.query.pages[0].revisions[0].slots.main.content'
Just how far can you nest your JSON Wikipedia? Are you trying to find the limits of jq or something here?!
And THEN.. as an icing on the cake, the result doesn't quite look like JSON, nor does it really look like XML, but it has elements of both. I had no idea what to make of this, especially before I had a chance to look at the exact structured output of that command above (if you just pipe into jq without arguments it's much less readable).
Then a friend of mine mentioned Wikitext. Turns out that Wikipedia's API is not only retarded, even the goddamn output is. What the fuck is Wikitext even? It's the Apple of wikis apparently. Only Wikipedia uses it.
And apparently I'm not the only one who found Wikipedia's API.. irritating to say the least. See e.g. https://utcc.utoronto.ca/~cks/...
Needless to say, my bot will not be getting Wikipedia integration at this point. I've seen enough. How about you make your API not retarded first Wikipedia? And hopefully this rant saves someone else the time required to wade through this clusterfuck.12 -
Now this looks stupid already, but here is the kicker: by "partially hydrated cursor" i mean that once every page size an sql query is ran to get the next page content. This code is put in an event handler, executed once every time a file is uploaded in a dms where files get uploaded by the thousand.
To sum things up, this simple snippet achieves triple dipping:
* waste time on useless sql queries
* waste cpu on useless iterations
* waste disk space on useless logs
Icing on the cake, the author of this piece of shit was complaining about the overall slowness of the process.
Needless to say that when I stumbled on this, both internal *and* external screaming ensued...4 -
Totally not dev related but had to ait this somewhere... Yesterday my parents came to me and asked what the best way would be for them to have some space cake...
Totally caught me by surprise! Was so surprised I couldn't utter actual sentences for a solid 5 minutes...8 -
A couple fucking brutal, merciless dungeon moments.
So first, we were having a chill kind of session. Throwing lots of jokes and shit, and I rolled with it. The baddie for the day, I felt inspired, and named him Fawq El-Fuqer, which yes, is very unfortunate.
Anyway, we avoid his goons and reach his impenetrable fortress of chronic masturbation, and it goes as well as you think. The rogue says hey, we gotta get him with his pants down (pause) literally. The cleric is skeptical at first, but she comes around to it.
And so we do it. I spin this tale of a man who's got a schedule tighter than his fucking asshole. El-Fuqer meticulously plans his shits, he makes it a whole ritual, even gives it a special name: Mud O'Clock.
We wait for his alarm to ring, and spring into action while he's taking a fat stinking fucking dump. The warrior kicks down the bathroom door and corners El-Fuqer while he's on the shitter, demanding satisfaction for their past romantic involment that's been strongly been hinted at, you see, she said Fuck the Fucker and I, that's history. And that's enough for a subplot if you ask me.
So where was I? Ah, yes, the rogue bursts in through the window shouting out "Mud O'Clock MOTHER FUCKER!!" and we immortalize the moment in the finest silks. The wizard then does a little Bane impression for some reason and a multitude of loud 'plops' are heard as El-Fuqer evacuates the entire content of his putrid guts.
He gets roughed up a little, you know nothing like interrogating someone after they nearly shit themselves to death. We reveal some oooh so unexpected plot twist about a portal to goddamn hell and it's like well, crap, we gotta do something about that. So the wizard and the rogue leave to give the warrior and El-Fuqer some, ehem, space to settle their score.
What followed was the most unexpected, most brilliant part of the whole session. She didn't just execute him in a brutal, gruesome manner, no, she went full fucking throttle. Forced El-Fuqer to eat his own cock and balls while sewing his ass shut, then had a bowl of bull testicle salad to drop a montanious fecal cake of biblical proportions upon his face.
Believe it or not, we made it into an emotional moment. Because everyone was shocked by how brutal the affair was. Warrior had a mental breakdown like, uuuh, I'm becoming the monsters I swore to fight ooh no. She starting shaking and crap, ran away and hid in an alley to weep, it begins raining and it's getting very dramatic, so I cook up some spirit of sorrow that goes in and helps her face her fears and shit through the power of friendship or whatever.
Moving on to second moment, this is shorter but I like it best. The cleric and another two extras went to an old shrine to try and prove the wizard wrong about his denial of prophecy. Thing is, they did the ritual wrong. And I'm usually very forgiving but I was feeling nasty after the whole sowing of the asshole thing. So I'm like, uh, I gave you fools VERY PRECISE instructions on how to perform this ritual, and you just did some wacky prayers to the moon nonsense, that's idolatry in-universe and out-of-universe too (depending on who you ask).
So I said fuck it, you guys had it coming. I whip out immortal ten-thousand year old elder sorceress bitch guardian of the holy sphincter, and it gets real pretty fucking quick. She's got sanctified heavy plate armor, blue fire torches coming out they fucking pauldrons, argent greatsword of anal judgement plus infinity, all the juiciest shit.
Anyway, the sorc descends from the sky in a pillar of azure flames and is like yo, drop that idolatrous shit right now or I'm gonna kill you all. They mistake her for angel or some shit, and are like hey chill, we're the good guys. But the sorc doesn't give a shit, and she says shut the fuck up or I'll send you to the Night Eternal, bitch.
I dunno why but the cleric and the other two extras don't get it, so they insist with the whole heyyyy we are not idolaters, we're your friends, we are questing for the mandinga mandango mcguffango. So she bisects one, breaks the neck of another, and decapitates the fucking cleric. It was awesome.
So what did we learn? idk, don't plan your dumps and don't pray to the fucking moon if you're standing on hallowed ground. *****9