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 - "unique id not unique"
-
Me: ya hi, we integrated with your API and I'm receiving error x
Provider: ok we'll disable validation, plz check
Me: ya it works, what's the problem? I used a GUID for id and I'm sure it's unique, here is URL and request body
Provider: you have something wrong in your implementation. Fix it and it will work
Me: aaand what's the wrong part of my implementation?
Provider: id is not unique, fix it. *Hangs up*
I sometimes sit and wonder, how and why does this kind of people get hired, FOR FUCK SAKE YOU ARE THE PROVIDER AND YOU DONT KNOW WHAT THE FUCK IS WRONG!
fucking useless ...7 -
So customers can place orders at our website, but some of the products are actually handled by a third party. We use a web service to communicate about these orders. Obviously, we need a way to uniquely identify each order, and decided with this other company that we would use a simple incrementing integer.
Last week, something strange happened: we could no longer cancel orders by their ID, because according to the web service, the orders were placed too long ago and were no longer eligible for cancellation. But I knew that could not be true: the orders were from last week. So I checked out database, turns out the ID's are not so unique: some refer to two or three orders. Somewhat worried, I contact the guy responsible at the other company and ask him how that could ever happen?
He: "Yeah, when we restart our server, the counter goes back to 1, you see. I didn't think that would be a problem...".
REALLY?! YOU DIDN'T THINK?5 -
Well... I had in over 15 years of programming a lot of PHP / HTML projects where I asked myself: What psychopath could have written this?
(PHP haters: Just go trolling somewhere else...)
In my current project I've "inherited" a project which was running around ~ 15 years. Code Base looked solid to me... (Article system for ERP, huge company / branches system, lot of other modules for internal use... All in all: Not small.)
The original goal was to port to PHP 7 and to give it a fresh layout. Seemed doable...
The first days passed by - porting to an asset system, cleaning up the base system (login / logout / session & cookies... you know the drill).
And that was where it all went haywire.
I really have no clue how someone could have been so ignorant to not even think twice before setting cookies or doing other "header related" stuff without at least checking the result codes...
Basically the authentication / permission system was fully fucked up. It relied on redirecting the user via header modification to the login page with an error set in a GET variable...
Uh boy. That ain't funny.
Ported to session flash messages, checked if headers were sent, hard exit otherwise - redirect.
But then I got to the first layers of the whole "OOP class" related shit...
It's basically "whack a mole".
Whoever wrote this, was as dumb and as ignorant to build up a daisy chain of commands for fixing corner cases of corner cases of the regular command... If you don't understand what I mean, take the following example:
Permissions are based on group (accumulation of single permissions) and single permissions - to get all permissions from a user, you need to fetch both and build a unique array.
Well... The "names" for permissions are not unique. I'd never expected to be someone to be so stupid. Yes. You could have two permissions name "article_search" - while relying on uniqueness.
All in all all permissions are fetched once for lifetime of script and stored to a cache...
To fix this corner case… There is another function that fetches the results from the cache and returns simply "one" of the rights (getting permission array).
In case you need to get the ID of the other (yes... two identifiers used in the project for permissions - name and ID (auto increment key))...
Let's write another function on top of the function on top of the function.
My brain is seriously in deep fried mode.
Untangling this mess is basically like getting pumped up with pain killers and trying to solve logic riddles - it just doesn't work....
So... From redesigning and porting from PHP 7 I'm basically rewriting the whole base system to MVC, porting and touching every script, untangling this dumb shit of "functions" / "OOP" [or whatever you call this garbage] and then hoping everything works...
A huge thanks to AURA. http://auraphp.com/
It's incredibily useful in this case, as it has no dependencies and makes it very easy to get a solid ground without writing a whole framework by myself.
Amen.2 -
You know what really grinds my gears? As a junior webdeveloper (mostly backend) I try my hardest to deliver quality content and other people's ignorance is killing me in my current job.
Let's rant about a recent project I had under my hood, for this project (a webshop) I had to restructure the database and had to include validation on basicly every field (what the heck, no validation I hear you say??), apperently they let an incompetent INTERN make this f***king webshop. The list of mistakes in this project can bring you close to the moon I'd say, seriously.
Database design 101 is basicly auto incremented ID's, and using IDs in general instead of using name (among a list of other stuff obv.). Well, this intern decided it was a good idea to filter a custom address-book module based on a NAME, so it wasn't setup as: /addressbook/{id} (unique ID, never a problem) but as /addressbook/{name}, which results in only showing one address if the first names on the addresses are the same. Lots of bugs that go by this type of incompetence and ignorance. Want to hear another joke? Look no further, this guy also decided it was a great idea to generate the next ID of an order. So the ordernumber wasn't made up by the auto incremented id on the order model, but by a count of all the orders and that was the next order number. This broke so many times, unbelievable.
To close the list of mistakes off, the intern decided it was a great idea to couple the address of a user directly to an order. Because the user is able to ship stuff to addresses within his addressbook, this bug could delete whole orders out of the system by simply deleting the address in your addressbook.
Enough about my intern rant, after working my ass of and going above and beyond the expectations of the customer, the guy from sales who was responsible for it showed what an a**hole he was. Lets call this guy Tom.
Little backstory: our department is a very small part of the company but we are responsible for so much if you think about it. The company thinks we've transitioned to company wide SCRUM, but in reality we are so far from it. I think the story below is a great example of what causes this.
Anyway, we as the web department work within Gitlab. All of our issues and sprints are organized and updated within this place. The rest of the company works with FileMaker, such a pile of shit software but I've managed to work around its buggyness. Anyway, When I was done with the project described above I notified all the stakeholders, this includes Tom. I made a write-up of all the changes I had made to the project, including screenshots and examples, within Gitlab. I asked for feedback and made sure to tag Tom so he was notified of my changes to the project.
After hearing nothing for 2 weeks, guess who came to my desk yesterday? F**king tom asking what had changed during my time on the project. I told him politely to check Gitlab and said on a friendly tone that I had notified him over 2 weeks ago. He, I shit you not, blantly told me that he never looks on there "because of all the notifications" and that I should 'tell him what to do' within FileMaker (which I already had updated referencing Gitlab with the write-up of my changes). That dick move of him made me lose all respect for this guy, what an ignorant piece of shit he is afterall.
The thing that triggers me the most in the last story is that I spent so much free time to perfect the project I was working on (the webshop). I even completed some features which weren't scheduled during the sprint I was working on, and all I was asking for was a little appreciation and feedback. Instead, he showed me how ignorant and what a dick he was.
I absolutely have no reason to keep on working for this company if co-workers keep treating me like this. The code base of the webshop is now in a way better condition, but there are a dozen other projects like this one. And guess what? All writen by the same intern.
/rant :P10 -
Episode 2 of this rant: https://devrant.io/rants/851636/...
PM went to meet with the provider and came back, so I had a talk with the PM and it went like this:
Me: so how did the meeting go? Hope they corporate with you
PM: *in a sarcastic voice* Bro, you need be a good dev, they told me only a good dev can implement Master Card API calls, and its all in the docs. That's all they told me, so you should know how the meeting went
Me: *there is no wifi in jail, there is no wifi in jail, there is no wifi in jail, there is no wifi in jail* Fine bro, I'll go back to school and come back after 12 years.
Seriously when I send the provider the request and the body and all they tell me is: You have an error, Id must be unique but they fail to point out the exact error or at least send me a valid ID to test, how does this make me the bad dev and him the genius that can run Apple, Google, MS all together at once!
What is even worse, when I called the provider he told me: Man transaction ID must always be unique, how could you not know this, how is Mastercard supposed to differentiate between transactions!!
But hey, no one told me transaction id must be unique, primary keys are never unique, like DUH!10 -
Coming back here after years to rant about... myself.
TLDR: I fucked up and now have to call a thousand people as a dev, I'm not even getting paid for it and they all get crazy about a random ID that got assigned to them, so now I want to throw away all my electronics and become a skilift operator.
Stupid me deployed a project shortly before we have the largest amount of orders in the year. (Like 90% of yearly orders in a couple minutes cause they are sold out fast and people wait to order first)
I got this horrible legacy "plain self written framework php" project which I tried to upgrade state of the art.
There was one piece missing to upgrade everything and nicely deploy it to some fresh new servers which can handle the high load which peaks at the time orders open.
So I did it the day before orders open and... everything worked well! Nothing crashed.
I wrote my client to wait a little before he confirms the orders, since after confirmation each of the people who ordered will receive an email where they can choose a unique number which they'll receive as a sticker with the order.
Since it's an event my client is promoting, people will meet each other wearing those unique stickers and being able to identify each other online and in person with this number.
Suddenly my clients call me that "customers are complaining about that there is something wrong"
Turned out he confirmed all orders straight away and that part of the application which makes the number unique was broken on the update.
So everyone could chose any number (also taken ones) as his "unique" number.
In my panic, I told my client "It's my mistake, I'll deal with it of course and call the affected people in my free time, since it's my mistake you don't have to pay for it". (it's my largest client by far, am a freelancer)
Realizing when people can chose any number it'll not be a few ones who have the same, it's like almost everyone did chose "69", "1", "420", "88 (a scary amount of people)",... (with 69 being the number being chosen by most people btw, even more then "1")
So now I have to call about a thousand people telling them a new random ID will be assigned to them. I thought of course about mailing them, wrote a script that deals with the issue automatically, and FUCKED IT UP TOO so everyone is confused and the only way to deal with it is by a call basically.
And while I'm sitting here now for 2 days straight calling people in my free time about their random ID will have to change, I realized that some people are quite crazy about random ID's.
I'm talking about yelling and threatening because "is it too much to ask for a working website when ordering this expensive product".
I hate my life right now and am getting quite serious about throwing all my electronic devices away and become a skilift operator instead. Fuck the higher pay, it's not worth the shit, I wanna have only responsibility about one button to press while watching people fall on their face.5 -
Issue reporter:
Feed from external service provider is overwriting the wrong things, pls fix
Resolution:
Service provider is sending duplicate unique IDs, you need to get with them to discuss
Service provider response:
This is a *RE-USABLE UNIQUE ID* . . . The bottom line is you should not use this UNIQUE ID as a primary key.21 -
You made a very important device used in pharmaceutical labs which stores important data, but for some fucking reason you decided to write the communication protocol so poorly that I want to cry.
You can't fucking have unique IDs for important records, but still asks me for the "INDEX" (not unique ID, fucking INDEX) to delete a particular one. YOU HAVE IT IN THE MEMORY, WHY DON'T USE IT?!
How the fuck you have made such a stupid decision… it's a device that communicates using USB so theoretically I could unplug it for a moment, remove records, add them and plug it in again and then delete a wrong one.
I can't fucking check if it's still the correct one and the user isn't an asshole every 2 seconds because this dumb device takes about 3 for each request made.
WHY?
Why I, developing a third party system, have to be responsible for these dumb vulnerabilities you've created? -
One intern showed me an issue he was facing. "Delete" button was not working in a HTML page he had developed, but edit button is working properly. I checked the code both buttons had same id "edit72-btn". I said to him you need to use unique id in a page.
The thing he said next made a speechless. I was just looking at his face.
He said "edit72-btn and del72-btn are almost same, couple of characters are different. Are they going to work?"1 -
I just want things to do on my phone that are intellectually going to be stimulating
and not brainwashing
is that so hard to ask for
I can't keep playing sudokus all the time. the other day I wanted to go read a coding answer I asked an AI in my browser on my laptop but I was in bed on a voice chat with a sleeping person and didn't wanna get up out of bed to go fetch the laptop. my browser lets me see tabs I have open on other machines and this AI website makes a url with a unique id so you can browse to the chat you had, but it seems to not always work
earlier in the day I had asked the AI a theoretical coding question and it answered, but I got distracted and needed to go do something before I finished reading it (it was long). but when I was in bed on my phone playing sudokus for intellectual stimulation, annoyed and bored it was the only thing I could do, I had the bright idea of opening the tab on my laptop through my phone. Vivaldi is great and this always works. unfortunately the AI website's unique id thing doesn't. it loaded the website by URL correctly but the AI website just took me to the home page and I had no chat history to read =[
phones are literally computers but you can't do anything on them. can't watch videos without ads or bugs, if you load a lot of websites the tab management system sucks and performance is shit, controls for games suck even if you could find something not ad infested
hell you can't even do a pedometer that's not trying to get you to "log in". bruh
you can't even browse GitHub code! at least last I checked. it's just awkward, their app
I feel like I'm in a straitjacket in terms of technology and I wanna scream. I don't even know how to adequately describe my frustration or what I keep wishing for. it's been prominent in my head a couple years now. it's like we're regressing in terms of compatibility. went from card games provided by Microsoft like solitaire and spider, paint... to Jesus fuck you can't even get paint in a browser now without someone trying to fleece you
remember when things were inventive, nice, and not shit?
I don't even like playing mindustry on a phone to be fair. fighting the controls is most of the experience. so maybe phones are only good for reading things
I just noticed my brain over time doing sudokus learns so I wanted to practice engaging in something and learning as exercise, cuz I think it would be good for the brain damage. bah5 -
Ok... so I have a unique question/opportunity. I can't give all the details but here's the jist:
3yrs ago I was hired to consult a now prominent(still decently well known then) web-based company with many thousands of users, dealing with a lot of money and leveraging a social environment. They had several issues but initially they really needed me to find/train chat mods.
I did not take the offer for monetary reasons, like all consulting I've done, I had additional reason and/or fondness to fix the issues. In this case it was an interesting challenge and I knew several customers and some support staff so it'd be worthwhile.
They (without request) reduced their typical 2mo probationary period to 2wk for me. With less than a day left of that period, I was 'hacked' via a pushed telegram update, on the account they made me create for work purposes (they had control of the phone number not me).
During this 'hack' one of the 2, currently active, culprits sent a message to his tg account from the 'hacked' one and quickly deleted the entire convo. The other pretended (poorly) to be me in the chat with the mods in training (at least a few directly witnessed this and provided commentary).
Suddenly, I was fired without any rationale or even a direct, non-culprit, saying anything to me.
The 'hack' also included some very legit, and very ignorantly used, Ukrainian malware.
This 'hack' was only to a 2nd gen lenovo yoga I got due to being a certified refurbisher... just used for small bs like this chat mod/etc job. I even opened up my network, made honey pots, etc., waiting for something more interesting... nope not even an attempt at the static ip.
I started a screen recording program shortly after this crap started (unfortunately after the message sent be 'me' to the dude who actually sent it happened... so i still dont know the contents).
I figured I'd wait it out until i was bored enough or the lead culprit was at a pinnacle to fall from...
The evidence is overwhelming. This moron had no clue what he was doing (rich af by birth type)... as this malware literally created an unhidden log file, including his info down to the MAC id of his MacBook... on my desktop in real time (no, not joking... that stupid)
Here's my quandary... Due to the somewhat adjacent nature of part of our soon to be public start-up... as i dont want it to turn into some coat tail for our tech to ride on for popularity... it's now or never.
Currently im thinking, aside from any revenge-esq scheme, it'd be somewhat socially irresponsible to not out him to his fellow investors and/or the organisation that is growing with him as one of few at the forefront... ironically all about trust/safety/verification of admins in the industry.
I tried to reach out to him and request a call... he's still just as immature. Spent hours essentially spamming me while claiming it wasnt him but hed help me find whoever it was... and several other failed attempts to know what i had. When i confirmed he wasnt going to attempt a call, i informed him id likey mute him because i don't have time for back and forth bs. True to form he deleted the chat (i recorded it but its of no value).
So... any thoughts?7 -
Data wrangling is messy
I'm doing the vegetation maps for the game today, maybe rivers if it all goes smoothly.
I could probably do it by hand, but theres something like 60-70 ecoregions to chart,
each with their own species, both fauna and flora. And each has an elevation range its
found at in real life, so I want to use the heightmap to dictate that. Who has time for that? It's a lot of manual work.
And the night prior I'm thinking "oh this will be easy."
yeah, no.
(Also why does Devrant have to mangle my line breaks? -_-)
Laid out the requirements, how I could go about it, and the more I look the more involved
it gets.
So what I think I'll do is automate it. I already automated some of the map extraction, so
I don't see why I shouldn't just go the distance.
Also it means, later on, when I have access to better, higher resolution geographic data, updating it will be a smoother process. And even though I'm only interested in flora at the moment, theres no reason I can't reuse the same system to extract fauna information.
Of course in-game design there are some things you'll want to fudge. When the players are exploring outside the rockies in a mountainous area, maybe I still want to spawn the occasional mountain lion as a mid-tier enemy, even though our survivor might be outside the cats natural habitat. This could even be the prelude to a task you have to do, go take care of a dangerous
creature outside its normal hunting range. And who knows why it is there? Wild fire? Hunted by something *more* dangerous? Poaching? Maybe a nuke plant exploded and drove all the wildlife from an adjoining region?
who knows.
Having the extraction mostly automated goes a long way to updating those lists down the road.
But for now, flora.
For deciding plants and other features of the terrain what I can do is:
* rewrite pixeltile to take file names as input,
* along with a series of colors as a key (which are put into a SET to check each pixel against)
* input each region, one at a time, as the key, and the heightmap as the source image
* output only the region in the heightmap that corresponds to the ecoregion in the key.
* write a function to extract the palette from the outputted heightmap. (is this really needed?)
* arrange colors on the bottom or side of the image by hand, along with (in text) the elevation in feet for reference.
For automating this entire process I can go one step further:
* Do this entire process with the key colors I already snagged by hand, outputting region IDs as the file names.
* setup selenium
* selenium opens a link related to each elevation-map of a specific biome, and saves the text links
(so I dont have to hand-open them)
* I'll save the species and text by hand (assuming elevation data isn't listed)
* once I have a list of species and other details, to save them to csv, or json, or another format
* I save the list of species as csv or json or another format.
* then selenium opens this list, opens wikipedia for each, one at a time, and searches the text for elevation
* selenium saves out the species name (or an "unknown") for the species, and elevation, to a text file, along with the biome ID, and maybe the elevation code (from the heightmap) as a number or a color (probably a number, simplifies changing the heightmap later on)
Having done all this, I can start to assign species types, specific world tiles. The outputs for each region act as reference.
The only problem with the existing biome map (you can see it below, its ugly) is that it has a lot of "inbetween" colors. Theres a few things I can do here. I can treat those as a "mixing" between regions, dictating the chance of one biome's plants or the other's spawning. This seems a little complicated and dependent on a scraped together standard rather than actual data. So I'm thinking instead what I'll do is I'll implement biome transitions in code, which makes more sense, and decouples it from relying on the underlaying data. also prevents species and terrain from generating in say, towns on the borders of region, where certain plants or terrain features would be unnatural. Part of what makes an ecoregion unique is that geography has lead to relative isolation and evolutionary development of each region (usually thanks to mountains, rivers, and large impassible expanses like deserts).
Maybe I'll stuff it all into a giant bson file or maybe sqlite. Don't know yet.
As an entry level programmer I may not know what I'm doing, and I may be supposed to be looking for a job, but that won't stop me from procrastinating.
Data wrangling is fun.1 -
So, I just (few hours ago)made a new variable that's either brilliant or innately flawed... not sure yet. It's an oddly unique var...
__bs__
So far I only made it in python and windows env (i script like the methodology of css).
I bet you're wondering how I've defined __bs__ and the practicality of it.
__bs__ is derived from a calculated level of bullshit that annoys me to tolerate, maintain, etc. as well as things that tend to throw nonsensical errors, py crap like changing my strings to ints at seemingly random times/events/cosmic alignments/etc or other things that have a history of pulling some bs, for known or unknown reasons.
How/why did this come about now?
Well I was updating some symlinks and scripts(ps1 and bat) cuz my hdd is so close to death I'm wondering if hdd ghosts exist as it's somehow still working (even ostream could tell it should be dead, by the sound alone).
A nonsense bug with powershell allowing itself to start/run custom ps1scripts with the originating command coming from a specific batch script, which worked fine before and nothing directly connected to it has changed.
I got annoyed so took an ironic break from it to work on python crap. Python has an innately high level of bs so i did need to add some extra calculations when defining if a py script or function is actually __bs__ or just py.
The current flavour of py bs was the datetime* module... making all of my scripts using datetime have matching import statements to avoid more bs.
I've kept a log of general bs per project/use case. It's more like a warning list... like when ive spent hours debugging something by it's traceback, meticulous... to eventually find out it had absolutely nothing to do with the exception listed. Also logged aliases i created, things that break or go boom if used in certain ways, packages that ive edited, etc.
The issue with my previous logging is that it's a log... id need to read it before doing anything, no matter how quick/simple it should be, or im bound to get annoyed with... bs.
So far i have it set to alert if __bs__ is above a certain int when i open something to edit. I can also check __bs__ fot what's causing the bs. I plan to turn it into a warning and recording system for how much bs i deal with and have historical data of personal performance vs bs tolerance. There's a few other applications i think ill want to use it for, assume it's not bs itself.
*in case you prefer sanity and haven't dealt with py and datetime enough, here's the jist:
If you were to search any major forum like StackOverflow for datetime use in py, youd find things like datetime.datetime.now() and datetime.now() both used, to get the same returned value. You'll also find tons of posts for help and trying to report 'bugs', way more than average. This is because the datetime package has a name conflict... with itself. It may have been a bug several years ago, but it beeb explicitly defined as intentional since.2 -
Working with nightly builds and concept tech is such a fucking hassle...
I'm currently working on a WebAssembly proof of concept where I need to generate a unique id, but since threading is currently not supported (rust and webassembly) I cant use half of the libraries currently out.
And the ones that does work... guess what... are not compatible with the nightly build of the compiler I'm using for Rust. Just fucking end me.
The legit only workaround I can find is to make a server request and get the unique id from there... piece of cunt software...I need a break 😑