Details
Joined devRant on 2/21/2018
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
-
!dev
So I've just been evicted, apparently the house I have a room in is being repossessed.
Now living in a tin hut in the middle of a field. Loving life, life loving me.9 -
Most satisfying bug I've fixed?
Fixed a n+1 issue with a web service retrieving price information. I initially wrote the service, but it was taken over by a couple of 'world class' monday-morning-quarterbacks.
The "Worst code I've ever seen" ... "I can't believe this crap compiles" types that never met anyone else's code that was any good.
After a few months (yes months) and heavy refactoring, the service still returned price information for a product. Pass the service a list of product numbers, service returns the price, availability, etc, that was it.
After a very proud and boisterous deployment, over the next couple of days the service seemed to get slower and slower. DBAs started to complain that the service was causing unusually high wait times, locks, and CPU spikes causing problems for other applications. The usual finger pointing began which ended up with "If PaperTrail had written the service 'correctly' the first time, we wouldn't be in this mess."
Only mattered that I initially wrote the service and no one seemed to care about the two geniuses that took months changing the code.
The dev manager was able to justify a complete re-write of the service using 'proper development methodologies' including budgeting devs, DBAs, server resources, etc..etc. with a projected year+ completion date.
My 'BS Meter' goes off, so I open up the code, maybe 5 minutes...tada...found it. The corresponding stored procedure accepts a list of product numbers and a price type (1=Retail, 2=Dealer, and so on). If you pass 0, the stored procedure returns all the prices.
Code basically looked like this..
public List<Prices> GetPrices(List<Product> products, int priceTypeId)
{
foreach (var item in products)
{
List<int> productIdsParameter = new List<int>();
productIdsParameter.Add(item.ProductID);
List<Price> prices = dataProvider.GetPrices(productIdsParameter, 0);
foreach (var price in prices)
{
if (price.PriceTypeID == priceTypeId)
{
prices = dataProvider.GetPrices(productIdsParameter, price.PriceTypeID);
return prices;
}
* Omitting the other 'WTF?' code to handle the zero price type
}
}
}
I removed the double stored procedure call, updated the method signature to only accept the list of product numbers (which it was before the 'major refactor'), deployed the service to dev (the issue was reproducible in our dev environment) and had the DBA monitor.
The two devs and the manager are grumbling and mocking the changes (they never looked, they assumed I wrote some threading monstrosity) then the DBA walks up..
DBA: "We're good. You hit the database pretty hard and the CPU never moved. Execution plans, locks, all good to go."
<dba starts to walk away>
DevMgr: "No fucking way! Putting that code in a thread wouldn't have fix it"
Me: "Um, I didn't use threads"
Dev1: "You had to. There was no way you made that code run faster without threads"
Dev2: "It runs fine in dev, but there is no way that level of threading will work in production with thousands of requests. I've got unit tests that prove our design is perfect."
Me: "I looked at what the code was doing and removed what it shouldn't be doing. That's it."
DBA: "If the database is happy with the changes, I'm happy. Good job. Get that service deployed tomorrow and lets move on"
Me: "You'll remove the recommendation for a complete re-write of the service?"
DevMgr: "Hell no! The re-write moves forward. This, whatever you did, changes nothing."
DBA: "Hell yes it does!! I've got too much on my plate already to play babysitter with you assholes. I'm done and no one on my team will waste any more time on this. Am I clear?"
Seeing the dev manager face turn red and the other two devs look completely dumbfounded was the most satisfying bug I've fixed.5 -
How do you like my setup? Ubuntu laptop on the left, windows laptop on the right.
(And giant rubber duck upper left 😼)13 -
Last today's project (I think).
The history: a good cover for this pool costs as much as the pool.. The fuckers are selling the pools cheap and accessories really expensive.
7 euros cover that uses the sun to heat the water. Added hocks but no need, only really needed the weights. So... 1 extra hour spent, but I like my hocks :D5 -
Let's see if my cover really stores heat...
I'm Melting in the shade :( can't work like this.
My nephew and I tryed my convencional milling machine, written half his name. I still got it
Funny thing, I'm noticing now... All the man from my direct family are crazy.
I was helping the mechanic yesterday, telling my adventures and he was always, lik he said father like sun.. The inventors...
Today I finally got my brother for an hour.. He is even crazyer then me, told me just a few of his diys and I'm like... Wow8 -
To hot to be at home. Tought of studying outside...
Damn mosquitos were eating me alive. The fuckers.
And didn't print any cnc manual, great2 -
Hey guys.
I've been using instructables a lot for arduino tutorials. Do you guys know other sites like that?14 -
Hey Guys.
https://userland.tech
For Linux fans and who wants to learn Linux there is a new app with a Linux VM on Android, it's called UserLand , testing it now. Has Debian and Ubuntu5 -
Psu >> cheap, low running cost power supply
So... Gonna turn my first psu in a low cost power supply for my projects.
Found this beauty, only 250W and has the description of all wires with Amps...
Nice :D8 -
@Condor did you mention this?
One of my final projects... To connect gas, movement, IR pir and do a all arround protection sistem. I'll build the on-off for the gas difectly in the box for the arduino, it's the easy way, since I can now make an app to control it online.
Sorry forgot the pic20 -
Hey guys, noob hydraulics Question
I have this water pump:
https://aliexpress.com/item/...
What is the best way to increase the pull, so it sucks further?
I want to use it to vacuum my pool.4 -
My mom is amazing, bought one of this for me to try and Limon concentrate because I love lemon juice3
-
Went to my favorite scrapyard but it's hard to catch my friends here (I worked here for 6 months, learned a lotttttt). I always leave a surprise. This time I also brought aluminum to give so I much hide the bag and I'm placing a ridle.. This bottle in the front door. Let's see if they get it3
-
To the ranter who showed the memo on Blades of Glory, THANK YOU.
You don't see comedy like this, this days3 -
Found this book amongst other 7 grade school books...
Fuck, kids are learning the basis for every technical job this days, in my time even chemistry was only theory... Let alone practical lessons5 -
I'm picking old manuals and documents for recycling, enough to fill one handcart.
Just found a letter from old girlfriends and lovers, and a folder full of a closed form of soft non-gender hentai...
Why do I find homoerotic hentai art better then more normal hentai... I don't know, but I still do.
Well, I'm just gonna save a few... hehe
Btw, also found some paintings and drawings I forgot I've done, 15 years ago. :D2 -
Checking Android Pie changes.
First frase:
"Android 9 harnesses the power of artificial intelligence to give you more from your phone. Now it's smarter, faster and adapts as you use it."
Ok... So all Android Pies will have the possibility of becoming self-aware? If they have A.I. ...2 -
That time after you changed to Linux and you really need windows...
Trying to root my new server :( Don't know why can only use USB1 on my VirtualBox VM... Fuck man26 -
Good morning, good day and good weekend.
Sometimes babysitting is worth it Hehehehe.
No projects today, resting day, me, the pool, my nephews and a arduino basic manual.4 -
What did I just saw?? And I had a free VPS on this service with 512mb, could be using a duped computer :-D sended request, have my doubts...80
-
What is the social networking programmers use to communicate.
Hey guys.
So what program do you guys use to communicate? Something that I can drop here and not behing spammed. Time to start creating my own network arround you guys... You know, smart people.11 -
Hey guys.
Can't find help for this.
I want to program my arduino with my phone, but ArduinoDroid doesn't detect the Arduino while the device detects a USB device plugged in.
Can't find any help so don't know if it's my android (xioami mi A1 Android 8.1, soon Android 9). Anyone who uses that knows?5 -
Batteries and power.
Hey guys. I have a question I have to rectify so I can think without doubts.
Let's say I have a sistem with solar power, a 1 lipo battery, one lipo module and arduino + shields and I want to power only by the 🔋.
My question is: is it good practice to charge while discharging at the same time with a lipo module? Won't it damage the batery and incrise the chance of fire? Thank you6