Details
-
SkillsC++, Python, Qt, PyQt
Joined devRant on 6/17/2016
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
-
First rant, so here goes:
def initialize
@rant = 'when the contractor your boss brought in to help, whose weekly rate exceeds your monthly salary, doesn't know the difference between server side and client side technologies.'
end5 -
This is the prototype of my "Build Button". I press the button and it executes a build process. Keyboard shortcuts weren't good enough for me.15
-
Found in repository:
<some_code> //TODO fix it, its really important
It was commited 2 years ago... and still exists in code -
[POLL] How do you develop stuff?
1 - just write code. It doesn't need to be organized, it just need to work how you thought it would, and THEN you start organizing things, like editing/creating new files, letting things DRY, optimizing the sutff you did earlier;
OR
2 - you surgically write code, making sure you keep everything is organized from the beginning. Basically you only write when you are sure.
Or maybe it's a blend between the two or something.
I'm asking because I do like the #1 and I feel uncomfortable when people see my code when it's under development. It's a mess, there are tons of comments everywhere and a bunch of repetition. But, when I find the right stuff, I start writing modules to make my code work better, remove unnecessary things, add documentation, and so on.
My development process is not the best of the best, but I get things done with it.7 -
the best way to learn programming is not by just reading books and coding basic examples. it is to take up a project which seems impossible and start doing it piece by piece, with the help of Google and stack overflow14
-
I messed up carelessly in production. Learnt how SQL queries bite you in the ass when it knows you are under pressure.
Was hosting an online quiz kinda thing during my college techfest. Tens of thousands of people participating.
Using MySQL as database and thousands of queries were being executed. Everyone were pretty excited as the event just opened up.
None of the teams could solve one particular level. Turns out the solution was wrong and was asked by the organisers to change the solution for that particular level. Usual stuff, right?
Was too lazy to open up the web UI for the back office and so, straight ahead logged in to the MySQL server and ran the UPDATE query on the table consisting of the solutions.
It had been a couple of hours and the organisers came to me with a weird problem. There were no changes in the scoreboard for the last two hours. Everyone were stuck wherever they were. Weird, right?
I then realized.
Fk.
In that dreaded query, I had only run
UPDATE 'qa' SET answer = 'something'
leaving out the where clause, specifying the question to update, like
WHERE qno=13
As a result, solutions to all the questions were updated to the same answer. After hastily fixing everything back, I had the dreaded conversation.
Org: What was the problem?
Me: It was the cache.
Org: Damn thing. Always messes up.
Me: *sheepishly* yeah
Probably the most embarrassing moment in my life, wrt coding 😑4 -
Random guy at work pushed this to production today...
var i = 0;
do { // DO NOT DELETE THIS! }
while (i < 1);
....
doImportantThing();
And my boss keeps saying code reviews are overrated, lol.2 -
One of our web developers reported a bug with my image api that shrunk large images to a thumbnail size. Basically looked like this img = ResizeImage(largeImage, 50); // shrink the image by 50%
The 'bug' was when he was passed in the thumbnail image and requesting a 300% increase, and the image was too pixelated.
I tried to explain that if you need the larger image, use the image from disk (since the images were already sized optimally for display) and the api was just for resizing downward.
Thinking I was done, the next day I was called into a large conference room with the company vice-president, two of the web-dev managers, and several of the web developers.
VP: "I received an alarming email saying you refused to fix that bug in your code. Is that correct?"
Me: "Bug? No, there is no bug. The image api is executing just as it is supposed to."
MGR1: "Uh...no it isn't. Images using *your* code is pixelated and unfit for our site and our customers."
MGR2: "Yes, I looked at your code and don't understand what the big deal is. Looks like a simple fix."
<web developers nodding their heads>
Me: "OK, I'll bite. What is the simple fix?"
<MGR2 looks over at one of the devs>
Dev1: "Well, for example, if we request an image resize of 300, and the image is only 50x50, only increase the size by 10. Maybe 15."
Me: "Wow..OK. So what if the image is, for example, 640x480?"
MGR1: "75. Maybe 80 if it's a picture of boots."
VP: "Oh yes, boots. We need good pictures of boots."
Me: "I'm not exactly sure how to break this to you, but my code doesn't do 'maybe'. I mean, you have the image from disk.
You obviously used the api to create the thumbnail, but are trying to use the thumbnail to go back to the regular size. Why not use the original image?"
<Web-Dev managers look awkwardly towards the web devs>
Dev3: "Yea, well uh...um...that would require us to create a variable or something to store the original image. The place in the code where we need the regular image, it's easier to call your method."
Me: "Um, not really. You still have to resolve the product name from the URL path. Deriving the original file name is what you are doing already. Just do the same thing in your part of the code."
Dev2: "But we'd have to change our code"
Mgr2: "I know..I know. How about if we, for example, send you 12345.jpg and request a resize greater than 100, you go to disk and look for that image?"
<VP, mgrs, and devs nod happily>
Me: "Um, no that won't work. All I see is the image stream. I have no idea what file is and the api shouldn't be guessing, going to disk or anything like that."
Dev1: "What if we pass you the file name?"
<VP, mgrs, and devs nod happily again>
Me: "No, that would break the API contract and ...uh..wait...I'm familiar with your code. How about I make the change? I'm pretty sure I'll only have to change one method"
VP: "What! No...it’s gotta be more than that. Our site is huge."
<Mgrs and devs grumble and shift around in their chairs>
Me: "I'm done talking about this. I can change your code for you or you can do it. There is no bug and I'm not changing the api because you can't use it correctly."
Later I discovered they stopped using the resize api and wrote dynamic html to 'resize' the images on the client (download the 5+ meg images, and use the length and width properties)22 -
Bored waiting for code to compile so here is a joke someone sent me last week .....
A man walks in a bar with his pet monkey. He sits down and orders a drink, meanwhile the monkey is running around all over the place and jumps up on a pool table. He grabs the 8 ball, shoves it into his mouth and swallows it hole.
"Holy crap!" says the bartender, completely livid. He says to the man, "Did you see what your stupid monkey just did?"
"Nope. What did he do this time?" says the man.
"He just swallowed one of the balls off the pool table, whole!" says the bartender.
"Yeah, well I hope it kills him 'cause he's been driving me nuts" says the man.
After finishing his drink, the man leaves.
A few weeks later the man returns to the bar with his monkey. After ordering a drink, the monkey starts running wild around the bar again. Up on the bar, he monkey finds some peanuts. He grabs one out of the bowl, sticks it up his butt, then pulls it out and eats it. The bartender is disgusted.
"Did you see what your stupid monkey did this time?" he asks.
"What now?" responds the man.
"He stuck a peanut up his butt, then pulled it out and ate it!" says the bartender.
"Well, what do you expect?" replied the man. "Ever since he ate that pool ball he measures everything first!"4 -
This is what I found in the logs:
3280546 I had a cup of tea and now it's fixed
9daaf6c copy and paste is not a design pattern
958ca5b It compiles! Ship it!
a9edf8d LAST time, Masahiro, /dev/urandom IS NOT a variable name generator...
438072f 640K ought to be enough for anybody
1fb839b Too lazy to write descriptive message
4d70890 ...
d6ce0c8 Ugh. Bad rebase.
a00b544 Programming the flux capacitor
49715cb Fix my stupidness
4babf07 Do things better, faster, stronger
49b3a7b SEXY RUSSIAN CODES WAITING FOR YOU TO CALL
12c7b55 formatted all
2658c87 and so the crazy refactoring process sees the sunlight after some months in the dark!
2376c89 - Temporary commit.
a83220a I honestly wish I could remember what was going on here...
3347007 work in progress
3382b4c well crap.
109748a Glue. Match sticks. Paper. Build script!
c3f025e Useful text
70394e7 Who knows WTF?!
0d78f14 breathe, =, breathe
5344e39 removed tests since i can't make them green
8a3a6bf better grepping
2777cc4 first blush
cf620ff Continued development...
9591c19 Too lazy to write descriptive message
767e0cd Some shit.
763602a Yes, I was being sarcastic.
8d7a602 /sigh
c6296e5 rats4 -
Would people use a feature where they could swipe on a rant they've seen. This way newer stuff could be let through but old stuff wouldn't keep popping up every time you reopen devrant.8