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 - "returns"
-
FINALLY
GODDAMNED
FIXED
I'VE SPENT OVER A GODDAMN WEEK SWIMMING THROUGH DEMON EXCREMENT WITH A MAGNIFYING GLASS TRYING TO FIND THE SOURCE OF THIS SHIT.
I FINALLY FOUND IT. IN A FUCKING. CONDITIONAL. OVERLOAD. OF A MODEL GETTER.
THAT ABSOLUTE NONSENSE RETURNS EITHER THE REQUESTED COLUMN FROM THE DATABASE, OR AN ENTIRELY FUCKING DIFFERENT COLUMN, ALL DEPENDING ON THE VALUE OF A THIRD FUCKING COLUMN.
HKJSDFASKFJ
TO MAKE MATTERS WORSE.
THE VALUE IT RETURNS. IS COMPLETELY WRONG. FOR ALMOST. EVERY. FUCKING. CASE.
BECAUSE THAT FIRST COLUMN? IT NEVER GETS UPDATED. EVER.
AND THIS DEALS WITH ACCOUNTING AND REAL GODDAMN MONEY.
AARRGHHHHH
WHAT THE HELL WERE YOU THINKING?!28 -
My little brother (still in school , learning security and pen testing): i found a bug in a website , it returns an xml file instead of the web page , i reported it to them and i think i'm gonna get rewarded like 2k $ for it .
Me : cool ! Show me .
Him : shows me his phone ...
Me : wait , gotta rant this .9 -
What kind of music from video games has stuck in your head?
For me it was nearly all music from American McGee's Alice(because that OST is absolutely unique), Bumby's Office from Alice: Madness Returns, along with some other music, Crysis 2 Theme(it stuck in my head for at least a month after having beaten it), some songs from Still Life, the theme for Ori and the Blind Forest, Halo Theme(of course), and others I just cannot remember...48 -
*Reads dokumentation*
"Function A returns a float, see Function B for more information."
- Alright! *Scroll*
"Function B returns a float, see Function A for more information."7 -
I found a healthCheck function while troubleshooting an old application for a large auto manufacturer today. The healthCheck function was running several times a day on a timer. The function tries to insert a record into the database and returns whether or not it was successful. It was written in 1999 and has to date inserted over 2.5 million records into the database! 1/3rd of the data for this application was the same record.
How the hell did nobody notice this for 20 years!!!3 -
Who the fuck on earth named it Chef. You idiots, if I google Chef I get people wearing aprons on my browser. And what the fuck is cookbooks, cookbooks for chef returns 60 ways of making chicken. Who on earth has such naming convention for IT DevOps. Recipe, cookbooks, knife. Dafuq is wrong.10
-
You know you're fucked when google returns less than a page of results on your short three word query. The first result is the only question on SO related to your problem un-answered for two years and the rest of them are in Chinese or Russian.8
-
If you like Google algorithms better, you can always just precede your duckduckgo search with !Google
Returns an encrypted Google search8 -
This is not a joke. This is not something I wrote to be funny. This is not found randomly off the internet. This is a real part of the project I inherited: a function that not only is more cumbersome to use than the simple <Array>.contains that it wraps, but rather than returning the boolean result from the function, sends it through an if statement and returns hardcoded true and false values for... Good luck? I guess?47
-
If only it was this simple. Hi all, im new, I found this app while window shopping the play store, after reading some of the daily post, I think im gonna stay :) i wish your code the best. *returns to staring at compiling error for the next 3 hours*1
-
YouTube: you want 3 months of free YouTube premium? YouTube originals!!!
*Closes YouTube app and returns to Yatse to control my Kodi installation*
*Returns back to the YouTube app*
YouTube: oh, did you ever wish that you could play videos in the background?!
FUCK NO!!! I've got NewPipe and youtube-dl for that!!! The latter even combines nicely with my BlackPlayer EX!!!
Open source is amazing. The ability to just say no to those profiteering gluttons because you already have what they're offering as a "premium feature". Fucking awesome!9 -
We have an API which returns 600 MB of JSON.
Because client "Wants to see everything first and then apply filters, just like Excel".
FML
Edit and ofc thier laptops with core i3 and 4GB of ram can't even process that.40 -
So a coworker wrote this -- a function that returns a view if a specific object exists in the database. Now what would happen said object doesn't exist in the database? Forget about returning false and handling it properly, he decides that the function should print (echo) a zero! Not to mention almost all his if-else blocks prints a fucking zero when the if condition is false (there are 8 of them, if you're asking). Error messages? The hell with those.
He is now the PM btw. I've had enough of this shithole.14 -
Boss refused to sing my termination latter saying he wont sign it until CTO returns from vacation (2-3 weeks)... So today i brought my freelance project to work and i work on it.. guess who is making more €/h today and doesnt have to pay for electricity11
-
Boss: "Can you create a login page where every login fails?"
Me: "Sure thing!"
*Writes out php file that returns false and calls it via AJAX*8 -
Saturday plan: serious switch to Linux.
1. Installs Fedora, lookin nice.
2. Let's update it, fails to boot.
3. Nouveau driver fails, lets install proprietary one.
4. dnf install dependencies, repo returns 503
5. Be stuck on a 640x480 bash.
6. Boot windows, start overwatch.15 -
Coworkers: "Who still even uses vim? Glad we've got Visual Studio so we don't have to deal with ancient shit tools like that!"
Me: "Psh, yeah, total losers right? Haha!"
**Sheepishly returns to coding using the VsVim extension**8 -
*downloads Torrent that's about to die*
Oh wicked, both of my peers have the whole thing and I can just come in and let my server seed it as well!
*watches asdfmovie as it downloads*
*returns*
Peer 1: have some data man
Peer 2: fuk off, I wan ma deta for meself
Pussy.
(Quite ironically, as I'm posting this rant, Peer 2 magically sent out data again as well.. coincidence? I think not!)4 -
Alright, this is a new one to me, and wow am I blown away.
Working on upgrading an API that I did not build. Getting things running well enough and then an endpoint (which runs well enough in the tests) returns a `418 I'm a teapot`
Yeah, you read that right "I'm a (motherfucking) teapot"
The description is that...
"refuses to make coffee because it is a teapot"
It was an April fools joke in the beginning.
I couldn't return that error if I tried!
This shit is bizarre.
For your reading pleasure:
https://developer.mozilla.org/en-US...3 -
Today's highlights include:
The offshore team has put code gems in production featuring the example code generated on project startup that you're supposed to delete or overwrite, an API endpoint that just returns the value 5, and various debugging console.logs. it's a delight reading their code.
My boss also forgot the meeting he called me in for so I've been sitting here waiting for 20 minutes when I could have gone home. I'm glad it's friday17 -
friendsList.getBest().getHelp()
doesn't work.. I thought getBest() returns null.. but it turns out that friendsList is empty..
*cries in whatever language2 -
Anyone had this situation ?
Compile:
It returns null
Change something:
It returns error
Undo the last something and compile:
Works perfectly
😵😵😵😲4 -
Two years ago: company exec (Mac fan) buys a Surface Pro to show off our .NET application to customers as he travels. Hands it to me (I build releases) and I iron out a few Win 8 bugs since we'd always used Win 7 before. Get it set up, get to like the device a little, he takes it home... and returns it within 24 hours because he didn't mesh well with Windows. (Again, Mac user.)
8 months later he buys a Surface Pro again. I install our latest release, verify that everything is working as expected with hardware we normally don't use, and give him a controlled setup that will just work when he's at a customer site. Once again, he returns the Surface within 24 hours because he can't get used to Windows.
At least we verified Windows 8 compatibility, I guess.1 -
Feel like a god!
I've made an API service that returns a list of countries based on a temperature range that they will have within the next 10 days for spur of the moment holidays.
It even finds you the cheapest possible flight ticket from your location to it.
So many nights were spent raging since I had never touched node js until 9 weeks ago and I have other huge pieces of work on the burner.
Once it's finished and works properly, how does one market such a service?9 -
Well, after two hours of scratching my head, I found that angular.isNumber () returns true when you pass in a NaN. Brilliant.2
-
Try this code in JS:
++[[]][+[]]+[+[]]
This is valid and returns the string "10" in JavaScript :)))
Source: in comment👇5 -
Past few weeks, I have started to work late night and sleep whole day. I go to office at around 7pm and returns back next day 8-9am. I found it super productive.
But, my manager wasn't happy about it and now, she shifted daily scrum at 1 PM and emailed me to make sure I attend it daily.
Now, I have to fix my sleeping cycle... Nights are so great to work. Silent and nobody around.
Now, from tomorrow, I got a new challenge everyday to make it to scrum daily.6 -
Client's API returns a very weird response that changes its structure depending on its content.
When a array field has more than 1 children it returns:
{
"field" : [
{ "name1" : "value1"},
{ "name2" : "value2"}
]
}
So far so good. However, the fuckery happens when it has 1 children:
{
"field" : { "name1" : "value1"}
}
WTF! So the client API can return either a JSON object or an array and we cant trust the specs they gave us.4 -
Coworker: since the last data update this query kinda returns 108k records, so we gotta optimize it.
Me: The api must return a massive json by now.
C: Yeah we gotta overhaul that api.
Me: How big do you think that json response is? I'd say 300Kb
C: I guess 1.2Mb
C: *downloads json response*
Filesize: 298Kb
Me: Hell yeah!
PM: Now start giving estimates this accurate!
Me: 😅😂4 -
Python Dev Learning C#: I'll just wait until I run the program to see what type the function returns.
Me: Static typing means you know that before the code even compiles!
Python Dev: Sometimes I forget that all functions explicitly say what they can return.4 -
!rant
Has anyone looked at the linux kernel 1.0?
I am amazed with this! And the comments are priceless
e.g:
tcp.c
/* I hope this returns what I want. */
return(~d+1);
buffer.c
* 14.02.92: changed it to sync dirty buffers a bit: better performance
* when the filesystem starts to get full of dirty blocks (I hope).
*/
So cool!!!!3 -
So I just got this email from a tech company, I registered to send my CV some years ago , about a dev Job openning.
The descripition included:
Java and Angular ( first red flag )
So I go to their site to check it out ...
No https, ping the domain returns an ip from another continent with 500+ ms latency.
Major flaws on the site usability...
Super dumb password recovery method...
I'm fucking outta here dude. I might send them a proposition to fix their servers and at least put it behind letsencrypt though...
And these morons have big clients, like my bank... wtf...4 -
Fried from working all day, not long after getting up and doing something else the itch returns.
Coding is a drug and we're all addicts. -
...i just remembered why I have a MasturbatorPattern repository on my bitbucket, why is it named that way, and what it does.
It's one of the core abilities of that magical AI i've mentioned in my previous rant. And it's called that way, because of how it works:
The Agent has some objects (as in, class instances) available to it, and wants to get some other kind of object. So it inspects by reflection ("touches") all objects around itself, inspecting their public functions, building up a plan/path/tree of "this function takes the object I have as input, and returns this other object which this other function of other object takes as input and returns this different object, which...." etc, etc, until the final function returns the object the Agent wanted to get in the first place.
And then it goes and "does" all those functions, in that order piping the parameters through.
So first it touches them (second layer of metaphor - linux finger command), and then it does those which output (ejaculate =D) something useful to it.
Therefore, MasturbatorPattern =D
Not sure if my sense of humor is just weird or outright unfunny.8 -
API returns two date time in json (x-date-time, y-date-time) both of which are coming wrong.
Instructions for consuming API :
Take date part from y-date-time and time part from x-date-time and combine them so you would have the desired result1 -
My code was doing the exact oposite of what I wanted it to do and it took me about 2 hours to find out that strcmp() returns 0 when the strings match, problem solved, fml.4
-
Been programming Java for a few weeks now, and WTF is this, Java?!
"Example".equals("Example")
What is wrong with the form that a dozen of other languages use?
"Example" == "Example"
P. S. If you don't know Java, the latter one compares for the type of objects and always returns true in this case.15 -
Worst collaboration experience story?
I was not directly involved, it was a Delphi -> C# conversion of our customer returns application.
The dev manager was out to prove waterfall was the only development methodology that could make convert the monolith app to a lean, multi-tier, enterprise-worthy application.
Starting out with a team of 7 (3 devs, 2 dbas, team mgr, and the dev department mgr), they spent around 3 months designing, meetings, and more meetings. Armed with 50+ page specification Word document (not counting the countless Visio workflow diagrams and Microsoft Project timeline/ghantt charts), the team was ready to start coding.
The database design, workflow, and UI design (using Visio), was well done/thought out, but problems started on day one.
- Team mgr and Dev mgr split up the 3 devs, 1 dev wrote the database access library tier, 1 wrote the service tier, the other dev wrote the UI (I'll add this was the dev's first experience with WPF).
- Per the specification, all the layers wouldn't be integrated until all of them met the standards (unit tested, free from errors from VS's code analyzer, etc)
- By the time the devs where ready to code, the DBAs were already tasked with other projects, so the Returns app was prioritized to "when we get around to it"
Fast forward 6 months later, all the devs were 'done' coding, having very little/no communication with one another, then the integration. The service and database layers assumed different design patterns and different database relationships and the UI layer required functionality neither layers anticipated (ex. multi-users and the service maintaining some sort of state between them).
Those issues took about a month to work out, then the app began beta testing with real end users. App didn't make it 10 minutes before users gave up. Numerous UI logic errors, runtime errors, and overall app stability. Because the UI was so bad, the dev mgr brought in one of the web developers (she was pretty good at UI design). You might guess how useful someone is being dropped in on complex project , months after-the-fact and being told "Fix it!".
Couple of months of UI re-design and many other changes, the app was ready for beta testing.
In the mean time, the company hired a new customer service manager. When he saw the application, he rejected the app because he re-designed the entire returns process to be more efficient. The application UI was written to the exact step-by-step old returns process with little/no deviation.
With a tremendous amount of push-back (TL;DR), the dev mgr promised to change the app, but only after it was deployed into production (using "we can fix it later" excuse).
Still plagued with numerous bugs, the app was finally deployed. In attempts to save face, there was a company-wide party to celebrate the 'death' of the "old Delphi returns app" and the birth of the new. Cake, drinks, certificates of achievements for the devs, etc.
By the end of the project, the devs hated each other. Finger pointing, petty squabbles, out-right "FU!"s across the cube walls, etc. All the team members were re-assigned to other teams to separate them, leaving a single new hire to fix all the issues.5 -
Genuine snippet of code from something we are rewriting from scratch..
// Returns true if section length is greater than maximum path
public bool isOversized(double sectionLength) {
return false;
}
Fffuuuuuu6 -
Me: Return data from Firebase into unity project
Firebase: Returns data as object
*Type casting fails for 6hrs*
Finally find the reason Data return type is int64 and I was saving as int32
Now I sit and question my life while listening to epic music2 -
Fuck you javascript and your bizarre Date object.
May your ass itch, and arms become too short to reach.
Spend a good hour debugging why this fucker:
(new Date).getDay();
Returns 3, when it's actually the 2nd of May.
Turns out the value returned by getDay is an integer corresponding to the day of the week.
(new Date).getDate(); it is, ಠ_ಠ15 -
I’m writing funky code. I hope no one notices.
For instance, I needed to add a function which returns whatever is input to it.16 -
So I found out few days ago that I’m pregnant. All’s well, except this guy who sits behind me in the office and keeps going out for a smoke every hour and returns smelling strongly like cigarettes. The smell fades after a while and he goes out again. Repeat.9
-
when the IBMQuantumExperience python package just returns "400: GENERIC ERROR"
come on, how the fuck am I supposed to debug that?8 -
I just wrote this stub function for my test and thought it was a bit ridiculous and had to share.
A function that returns a function that returns an object with just one function6 -
Playing Minecraft minigames.
It's a pictionary clone. One player draws a secret word while the other players have a minute to guess.
Along the bottom is a hint.
Hint is in "_ _ _ l e" format.
Possible word is apple, for example.
I already win half of the games.
I can win more.
Initiate cheating.
Python script that accepts input in same format as hint and returns a list of results based on the word database.
Any time I come across a new word just add it to the database.
Stopped at 69 words tonight.
Game on.5 -
!rant
2 days ago I made an image crawler with a web interface that scrapes whatever url you put in and returns a list of images that it found on that website, right now it's only limited to img elements
It was pretty fun to work on it during the weekend :39 -
Building a wheel is great.
Building a steering wheel is also great
Building a brakes pedal is amazing.
Making them work asynchronously - not that good of an idea is it...
Who the fuck thought separating data stream (copying bytes) from stream control (when does the stream start/end) is a good idea...?
- open a connection
- send data to the stream
- send() returns
- close the connection
Apparently, the send() does not copy the data and returns. Instead, it enqueues the data copying task end returns. When does the actual copying start? IDK. When does it end? IDK. Can I close the conn? NO!
This thing is UNUSABLE. And I'd riddle it with reflection-based workarounds if it weren't for the static methods.
Fuck!3 -
Debugging an assertion for hours that keeps failing on 19 == 20 , and you just cannot figure out why it returns 20, until you realize that it in fact returns 19 and the constant in the test case that you screwed up at the start reads 20.7
-
Because fuck logic.
'This returns a lot of rows
myAdapter.SelectCommand.CommandText = "SELECT FROM tblNews order by DateAdd desc "
myAdapter.Fill(rs)
'He only wants the 4 latest articles
For index = 0 to 4
'Do something with the data
Next
How some people manage to still have a job is truly fucking amazing.4 -
My phone crashed (probably bricked), so I had to return it to the retailer for repairs.
They lend me a phone until mine returns from the shop. It is ancient. I feel like an archaeologist.5 -
Have a query that runs in 01:58 and returns 517860 records. Rewrite it a bit for performance reasons, try running again, now it runs in 01:17 and returns 517870 records. Where the hell did I pick up those extra 10 records on that many total records?
I hate optimization...5 -
Most satisfying bug to fix...
Literally any API bug that returns JSON. Nothing quite like seeing that JSON blob come back correct.1 -
Api-docs: Use the query parameter name_pattern to return results that contain name. Otherwise use name to return an exact match
Api: Returns *name* results when using name and everything when using name_pattern without a wildcard -
Progress: I have Lua code running, however it returns an error every time.
An error containing the result I wanted.3 -
Guy I work with messaging me: Hey could you check my SQL syntax to get the date part for the month and year.
Me thinking: Ughhh this is going to be something stupid I know it. Why doesn't he just check it himself?
I check it... 2 queries that are very, very, very... simple... and similar except one returns last year (2017) and the other returns the current year (2018)
Me: Not sure what your issue is... I'm not getting any syntax errors. They are executing
Him: Well it shouldn't show 2017, it should show 2018
Me thinking: learn to debug you lazy fuck
Me: Well you're adding a -1 to your year...(Not sure why your even adding to it if your just getting the current month and year)
Him: Oh you're correct! That makes sense
Waste of my time2 -
Oh dear Apple,
so you're telling me that for the camera API, the requestAuthorization() method returns a bool and for the PhotoLibrary it returns an enum. Why are you going with an enum when there are 2 states and the camera api doesn't use an enum?
(The 2 methods serve the same purpose, the enum exists in the camera api as well and has the exact same states)
And why do I need access to users photos, if I only want to write photos?2 -
Instructions on how to become suicidal:
- Create an API controller for the /file/ path
- Add an empty endpoint for POST /file/upload (will write it later!)
- Forget about this endpoint at some point
- Later, create a page for /file/upload
- GET /file/upload returns page
- POST /file/upload returns empty 200
Pure psychological horror for like an hour Googling why the fuck my razor page is returning empty responses and my breakpoint on OnPost is not fucking hitting even if I copy and paste example code from the ms website
Oh yeah, that controller.5 -
Wrote a small code to test my "Reset Password" feature, service console kept printing: User not found and returns 404
I was 100% I added that user manually to the database....
Well it turned out I added that user to the wrong database. I need to sleep T_T -
Webservice asks for parameters. We give the right parameters, gets results.
Now here's the funny part, we replace the parameters with "banana". Same results.
So no matter what parameters you pass, it returns THE SAME FUCKING RESULTS.1 -
One of our internal apis returns an array in which the first element is metadata about the request.
Why would anyone want to punish their users like that5 -
“hi all, we are cancelling the last two releases this year due to instability that we can’t fix by the cut off. If the server returns an error, every react-native built component crashes and stops working until a relaunch”7
-
$md5 = md5_file($file_uri);
=> Returns false
Mmh...
die(is_readable($file_uri));
=> Returns false
[Mmh intensifies]
if(!is_readable($file_uri)) {
chmod($file_uri, 0777);
}
=> Chmod() returns false
GAAAAH FUCK THIS I CALL IT A DAY6 -
Instagram returns 404 when profile is not found and no user is logged in but returns 200 for the same url when any user is logged in. WTF!
Took me so long to debug this shit2 -
Feel free to make fun of me on this one.
> be me.
> Write a function that calls a second function to get a returned value and continue work.
> That second function always returns null no matter what changes are made.
> Spend half hour scratching head.
> That second function has this written at the end
return null;
//return $returnVal;
> fml.13 -
What the sh*t is this kind of response?! One of my corporate department's internal API returns THIS.
LOOK AT IT. LOOK. "NULL". What are those malformed closing / ending brackets?!
(request headers have accept: application/json btw)
And, as a final "f*uck you", the "IPG_API_JOBD_NC_RESP_P_COLL" is returned as JSON object if response has one element to return, but will be JSON ARRAY if result has more than one element.
Good luck, you there with strongly typed languages..... Boils my blood 😅4 -
There are comments in prod code which say "need to change after POC" or something similar in multiple places.
Also, something that was designed to check something, but the call is made in such a way that it always returns true.
Best part, all the original authors left the company before I joined this team.1 -
Trying to work with an API that has no response object (it just returns empty arrays if something breaks) and it's JSON is not key-value.. just a bunch of dynamic nested values. just wow.3
-
KISS, DRY, Path of Least Resistance, Three Strikes and You Refactor, early returns, no array.map when nothing is returned, only use switch when # cases >= 3.
And using var in javascript instead of let/const to piss off my colleagues (and because I understand function scope well)6 -
I want to kill the guy who wrote this. He creates a temp table, selects data into it. Then selects the data out of it and returns the results. It does Nothing Else. WTF.5
-
*feels sad.
*steps outside for a while in search of someone who would maybe understand him.
*finds no one.
*returns to his computer and music and feels extreme happiness again.1 -
Came across a method in the code base that returns a boolean.
It uses a ternary operator which returns true if the result is true and false.. you guessed it... if the result is false.
WHY NOT JUST RETURN THE FUCKING RESULT!!!
What. The. F#%#....2 -
Forgot headphones, noticed coworkers conversation...
If null coalescing operator (??) returns right on null, why doesn't !! Do the opposite?
- boolean beat ya to it.1 -
After 10 years using Linux server my boss bough a new application that runs on Windows server with Apache.
It's just like when my son returns to an old play ground and finds the sand box.
P.S. Please give me a suggestion: what FTP server shall I use?6 -
When the API you are supposed to use for fetching data returns another item when the item you were looking for is not found! Dudes WTF? Ever heard of 404 or something2
-
IT CAN'T BE THAT HARD
1) A CONTROLLER RETURNS HTTP RESPONSES, computed using data received from
2) A SERVICE\MANAGER\YOURMOTHER, which fetches data from a DB\external service\whatever
LITERALLY 2 FUCKING STEPS. I'LL TAKE THAT "SENIOR" IN YOUR TITLE AND CHISEL IT ON YOUR FOREHEAD SO YOU'LL REMEMBER WHAT YOU'RE SUPPOSED TO BE WHEN YOU COMMIT THIS FUCKING GARBAGE2 -
When a JSON structure returns back as:
{
"array_data" : {
"123" : {
"id" : 123,
"name" : "NAME"
},
"176" : {
"id" : 176,
"name" : "NAME"
},
"189" : {
"id" : 189,
"name" : "NAME"
}
}
}
Instead of:
{
"array_data": [
{
"id": 123,
"name": "NAME"
},
{
"id": 176,
"name": "NAME"
},
{
"id": 189,
"name": "NAME"
}
]
}3 -
how i declare Coding session of the day to be over : when i see an error about an error that is not an error... :D
(hint: fatal: validation failed but when asked if it passed, returns true... ) -
when your teammate finds the existing endpoint that returns what you need after you frankenstein some dumbass shit from other existing endpoints that you managed to find
fuck me1 -
I propose the brand new, AI-powered debugger.
When your program returns an error, like this one:
“x is undefined”,
…you convert it to SpongeBob case and add a clown emoji, like this:
“x iS uNdEfInEd 🤡”
and the program fixes itself and apologizes.1 -
I've made a route in our API called /API/teapot that returns 418. That was my revenge for them screwing me so much!3
-
Fighting dev environment stuff makes me sometimes wish I could be evil and have some sort of framework that when an API call fails it just makes a second call to the PokeAPI and returns some random results ... because if shit is gonna be absurd it may as well be fun absurd.
-
Just because it's popular, doesn't mean it's good.
An overengineered solution can usually be simplified without breaking anything important. An oversimplified solution can rarely be upgraded without major breaking changes.
Not everything needs to follow the "best practices" - if it's not a part of the core functionality, diminishing returns often kick in quite fast.2 -
Asked a provider for an endpoint that returns customer usage
Provider sends back an endpoint that takes 1 minute to return one days worth of data for 1 customer and asks we limit concurrency to 3... we have 3000+ customers with them
(1 minute * 3000 customers) / 3 = 16 hours to pull yesterday's numbers
Hope we don't get behind7 -
Today a client opened a ticket saying that all the content for a customer returns 404. Turns out it's kinda important to end a prefix on a separator if you plan to recursively delete all data /user/<user_id> or you might end up deleting a bit of extra data1
-
Customer: "There are only 'X' values in COLUMN_D, your - report - import is wrong!"
Me: select count(*) from table_a where column_d is not in ('X') -> returns more than a thousand... Yeah please only scroll within a couple hundreds of records in your shitty sql client gui without making queries. Fuckhead. -
So the library we used to interact with s3 had this very cool delete function. (Pseudocode)
function delete(bucket, file)
request = buildRequest(bucket, file)
sendRequest(request)
OK
Now imagine how many problems we setup without delete permission, because we assumed this librsry actually returns an error code -
JSON.stringify()
It has the power to solve countless numbers of integration issues and has done what nobody else could ... tell me what the fuck the API returns -
Who the hell returns a SOAP response with a CDATA node containing a text string that is a concatenation of XML document?
Someone hates me...5 -
Public REST (-inspired) API. Should I skip numeric IDs because it's easy for consumers to snoop around?
Example:
POST api/foo
201 Created api/foo/69
Uh, I'll get 68 just because I can. Hopefully it returns Unauthorized, unless we some kind of bug.
Is it just security by obscurity if I use, like, guids or something instead of sequental IDs?17 -
Today in Rust I defined a function that takes Any and returns Any specifically so that parametric types turned into trait objects of this trait can still receive commands without having to know their concrete type.
Bridging static and dynamic typing is one hell of an exercise.8 -
I was returning something at MicroCenter the other day. The guy in front of me was picking up a laptop be brought in to have fixed. They had replaced the motherboard, and put all his old data on an external drive.
"So what's this?"
"This is an external hard drive. We copied all the data from your laptop onto it and put a fresh install on it."
"So .. how do I get to it?"
"You just plug it in, over USB."
"So how ... how does that work."
This goes on for a while. Shop owner has to start his computer. Plug in the drive. There was a lot of, "So everything that was on here, is now on here?"
The guy had no basic understanding of external hard drives, USB, copying files ... thankfully while the files were copying from the hard drive to his desktop, he said he needed a longer cable to the router so he could put it on the other side of the room. It took the guy behind the desk an unreasonable amount of time to direct him to the isle with the Ethernet cables, but once he did, I was finally able to return my item.
I'm glad I no longer work in desktop support.1 -
How to Recover Usdt from a Telegram Scam - Consult OMEGA CRYPTO RECOVERY SPECIALIST HACKER
OMEGA CRYPTO RECOVERY SPECIALIST can help recover lost Usdt from Telegram investment scams. One of the most common types of crypto scams is the Telegram investment scam. Scammers use the Telegram messaging app to lure victims into investing in fake investment schemes that promise high returns. These scams often have common characteristics, such as promising guaranteed returns, using fake testimonials and endorsements. Contact OMEGA CRYPTO RECOVERY SPECIALIST right away and redeem your funds.
Learn more; omegarecoveryspecialist .c om
Whatsap; +1 (701, 660 (04 75)
E-Mail; omegaCryptos@consultant .c om13 -
Aber method that was supposed to Check If a payment for a (back then) unimplemented payment methode that returns true as a default value...
A Javascript oneliner to skip the payment... Used to be in produktion for years, before I reported it -
If it walks like a duck and talks like a duck, it’s a duck, right? So if this duck is not giving you the noise that you want, you’ve got to just punch that duck until it returns what you expect. -Patrick Ewing2
-
An actual text from my CS Human-Machine Interfaces book:
"How do users react when a vending machine "eats" their money and doesn't give the product? Most likely, they will kick the machine in hopes of it returning him the money. Therefore, if we build a machine which has a "Cancel" button which returns the money in the lower part of the machine (the "kick zone") we would be improving the usability of the system a lot'
1st reaction: Wait, what the fuck?
2nd reaction: It ain't stupid if it works, I can't argue with that 🤔2 -
Me solving a problem x
Open google types
Me: {
"How to's x ...."
}
google: {
dev overflow first result: very complicated solution
result 2: Even more complicated
result 3: Out of topic
... Irrelevant
}
Me: {
"Google's: Why x sucks" // To see if we are many victims
}
google: {
"Returns all positive reviews of x"
}
Me: Bitter, Confused and in denial -
API endpoint returns data on thing with id number you specify
request data on certain id numbers
gives response data on different id than what you requested
how fucking horrifying
we depend on this thing, but we don't own it at least3 -
1) Writing data to database works just fine
2) Query reading back that same data returns null
3) Spend 3 hours to try figure out why that 4 year old select statement suddenly doesn't work anymore
4) Figure out mysql master stopped replicating to read slaves
5) Facepalm and cry a little -
Interesting read: https://observablehq.com/@eeeps/...
TL;DR: Diminishing returns from higher smartphone resolutions. The visual jump from 1x images to 2x is huge, but more than 2x res images in the img/picture scrset isn't worth the additional loading time.4 -
16 files (!) to create a rest endpoint that does nothing (returns an empty wrapper message).
WTF spryker? are you fucking kidding me?5 -
Had to create a quick server side script. Created a quick function that returns an array, and tried to access a value from the function call like this:
$val = func()[0]
Apparently php didn’t include that feature until PHP 5.4
Wtf PHP.
Log into my webhost to update the the PHP version; only to discover that the highest PHP is PHP 5.5. PHP 7 is the current revision.
Wtf a2hosting.8 -
BPOS client sub contracts a website and wants a WordPress one. Creates a design based on a theme.
This particular theme has a demo page.
And when running it through pagespeed insights returns a score Of 29.
Pingdom score of grade D.
Halfway through "development" we get a complaint from BPOS that the site is returning a score of 49 and a Pingdom score of grade B.
Considering how bad the theme is and how optimized we got. I believe that this was a miracle.
The things we do to make a living. -
Had to replace my Huawei watch due to a charging pad getting eaten away.
Bought on Amazon but returns always get lost so I went to my local Huawei service center but they had no stock and ordered one for me to replace mine. Today I picked up my new watch and they freaking upgraded me to the 4g watch.
Thank you Huawei, just another reason I'm staying -
Fuck api docs which are blatantly wrong. Wasted several hours on building an API client with pagination according to the api docs.
Turns out the actual implementation did not follow its own spec / api doc and returns values without pagination. And some objects are not objects but arrays.
I mean, next time I build an API client, I'll just fire a dozen requests on the endpoint, see what it wants and see what I get and maybe guess right what it actually does.4 -
My Gripe With Implicit Returns
In my experience I've found that wherever possible code should be WYSIWYG in terms of the effects per statement. Intent and the effects thereof should always be explicit per statement, not implicit, otherwise effects not intended will eventually slip in, and be missed.
It's hard to catch, and fix the effects of a statement intent where the statement in question is *implicit* because the effect is a *byproduct* of another statement.
Worse still, this sort of design encourages 'pyramid coding recursion hell', where some users will first decompose their program into respective scopes, and then return and compose them..atomically as possible, meaning execution flow becomes distorted, run time state becomes dependent not on obvious plain-at-sight code, but on the run time state itself. This I've found is a symptom of people who have spent too much time with LISP or other eye-stabbingly fucky abominations. Finally implicit returns encourage a form of thinking where programmers attempt to write code that 'just works' without thinking about how it *looks* or reads. The problem with opaque-programming is that while it may or may not be effortless, much more time is spent in reading, debugging, understanding, and maintaining code than is spent writing it--which is obviously problematic if we have a bunch of invisible returns everywhere, which requires new developers reading it to stop each and every time to decide whether to mentally 'insert' a return statement.
This really isn't a rant, as much as an old bitter gripe from the guy that got stuck with the job of debugging. And admittedly I've admired lisp from afar, but I didn't want to catch the "everything is functional, DOWN WITH THE STATE" fever, I'm no radical.
Just god damn, think of the future programmer who may have to read your code eventually.2 -
while (UniStudent == True)
{
*Spends Hours In Uni Lab
*Can't figure out Solution
*Return home To sleep
*Realsies solution as falling asleep
*Returns to Lab
}4 -
Lol, people who use npm currently experience issues as npm install returns 418 I'm a teapot
Source: https://github.com/npm/npm/...1 -
Got screwed by Amazon...
Never buy renewed stuff even if it says Free Returns and Fulfilled by Amazon... It's not
https://twitter.com/allanx2000/...10 -
Me: "Yeah so I have this problem, I generated an environment and setup a NodeJS docker image on it and it returns "Cannot find public IP address", help"
SO: "Yeah but what are you trying to achieve? Here is a link of the documentation everyone saw and that didn't help at all."
Me: "I just want to... reach the fucking server? Without trouble? Please?"
Some people need some cocaine in they morning coffee, if it can help then open their fucking eyes -
To the guys that develop any form of hybrid applications, is there literally no js templating engine that accepts template files as its base? I could write probably a single file that just returns the template and then all the others request it before templating, but seriously, is there no ready to go solution?5
-
When you're not confidant enough in your own code ... but you should be:
Me: "Why the hell is this duplicating data?!?!?!"
-time passes-
-figures it out-
Me: Wait that returns an error wouldn't that be ...
Yeah there was an error on the god damn screen in the status box I created telling me what was going wrong but I just ignored it... I was knee deep in code and my own UI was telling me what was wrong ;)2 -
The Angular ng-WAT talk: https://youtu.be/M_Wp-2XA9ZU
Most hilarious dev talk I have ever watched! This guy shows the common frustration of reading confusing API docs with even more confusing terminology. Hahaa!
"You have a factory, which is a service and you have a service which is a service. Both have Providers.. and when you write a Factory.. as your service.. you actually write a Provider.. which returns a Factory.. which is basically.. a Service!". WAT3 -
How can a big company as Facebook, allow that many functions of its website are just untested?
I make you an example, access the mobile version of Facebook from browser, go to a group and change the notifies settings, then refresh the page. The settings returns as before! If I did something like this I'd get fired in less than 0.1 seconds2 -
!rant
I finally returned from my hiatus, I am starting professional college now and I am starting to work a little again on AltRant! The next feature will be weekly rant group support. I am unsure about when it will be released to testers on TestFlight but it will be pretty soon I think.1 -
For the past 5 odd years my Bluetooth headphones wouldn't connect to my laptop properly and I had to issue a second Connect command while the first was pending to get it working. I even wrote a script to automate this: https://github.com/lbfalvy/...
Today Bluez finally released a patch for this. That's right, after many years, today the issue got fixed; Connect now returns an error if a call is already pending.
My headphones still don't work, but my workaround is now correctly recognized as invalid input.13 -
A large pool of application instances' is writing logs to the same physical file. No way to distinguish which instance wrote which line.
Welcome to hell
We're being asked questions. We're replying that we cannot help unless logging is fixed. Noone's bothering to fix this mess and instead returns tickets with requests to investigate more.
F.U.N
/s3 -
What's the best passive income for you? With small effort/capital but with big returns in a short period of time? Also high chance of working/succeeding.
I don't want to be an employee forever :) thanks!11 -
The worst kind of legacy code is the one in which a function body run miles climbing if-else ladders until nobody knows where the sky hits the floor, and returns when nobody is looking.
The best kind of legacy code is the one which is fully commented out! -
So, the other day, I was working in Unity, and trying to find the complement of a byte number. That is, 255 - myByte. So, I write this :
Byte newByte = 255 - myByte;
And it says that it can't convert from a byte to an int. Okay... So, I do this:
Byte newByte = byte.MaxValue - myByte;
And still, it errors the same thing. So, a quick google search proves that no matter what, the subtraction operator returns an int. WHAT IS WRONG WITH C#? That is the dumbest thing ever!4 -
Would you guys get annoyed if someone(me) made a habit of going through your code and cleaned things up, such as clearer naming, untangling ifs with early returns and so on.
I mean doing stuff that doesn't change the behavior, but makes it easier for the next person.9 -
Fuck you c++...!!!
TL;DR:
float a = 1.0/10.0;
float b = a*10.0;
a == b returns false
😐
Story:
A beginner of c++ here
Wrote about a 1000 lines code (spread across multiple files, m not dumb)
Passed 90% of cases
Took one and a half days to figure out what's wrong
Turns out c++ doesn't give accurate (as perceived by a human who thinks in decimal) results when comparing equality of 2 floats with ==
Shouldn't that be the first thing to be taught in schools?19 -
When you search for 'Microsoft startup program' and it only returns articles that show you how to add or remove startup programs from windows.
*sigh*2 -
For a new microservice we were designing, I recently had a design discussion with a team member on creating REST endpoints for a new entity. This discussion went on for almost 3 hours, most of the time was spent on why to have two endpoints for getting this resource, one is a POST using a graphQL-like query and another one is a GET using unique ID. I said, the client-side use case is different, one is a dashboard where search results need to be shown based on multiple fields and the unique ID won't be available there because it is a system generated value, second one will be used when the unique ID is present in the client as a result of previous search result. Their responses will be similar, first returns a list of entities, second returns a single entity of the same structure.
Then came the next argument: if both APIs are returning same response, why do we need two different requests ?
It was like saying, because 5+6=11, any sum of two numbers resulting in 11 should always use 5 & 6.
Are people so frustrated of working remotely all the time that they come with such weird arguments ?1 -
The company I work in had to build a software that establishes a connection to a MySQL database running on an external server. It doesn't work for the client company because the firewall is very restrictive and only lets through connections on port 80, so we had to build a fucking http server that forwards SQL queries to the MySQL server and returns the result. This is so horrible!
(Running MySQL on port 80 isn't an option as any other connection type than http is blocked by the firewall)8 -
I am developing a twitter bot which will post local weather daily. After few test tweets, twitter locked the account and asked to verify account by calling. They called and I wrote down the verification code but THE FUCKING TWITTER returns a "Something went wrong." error with no actual clue about the problem.
-
@dfox
I recently posted a rant containing the tag "$" (php, you know).
But if I search rants with the search pattern "$", the search returns no results.
I guess this has something todo with $ as a special character ;)
Is it a bug or is it a feature? *g*7 -
me printing some variables and function returns and such in <pre> tags while developing/debugging and immediately see designers' entries on bugherd saying the site doesn't work and shit my that. smh...1
-
I think UPS' Api documentation and service must be the worst documented and build API I have ever seen from a corporate.
1. The developer website is a mess. A total mess. You can barely find the API type you are looking for.
2. When you get the API and download the documentation, the files, .pdf etc is still a mess. Pages long that most are craps.
3. Each request returns Status Code 200. Even if it is an error. This blew my mind.
4. Each request, based on error type or based on tracking activity returns different JSON schema.
For example, the JSON Schema for a shipment in transit is different from JSON schema for a shipment that has been delivered. A shipment that has been returned, a shipment that required signature etc. They are different from each other.
5. And the worst. They do not provide with test tracking codes. I have found some on internet, but they do not work in development and production environment.4 -
Having a method that is only called at one place is ok, if you want to tidy your code (except that that hope is long lost in this project). But if that method usually returns an array, except if it's an empty array, then it returns null, but at the only call location you handle that null case specifically to act just like it would if you just had returned that empty array in the first place, then I ask myself: Why separate that?2
-
Damn brain fog returns. What’s the best stim to get out of this that isn’t cocaine, and I already take adderall and no I’m not taking a higher dose lol
I can’t do shit7 -
Seriously! My wife is a fucking NFA!
She can be in several states at the same time.
She knows what I'm thinking before I do.
She sometimes get stuck and then immediately returns to an accepting state.
WHAT THE ACTUAL FUCK?!2 -
how to describe the feeling when you started using sql and you had to get the first element from a table via jdbc...
you, obviously, think "oh, the first index is 0, every languages start at 0, so let's take the content at 0!!!" but the ide returns you "0 < 1"
so you don't understand, you stare the code for 20 mins, you start crying, and then you realize sql starts counting from 1 because it pretends to be cool BUT IT DOESN'T
I hate you, sql.5 -
I need a fucking crystal ball to know whether something is a reference or an object fuck angularjs
2 functions 100% same logic 1 returns a new object 1 returns a reference to the old one
Anyone knows where i can order one my expectations are that it lights up if the function will return a reference and stays daark if it returns a copy -
Fuck I hate when my brain remembers the wrong keyword! Just spent way too long trying to figure out why my regex wasn’t working! I remember RegEx.check(str) tests for a match and returns a Boolean. The docs say RegEx.test(str) checks for a match and returns a Boolean! Dammed cinnamons! English is my native language I swear.2
-
Do you guys return 200 when a search function in your API returns a not found and you attach a response in the object saying "success: false", or do you return 404? I'm confused. Thanks.
https://softwareengineering.stackexchange.com/...3 -
So I encountered Python's PIL module, and started exploring it. Soon enough I built an ASCII art generator that takes an image as a parameter and returns a text output resembling the input image. :)
The github repo is here - https://github.com/rameshaditya/...
Do check it out and gimme feedback, and leave a star if you like it - it means a lot! :)3 -
Questions that are bothering me:
When a function that returns void returns, is any value from the stack frame copied into the register?
Is the return address in the stack frame even allocated, or is it nullptr?
Could a void function theoretically return a value if you hacked one into the frame?
Does the register even know to expect a value from a void function? If so, where is the logic for this and what is difference between a void and non-void function return at the stack frame & register level?
Any good books on this stuff?2 -
User: your python script is giving me error, <insert stack trace indicating a missing directory on the system path>
Me: Did you add the directory to the path
User: yes
Walks over to desk checks path, finds a space after the semicolon separator before the directory.
Removes space, problem fixed
Why Windows, why can't you just strip the white space.
Returns to desk, hides underneath and waits out the end of the day 😿 -
PLEASE. Help me to find a good name for my function.
My function returns json or XML based on the accept header parameter.
🤔🤔🤔🤔🤔10 -
Has anyone here worked on news scraping?
I am currently doing my academic project where I need to scrap the news headlines. I have built scrappers for some news sources using their native API. I also tried using newsapi.org, but it returns only 10 results.
If anyone have worked on similar projects or know of their existence, some advice would be highly appreciated.5 -
"hey, write us a simple interface for this shell script.."
script:
- input must be a file, does not accept loading through stdin/redirect
- accepts relative path input from one specific directory only
- fails if provided absolute path
- even though it fails, it still returns return code 0
and every time we've tried to open up a topic of programming practices we got slammed with "we're ops. you should be glad they're doing at least some scripting"5 -
So I and couple of my friends are facing this chrome issue where 'waiting for proxy tunnel' , apparantly it's changing my location too,
It should return .co.in and returns .ae ,
Wtf I'm scared as hell, for now Firefox is a lifesaver ♥️3 -
What the fuck is wrong with npm/react-native??!?😡😡
I completed a part of a project last week, worked well, then I cloned the repo today and It returns BUILD FAILED,
WHAT THE FUCK DID I DO TO YOU SATAN?!😡1 -
Javascript in a nutshell:
Function in a teaching example for a framework, checks for validity of input, dev returns null instead of false when it isn't. In another place, uses !variable to check if variable is 0.
fucking follow the semantics of the code you write cunt why do you have to do this why is it so hard to write variable !== 0
I'm sorry, this really triggers me.
https://media.giphy.com/media/... -
It's probably no news that I love Typescript's versatile and powerful generics. Today I found what is probably the most brilliant use of these tools to solve a real problem. This package exports one generic type which takes one generic argument, reads it like a JSON schema and returns the Typescript type for it:
https://github.com/YuJianrong/...7 -
>= rant
While its really hard to get code wrong in Rust, it is also really hard to get code right in Rust. It took me a considerably long time to write a code which returns the first word in the sentence
I felt the borrow checker introduces a steep learning curve into Rust which is otherwise a beautiful language according to me. C++, my current favorite language, also suffers the same problem with respect to certain language features.3 -
It just hit me. If you wanna achieve something great you have to dream big. If you aim for something humble, you'll just get lost in the endless land of diminishing returns where you take forever to make little progress
If you aim high, you are naturally inclined to do big strides since you feel that there is still so much left to be done
Just a thought I had working on my engine2 -
What a mess ^^
From one moment to another unit-tests on my local machine stopped working.
There was a PHP fatal error, because of insufficient memory.
Actually, there was a ducking "unit"-test of a controller action "log".
This action returns the content of the projects log file...
Since this log file grew over the time, PHP tried to assert the response of the controller action which was sized about 400MB.
C'moooooon guys!
What were your thoughts behind this bullshit? ^^ -
Receiving content in word littered with carriage returns and double spacing. They haven't figured out paragraph spacing (which will automatically add a desired gap between paragraphs) or that double spacing after a full stop died out after monospaced manual typewriters ceased to exist. For some this is the only Application they use and they still haven't figured out how to do the most basic shit. Useless Cunts.1
-
"- Hello I work on this shitty Drupal project where the vendor directory is gitted, and we can't use composer becauses it returns error [note: i wish this was a joke]. So I installed a module that won't work, because it needs a depency. I installed it but it still doesn't work
- You need to edit your autoloader
- Ok, what do I put in it?
- Idk, you're not supposed to do it, and let composer do it for you"
Did I ever tell you how the Drupal stack exchange will one day make me turn into a serial killer? -
My last rant with example of usefull PHP function in old inhouse CRM software was somewhat popular, so I decided to post more stuff. This time we look at the login function. Besides obvious problem of SQL injection (that i of course tested) we have two calls to the same 'poslednji_login()' method (translated to english - 'last login') that actually just returns current time, not the last login time... twice...6
-
Is anyone familiar with Bitwig? It's a pretty good DAW and you can write your own controller scripts in JS. I bought two controllers (Launchpad Mini and Launch Control), one of which has a really outdated factory script and the other one doesn't have anything, so I decided to update the existing one and port it over to the other controller. They do similar stuff.
I started going through the code and I think it gave me cancer. It has many gems, but so far this is my favourite. The second is a function that takes two parameters and returns false. -
The count returns 19, my if statement is looking for anything greater than 0. Sitting here wondering why it's not working for 3 damn minutes then I remember this (https://learn.microsoft.com/en-us/...)
I can't do $variable.count > 0
I have to do $varibale.count -gt 0
: | I like powershell, it's useful for simple small things in windows
Then things like this make me wish I wasn't on windows for work
Happens every damn time, especially after working with any other language we use, i just forget PowerShell likes to be 'special' -
print(type(signal))
print(type(-signal))
print(type(-1*signal))
returns....
<class 'numpy.ndarray'>
<class 'numpy.float32'>
<class 'numpy.float64'>
ffs.2 -
...Firefox I feel like you just stabbed me in the back.
Version 49.0.1 I pull out Internet on Mac, navigator.onLine returns false. I pull out Internet on PC (windows 8) same version navigator.onLine returns true even though work offline mode is off. -
Damn, I'm conducting some benchmarks on go and php...
A php page that simply returns "hi" with no framework is a lot slower than 1000 calls with 200 concurrency to a go function that queries redis and returns a json.1 -
Ever tried to use Windows 10's search as a calculator? For me it just returns numerically named folders in System32 most of the time... 😕9
-
When the previous dev's function returns null instead of an empty list when no results were found. Why?!
-
Jason Bourne logic: type "run predictive algorithm" without any parameters into a terminal and it returns the locations of whatever you want. Either that function is the _best_ at predicting user input, or its variables are so hardcoded that we've just discovered the hardest material on earth2
-
Writing code at work be like:
Hmm okay so if I call this facade looking for an order with a code, and the order can't be found, it will return null. Thank God this bit of code is documented...
Ten minutes later
Why is this not throwing an exception when I pass invalid parameters in...?
Two minutes later
Oh, so this never returns null. If the order isn't found, it returns an empty DTO. Fucking docs.
Seriously, the only thing worse than no documentation is documentation that lies. And that's all I get for my first project at the company, which I am having to do alone. Either no docs, or misleading docs. -
Is anyone out there actually using Eclipse PDE/OSGi or e4 DI?
Everytime I ran into a problem and actually want to see if anyone out there has a similar problem the Internet returns just lots of emptiness - I'm disappointed like hell.
Damnit - finally I had to rant for the first time. Grrr. -
Java has the worst kind of union type where every method returns the union of Exception | null | value.17
-
WTF!! Function that returns multiple outputs!! Why not make a datetime object and return the whole fucking object!!1
-
Amazon returns: I just fucking hate when a customer request a return due to the fact product looks bigger than expected when they should do their homework before fucking buying6
-
Spend the whole day trying to figure out why that API call returns undefined...
Whitespace character after the variable -
I created a custom interface for an LMS that allows students to see their marks even if they haven't been 'shared' yet by their teachers. This is all done without accessing any unauthorized apis, as the LMS always returns all student marks and then hides the ones with a False 'shared' key. School administration caught me, so I've now shut it down. I have a meeting with the deans tomorrow. Any advice? (Again, this is all done using existing methods found within this LMS)4
-
Every time I have to use CloudWatch, I feel like I'd be more productive if I shoved glass shards in my eyes.
Every query/filter either returns nothing or errors out because too much is returned.2 -
This is ridiculous.
https://businessinsider.com/apple-m...
Looks like only Inuit can utilise the full power of the new MacBook Pro.4 -
Bool rant: true;
Bool dev: false;
I purchased my Lenovo P90 a year ago and it never updated since.
Lenovo even took the P90 off the upgrade plan. Is that why I spent around 350$ on it?
I'm sill running android 4.4.4 and can't find a ROM because the phone is intel based.
When I asked them in E-Mail I got a copy-pasted anwser to use the phones update function(it returns that I'm running the newest version)1 -
https://support.live.com/ returns "Service Unavailable - DNS failure" but hotmail continues to list my servers as spammer...
how the fuck do I delist my server like this!!! FUCK!4 -
So... I had to create a VBA macro, ok, it is very simple and it will be necessary during some DOC files reviewing. Ok, not a problem.
I created the functions, added some quick launch buttons and saved it as a .DOTM file. I even included an autoload form with an Install button, so the file copy itself to the Word Startup folder. Nice, everything working just fine.
But... there are two Mac users in the company. I do not have a Mac, but the first thing I thought was I hardcoded the "\" to check if the file already exists and to copy the file. Using the system separator would do the trick. The macro would be copied and everything is done. But...
1. The quick launch buttons do not appear on Mac;
2. The "Application.PathSeparator" returns an ":"
3. The "application.StartupPath" returns an invalid path (something like "Mac's Name:Application:etc")
4. The copy command is not working, the Dir command appears to be not identifying the path etc
5. I need to have it working by Monday morning.2 -
Umbraco updated so a Content Picker now returns a collection of IPublishedContent rather than their IDs. Fantastic.
Except, upgrading from an older version is now more tedious. -
Am I the only one that thinks Linq's .Any() and .All() methods are more appropriately named for the use case they cater to, as opposed to their JS counterparts .some() and .every() ?
.some() doesn't justify the fact that it returns true if *atleast* one item in the collection matches the predicate. Should've been named something like .atleastOne() or something else.
Moreover, there isn't any harm to just use the same method names as in Linq ¯\_(ツ)_/¯4 -
You know what's more fun than debugging a SQL stored prodecure?
Debugging a SP which CATCHes all errors and instead returns an error code. Because exceptions are scary... -
I just wasted a few hours by not realizing that array.prototype.concat does not act upon the array calling it but rather that it returns a new concatenated one :/
-
Probably a veery long time ago, but being able to use what you use in if(...){} for e.g. booleans like "bool(ean) isX = a == x;".
And than reusing that value in if again and so on.
Even if it sounds trivial, there was a time where it was not and "==" was only associated with "you use that in if/while only" rather than "a == b" returns a bool(ean)/int.
Same goes for other arithmetic operators and && / || ofc.6 -
Why has to be axios sooo fucking bad? I just want to load one fuckin JSON. Server returns 200 but axios is trying to tell me it is fucking error.... Whyyyyy1
-
public static bool IsYouCrazy()
{
// I can't stand random
// carriage returns
bool hasRandomBlankLines = true;
Return hasRandomBlankLines;
} -
So TIL chat-gpt can’t COUNT!! Since my eyes suck I asked it to return the last 24 chars of a string just as a quick sanity check and it gives me back a substring of only five. Went back to correct and it returns a substring of 7 😫😫😫😫!!!!
I gave up 🤬. It always fails basic calculations for some fucked reason6 -
The strcmp(3) manual page takes me closer to god: "strcmp() function compares the two strings s1 and s2. It returns an integer less than, equal to, or greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2."
-
I just had the weirdest feeling where the word "response" completely lost all meaning to me.
I googled it, and apparently this is called semantic satiation.
Huh, never happened to me before.. I hope the memory of the word response returns to me because though I'm not sure why I feel like it's important.3 -
Just askin:
If you have a method which returns a value from an array. What do you prefer in a case when the item is not found?
A)Throw an exception
B)return null
C)return a special value like a null object or some primitive type edge value like Integer.MIN_VALUE14 -
*Triggers OAuth request through browser
Returns : success and valid tokens.
*Another project triggers the same process and code.
Returns : well shit nigga, I know I use the same logic as above but fuck you. -
I'm implementing a REST API that returns data as it's fetched from MongoDB.
If it's returned all at once it would be a JSON a string like [{}, {}, ...]
But what about when it's returned as a Stream?
Node by default seems to just return it as {}{}{}{} but that can't be parsed by the program that requested it?4 -
WTF Windows?
If you call the API function to lookup the name of a service it expects a buffer and the size of the buffer.
If the supplied size is smaller than the service name it returns the number of characters (excluding the null-terminator) of the service name.
You can allocate a buffer for the service name and call the function again to receive the service name.
Except now Windows wants to know the size of the buffer including null terminators.
That took me a moment to figure out. -
Challenge#1 26-01-2020
Implement document.getElementsByClass without using document.querySelector or using document.all.
Part A : Write a function getElementsByClass(className){...} such that it returns the same result.
Hint to solve: `Recursion`.
Part B: Give a solution without using recursion.
@COD4 @Wack @NoToJavaScript @Root @don-rager @Ranchu28 -
The highlighted lines are a part of a flask app I'm writing in Python2(not python3 because I'm a bit too lazy to fix few dependency errors). All functions work as expected and all templates are rendered individually, and routes are all defined. check_date checks for invalid dates like 32Jan, 2018. It returns 0 if date is valid. add_data basically returns 0 if it decides to add user data into the database(db).
The problem is that line 60 renders but lines 54,57 don't. Any ideas as to what might be going wrong.?
PS: I'm building this app for learning and not for a production environment...1 -
Question to the C pros.
Is there an ANSI/ISO/POSIX function that searches for an executable in PATH and returns the absolute path,
Like "which" on the CLI.
I already searched for a while and couldn't find anything.3 -
Getting the angular interceptor working the way I want has proven to be a pain for me. I try to update an auth token, which returns a promise that has to be transformed to an observable again. based on that, redirect to a login page, in case of 401. But nothing works! Either infinite page reload because of the login() promise function of the auth provider or no reaction at all after a router redirect. 😤4
-
In Java or any object oriented languages.
I have a complex object (X) made up of other objects, some of which open network connections that remain open.
Now there's a function that needs to create a new X every time it's called but didn't need it after it returns... but X isn't destroyed because those connections are still open.
Is there a way to destroy X without needing to explicitly close all the connections?
Also wondering, if I close the program itself, all resources are freed by the OS. How does the OS do it?16 -
I broke the algorithm!
My app has a function to filter out read rants but only returns the first 5 pages (250 rants) apparently I have reached the end. -
Does anyone know how to fix my current issue, because this seems to be a very obscure case.
current situation: user is logged in on our app and wants to add a link to their "instagram" profile.
The user presses "add profile" button and has to fill in their username.
Issue: users dont know their username, or misspell them(this causes users to lose interest)
What we want it to be:
already logged in user presses "add" and gets directed to the social media in question to authorize our app which then returns a link to the users profile3 -
Struggled whole day to remove duplicate objects from a list in java. Those objects (of a custom class) contain a unique id, the remaining properties can be identical across list items.
Wondered why hashset.add() always returns true and thus duplicates are still inserted.
Little did I forget about things like equals() and hashCode() 🤦1 -
I hate windows caret returns sneaking in bash scripts! fuck*ng \r shit!!!!
sed -i 's/\r$//' YOURFILE every time a fucking windows friend send me a script so boring2 -
I've gone from a "no early returns" guy to a "return as early as possible to maintain the happy path indented as much to the left as possible" guy.
Looks so much neater now. -
My journey along Java continues and so I have discovered something I didn't know before:
If a subclass tries to call a method on its parent which it has not overridden, then it will call the method as if you hadn't used the keyword 'super' (and I think it will try to find it in the classpath and SDK).
Example 1:
public class SuperParent {
public String test(){
return "SuperParent";
}
}
public class Parent extends SuperParent {
}
public class Child extends Parent {
public String testChild(){
return super.test(); // same effect as test();
}
}
public class TestInheritance {
public static void main(String[] args) {
System.out.println(new Child().test()); // returns "SuperParent"
}
}
Example 2: with getClass():
public class Parent {
@Override
public String toString(){
return super.getClass().getSimpleName();
}
}
public class Child extends Parent {
}
public class TestInheritance {
public static void main(String[] args) {
System.out.println(new Child()); // prints "Child"
}
}
This here is of course a special case: .getClass() will always return the class name of its caller, so naturally in this case it returns Child and not Parent.
You would expect it to return "Parent" since you use 'super' in the overridden toString() but it returns the Class name of the Child (then there's something in programming languages such lexical scope and execution scope, which I'm not sure if it applies here).
The solution for this example is of course .getSuperClass().
Inheritance isn't always straight-forward.
References:
https://stackoverflow.com/questions...
https://stackoverflow.com/questions...2 -
So for quite a time I've been trying to understand what does it mean to center a div 'vertically', I googled it but it returns only solutions to center it 'vertically', can anyone explain what does it mean to center it vertically?11
-
Building a Web dashboard. Stats a day tiles etc.
Boss wants to write sql stored procedures to populate tiles.
Azure dB returns tile list, that maps to angular directive names, use nested angular directive that auto compiles a directive by name, then that directives controller calls a sql query which returns the name of the query to call to receive data, formats the data into charts or lists, builds the tile, places it into a gridster tile array and redirects to new tile pages by UI router state names.
I... I think I have gone too far. What have I done. -
😢... Built a mobile app with React Native, the app implements Navigator api in JS to get coordinates. It works perfectly on 6.0 and below, but fails on 7.0 to be specific, Nokia 2 (it returns the same coordinates regardless of the location). How to go about this? What other library can I use to get coordinates?
PS: I have checked the permissions and they are set. -
I just love when an API returns a set of results, some have property X as a string and some as a JSON array. Wtf? Good people had put great API wrappers and it works if X is string as per service specification, but breaks otherwise, unsurprisingly.
I had to do a pull request to the wrapper repository to account for this inconsistency 😶3 -
I hate tooling around Scala with libGDX so much - Gradle, Gradle Android plugin and ProGuard are just awful.
For example today I got during compilation: "Warning: Exception while processing task java.io.IOException: Please correct the above warnings first."
Grepping build log for (case insensitive) "warn" returns only the message above to correct warnings.
What the hell? I am required to correct not existing or invisible warnings or what? I hate you Gradle and ProGuard, I really do! >:( -
this is torch. is this the proper way ?
self.linear_relu_stack = nn.Sequential(
nn.Linear(9, 512),
nn.ReLU(),
nn.Linear(512, 512),
nn.ReLU(),
nn.Linear(512,100),
nn.ReLU(),
nn.Linear(100,5),
nn.Sigmoid()
)
The sigmoid part ?
It returns garbage numbers on the first run of course.6 -
God fuckin dammit, I swear to heaven if this bitch ass code returns IO.Exception file is being used blah blah blah even though I'm using filestream and streamwriter. I will lose my shit in this fucking office1
-
I was working on a bug in a parser for the response from an api which returns 'n/a' when a certain measurement isn't available. The code was "if ($value == 'n/a')" and when this was true the value was rejected (language is php).
Some of you may instantly understand the problem here. I didn't. Some of the measurements were 0 which is ok, but for some reason it didn't accept them.
Then I discovered the bitter truth:
0 == 'n/a' is true!
Apparently php tries to convert the string to a number to compare it and if it fails it returns false, so false == 0
😞3 -
This is a massive tossup between RandNoRepeat( from TI-BASIC (returns an int between 2 passed params but tracks what's been given from that range this power-on, meaning if the range is too low IT ENDS UP HANGING THE FUCKING CPU IF YOU RUN OUT OF NUMBERS and it also rolls over and over so it's slow as shit in general) or Python forgetting how the fuck if statements work.16
-
package main
// go is very frustrating. in their efforts to keep the language simple, they've broken its consistency :(
// A A is just some arbitrary interface
type A interface {
Foo()
}
// B is an interface requiring a function that returns an A
type B interface {
Bar() A
}
// Aimpl implements A
type Aimpl struct{}
// Foo is Aimpl's implementation of A
func (a Aimpl) Foo() {}
// Bimpl attempts to implement B
type Bimpl struct{}
// Bar is Bimpl's attempt at implementing B.
// problem is, if Bar returns an Aimpl instead of A, the interface is not satisfied
// this is because Go doesn't support implicit upcasting on returns from interfaced objects.
// if we were to simply change the declared return type of Bar() to 'A', without changing
// the returned value, Bimpl will satisfy B.
func (b Bimpl) Bar() Aimpl {
return Aimpl{}
}
var _ B = Bimpl{}
func main() {
}2 -
Web dev (JS, node) question since there are so many here... I think...
I want to return a JSON array as a stream so the server passes whatever the DB returns but also normalize each record.
Also the data is across several collections. Is it possible to return this in a single request?
And how do I add in error handling? If there's an error in between the user already has part of the data?3 -
!rant
Go's tuple-style returns. ❤️
What's an exception? I don't even know what those are anymore. 😄
I've started using this pattern in JavaScript / TypeScript too.
also... supabase anyone? ❤️5 -
Fun fact about JavaScript: it's a... bit inconsistent. For example, functions like Array.map, Array.reduce, Array.sort don't mutate the array, but Array.unshift does, and returns array's length after the element was added.5
-
Has anyone else used the Decimal module in python?
And if so do you know why it returns
"AttributeError: type object 'decimal.Decimal' has no attribute 'power'"?
According to the documentation
https://docs.python.org/3/library/...
...theres a power() function.
Doing
decimal.power()
Decimal.power()
power(x, y)
No matter how I call it, it always returns an error indicating power() doesn't exist and I'm scratching my head.4 -
Maybe it's a dumb question, I don't know…
Why "Math.Truncate()" (trunc() in C++) returns a double?
Its only purpose is to return the integer part of a double, which is a fucking integer…
Same for floor() and ceil().
My point is that you can put an int in a double without any problem (so they could have return an int), not the other way around, so you have to convert it if you need it in an int.3 -
first() function in python...
Because it does not exist
Why have a any() that returns True if any of the items in iteratable are True
But what if I need to get the item itself...
In C it's as easy to write as the any func The performance will be the same6 -
Why the fuck does my subdomain work with https but my main domain returns an ssl error. Wouldnt nether work if the ssl was the issue
Its midnight I want to fucking sleep not deal with this shit. I'm probably doing something stupid but don't have the fucking experience to recognize what I'm doing wrong4 -
I have a function that receives 2 parameters: a string and a max numer of characters.
It returns an array with the partitioned string.
Example:
function name("hi, I love devRant", 10);
//return:
array(2){
[0] ->"hi, I love"
[1] ->" devRant"
}
Now.... what would be the appropriate name for that function?10 -
Say a JS 'widget' is embedded inside a domain abc.com
the widget's content is retrieved from xyz.com (API?), the API also returns a custom URL (think of it as a tracker) that the JS adds to the DOM of abc.com, inside an iFrame.
Essentially making this iFrame hosting xyz.com content/page while existing in abc.com domain
Now this iFrame's page makes its own requests to 3rd party sites, would that mean the 3rd party would see the request originating from xyz.com (iFrame page) or abc.com (the site hosting the iFrame)?9 -
stupid dumb wordpress, who POSTS a user registration, returns data to the SAME site with a dumb "successful" message alert, and THEN redirects to whatever page you want?!?! looks like shit, feels like shit in terms of UX
JUST REDIRECT ME TO THE PAGE I WANT FROM THE SERVER THAT'S THE WHOLE POINT OF PHP
I swear its as slow as balls too -
Not sure if I'm making a mistake or what, but in Kotlin:
10 % 30 = 10 🤔
Shouldn't it be 33333...?
No matter what numbers I use it always returns the left hand side of the equation 🤔17 -
I need help in this?
Create a function name divisers/Divisers that makes an inter n>1 and returns an array with all of the interger’s divisors(except for 1 and the number itself), from smallest to largest. If the number is prime return the string ‘(interger) is prime’ (null in C#)(use Either string a in Haskell and Result<Vec<u32>, String> in Rust)5 -
A usefull function, everyone should have near by. May requires some optimisations.
/// <summary>
/// DoEs tHiS To tHe pRoViDeD StRiNg. StArTs aLwAyS WiTh a cApItAl
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
public static string DoThIsToThEtExT(string s)
{
var array = s.ToCharArray();
Parallel.For(0, s.Length, (index) =>
{
if (index % 2 == 0)
{
array[index] = array[index].ToString().ToUpper()[0];
}
else
{
array[index] = array[index].ToString().ToLower()[0];
}
});
return new string(array);
}3 -
!rant && !question
If anyone has some info on this behaviour :P
I've got this website and it loads fine and stuff, but for some reason when I pop chrome into mobile mode on my desktop (you know the mobile emulator thingymabob) and reload the page the server returns a 500 error, like how does that even work?
(works on an actual phone btw, safari, edge, IE, Firefox, ....)
FYI I use lighttpd as a webserver4 -
We have a huge domain model in Java and something is really fucked up with our equals/hashcode implementations and know body can track it down.
I have suggested Lombok/Groovy several times but they didn't listen.
Anyways it is so fucked up, that map.contains(foo) returns false, although it is part of the map.
So we wrote something like this:
for (Entity e: map.keyset) {
if (foo.equals(e) {
return true;
}
}1 -
ioctl with FIONREAD as request
it returns size of bytes ready to read, but to store that size it requires pointer to int passed in va_args
when i want to malloc a memory using that size i need variable of type size_t which is 8 bytes on 64-bit system
why do this types mismatch? if ioctl returns size with FIONREAD request it should accept pointer to size_t variable in va_args -
Okay, so I need a Twitter client library for my Python app. Surely there's a decent one out there, right?
> Goes to Twitter's developer site
There are links to nine different Github repos.
> Takes a look at the one with the most stars
Every method of the API class is @property decorated and returns the result of a function that creates an entirely new class, and then returns a new function that creates an instance of the new class and calls one of its methods that happens to actually make the damn API call.
Alright then...
> Takes a look at the one with the second most stars
All method names are PascalCased.
Please help😭 -
I am using MERN to develop a poll app. I have 6 collections in my database. I have an API for each collection, 4 of those API returns the data whereas the other 2 return 'undefined'. What is the issue I am facing? Is MongoDB not allowing me to use more than 4 collections?6
-
So if only one query on a firestore collection returns 1000 documents, this is considred as 1000 read ?
Or only one ?
Docs say 1000 !
And since the cache os 30min long, if the user came to the same and open it 30sec later, ill be charged for 1000 reads ?
Well well well !2 -
Just found a service method that saves an entity that isn't related to that service, that returns a ModelAndView object. I think my brain just broke. 1) Single Responsibility Principal. Do not save ObjectB in ObjectAService. 2) Services should not be aware of your view context. That's what controllers are for. Do not return a ModelAndView from a service method.
-
Is there any reason why the actual fuck the OracleDataAccess Driver for C# returns everything either as decimal or string else its a TypeConversionError? Why does it even have the functionality to return an int if that can literally never happen?
-
>working with graphQL
>for some reason request returns null
>???
>nothing works despite the explorer showing it should be right
>remove lang param
>it returns wrong language but works
>literally just ctrl+z this shit
>suddenly it's working
I'm sorry but what? I restarted the server beforehand, hell, I even restated the computer. Why did it suddenly start working?2 -
Save method returns true. No validations errors. Everything looks good, except that a boolean field that controls the record has been set to false from true...even though it wasn't in the objects changeset!
-
Default dict that returns default dict on configparser to replace "if/try/nested .get()" to just "or"
In the end I had just
data = source or source1 or source2 or source3 -
Any ASP.NET Core experts here? I'm using the localization code found from asp.net core documentation and it works fine except that if I let the browser open and idle for like 15 minutes and then refresh the page it always returns an english version. If I refresh again it goes back to the chosen language and works as long as I use it. Same thing locally and on server. Any ideas what this could be related to? I'm lost :(
-
Just cut down registration from 5s api response (because its sending email confirmation) into 70ms using rabbitmq (emails are now delegated in rabbit queue and sent whenever the queue takes place)
But still around 70ms to register which is great and fast (because it also generates jwt token and returns the whole user object + jwt) so its difficult to keep this at 7-9ms response time
Is this normal and is it fine to leave it at 70 or can this be optimized (or should it be)?7