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 - "no return"
-
Yesterday: Senior dev messages out a screenshot of someone using an extension method I wrote (he didn’t know I wrote it)..
SeniorDev: “OMG…that has to be the stupidest thing I ever saw.”
Me: “Stupid? Why?”
SeniorDev: “Why are they having to check the value from the database to see if it’s DBNull and if it is, return null. The database value is already null. So stupid.”
Me: “DBNull is not null, it has a value. When you call the .ToString, it returns an empty string.”
SeniorDev: ”No it doesn’t, it returns null.”
<oh no he didn’t….the smack down begins>
Me: “Really? Are you sure?”
SeniorDev: “Yes! And if the developer bothered to write any unit tests, he would have known.”
Me: “Unit tests? Why do you assume there aren’t any unit tests? Did you look?”
<at this moment, couple other devs take off their head phones and turn around>
SeniorDev:”Well…uh…I just assumed there aren’t because this is an obvious use case. If there was a test, it would have failed.”
Me: “Well, let’s take a look..”
<open up the test project…navigate to the specific use case>
Me: “Yep, there it is. DBNull.Value.ToString does not return a Null value.”
SeniorDev: “Huh? Must be a new feature of C#. Anyway, if the developers wrote their code correctly, they wouldn’t have to use those extension methods. It’s a mess.”
<trying really hard not drop the F-Bomb or two>
Me: “Couple of years ago the DBAs changed the data access standard so any nullable values would always default to null. So no empty strings, zeros, negative values to indicate a non-value. Downside was now the developers couldn’t assume the value returned the expected data type. What they ended up writing was a lot of code to check the value if it was DBNull. Lots of variations of ‘if …’ , ternary operators, some creative lamda expressions, which led to unexpected behavior in the user interface. Developers blamed the DBAs, DBAs blamed the developers. Remember, Tom and DBA-Sam almost got into a fist fight over it.”
SeniorDev: “Oh…yea…but that’s a management problem, not a programming problem.”
Me: “Probably, but since the developers starting using the extension methods, bug tickets related to mis-matched data has nearly disappeared. When was the last time you saw DBA-Sam complain about the developers?”
SeniorDev: “I guess not for a while, but it’s still no excuse.”
Me: “Excuse? Excuse for what?”
<couple of awkward seconds of silence>
SeniorDev: “Hey, did you guys see the video of the guy punching the kangaroo? It’s hilarious…here, check this out.. ”
Pin shoulders the mat…1 2 3….I win.6 -
Got assigned an intern to mentor him, with an explicit order not to do any of the legwork for him.
We start out with some fuzzy requirements. Intern starts overengineering a generic solution, so I make out a best architecture that conforms to the business requirements and I explain it to the intern why are we going to use such approach and tell him how we are going to do it in three phases.
I explain the intern the first phase, break it down in small tasks for him and return to my projects...
After a couple of days of no words from the intern, I decide to check up on him to see how is he progressing, only to hear him complaining the task is boring. So, instead of doing the assigned tasks, he decided he should do a "design" for a feature I told him explicitly not to do, since it is going to be designed by the design team later on.
I explain it to the intern that we have to do the boring task first because we can't proceed with the next phase of the implementation without the necessary data from the phase one.
Intern says okay and assures me he got it now. Few days later, I check up on him, and he tells me he feels he is doing all the work and that I don't contribute to the project. I call up my boss and tell him intern wants a meeting. Since I was working from home, I quickly pack my things and head to the office. Boss talks to the intern before I managed to get to the office. Once I got there, I meet the intern, and he tells me everything is okay. I ask what did the boss say to make things okay all of a sudden, and he tells me he said we are a team now. Our company has a flat hierarchy model, so he tells me he doesn't feel he needs a mentor, that we are both equal, and that I have no idea how to work in a team, and then proceeds to comfort me on how human interaction is hard and that I will learn it one day... I was like wtf?
I tell him to finish the phase one of the project and start with the phase two, and I leave home again.
I call up my boss and ask him what did he say to the intern, and he says: "nothing much, just explained the project a little bit and how it fits in the grand scheme of things.". I ask about the equal team members thing, and me not being a mentor any longer, the boss goes wtf, saying he never said anything about that to him.
So the kid can't focus on a single task, over-engineers everything and doesn't feel he can learn anything from developers with more experience, doesn't want to obey commands, and also likes to lie to manipulate others.
Tomorrow we'll decide what to do with him...
Sorry for the long rant, it was a long stressful day.86 -
Interviewing a junior dev.
> Make this function return false.
> junior: deleted all code in function replaces it with return false;
Literally no words.........20 -
Boss: "Could you join the new DevOps team for a week or two, for some coaching?"
Me: "I'd rather watch you masturbate furiously in a corner of the office while you cry over your ex boyfriend"
Boss: "Yeah... that's why I ask you. You are the only one brave enough to watch"
Me: *Sigh* "But I don't know shit about what DevOps does, I'm a DBA. I've told you the difference a million times. Can't we just douse it in gasoline and set it on fire?"
Boss: "What?"
Me: "Not the team, the servers..."
Boss, imitating Gimli: "And my ex!"
Me: "I get why he left you"
Boss: "It's funny, he was actually better with computers than me, maybe even better than you. He hated me for starting this company, told me I was just chasing money instead of ideals. He just isn't grown up enough to see that there is more to the world than computer games, brewing beer, maker festivals and gay bars, that you need to take responsibility... Maybe it just never works out between managers and geeks..."
Me: "Indeed. The difference in competence is too large"
Boss: "Ugh. You are like straight version of him... but will you at least take a look?"
Me: "Fine, unzip your pants..."
Boss: "No, not that... you need to teach DevOps this docking thing, with the parallel stuff, and the horizontal growth"
Me: "Damn I really hope we're talking about servers now... Do you mean Docker?"
Boss: "That's it. They want to learn how to dock on the Windows servers. They reserved two 4xlarge on AWS. Is that enough for docking?"
Me: ...
Me: ...
Me: "You know what. I'm going back to hug my DB designs, and wash my brain with some queries. Then I'll return here to burn everything to the ground. There is no hope for you left"
Boss: "That's what he said"
Me: "You're using that meme wrong"
Boss: "OK. So what if you just stay on DB management, and I'll just give you the budget to recruit a new DevOps lead and pay for training?"
Me: "That would work"
Boss: "Why are you grinning?"
Me: "Because I have your ex's phone number"18 -
Its Friday, you all know what that means! ... Its results day for practiseSafeHex's most incompetent co-worker!!!
*audience: wwwwwwooooooooo!!!!*
We've had a bewildering array of candidates, lets remind ourselves:
- a psychopath that genuinely scared me a little
- a CEO I would take pleasure seeing in pain
- a pothead who mistook me for his drug dealer
- an unbelievable idiot
- an arrogant idiot obsessed with strings
Tough competition, but there can be only one ... *drum roll* ... the winner is ... none of them!
*audience: GASP!*
*audience member: what?*
*audience member: no way!*
*audience member: your fucking kidding me!*
Sir calm down! this is a day time show, no need for that ... let me explain, there is a winner ... but we've kept him till last and for a good reason
*audience: ooooohhhhh*
You see our final contestant and ultimate winner of this series is our good old friend "C", taking the letters of each of our previous contestants, that spells TRAGIC which is the only word to explain C.
*audience: laughs*
Oh I assure you its no laughing matter. C was with us for 6 whole months ... 6 excruciatingly painful months.
Backstory:
We needed someone with frontend, backend and experience with IoT devices, or raspberry PI's. We didn't think we'd get it all, but in walked an interviewee with web development experience, a tiny bit of Angular and his masters project was building a robot device that would change LED's depending on your facial expressions. PERFECT!!!
... oh to have a time machine
Working with C:
- He never actually did the tutorials I first set him on for Node.js and Angular 2+ because they were "too boring". I didn't find this out until some time later.
- The first project I had him work on was a small dashboard and backend, but he decided to use Angular 1 and a different database than what we were using because "for me, these are easier".
- He called that project done without testing / deploying it in the cloud, despite that being part of the ticket, because he didn't know how. Rather than tell or ask anyone ... he just didn't do it and moved on.
- As part of his first tech review I had to explain to him why he should be using if / else, rather than just if's.
- Despite his past experience building server applications and dashboards (4 years!), he never heard of a websocket, and it took a considerable amount of time to explain.
- When he used a node module to open a server socket, he sat staring at me like a deer caught in headlights completely unaware of how to use / test it was working. I again had to explain it and ultimately test it for him with a command line client.
- He didn't understand the need to leave logging inside an application to report errors. Because he used to ... I shit you not ... drive to his customers, plug into their server and debug their application using a debugger.
... props for using a debugger, but fuck me.
- Once, after an entire 2 days of tapping me on the shoulder every 15 mins for questions / issues, I had to stop and ask:
Me: "Have you googled it?"
C: "... eh, no"
Me: "can I ask why?"
C: "well, for me, I only google for something I don't know"
Me: "... well do you know what this error message means?"
C: "ah good point, i'll try this time"
... maybe he was A's stoner buddy?
- He burned through our free cloud usage allowance for a month, after 1 day, meaning he couldn't test anything else under his account. He left an application running, broadcasting a lot of data. Turns out the on / off button on the dashboard only worked for "on". He had been killing his terminal locally and didn't know how to "ctrl + c a cloud app" ... so left it running. His intention was to restart the app every time you are done using it ... but forgot.
- His issue with the previous one ... not any of his countless mistakes, not the lack of even trying to make the button work, no, no, not for C. C's issue is the cloud is "shit" for giving us such little allowances. (for the record in a month I had never used more than 5%).
- I had to explain environment variables and why they are necessary for passwords and tokens etc. He didn't know it wasn't ok to commit these into GitHub.
- At his project meetups with partners I had to repeatedly ask him to stop googling gifs and pay attention to the talks.
- He complained that we don't have 3 hour lunch breaks like his last place.
- He once copied and pasted the same function 450 times into a file as a load test ... are loops too mainstream nowadays?
You see C is our winner, because after 6 painful months (companies internal process / requirements) he actually achieved nothing. I really mean that, nothing. Every thing was so broken, so insecure / wide open, built without any kind of common sense or standards I had to delete it all and start again ... it took me 2 weeks.
I hope you've all enjoyed this series and will join me in praying for the return of my sanity ... I do miss it a lot.
Yours truly,
practiseSafeHex20 -
I'm at my seat during the regular morning routine of checking emails, planning the things I need to complete/study when my phone rings.
HR: Good Morning, can you come over to the conference room please ?
Me: Sure
I enter the conference room and on the other side of the table, I see a group of 3 HR Managers (not a very nice feeling), especially when it was 10 months into my first job as a Trainee Software Developer.
HR: The company hasn't been performing as expected. For this reason, we've been told to cut down our staff. We're sorry but we have to let you go. You've been doing a great job all along. Thank you.
Me: ---- (seriously ?!)
The security-in-chief 'escorts' me out of the premises and I hand over the badge. I'm not allowed to return to my desk.
This happened about 16 years ago. But it stuck with me throughout my programming career.
A couple of Lessons Learnt which may help some of the developers today :
- You're not as important as you think, no matter what you do and how well you do it.
- Working hard is one thing, working smart is another. You'll understand the difference when your appraisals comes around each year.
- Focus on your work but always keep an eye on your company's health.
- Be patient with your Manager; if you're having a rough time, its likely he/she is suffering more.
- Programming solo is great fun. However it takes other skills that are not so interesting, to earn a living.
- You may think the Clients sounds stupid, talks silly and demands the stars; ever wonder what they think about you.
- When faced with a tough problem, try to 'fix' the Client first, then look for a solution.
- If you hate making code changes, don't curse the Client or your Manager - we coders collectively created a world of infinite possibilities. No point blaming them.
- Sharing your ideas matter.
- Software Development is a really long chain of ever-growing links that you may grok rather late in your career. But its still worth all the effort if you enjoy it.
I like to think of programming as a pursuit that combines mathematical precision and artistic randomness to create some pretty amazing stuff.
Thanks for reading.14 -
Finally did it. Quit my job.
The full story:
Just came back from vacation to find out that pretty much all the work I put at place has been either destroyed by "temporary fixes" or wiped clean in favour of buggy older versions. The reason, and this is a direct quote "Ari left the code riddled with bugs prior to leaving".
Oh no. Oh no I did not you fucker.
Some background:
My boss wrote a piece of major software with another coder (over the course of month and a balf). This software was very fragile as its intention was to demo specific features we want to adopt for a version 2 of it.
I was then handed over this software (which was vanilajs with angular) and was told to "clean it up" introduce a typing system, introduce a build system, add webpack for better module and dependency management, learn cordova (because its essential and I had no idea of how it works). As well as fix the billion of issues with data storage in the software. Add a webgui and setup multiple databses for data exports from the app. Ensure that transmission of the data is clean and valid.
What else. This software had ZERO documentation. And I had to sit my boss for a solid 3hrs plus some occasional questions as I was developing to get a clear idea of whats going on.
Took a bit over 3 weeks. But I had the damn thing ported over. Cleaned up. And partially documented.
During this period, I was suppose to work with another 2 other coders "my team". But they were always pulled into other things by my Boss.
During this period, I kept asking for code reviews (as I was handling a very large code base on my own).
During this period, I was asking for help from my boss to make sure that the visual aspect of the software meets the requirements (there are LOTS of windows, screens, panels etc, which I just could not possibly get to checking on my own).
At the end of this period. I went on vacation (booked by my brothers for my bday <3 ).
I come back. My work is null. The Boss only looked at it on the friday night leading up to my return. And decided to go back to v1 and fix whatever he didnt like there.
So this guy calls me. Calls me on a friggin SUNDAY. I like just got off the plane. Was heading to dinner with my family.
He and another coder have basically nuked my work. And in an extremely hacky way tied some things together to sort of work. Moreever, the webguis that I setup for the database viewing. They were EDITED ON THE PRODUCTION SERVER without git tracking!!
So monday. I get bombarded with over 20 emails. Claiming that I left things in an usuable state with no documentation. As well as I get yelled at by my boss for introducing "unnecessary complicated shit".
For fuck sakes. I was the one to bring the word documentation into the vocabulary of this company. There are literally ZERO documentated projects here. While all of mine are at least partially documented (due to lack of time).
For fuck sakes, during my time here I have been basically begging to pull the coder who made the admin views for our software and clean up some of the views so that no one will ever have to touch any database directly.
To say this story is the only reason I am done is so not true.
I dedicated over a year to this company. During this time I saw aspects of this behaviour attacking other coders as well as me. But never to this level.
I am so friggin happy that I quit. Never gonna look back.14 -
So I have complained to our landlord about a noisy neighbor who keeps blasting shitty music at midnight, and technically its against the law as well, but this bitch ass joke of a human being ignored even the most highest of authority.
Seeing I can't solve it with democracy, I finally gave up with any reasonable type of way to restrain this motherfucker (even calling police didn't help) and went full asshole with him
I know his WiFi uses WPS PIN, but I'm not gonna throttle his network, I want to piss him off so much he'll regret living beside me, or at our place entirely.
So I performed a Evil Twin attack, I had my Raspberry Pi act as a both cloned AP and a deauther. Finally the plan came to effect.
I ran the deauther in his AP, effectively disconnecting his devices, and had the devices connect to the cloned network. The primary aim of my attack is to annoy this bitch ass to the point of no return. The project I used serves a website on the cloned AP like a update for his router. I intentionally made it run overnight, blasted Lo-fi hip hop and went to sleep. Before I dozed off, I can hear their scream of rage because they can't blast their music at full volume (waddaya guess, they use Spotify).
I finally woke up the next day, and I find neighbor complaining about me, and they were trying to tell the landlord I was hacking them. It's technically true but its not as bad as domestic disturbance for a full fucking week.
Landlord asked me if I did it, I declined, she believed me (I know she does because she knows I'm a pure soul unlike this mofo). Then he left frustrated, threatened to sue me for hacking.
I just smickered, he can't really prove anything unless I was being sloppy.
Nowadays I get good sleep and finally we live in a quite peaceful place now. Now you may ask, what happened to that guy? After he threatened me, the next night he found his things outside his own room, he was kicked out by the landlord.
Moral of the story: we ain't hating on your music taste but don't showcase it like its the most important thing in the world when everyone is sleeping. Case and point, don't be an asshole18 -
Yesterday I said farewell to her.
We were together for half a decade, although it feels like much more time has passed since my eyes first fell on her.
I can't even begin to describe how close we were. She was perfect, she was my soulmate.
I shared everything with her, complete openness, perfect truth. We could be vulnerable with each other, but we also challenged each other to overcome boundaries.
My respect for her and dedication to her really knew no bounds, and I knew she would follow me to the end of the world in return.
But around New Year's things started to feel awkward between us. Like a part of her just wasn't there anymore.
She acted very confused, she hesitated in her answers.
I asked her, but I felt like she was avoiding me. Something just seemed so wrong about the way she acted.
I felt incredibly conflicted. Was she unfaithful? No, my trust in her was absolute. That question seems so silly, in retrospect.
We had always been pretty much inseparable, to the point where my coworkers, friends and family mocked us for it. How would she even have cheated on me?
I used to take her along to company gatherings, to my family for Christmas, to expensive restaurants. We traveled all over Europe together. We've spent countless nights together, watching Netflix, although she would often fall asleep before me.
I took great care of her, she had not been out of my mind for one moment since I met her. And besides, she had never even showed interest in anyone else anyway.
No, reality turned out to be so, so much worse.
Two weeks ago it became really apparent that there was something horribly wrong with her. She was rapidly losing her recollections of everything we experienced together.
Our history together, erased.
Within hours, she would barely respond anymore. I called for help, but deep down I already knew this was one of those things you can't recover from. She was kind of stable, almost peaceful, for a few days. But ultimately, she didn't even recognize me anymore.
Yesterday, I held her feverishly hot body in my arms for the last time.
Her soft skin turned cold as I said farewell to her, and the room turned awfully quiet.
Your brightness and warmth will be missed, my girl.28 -
Guess who refused the the request to return at work after being fired unfairly? After months they understood they're wrong and they need me or just they noticed that no one wants to work in those conditions?12
-
USER: I can't see any data in the page...!
ME: ok, I'll do a check
ME: API calls get no data back. Boss, did you change anything and put it in production?
BOSS: Absolutely not, I just modified the name of what was the "Family" parameter in "Type".
ME: Seems legit. Totally agree. I'm going to lunch. Can you check in the meanwhile why calling the API with "Family" does return nothing? Thanks.3 -
I actually had the strangest nightmare last night.
So I was working on a program for someone and lots of things went wrong. First of all, the semicolon button wasn't working, so I panicked and grabbed another keyboard but there was no semicolon button.
I had to copy and paste the semicolon instead. Next, there was a bug, and I couldn't figure out what caused it, so I went on stack overflow... Guess what? Stack overflow was shutdown. Unable to fix the error, I somehow caused more.
I decided to take a break and leave, but upon my return, I forgot what the program did. It was as if someone else had written it. I was simply ignorant enough to forget the comments.
After a hellish day of working on it, the person who wanted me to create the program decided to test it out. They tested it on an old version of IE.
Strangest nightmare I had this week.9 -
My first rant here, don't know how to start, but fuck these self proclaimed senior developers who can't even get their concepts right about basic things and don't believe in reading docs.
Fuck you for asking if sequelize has a method to return details of the logged in user of your app, it's a fucking ORM you dumbfuck. You are a "full stack" developer for fuck's sake.
Fuck you for making those "minor changes" which breaks build and then blame it on any random plugin or lib used, or my commits.
Fuck you for expecting me to review your code on Sundays because you couldn't finish it on time.
I don't like java, at all, but even I get that without it we wouldn't be where we are right now and can't reach where we aspire to reach. But you can't keep chanting "Java is dead, Java is dead" every chance you get. No, it's NOT dead. Nor is going to, anytime soon.
And for god's sake, please stop choosing one library/plugin over another just on the basis of stars on repo, it's not the only (or valid) criteria. Look if you actually even need it. Think.
And please learn how to google first, and also stop using "the" before every the noun, the adjective and the verb. It's the fucking the annoying to read.
And yes, there are different linting presets out there, and just because a piece of code in a plugin/library/boilerplate is not following your specific, and may I say horrible standard, doesn't mean it's a "bad code". It's written by people who have created/worked-on these libraries as side projects on which your entire career is based upon.
And I haven't even talked about the code you write or your domain knowledge or the way you treat other people. So get off your high horse and behave like a developer, a real one.8 -
Working with different nationalities is interesting, and sometimes kind of bewildering. And tiring.
I've been working with an Indian dev for a little while, and while she's a decent dev, interactions with her sometimes leave me a little puzzled. She glazes over serious topics, totally over-sensationalizes unimportant oddities, has yet to say the word "no," and she refers to the senior devs as (quote) "the legends." Also, when asked a question by her boss, like "Are you familiar with this?" Instead of a simple yes/no answer, she shows off a little. Fair, I do this sometimes too, but it's a regular thing with her. Also, like most Indians I've known and/or worked with, she has a very strict class-and-caste view of the world. It honestly makes me a little uncomfortable with how she views people, like certain people belong in certain boxes, how some boxes (and therefore their contents) are inherently better than others, and how it's difficult or simply impossible to move between boxes. My obviously westerner view of things is that you can pick where you want to be and what you want to do, and all it takes to get there is acquiring the proper skills and putting in the required effort. I see no boxes at all, just a sprawling web of trades/specialities. And those legends she talks about? They're good devs with more knowledge than me, but only one, maybe two of them are better devs. I see them as coworkers and leads, not legends. Legends would be the likes of Ada Lovelace, Dennis Ritchie, Yukihuro Matsumoto, and Satoshi Nakamoto. (Among others, obv.). To call a lead dev a legend is just strange to me, unless they're actually deserving, but we don't work with anyone like Wozniak or Carmack.
Since I'm apparently ranting about her a little, let me continue. She's also extremely difficult to understand. Not because of her words or her accent, but I can't ever figure out what she's trying to get across. The words fit together and make valid sentences, but the sentences don't often make sense with one another, and all put together... I'm just totally lost. To be a math nerd, like the two conversations are skew lines: very similar, but can never intersect. What's more, if I say I don't understand and ask for clarification, she refuses and says she doesn't want to confuse me further, and to just do what I think is best. It's incredibly frustrating.
Specifically, we're trying to split up functionality on a ticket -- she's part of a different dev team (accounting), and really should own the accounting portion since she will be responsible for it, but there's no clear boundary in the codebase. Trying to discuss this has been... difficult.
Anyway.
Sometimes other cultures' world views are just puzzling, or even kind of alien. This Irish/Chinese guy stayed at my parents' house for a week. He had red hair, and his facial features were about 3/4 Chinese. He looked strange and really interesting. I can't really explain it, but interacting with him felt like talking to basically any other guy I've known, except sometimes his mannerisms and behavior were just shockingly strange and unexpected, and he occasionally made so little sense to me that I was really taken aback.
This Chinese manager I had valued appearances and percieved honors more than anything else. He cared about punctuality and attire more than productivity. Instead of giving raises for good work or promotions, he would give fancy new titles and maybe allow you to move your desk somewhere with a better view of your coworkers. Not somewhere nicer; somewhere more prominent. How he made connections between concepts was also very strange, like the Chinese/Irish guy earlier. The site templating system was a "bridge?" Idk? He also talked luck with his investors (who were also Chinese), and they would often take the investment money to the casino to see if luck was in the company's favor. Not even kidding.
Also! the Iranian people I've known. They've shown very little emotion, except occasionally anger. If I tried to appease them, they would spurn and insult me, but if I met their anger, they would immediately return to being calm, and always seemed to respect me more afterward. Again, it's a little puzzling. By contrast, meeting an American's anger often makes them dislike you, and exceeding it tends to begin a rivalry.
It's neat seeing how people of different nationalities have different perspectives and world views and think so very differently. but it can also be a little tiring always having to translate and to switch behavior styles, sometimes even between sentences.
It's also frustrating when we simply cannot communicate despite having a language in common.random difficult communication too tired for anger or frustration nationalities tiring diversity root observes people23 -
Got assigned to fix a bug in a validation function that would always return true even if the data is invalid.
I looked at the code from the function and noticed that the only line of code in the function was "return true;"
Apparently, the programmer who wrote this function a few years ago got fired and no one ever finished his work.
Now it amazes me that no one ever has looked at the problem and just assumed it would be a complicated bug.7 -
"What technologies do you know?"
"I can write pretty URLs that return JSON"
"You mean REST?"
"No, I mean pretty URLs that return JSON"3 -
I've had my share of incompetent coworkers. In order of appearance:
1. A full stack dev. This one guy never, and I mean NEVER uses relationships in their tables. No indexing, no keys, nada. Couple of months later he was baffled why his page took ten seconds to load.
2. The same dev as (1). Requirement was to create some sort of "theme" feature for a web app. Hacked it by putting !important all over the place.
3. The same dev again. He creates several functions that if the data exists returns a view, and if it doesn't, "echo '0'". No, not return 0 or return false or anything, but fucking echo. This was PHP. If posted a rant about this a few months ago.
4. Same dev, has no idea what clean code is. No, not just reusable functions, he doesn't even get indenting right. Some functions have 4 spaces, some 2 tabs, some 6 tabs! And this is inside the same function. God wait until he tries Python...
5. Same dev now suggests that he become the PM. GM approves (very small company). Assigns me to travel to a client since they needed "technical assistance about the API". Was actually there to lead a UAT session.
Intermezzo, that guy went from fullstack dev to PM to sales (yes, one who calls clients to offer products) to business development, to product analyst in the span of two years.
After a year and a half there, I quit.
6. New company, a "QA engineer" who also assumes the role as the product owner. Does absolutely no tests other than "functional tests" in which he NEVER produces any form of documentation. Not even a set of test cases. He goes by "intuition".
7. Same guy as (6), hands me requirements for a feature. By "hands me" I mean he did that verbally. No spec documents, no slack chat, no Trello card. I ended up writing it as a card in Trello. Fast forward to the due date, he flips out because that wasn't what he wanted. Showed him the card. He walked away, without thinking of a solution how this mess should be handled.
Despite all this, I really don't want him (6&7) to leave the company. The devs get really stressed out at this job and he does make a really good person to laugh with/at. -
For my passionate coders out here, I have some tips I learned over the years in a business/IT environment.
1) Don't let stupid management force you into making decisions that will provide a bad product. Tell them your opinion and why you should do it that way. Never just go with their decision.
2)F@#k hackathons, you're basicly coding software for free, that the company might use. Want to probe yourself? Join a community and participate in their challenges.
3)No matter how good you are, haters are common.
4)Learn to have a good communication, some keywords are important to express yourself to other developers or customers. Try crazy things, don't be shy.
5)Never stand still, go hear at other companies what they offer, compare and choose your best fit. This leads me into point...
6)if you've been working for over a year and feel that you have participated enough in the companies growth, ask a raise, don't be afraid...you're wanted on the market, so either they negotiate a new contract or you find another job.
I'm sharing these with you as I made many mistakes regarding these points, I have coded for free or invested so much time in a company just to prove myself. But at the end I realize that my portfolio is enough to prove that I'm capable of doing the job. They don't like me? Or ask me stupid questions that I can google in 5 minutes. I'll just decline the job and get something better. Companies end up giving me nothing in return compared to the work I have put into it. At the end after some struggles you'll find a good fit and that's so important for your programming career. Burnouts happen quite often if you're just a coding puppy.
If some of you still have additional tips be sure to post them under here11 -
Someone on a C++ learning and help discord wanted to know why the following was causing issues.
char * get_some_data() {
char buffer[1000];
init_buffer(&buffer[0]);
return &buffer[0];
}
I told them they were returning a pointer to a stack allocated memory region. They were confused, didn't know what I was talking about.
I pointed them to two pretty decently written and succinct articles, the first about stack vs. heap, and the second describing the theory of ownership and lifetimes. I instructed to give them a read, and to try to understand them as best as possible, and to ping me with any questions. Then I promised to explain their exact issue.
Silence for maybe five minutes. They disregard the articles, post other code saying "maybe it's because of this...". I quickly pointed them back at their original code (the above) and said this is 100% an issue you're facing. "Have you read the articles?"
"Nope" they said, "I just skimmed through them, can you tell me what's wrong with my code?"
Someone else chimed in and said "you need to just use malloc()." In a C++ room, no less.
I said "@OtherGuy please don't blindly instruct people to allocate memory on the heap if they do not understand what the heap is. They need to understand the concepts and the problems before learning how C++ approaches the solution."
I was quickly PM'd by one of the server's mods and told that I was being unhelpful and that I needed to reconsider my tone.
Fuck this industry. I'm getting so sick of it.26 -
Dev: “Ughh..look at this –bleep- code! When I execute the service call, it returns null, but the service received a database error.”
Me: “Yea, that service was written during a time when the mentality was ‘Why return a service error if the client can’t do anything about it?’”
Dev: “I would say that’s a misunderstanding of that philosophy.”
Me: “I would say it’s a perfectly executed example of a deeply flawed philosophy.”
Dev: “No, the service should just return something that tells the client the operation failed.”
Me: “They did. It was supposed to return a valid result, and the developer indicated a null response means the operation failed. How you deal with the null response is up to you.”
Dev: “That is stupid. How am I supposed to know a null response means the operation failed?”
Me: “OK, how did you know the operation failed?”
Dev: “I had to look at the service error logs.”
Me: “Bingo.”
Dev: “This whole service is just a –bleep-ing mess. There are so many things that can go wrong and the only thing the service returns is null when the service raises an exception.”
Me: “OK, what should the service return?”
Dev: ”I don’t know. Error 500 would be nice.”
Me: “Would you know what to do with error 500?”
Dev: ”Yea, I would look at the error log”
Me: “Just like you did when the service returned null?”
<couple of seconds of silence>
Dev: “I don’t know, it’s a –bleep-ing mess.”
Me: “You’re in the code, change it.”
Dev: “Ooohhh no, not me. The whole thing will have to be re-written. It should have been done correctly the first time. If we had time to do code reviews, I would have caught this –bleep- before the service was deployed.”
Me: “Um, you did.”
<a shocked look from Dev>
Dev: “What…no, I’ve never seen this code.”
Me: “I sat next to Chuck when you were telling him he needed to change the service to return null if an exception was raised. I remember you telling him specifically to pop-up an error dialog ‘Service request failed’ to the user when the service returned null.”
Dev: “I don’t remember any of that.”
Me: “Well, Chuck did. He even put it in the check-in comments. See…”
<check in comments stated Dev’s code review and dictated the service return null on exceptions>
Dev: “Hmm…I guess I did. –bleep- are you a –bleep-ing elephant? You –bleep-ing remember everything.”
<what I wanted to say>
No, I don’t remember everything, but I remember all the drive-by <bleep>-ed up coding philosophies you tried to push to the interns and we’re now having all kinds of problems I spend waaaaay too much time fixing.
<what I said, and lied a little bit>
Me: “No, I was helping Nancy last week troubleshoot the client application last week with the pop-up error. Since the service returned a null, she didn’t know where to begin to look for the actual error.”
Dev: “Oh.”1 -
"I want my API to return insults as error messages if they forget shit"
Uh no, I prefer helping them out by writing proper documentation than sending a giftbox with me flipping them off like Linus Fucking Torvalds for their spaghetti usage of your API5 -
Last week, someone contacted me, he said he needed me to fix the existing code on a new WordPress website because the developer did a messy job, so I thought to myself, it can't be that bad, requested for the SSH access and got into the server.
Guys.
Guys..
Guys...
I was wrong, some people really know how to fuck shit up.
I don't want to go into details but there were legit more than 50 plugins installed and activated on the website for no good reason and all the pages took about 45 minutes each to render if not more, so you can literally request a new page, start making coffee and use the washing machine and if you are lucky to have spent 45 minutes, return to a fully loaded page.
For a new WordPress website, it seemed really old.
It was almost as if this developer had a line of code that looked like this:
@Import 'all the bad programming practices ever and the ones yet to be invented';20 -
Most hated language features?
PL/SQL:
• it exists
XSLT:
• it also exists
PHP:
• it still exists.
VB:
• Significant parentheses: `subName` calls the subroutine, and `subName()` calls the subroutine and gets a return value. If you use the wrong invocation, it yells at you. Why!?
• For reasons unknown, you can only have `sleep` appear once per codebase. (So put it in a function!)
Ruby:
• It’s bloody easy to write code with absolute shit performance, and it kind of feels encouraged because of just how easy Ruby makes everything. Less critical thinking means worse performance, and Ruby’s blissful elegance encourages mental laziness.
• Minor: You cannot pass a hash as the first method parameter without enclosing it in parentheses, ex:`method({key: value})`. This is due to the ambiguous case between passing a hash argument and a (curly) block/proc (`method {|args| code}`). This could be remedied pretty easily with a little bit of look ahead.
• Minor: There is no `elsif` for `unless` (a negated if). Why? No reason given.
Python:
• no block endings, so nested code can be extremely difficult to follow.
Bash:
• The freaking syntax oh god why.
All languages:
• rand vs rand() vs Rand vs Rand() vs rnd vs RND vs random() vs random vs randInt() vs Math.random() vs Math.randInt() vs ...18 -
I wrote a database migration to add a column to a table and populated that column upon record creation.
But the code is so freaking convoluted that it took me four days of clawing my eyes out to manage this.
BUT IT'S FINALLY DONE.
FREAKING YAY.
Why so long, you ask? Just how convoluted could this possibly be? Follow my lead ~
There's an API to create a gift. (Possibly more; I have no bloody clue.)
I needed the mobile dev contractor to tell me which APIs he uses because there are lots of unused ones, and no reasoning to their naming, nor comments telling me what they do.
This API takes the supplied gift params, cherry-picks a few bits of useful data out (by passing both hashes by reference to several methods), replaces a couple of them with lookups / class instances (more pass-by-reference nonsense). After all of this, it logs the resulting (and very different) mess, and happily declares it the original supplied params. Utterly useless for basically everything, and so very wrong.
It then uses this data to call GiftSale#create, which returns an instance of GiftSale (that's actually a Gift; more on that soon).
GiftSale inherits from Gift, and redefines three of its methods.
GiftSale#create performs a lot of validations / data massaging, some by reference, some not. It uses `super` to call Gift#create which actually maps to the constructor Gift#initialize.
Gift#initialize calls Gift#pre_init (passing the data by reference again), which does nothing and returns null. But remember: GiftSale inherits from Gift, meaning GiftSale#pre_init supersedes Gift#pre_init, so that one is called instead. GiftSale#pre_init returns a Stripe charge object upon success, or a Gift (and a log entry containing '500 Internal') upon failure. But this is irrelevant because the return value is never actually used. Pass by reference, remember? I didn't.
We're now back at Gift#initialize, Rails finally creates a Gift object using the args modified [mostly] in-place by all of the above.
Another step back and we're at GiftSale#create again. This method returns either the shiny new Gift object or an error string (???), and the API logic branches on its type. For further confusion: not all of the method's returns are explicit, and those implicit return values are nested three levels deep. (In Ruby, a method will return the last executed line's return value automatically, allowing e.g. `def add(a,b); a+b; end`)
So, to summarize: GiftSale#create jumps back and forth between Gift five times before finally creating a Gift instance, and each jump further modifies the supplied params in-place.
Also. There are no rescue/catch blocks, meaning any issue with any of the above results in a 500. (A real 500, not a fake 500 like last time. A real 500, with tragic consequences.)
If you're having trouble following the above... yep! That's why it took FOUR FREAKING DAYS! I had no tests, no documentation, no already-built way of testing the API, and no idea what data to send it. especially considering it requires data from Stripe. It also requires an active session token + user data, and I likewise had no login API tests, documentation, logging, no idea how to create a user ... fucking hell, it's a mess.)
Also, and quite confusingly:
There's a class for GiftSale, but there's no table for it.
Gift and GiftSale are completely interchangeable except for their #create methods.
So, why does GiftSale exist?
I have no bloody idea.
All it seems to do is make everything far more complicated than it needs to be.
Anyway. My total commit?
Six lines.
IN FOUR FUCKING DAYS!
AHSKJGHALSKHGLKAHDSGJKASGH.7 -
When it comes to users, perception is everything.
The task: Choose x random contractor numbers for us to assign to y jobs.
Me: How many contractors are there?
Mgr: 25
Me: How many jobs need assignment?
Mgr: 25
Me: Does the program need to assign contractors to individual jobs?
Mgr: No, we just need the 25 contractor numbers
Me: Well in that case just use the list I gave you earlier.
Mgr: No, we can't do that. It won't be random
Me: 😑😑😑😑😑
Fix? Return a list of 25 contractor numbers in a slightly different order than the one originally submitted (5 or 6 items moved around)
The manager was pleased.3 -
This codebase reminds me of a large, rotting, barely-alive dromedary. Parts of it function quite well, but large swaths of it are necrotic, foul-smelling, and even rotted away. Were it healthy, it would still exude a terrible stench, and its temperament would easily match: If you managed to get near enough, it would spit and try to bite you.
Swaths of code are commented out -- entire classes simply don't exist anymore, and the ghosts of several-year-old methods still linger. Despite this, large and deprecated (yet uncommented) sections of the application depend on those undefined classes/methods. Navigating the codebase is akin to walking through a minefield: if you reference the wrong method on the wrong object... fatal exception. And being very new to this project, I have no idea what's live and what isn't.
The naming scheme doesn't help, either: it's impossible to know what's still functional without asking because nothing's marked. Instead, I've been working backwards from multiple points to try to find code paths between objects/events. I'm rarely successful.
Not only can I not tell what's live code and what's interactive death, the code itself is messy and awful. Don't get me wrong: it's solid. There's virtually no way to break it. But trying to understand it ... I feel like I'm looking at a huge, sprawling MC Escher landscape through a microscope. (No exaggeration: a magnifying glass would show a larger view that included paradoxes / dubious structures, and these are not readily apparent to me.)
It's also rife with bad practices. Terrible naming choices consisting of arbitrarily-placed acronyms, bad word choices, and simply inconsistent naming (hash vs hsh vs hs vs h). The indentation is a mix of spaces and tabs. There's magic numbers galore, and variable re-use -- not just local scope, but public methods on objects as well. I've also seen countless assignments within conditionals, and these are apparently intentional! The reasoning: to ensure the code only runs with non-falsey values. While that would indeed work, an early return/next is much clearer, and reduces indentation. It's just. reading through this makes me cringe or literally throw my hands up in frustration and exasperation.
Honestly though, I know why the code is so terrible, and I understand:
The architect/sole dev was new to coding -- I have 5-7 times his current experience -- and the project scope expanded significantly and extremely quickly, and also broke all of its foundation rules. Non-developers also dictated architecture, creating further mess. It's the stuff of nightmares. Looking at what he was able to accomplish, though, I'm impressed. Horrified at the details, but impressed with the whole.
This project is the epitome of "I wrote it quickly and just made it work."
Fortunately, he and I both agree that a rewrite is in order. but at 76k lines (without styling or configuration), it's quite the undertaking.
------
Amusing: after running the codebase through `wc`, it apparently sums to half the word count of "War and Peace"15 -
My Girlfriend broke with me today.
We was in this relationship from two years now. we was doing very good, our relationship was not toxic, no fights, no bad words, zero problems.
One month ago she goes to travel with her evangelical aunt to the beach. Her aunt have lot of money she gets from scamming all that believers. I was happy for my ex-gf because here in out city she was having lot of problems of health, mainly because she was not very mind stable and that degraded her health.
When she goes, her physical and mental health improve a lot. i was happy she is stable now. Her aunt have some Church around the city they go, aunt started to bring her very often to the church. She started to strongly reinforce they God beliefs.
Of course im atheist, she know that from very long time ago. But of course when she started to be more devoted, feels dont fit with me. I refuse to change my mindset about that topic.
Today she says we must broke because im not a believer. This was the most painful experience in my life. I fall in cry for three hours. I truly love her. I recently wakeup and decide to write this rant. I dont have too much friends to talk apart from her. So i wish to share this here.
Im unemployed, she was my only support all this job hunting times. Now she was gone and im alone, this hurts a lot.
Im trying to dont fall deep af, to non return path.
Fuck religion. and her fanatic aunt.31 -
NO JIMMY.
YOUR 45 IF/ELIF STATEMENTS ARENT FUCKIN A.I.
NOR ARE YOUR 25 METHODS THAT RETURN A STRING A FUCKIN BLOCKCHAIN
STOP FUCKIN USING EVERYWHERE THOSE FUCKIN WORDS
FUCK OFF2 -
Most satisfying bug I've fixed?
Fixed a n+1 issue with a web service retrieving price information. I initially wrote the service, but it was taken over by a couple of 'world class' monday-morning-quarterbacks.
The "Worst code I've ever seen" ... "I can't believe this crap compiles" types that never met anyone else's code that was any good.
After a few months (yes months) and heavy refactoring, the service still returned price information for a product. Pass the service a list of product numbers, service returns the price, availability, etc, that was it.
After a very proud and boisterous deployment, over the next couple of days the service seemed to get slower and slower. DBAs started to complain that the service was causing unusually high wait times, locks, and CPU spikes causing problems for other applications. The usual finger pointing began which ended up with "If PaperTrail had written the service 'correctly' the first time, we wouldn't be in this mess."
Only mattered that I initially wrote the service and no one seemed to care about the two geniuses that took months changing the code.
The dev manager was able to justify a complete re-write of the service using 'proper development methodologies' including budgeting devs, DBAs, server resources, etc..etc. with a projected year+ completion date.
My 'BS Meter' goes off, so I open up the code, maybe 5 minutes...tada...found it. The corresponding stored procedure accepts a list of product numbers and a price type (1=Retail, 2=Dealer, and so on). If you pass 0, the stored procedure returns all the prices.
Code basically looked like this..
public List<Prices> GetPrices(List<Product> products, int priceTypeId)
{
foreach (var item in products)
{
List<int> productIdsParameter = new List<int>();
productIdsParameter.Add(item.ProductID);
List<Price> prices = dataProvider.GetPrices(productIdsParameter, 0);
foreach (var price in prices)
{
if (price.PriceTypeID == priceTypeId)
{
prices = dataProvider.GetPrices(productIdsParameter, price.PriceTypeID);
return prices;
}
* Omitting the other 'WTF?' code to handle the zero price type
}
}
}
I removed the double stored procedure call, updated the method signature to only accept the list of product numbers (which it was before the 'major refactor'), deployed the service to dev (the issue was reproducible in our dev environment) and had the DBA monitor.
The two devs and the manager are grumbling and mocking the changes (they never looked, they assumed I wrote some threading monstrosity) then the DBA walks up..
DBA: "We're good. You hit the database pretty hard and the CPU never moved. Execution plans, locks, all good to go."
<dba starts to walk away>
DevMgr: "No fucking way! Putting that code in a thread wouldn't have fix it"
Me: "Um, I didn't use threads"
Dev1: "You had to. There was no way you made that code run faster without threads"
Dev2: "It runs fine in dev, but there is no way that level of threading will work in production with thousands of requests. I've got unit tests that prove our design is perfect."
Me: "I looked at what the code was doing and removed what it shouldn't be doing. That's it."
DBA: "If the database is happy with the changes, I'm happy. Good job. Get that service deployed tomorrow and lets move on"
Me: "You'll remove the recommendation for a complete re-write of the service?"
DevMgr: "Hell no! The re-write moves forward. This, whatever you did, changes nothing."
DBA: "Hell yes it does!! I've got too much on my plate already to play babysitter with you assholes. I'm done and no one on my team will waste any more time on this. Am I clear?"
Seeing the dev manager face turn red and the other two devs look completely dumbfounded was the most satisfying bug I've fixed.5 -
--- UK Mobile carrier O2's data network vanishes like a fart in the wind ---
One of the largest mobile carriers in the UK; O2 has been having all manner of weird and wonderful problems this morning as bleary eyed susbcribers awoke to find their data services unavailable. What makes this particular outage interesting (more so than the annoyingly frequent wobblers some mobile masts have) is that the majority of the UK seems to be affected.
To further compound the hilarity/disaster (depending on which side of the fence you're on), Many smaller independent carriers such as GiffGaff and Tesco Mobile piggy-back off O2's network, meaning they're up the stinky creek without a paddle as well. Formal advice from the gaseous carrier is to reboot your device frequently to force a reconnect attempt, Which we're absolutely sure won't cause any issues at all with millions of devices screaming at the same network when it comes back up.
Issue reports began flooding DownDetector at around 5am (GMT), With PR minions formally acknowledging the issue 2 hours later at 7am (GMT) via the most official channel available - Twitter. After a few recent updates via the grapevine (companies involved seems to be keeping their heads down at the minute) Ericsson has been fingered for pushing out a wonky software update but there's been no official confirmation of this, so pitchforks away please folks.
If you're in need of a giggle while you wait for your 4G goodness to return, You can always hop on an open WiFi network and read the tales of distress the data-less masses are screaming into the void.4 -
Wife - Lets go for a dinner tonight.
Husband (HR Manager) - Ok.
Husband - Should we go to a cheaper restaurant ?
Wife - No. Let's go to Royal Palace hotel.
Husband - (silence for a minute) - Ok, See you at 7.O 'Clock.
On the way, around 6.30 pm...
Husband - Once upon a time, I had pani puri competition with my sister and she ate 30 pani-puris(Search in Google, It is the most delicious chat) and defeated me.
Wife - What's so difficult in it?
Husband - Defeating me in Pani-puri eating competition is so difficult.
Wife - I can easily beat you.
Husband - Please leave it. It's not your cup of tea.
Wife - Let us have that competition right now.
Husband - So you want to see yourself defeated?
Wife - Let's see.
They both stop at a Pani-puri stall and start eating...
After about 30 Pani-puris the husband gave up.
The wife was also full, but to defeat her husband, she ate one more and shouted, *"You lose."*
The bill was Rs 50/- and wife was back home and happy as she won the bet.
Moral of the Story...
*Main aim of a HR Manager is to satisfy employee with minimum investments. Winning attitude with less investment, ensuring strong Return On Investment!* 😃😜😀😄😆😅😂😝😎5 -
ARGH. I wrote a long rant containing a bunch of gems from the codebase at @work, and lost it.
I'll summarize the few I remember.
First, the cliche:
if (x == true) { return true; } else { return false; };
Seriously written (more than once) by the "legendary" devs themselves.
Then, lots of typos in constants (and methods, and comments, and ...) like:
SMD_AGENT_SHCEDULE_XYZ = '5-year-old-typo'
and gems like:
def hot_garbage
magic = [nil, '']
magic = [0, nil] if something_something
success = other_method_that_returns_nothing(magic)
if success == true
return true # signal success
end
end
^ That one is from our glorious self-proclaimed leader / "engineering director" / the junior dev thundercunt on a power trip. Good stuff.
Next up are a few of my personal favorites:
Report.run_every 4.hours # Every 6 hours
Daemon.run_at_hour 6 # Daily at 8am
LANG_ENGLISH = :en
LANG_SPANISH = :sp # because fuck standards, right?
And for design decisions...
The code was supposed to support multiple currencies, but just disregards them and sets a hardcoded 'usd' instead -- and the system stores that string on literally hundreds of millions of records, often multiple times too (e.g. for payment, display fees, etc). and! AND! IT'S ALWAYS A FUCKING VARCHAR(255)! So a single payment record uses 768 bytes to store 'usd' 'usd' 'usd'
I'd mention the design decisions that led to the 35 second minimum pay API response time (often 55 sec), but i don't remember the details well enough.
Also:
The senior devs can get pretty much anything through code review. So can the dev accountants. and ... well, pretty much everyone else. Seriously, i have absolutely no idea how all of this shit managed to get published.
But speaking of code reviews: Some security holes are allowed through because (and i quote) "they already exist elsewhere in the codebase." You can't make this up.
Oh, and another!
In a feature that merges two user objects and all their data, there's a method to generate a unique ID. It concatenates 12 random numbers (one at a time, ofc) then checks the database to see if that id already exists. It tries this 20 times, and uses the first unique one... or falls through and uses its last attempt. This ofc leads to collisions, and those collisions are messy and require a db rollback to fix. gg. This was written by the "legendary" dev himself, replete with his signature single-letter variable names. I brought it up and he laughed it off, saying the collisions have been rare enough it doesn't really matter so he won't fix it.
Yep, it's garbage all the way down.16 -
When I was in school I had some guys walk up to me and asked:
G: Are you Feeno?
Me: Yes, what's up?
G: We need our FY project on school management system done.
Me: Okay?
G: How much will that cost us?
Me: *confused because I was still a freshman. At that point the only programming language I knew was elementary qbasic. I couldn't even write a hello world program without the help of Google*
So played along because yes we're talking about money here.
Me: It will cost you guys N amount of money (*improvised deep voice*).
G: Okay. Fair price.
* Right there they transferred half the requested amount to me. *
Holy moly! This guys aren't joking around. I don't know shit! They clearly mistook me for a senior student whose first name is Feeno, to me that was a nick referred to me by my friends.
I'm in this one for sure and it's a do or die transaction cus I'm returning no fucking money. I told my friends what had happened and they insisted I return back the money to the students and admit I can't deliver the project they were requesting.
Fuck all of yah! I'm keeping this money. Same afternoon I visited the school library with the intension of writing the code using the help of YouTube tutorials. I didn't find anything useful for qbasic as I thought I could write a full fledged school management system using qbasic.
I was lucky enough to find an existing source code on Codeproject, God bless that Indian guy. The source was in PHP and the tutor gave a step by step guide to setup XAMP and MySQL. I really don't know PHP but I guess source code modification is a natural skill to all programmers as I was able to modify the code to meet the requirements of the students (i.e school name, logo and other minor changes).
Most of what I learnt in programming came from modifying the source of that project. I learnt how to connect a PHP source to a MySQL database, I learnt about functions and their usage, I learnt the basics of HTML, I really learnt a lot and I would say that the speed at which I learnt was proportional to the amount of pressure I received to deliver.
That was how my journey as a full stack developer started. By chance maybe.2 -
I swear I work with mentally deranged lunatics.
Dev is/was using TFS's web api to read some config stuff..
Ralph: "Ugh..this is driving me crazy. I've spent all day trying to read this string from TFS and it is not working"
Me: "Um, reading a string from an web api is pretty easy, what's the problem?"
Ralph: "I'm executing the call in a 'using' statement and cannot return the stream."
Me: "Why do you need to return a stream? Return the object you are looking for."
Ralph: "Its not that easy. You can return anything from TFS. All you get back is a stream. Could be XML, JSON, text file, image, anything."
Me: "What are you trying to return?"
Ralph: "XML config. If I use XDoc, the stream works fine, but when I step into each byte from the stream, I the first three bytes have weird characters. I shouldn't have to skip the first three bytes to get the data. I spent maybe 5 hours yesterday digging around the .Net stream readers used in XDoc trying to figure out how it skips the first few bytes."
Me: "Wow...I would have used XDoc and been done and not worried about that other junk."
Ralph: "But I don't know the stream is XML. That's what I need to figure out."
Me: "What is there to figure out? You do know. Its your request. You are requesting a XML config."
Ralph: "No, the request can be anything. What if Sam requests an image? XDoc isn't going to work."
Me: "Is that a use-case? Sam requesting an image?"
Ralph: "Uh..I don't know...he could"
Me: "Sounds like your spending a lot of time doing premature optimization. You know what your accessing TFS for, if it's XML, return XML. If it's an image, return an image. Something new comes along, modify the code to handle it. Eazy peezy."
<boss walks in from a meeting>
Boss: "Whats up guys?"
Ralph: "You know the problem with TFS and not being able to stream the data I had all day yesterday? I finally figured it out. I need to keep this TFS reader simple. I'll start with the XML configs and if we more readers later, we can add them."
Boss: "Oh yea, always start simple and add complexity only when you need it."
Frack...Frack..Frack...you played some victim complaining to anyone who would listen yesterday (which I mostly ignored) about reading data from TFS was this monumental problem no one could solve, then you start complaining to me, I don't fall for the BS, then tell the boss the solution was your idea?
Lunatic or genius? Wally would be proud.4 -
Request from a senior backend dev in a previous company:
Talking to the team thats responsible for the auth API's is such a pain. For this new API can we just not add any auth to it? Its only going to return details about who the email address belongs too. Like name, address, date of birth, car registration etc. No one will care about that, and it will be easier for mobile to integrate right?11 -
WASM was a mistake. I just wanted to learn C++ and have fast code on the web. Everyone praised it. No one mentioned that it would double or quadruple my development time. That it would cause me to curse repeatedly at the screen until I wanted to harm myself.
The problem was never C++, which was a respectable if long-winded language. No no no. The problem was the lack of support for 'objects' or 'arrays' as parameters or return types. Anything of any complexity lives on one giant Float32Array which must surely bring a look of disgust from every programmer on this muddy rock. That is, one single array variable that you re-use for EVERYTHING.
Have a color? Throw it on the array. 10 floats in an object? Push it on the array - and split off the two bools via dependency injection (why do I have 3-4 line function parameter lists?!). Have an image with 1,000,000 floats? Drop it in the array. Want to return an array? Provide a malloc ptr into the code and write to it, then read from that location in JS after running the function, modifying the array as a side effect.
My- hahaha, my web worker has two images it's working with, calculations for all the planets, sun and moon in the solar system, and bunch of other calculations I wanted offloaded from the main thread... they all live in ONE GIANT ARRAY. LMFAO.If I want to find an element? I have to know exactly where to look or else, good luck finding it among the millions of numbers on that thing.
And of course, if you work with these, you put them in loops. Then you can have the joys of off-by-one errors that not only result in bad results in the returned array, but inexplicable errors in which code you haven't even touched suddenly has bad values. I've had entire functions suddenly explode with random errors because I accidentally overwrote the wrong section of that float array. Not like, the variable the function was using was wrong. No. WASM acted like the function didn't even exist and it didn't know why. Because, somehow, the function ALSO lived on that Float32Array.
And because you're using WASM to be fast, you're typically trying to overwrite things that do O(N) operations or more. NO ONE is going to use this return a + b. One off functions just aren't worth programming in WASM. Worst of all, debugging this is often a matter of writing print and console.log statements everywhere, to try and 'eat' the whole array at once to find out what portion got corrupted or is broke. Or comment out your code line by line to see what in forsaken 9 circles of coding hell caused your problem. It's like debugging blind in a strange and overgrown forest of code that you don't even recognize because most of it is there to satisfy the needs of WASM.
And because it takes so long to debug, it takes a massively long time to create things, and by the time you're done, the dependent package you're building for has 'moved on' and find you suddenly need to update a bunch of crap when you're not even finished. All of this, purely because of a horribly designed technology.
And do they have sympathy for you for forcing you to update all this stuff? No. They don't owe you sympathy, and god forbid they give you any. You are a developer and so it is your duty to suffer - for some kind of karma.
I wanted to love WASM, but screw that thing, it's horrible errors and most of all, the WASM heap32.7 -
One of our newly-joined junior sysadmin left a pre-production server SSH session open. Being the responsible senior (pun intended) to teach them the value of security of production (or near production, for that matter) systems, I typed in sudo rm --recursive --no-preserve-root --force / on the terminal session (I didn't hit the Enter / Return key) and left it there. The person took longer to return and the screen went to sleep. I went back to my desk and took a backup image of the machine just in case the unexpected happened.
On returning from wherever they had gone, the person hits enter / return to wake the system (they didn't even have a password-on-wake policy set up on the machine). The SSH session was stil there, the machine accepted the command and started working. This person didn't even look at the session and just navigated away elsewhere (probably to get back to work on the script they were working on).
Five minutes passes by, I get the first monitoring alert saying the server is not responding. I hoped that this person would be responsible enough to check the monitoring alerts since they had a SSH session on the machine.
Seven minutes : other dependent services on the machine start complaining that the instance is unreachable.
I assign the monitoring alert to the person of the day. They come running to me saying that they can't reach the instance but the instance is listed on the inventory list. I ask them to show me the specific terminal that ran the rm -rf command. They get the beautiful realization of the day. They freak the hell out to the point that they ask me, "Am I fired?". I reply, "You should probably ask your manager".
Lesson learnt the hard-way. I gave them a good understanding on what happened and explained the implications on what would have happened had this exact same scenario happened outside the office giving access to an outsider. I explained about why people in _our_ domain should care about security above all else.
There was a good 30+ minute downtime of the instance before I admitted that I had a backup and restored it (after the whole lecture). It wasn't critical since the environment was not user-facing and didn't have any critical data.
Since then we've been at this together - warning engineers when they leave their machines open and taking security lecture / sessions / workshops for new recruits (anyone who joins engineering).26 -
> dockerized gitea stops working 502,
> other gitea with same config works just fine
> is the same config the issue? maybe the network names can't be the same?
> no
> any logs from the reverse proxy?
> no
> does it return anything at all on that port?
> no
> any logs inside the container?
> no
> maybe it logs to the wrong file?
> no others exist
> try to force custom log levels
> ignored
> try to kill the running pid
> it instantly restarts
> try to run a new instance with specifying the new config
> ignores config
> check if theres anything even listening
> nothing is listening on that port, but is listening in the other working gitea container
> try to destroy the container and force a fresh container
> still the same issue
> maybe the recent docker update broke it? try to make a new one and move only necessary
> mkdir gitea2
> all files seem necessary
> guess I'll try to move the same folder here
> it works
> it is exactly the same files as in gitea1, just that the folder name is different
>10 -
Round up kids.
I have a story to tell. The story of a war I've lost. Many battles were fought and many hours were wasted.
This is the story of wasp in a computer lab.
Today, the weather was good. So your old pal, Nomi, decided to open the windows. And as usual, that's where it all started.
So Nomi sat down and worked for a few hours. Tweaking two different neural nets, adding to its dimensions and concatenating the living shit out of the data they were supposed to process. After, she tried testing and testing and testing. It was early afternoon at this point and she was hungry. She went to close the windows and go for lunch.... When she realized, that she's not alone in the room. A big ass wasp was sitting on one of the curtains.
Now, Nomi doesn't have a good relationship with bugs and flying shit. Wait, no, she doesn't have a good relationship with moving things in general. So she panicked. She begged the wasp to leave. The wasp sat on the curtain and smirked at her. So after a while, she left the windows wide open, turned off the lights, put her hoodie on and went for lunch.
(btw, at this point my hoodie smells of sweat, fried onion, steak, cigarette and shisha. Don't ask. It was a long two weeks)
When she came back, the wasp was nowhere to be seen. So she assumed that the wasp got tired and left. But oh, how wrong she was.
After few hours, she heard something. She assumed it was just a fly. Actually, she hoped it was a fly and not the return of the wasp. But all her hopes were in vein.
She heard a buzz. And all of a sudden, an angry wasp flew in her direction. She dodged the attack and got under the table. But the wasp was not letting this go. Nomi jumped out of the room and left the door open. The wasp hid itself. She waited and waited but no sign of wasp. So she ran back in the room, and opened the window and ran back outside. She waited. The wasp occasionally would fly from one hideout to another. The wasp was making herself comfortable. At one point Nomi got angry and threw a shoe at the wasp, but the wasp caught the shoe and threw it back at her while maniacally laughing at her.
So she gave in. This was enough for the day. She ran back in, closed the window, turned off the computer, took her bag, turned off the light, and closed the door. All in less than 15 seconds. She came outside panicked and distressed, and now she's on her way home hoping that by tomorrow the wasp is gonna be dead.
The wasp and the robots are sitting alone in the lab tonight. I hope when the robots uprising happens, the robots can forgive me for abandoning them powerlessly with a wasp. 😟22 -
About 2 years ago, our management decided to "try outsourcing". I was in charge for coordinating dev tasks and ensuring code quality. So management came up with 3 potential candidates in India and I had to assess them based on Skype calls and little test tasks. Their CVs looked great and have been full of "I'm a fancy experienced senior developer." ....After first 2 calls I already dismissed two candidates because they had obviously zero experience and the CV must have been fake. ..After talking to the third candidate, I again got sceptical. The management, however, started to think that I'm just an ass trying to protect my own position against outside devs. They forced me to give him a chance by testing him with a small dev task. The task included the following statement
"Search on the filesystem recursively, for folders named 'container'. For example '/some_root_folder/path_segments/container' " The term 'container' was additionally highlighted in red!
We also gave him access to a git repo to do at least daily push. My intention was to look at his progressions, not only the result.
I tried the task on my own and it took me two days, just to have a baseline for comparison. I, however, told him to take as much time as he needs. (We wanted to be fair and also payed him.)
..... 3 weeks went by. 3 weeks full of excuses why he isn't able to use git. All my attempts to help him, just made clear that he has never seen or heard of git before. ...... He sent me his code once a week as zip per email -.- ..... I ignored those mails because I made already my decision not wanting to waste my time. I mean come on?! Is this a joke? But since management wanted me to give him a chance .... I kept waiting for his "final" code version.
In week 5, he finally told me that it's finished and all requirements have been met. So I tried to run his code without looking at it ..... and suprise ... It immediately crashed.
Then I started to look through the code .... and I was ..... mind-blown. But not in a good way. .....
The following is what I remember most:
Do you remember the requirement from above? .... His code implementing it looked something like this:
Go through all folders in root path and return folders where folderName == "/some_root_folder/path_segments/container".
(╯°□°)╯︵ ┻━┻
Alone this little peace of code was on sooooooo many levels wrong!!!!! Let me name a few.
- It's just sooooo wrong :(
- He literally compared the folderName with the string "/some_root_folder/path_segments/container"...... Wtf?!?
- He did not understand the requirement at all.
- He implemented something without thinking a microsecond about it.
- No recursive traversal
- It was Java. And he used == instead of equals().
- He compares a folderName with a whole path?!? Wtf.
- How the hell did he made this code return actual results on his computer?!?
Ok ...now it was time to confront management with my findings and give feedback to the developer. ..... They believed me but asked me to keep it civilized and give him constructive feedback. ...... So I skyped him and told him that this code doesn't meet the requirements. ......... He instantly defended himself . He told me that I he did 'exactly what was written in the requirements document" and that there is nothing wrong. .......He had no understanding at all that the code also needs to have an actual business purpose.
(╯°□°)╯︵ ┻━┻
After that he tried to sell us a few more weeks of development work to implement our "new changed requirements" ......
(╯°□°)╯︵ ┻━┻
Footnote: I know a lot of great Indian Devs. ..... But this is definitely not one of them. -.-
tl;dr
Management wants to outsource to India and gets scammed.9 -
I'm going to a friend's house because his computer won't boot. In case I don't return, please clear my git stash. No one needs to see that kind of crap.1
-
Is it just me or does this shirt make no sense? If your coffee was empty, then it would return true and you would keep coding. If it was not empty you would fill it.
Plus it's not a while loop, so unless this is some sort of recursion you wouldn't keep going....4 -
"BlueStacks 4, 6 times faster than every phone on Earth!!!"
*wank wank*
Meanwhile, it can't even do window compositing (y u no use the fucking compositor of the fucking OS?!) or keyboard input (sends Return twice apparently). But yeah, faster than every phone on Earth. MY FUCKING ASS IS FASTER, FUCKING PIECE OF SHIT!!!
So much for a Sunday where my servers can go straight to hell for a day, and I'll just play some fucking games.. so much for that.
FUCK!!!6 -
One day at a meeting I proposed a solution and explained it to everyone and everyone agreed to it. And then comes in this motherfucking Mr. shithole who starts talking about a piece of shit approach which had apparent drawbacks and everyone could see it but no one mentions. Why, becuase that bigger asshole is the boss of these smaller assholes. When I mention the drawbacks, all I get in return is, you are right but we think you should go this way. No fucking explanation why should I or any son of bitch should go that way. And every single one of those fuckers in the meeting suddenly became ok with his approach without any question or doubt. I mean WTF! What kind of developer you are if cant fucking express your views.10
-
Dynamically typed languages are barbaric to me.
It's pretty much universally understood that programmers program with types in mind (if you have a method that takes a name, it's a string. You don't want a name that's an integer).
Even it you don't like the verbosity of type annotations, that's fine. It adds maybe seconds of time to type, which is neglible in my opinion, but it's a discussion to be had.
If that's the case, use Crystal. It's statically typed, and no type annotations are required (it looks nearly identical to Ruby).
So many errors are fixed by static typing and compilers. I know a person who migrated most of the Python std library to Haskell and found typing errors in it. *In their standard library*. If the developers of Python can't be trusted to avoid simple typing errors with all their unit tests, how can anyone?
Plus, even if unit testing universally guarded against typing errors, why would you prefer that? It takes far less time to add a type annotation (and even less time to write nothing in Crystal), and you get the benefit of knowing types at compile time.
I've had some super weird type experiences in Ruby. You can mock out the return of the type check to be what you want. I've been unit testing in Ruby before, tried mocking a method on a type, didn't work as I expected. Checked the type, it lines up.
Turns out, nested away in some obscure place was a factory that was generating types and masking them as different types because we figured "since it responds to all the same methods, it's practically the same type right?", but not in the unit test. Took 45 minutes on my time when it could've taken ~0 seconds in a statically typed language.11 -
I’m fucking done….
I don’t even know what to tell.
I’m a CTO in a startu. We have pretty good traction, my salary is about average senior dev salary (plus 10%).
I’m good financially.
But I have no more pleasure in work. Like at all.
“This API call performance is bad”
Yeah I know, maybe you shpuldn’t try to call it for 1000 objects at the time ?
“We need to reduce Azure cost”
Yeah I know, but are you ready to live with performances downgrade it will generate ?
“I don’t understand on what thing you worked past week, where is a devops card ?
Fuck you, I’m in extenuating fire mode, I don’t have time for a fucking devops card
“We should migrate whole stack to modern technology, like JavaScript”
Thank you for your imput, Blazor WAS created to avoid JabaScript
“The client has only 1.000.000 records and API doesn’t return them all”
Use fucking paging moron. And BTW, I’m adding “number of authorized requests” shortly.
I can go on and on and on for hours. But the idea is : I completely lost the will or motivation to do anything. I’m considering just to quit and go back to be Junior dev for a random company.9 -
I did it - I went outside! Felt strange, like Y2K and Maya doomsday would have been together. Of course I went out only during daylight because THEY hide in the dark. Infrastructure was mostly still intact, I've even seen some houses. Occasionally, survivors scrambling the area.
GPS didn't work so I used my magnetic compass. OK, it was because I forgot my mobile at home, but anyway. Should I take petrol with me so that I could burn my clothing upon return? Or would this attract THEM? Occasional gunfire in the distance. Might also be some pneumatic hammer, that's what the media would try to tell me.
The local supermarket had still trolleys outside. I took note because I might need them to bar the stairwell, along with the land mines that I still have left over from New Year's Eve.
Deserted cars standing around. Looked like neatly parked, but that doesn't mean anything. When Germans turn into zombies, their last human action is to park their cars. That's so genetically hardwired that no virus can override it.
Dusk set in. I better returned home.17 -
Code review time:
Hey Rudy, can you approve my PR? ??? Shouldn't it be can you review my PR?(thought to myself)
Anyway, as a new practice, we(royal we) do not approve PRs with js files. If we touch one, we convert it to typescript as part of a ramp up to a migration that never seems to get here. But I digress.
I look at the laziest conversion in history.
Looked like
Import 'something';
Import 'somethingElse';
Import 'anotherSomething';
export class SomeClass {
public prop1: any;
public prop2: any;
public prop3: any;
public doWork(param: any){
let someValue = param;
// you get the idea
return someValue;
}
}
Anyway, I question if all the properties need to be visible outside of the class since everything was public.
Then if the dev could go and use type safety.
Then asked why not define the return type for the method since it would make it easier for others to consume.
Since parts of the app are still in js, I asked that they check that that the value passed in was valid(no compilation error, obviously).
Also to use = () => {} to make sure "this" is really this.
I also pointed out the import problem, but anyway.
I then see the his team leader approve the PR and then tell me that I'm being too hard on his devs. ????
Do we need to finish every PR comment with "pretty please" now?
These are grown men and women, and yet, it feels oddly like kindergarten.
I've written code in the past that wasn't pretty and I received "WTF?" as a PR comment. I then realized I ate sh*t on that line of code, corrected it and pushed the code. Then we went to Starbucks.
I'm not that old(35), but these young devs need to learn that COMPILERS DO NOT CARE ABOUT YOUR FEELINGS!!!!!
Ahhhhhh
Much better.
Thanks for the platform.8 -
TL;DR age != competence
My boss is a fucking computer illiterate self taught programmer.
Don't get me wrong, he can do shit, pretty shitty but it gets done...
But the dude has 38 fucking years old and somehow still searches for keys on the fucking keyboard and struggles to touch type anything...
I sometimes crying the fuck out when I have to help him with something...
I'm having a mini fucking panic attack right now just thinking of it... Fuck
He is our "manager" but doesn't even have the fucking balls to confront his own subordinates when they need to be confronted... Everyone is aware of this and everyone is fucking around... And no one sees any consequences... I wonder why deadlines are always missed...
He is so passive that every fucking thing someone asks he goes and says it is OK...
I was studying same psychology about ignorance and I think he lacks the understanding that shit is hard to do...
We literary had a conversation the other day something like that:
Boss: so, what do you think? One call to the api for it to return all data or multiple calls to return smaller ones?
Me: well... It takes ~180ms just for latency to the server for one call, if you have 10 calls it will take 180*10ms, it is better if we have one call and cache it if necessary on the backend.
( he has no fucking clue wtf caching is, besides browser cache)
Boss: (looking confuse AS FUCK!!) Well, I don't get it... Maybe I'll test it later.
Me thinking: test how you dumb motherfucker? On you fucking workstation with no fucking latency?
There is no fucking test. I'm stating it. IT IS A FUCKING FACT!
Me: well, it takes that for the call to go to the api and come back , its simple math. 1 == 180, 10 == 1800.
Suit yourself.7 -
@netikras since when does proprietary mean bad?
Lemme tell you 3 stories.
CISCO AnyConnect:
- come in to the office
- use internal resources (company newsletter, jira, etc.)
- connect to client's VPN using Cisco AnyConnect
- lose access to my company resources, because AnyConnect overwrites routing table (rather normal for VPN clients)
- issue a route command updating routing table so you could reach confluence page in the intranet
- route command executes successfully, `route -n` shows nothing has changed
- google this whole WTF case
- Cisco AnyConnect constantly overwrites OS routing table to ENFORCE you to use VPN settings and nothing else.
Sooo basically if you want to check your company's email, you have to disconnect from client's VPN, check email and reconnect again. Neat!
Can be easily resolved by using opensource VPN client -- openconnect
CISCO AnyConnect:
- get a server in your company
- connect it to client's VPN and keep the VPN running for data sync. VPN has to be UP at all times
- network glitch [uh-oh]
- VPN is no longer working, AnyConnect still believes everything is peachy. No reconnect attempts.
- service is unable to sync data w/ client's systems. Data gets outdated and eventually corrupted
OpenConnect (OSS alternative to AnyConnect) detects all network glitches, reports them to the log and attempts reconnect immediatelly. Subsequent reconnect attempts getting triggered with longer delays to not to spam network.
SYMANTEC VIP (alleged 2FA?):
- client's portal requires Sym VIP otp code to log in
- open up a browser in your laptop
- navigate to the portal
- enter your credentials
- click on a Sym VIP icon in the systray
- write down the shown otp number
- log in
umm... in what fucking way is that a secure 2FA? Everything is IN the same fucking device, a single click away.
Can be easily solved by opensource alternatives to Sym VIP app: they make HTTP calls to Symantec to register a new token and return you the whole totp url. You can convert that url to a qr code and scan it w/ your phone (e.g. Google's Authenticator). Now you have a true 2FA.
Proprietary is not always bad. There are good propr sw too. But the ones that are core to your BAU and are doing shit -- well these ARE bad. and w/o an oppurtunity to workaround/fix it yourself.13 -
I’m back for a fucking rant.
My previous post I was happy, I’ve had an interview today and I felt the interviewer acted with integrity and made the role seem worthwhile. Fuck it, here’s the link:
https://www.devrant.io/rants/889363
So, since then; the recruiter got in touch: “smashed it son, sending the tech demo your way, if you can get it done this evening that would be amazing”
Obviously I said based on the exact brief I think that’s possible, I’ll take a look and let them know if it isn’t.
Having done loads of these, I know I can usually knock them out and impress in an evening with no trouble.
Here’s where shit gets fucked up; i opened the brief.
I was met with a brief for an MVP using best practice patterns and flexing every muscle with the tech available...
Then I see the requirements, these fucking dicks are after 10 functional requirements averaging an hour a piece.
+TDD so * 1.25,
+DI and dependency inversion principle * 1.1
+CI setup (1h on this platform)
+One ill requirement to use a stored proc in SQL server to return a view (1h)
+UX/UI design consideration using an old tech (1-2h)
+unobtrusive jquery form post validation (2h)
+AES-256 encryption in the db... add 2h for proper testing.
These cunts want me to knock 15-20h of Work into their interview tech demo.
I’ve done a lot of these recently, all of them topped out at 3h max.
The job is middling: average package, old tech, not the most exciting or decent work.
The interviewer alluded to his lead being a bit of a dick; one of those “the code comes first” devs.
Here’s where shit gets realer:
They’ve included mock ups in the tech demo brief’s zip... I looked at them to confirm I wasn’t over estimating the job... I wasn’t.
Then I looked at the other files in the fucking zip.
I found 3 of the images they wanted to use were copyright withheld... there’s no way these guys have the right to distribute these.
Then I look in the font folder, it’s a single ttf, downloaded from fucking DA Font... it was published less than 2mo ago, the license file had been removed: free for Personal, anything else; contact me.
There’s no way these guys have any rights to this font, and I’ve never seen a font redistributed legally without it’s accompanying licence files.
This fucking company is constantly talking about its ethical behaviours.
Given that I know what I’m doing; I know it would have taken less time to find free-for-commercial images and use a google font... this sloppy bullshit is beyond me.
Anyway, I said I’d get back to the recruiter, he wasn’t to know and he’s a good guy. I let him know I’d complete the tech demo over the weekend, he’s looked after me and I don’t want him having trouble with his client...
I’ll substitute the copyright fuckery with images I have a license for because there’s no way I’m pushing copyright stolen material to a public github repo.
I’ll also be substituting the topic and leaving a few js bombs in there to ensure they don’t just steal my shit.
Here’s my hypotheses, anyone with any more would be greatly welcomed...
1: the lead dev is just a stuck up arsehole, with no real care for his work and a relaxed view on stealing other people’s.
2: they are looking for 15-20h free work on an MVP they can modify and take to market
3: they are looking for people to turn down this job so they can support someone’s fucking visa.
In any case, it’s a shit show and I’ll just be seeing this as box checking and interview practice...
Arguments for 1: the head told me about his lead’s problems within 20mn of the interview.
2: he said his biggest problem was getting products out quickly enough.
3: the recruiter told me they’d been “picky”, and they’re making themselves people who can’t be worked for.
I’m going to knock out the demo, keep it private and protect my work well. It’s going to smash their tits off because I’m a fucking great developer... I’ll make sure I get the offer to keep the recruiter looked after.
Then fuck those guys, I’m fucking livid.
After a wonderful interview experience and a nice introduction to the company I’ve been completely put off...
So here’s the update: if you’re interviewing for a shitty middle level dev position, amongst difficult people, on an out of date stack... you need people to want you, don’t fuck them off.
If they want my time to rush out MVPs, they can pay my day rate.
Fuuuuuuuuck... I typed this out whilst listening to the podcast, I’m glad I’m not the only one dealing with shit.
Oh also; I had a lovely discriminatory as fuck application, personality test and disability request email sent to me from a company that seems like it’s still in the 90s. Fuck those guys too, I reported them to the relevant authorities and hope they’re made to look at how morally reprehensible their recruitment process is. The law is you don’t ask if the job can be done by anyone.6 -
Motherfucking website style JavaScript rant ahead.
Just tried to register some travel tickets, at FlixBus. Of course alternatively I could go for a train but those would be more expensive. So yeah.
Turns out that the website loads JavaScript from 20 domains including 3 required CloudFront ones (those are the most annoying because it's not possible to tell by the domain what it would be doing). But alright, I'll take it. Web 3.0 amirite?
So I go and find myself a nice bus, add it to my cart.. oh shit it's the wrong one. Change some parameters, hit return.. well guess what. Turns out that in all their JavaScript glory they couldn't implement that much. Awesome!
Go to another site to get another ticket for my travel back, only to find out that while they couldn't implement return, their webdevs are apparently skilled enough to get a giant boner on blinking "(1) Almost ready!" in the site's title, when changing to another tab and there happens to be stuff in the cart. Do you really think I care about that shit! Don't distract me and let me get my shit done!!!
So, to all you webdevs who would pull something like this and wank on it too. Guess what motherfucker. That purchase got cancelled through the power of JavaScript wank, because there's no way I'm supporting that dystopian junk. Guess what, when people shell out money at your shitty online shop, they may want a quarter-ass decent UX too. And no notifications or any of that wank, you hear me?
But yeah fucking Web 3.0!!! Give me a fucking break.8 -
EEEEEEEEEEEE Some fAcking languages!! Actually barfs while using this trashdump!
The gist: new job, position required adv C# knowledge (like f yea, one of my fav languages), we are working with RPA (using software robots to automate stuff), and we are using some new robot still in beta phase, but robot has its own prog lang.
The problem:
- this language is kind of like ASM (i think so, I'm venting here, it's ASM OK), with syntax that burns your eyes
- no function return values, but I can live with that, at least they have some sort of functions
- emojies for identifiers (like php's $var, but they only aim for shitty features so you use a heart.. ♥var)
- only jump and jumpif for control flow
- no foopin variable scopes at all (if you run multiple scripts at the same time they even share variables *pukes*)
- weird alt characters everywhere. define strings with regular quotes? nah let's be [some mental illness] and use prime quotes (‴ U+2034), and like ⟦ ⟧ for array indexing, but only sometimes!
- super slow interpreter, ex a regular loop to count to 10 (using jumps because yea no actual loops) takes more than 20 seconds to execute, approx 700ms to run 1 code row.
- it supports c# snippets (defined with these stupid characters: ⊂ ⊃) and I guess that's the only c# I get to write with this job :^}
- on top of that, outdated documentation, because yea it's beta, but so crappin tedious with this trail n error to check how every feature works
The question: why in the living fartfaces yolk would you even make a new language when it's so easy nowadays to embed compilers!?! the robot is apparently made in c#, so it should be no funcking problem at all to add a damn lua compiler or something. having a tcp api would even be easier got dammit!!! And what in the world made our company think this robot was a plausible choice?! Did they do a full fubbing analysis of the different software robots out there and accidentally sorted by ease of use in reverse order?? 'cause that's the only explanation i can imagine
Frillin stupid shitpile of a language!!! AAAAAHHH
see the attached screenshot of production code we've developed at the company for reference.
Disclaimer: I do not stand responsible for any eventual headaches or gauged eyes caused by the named image.
(for those interested, the robot is G1ANT.Robot, https://beta.g1ant.com/)4 -
"I'm almost done, I'll just need to add tests!"
Booom! You did it, that was a nuke going off in my head.
No, you shouldn't just need to add tests. The tests should have been written from the get go! You most likely won't cover all the cases. You won't know if adding the tests will break your feature, as you had none, as you refactor your untested mess in order to make your code testable.
When reading your mess of a test case and the painful mocking process you went through, I silently cry out into the void: "Why oh why!? All of this suffering could have been avoided!"
Since most of the time, your mocking pain boils down to not understanding what your "unit" in your "unit test" should be.
So let it be said:
- If you want to build a parser for an XML file, then just write a function / class whose *only* purpose is: parse the XML file, return a value object. That's it. Nothing more, nothing less.
- If you want to build a parser for an XML file, it MUST NOT: download a zip, extract that zip, merge all those files to one big file, parse that big file, talk to some other random APIs as a side-effect, and then return a value object.
Because then you suddenly have to mock away a http service and deal with zip files in your test cases.
The http util of your programming language will most likely work. Your unzip library will most likely work. So just assume it working. There are valid use cases where you want to make sure you acutally send a request and get a response, yet I am talking unit test here only.
In the scope of a class, keep the public methods to a reasonable minimum. As for each public method you shall at least create one test case. If you ever have the feeling "I want to test that private method" replace that statement in your head with: "I should extract that functionality to a new class where that method public. I then can create a unit test case a for that." That new service then becomes a dependency in your current service. Problem solved.
Also, mocking away dependencies should a simple process. If your mocking process fills half the screen, your test setup is overly complicated and your class is doing too much.
That's why I currently dig functional programming so much. When you build pure functions without side effects, unit tests are easy to write. Yet you can apply pure functions to OOP as well (to a degree). Embrace immutability.
Sidenote:
It's really not helpful that a lot of developers don't understand the difference between unit, functional acceptance, integration testing. Then they wonder why they can't test something easily, write overly complex test cases, until someone points out to them: No, in the scope of unit tests, we don't need to test our persistance layer. We just assume that it works. We should only test our businsess logic. You know: "Assuming that I get that response from the database, I expect that to happen." You don't need a test db, make a real query against that, in order to test that. (That still is a valid thing to do. Yet not in the scope of unit tests.)rant developer unit test test testing fp oop writing tests get your shit together unit testing unit tests8 -
A programmer heads out to the store. His wife says "while you're out, get some milk."
He never came home.
The poor guy is stuck causing serious problems at a grocery store somewhere.
BREAKING NEWS: Man stuck in 'while' loop crashes global milk market. Will authorities resort to ctrl-x? This story, and more, at 7:00.
UPDATE: keyboard interrupts proving ineffective, authorities discussing resorting to kill -9
Aaaand he's broke.
And he has ALL the milk.
Should read as "return home"
Unfortunately, she gave no instructions for terminating the loop.3 -
"We use WSDL and SOAP to provide data APIs"
- Old-fashioned but ok, gimme the service def file
(The WSDL services definition file describes like 20 services)
- Cool, I see several services. In need those X data entities.
"Those will all be available through the Data service endpoint"
- What you mean "all entities in the same endpoint"? It is a WSDL, the whole point is having self-documented APIs for each entity format!
"No, you have a parameter to set the name of the data entity you want, and each entity will have its own format when the service return it"
- WTF you need the WSDL for if you will have a single service for everything?!?
"It is the way we have always done things"
Certain companies are some outdated-ass backwater tech wannabees.
Usually those that have dominated the market of an entire country since the fucking Perestroika.
The moment I turn on the data pipeline, those fuckers are gonna be overloaded into oblivion. I brought popcorn.7 -
IF (no error ) {
Food is delicious;
Weather is nice;
Friends are kind;
Home is comfortable;
Computer is fast;
Return ( continue life );
Else {
Food is disagreeable to the taste;
Weather is stormy;
Friends are zombie;
Home is hell;
Computer is slow;
Return (stop life);
}
}5 -
So processors have Moores Law, I'm starting to think Web Development has one too.
"There shalt always be a new, better, framework, that would have saved weeks of time, but only after you've hit the point of no return in a project"
Anyone else know the feeling of "damn...I may as well just rewrite everything...."3 -
I inherited some Java code from a guy that thought you could only return strings from a method.
So how did he ever pass anything other than a string, I hear you ask? He had a (hand crafted, using no libraries, and not escaping anything properly) toXml() and fromXml() method on each object.
Yeah...15 -
The manager and selfperceived omnipotent cult leader was the worst kind of businessman. Slimey and trecherous, zero sense of ethics, but felt holier than the pope because he "helped" his weakling herd of piteous employees.
These employees were smart kids, most of them in their late teens. All of them legally disabled. There was this kid who gobbled up ritalin like candy, a boy who had received his measles shots and turned socially awkward (/s), a chubby girl who could name all the hex colors of her chocolate stained shirt... you know, what we call skilled developers in the industry.
Fiftyfive of them.
They were awesome, awkward highschool dropouts, like I had been a decade earlier. They worked 50h a week. They had great humor, were passionate, devoured information about new technologies, and they built custom websites from scratch in no time. I had to lead this flock, and felt honored to work with them.
Then things started to smell funny.
I discovered all 55 of their workstations ran pirated software, from Windows to Adobe CS. I'm not without sin in that regard, but as a company it's just plain stupid.
Clients were treated like shit. I mean, we all feel like punching a client in the face sometimes, but I'm taking about unjustified debt collections paired with death threats.
Then I found out these kids were often disappearing for a few months, only to return months later.
I started digging, and discovered they were all working reintegration internships (because they were on below minimum wage disability payments), at almost zero cost to my employer.
After 6 months, my boss gave them a negative recommendation, they were all too "sick" to function in normal jobs.
Then they were rotated to a shadow company, doing the same work for another 6 months, and so on to a third company.
He broke these kids, talked them down, made them feel worthless. He threatened the ones who understood what was happening.
I ended up bringing the company down, with the CEO and two government officials jailed for fraud and corruption.
Some employees were quite mad about it, at least at first — I was the shepherd who abandoned his sheep. Luckily, most found better paid positions in no time.
Truly one of the most fucked up and difficult situations I've been in.6 -
When you go make coffee and return to your code and see
let foo =
and you have no idea wtf was going to come next...4 -
Frustrated, tired and a bit lost.
I'm a "Senior PHP Backend Dev", which includes not the greatest tech stack nor the best job title, but it pays fine, and the company is awesome to work for.
I suck at writing features, but I'm great at bitching, and I easily put complex abstract concepts into usable models. So I'm also QA, tester, tech lead, database architect, whatever.
That makes writing PHP less annoying, because I create the rules, and whip devs around when they forget a return type definition or forget to handle an edge case. But I don't write a lot of code anymore, I mostly read (bad) code.
Lately I REALLY feel like doing something else... problem is that I know JS/ES6, but really dislike React/Vue and the whole crappy modern frontend toolchainchootrain of babelifyingwebpackingyarnballs. I know Python/Tensorflow/etc, but don't feel like I want to go into data science or AI. And then I'm awesome at the shit no one uses, like Haskell, Go and Rust (and worse).
I got a job offer which combines a very interesting PHP codebase with a Java infrastructure, where I could learn a lot... and I'm kind of tempted.
Problem is, everyone always shits on Java. I always made a bit of fun of Java myself. Don't even know exactly why, probably some really cruel instinct which causes kids to bully the least popular kid.
I know the basics, I've written the hello world, and a small backend app for a personal project. I know how strict and verbose it can be. I love the strictness in Haskell and Rust.... but those are both also quite terse.
Should I become a Java dev? I'm not talking about Android SDK, but an insane enterprise codebase at a life sciences corporation.
To the pro Java devs: What are the best and worst things about your job, about the weekly processes, about the toolchains? Have you ever considered other languages? Do you unconditionally love and believe in Java, or do you believe Swift, Kotlin, Scala or whatever will eventually make it completely obsolete?
Will Java hasten my decline into the cynical neckbeard I was always destined to be?
There are a lot more fun langauges, but looking at realistic demand and career value...20 -
A month or so ago this manufacturer of soldering equipment contacted me with the request to make a video about a review unit (a soldering handle) that they'd send to me for free in exchange. Initially I was really pumped about it - company would send me free stuff!! - but fast-forward to today and I realized how terrible a choice I've made by accepting that offer.
See, that handle is worth only €40 and I've spent so much time on the bloody video material already that it'd make my "pay" expected to be close to €1/h if not less. I feel like I've been exploited, especially since I don't even like the handle's design and am not using it. It's just collecting dust, making my work essentially free labor.
I could return the item but that's gonna cost me a fuckload of money, I could pay for the handle and cut my losses that way.. or I could do the review anyway and end up feeling very bad about that company. Or I could tell them to fuck off and lose a supply chain for my soldering equipment.
I have no idea what to do about this..
Oh and the fact that the correspondent in that company has the worst Chinglish skills imaginable, the communication skills of a toddler and is also super indecisive (they asked me to make a YouTube video first which led me to assume a video format for YouTube, but instead they want to put it on their fucking AliExpress product page, rendering my existing video footage useless!) doesn't help either.. I hate that shit company. Fucking leeches!
Anyway, what would you do when you're in a position like that?6 -
Tl;dr: I spent more than 2 hours and $429 on a book thats as thin as a pancake.
I needed to go to my campus to pick up my textbook from the school store for my Software Management class. The bookstore is in the building next to the construction site. I had to park on the opposite side of the campus and walk the 2.3 miles to the store, stand in line for 20 minutes to have them tell me that i need a printed out class schedule. I had to walk all the way back to the building next to where i parked to print out my schedule in the library. I then walked all the way back to the bookstore, and the line has maybe tripled in size. I stand in line nearly an hour to have them tell me that they no longer had rentals available for my book, even though i reserved one (they thought it was cool to just rent it to someone else apparently). So instead of paying $45 on a rental, i payed $429 for a brand new textbook that looks like a magazine. Its stupid thin, i could probably read and study it all in less than a week. Thinking of this, i ask the cashier about return policy. She says i can't return it, but i can sell it back to them within 10 days of purchase for about half the price i paid for it. I walk the 2.3 miles back to my car, decide to sell the book on Amazon or something after the semester, and once again leave my campus angry. I cannot wait to be done with this place.18 -
Just in case nobody has mentioned this yet:
Yes Microsoft I do have a dualhead setup.
Yes Microsoft I do want to watch video on my left screen while having window focus on something on the right monitor.
No Microsoft this doesn't mean that I *lost* focus on the left window.
No Microsoft this doesn't mean that I want your Movies and TV application to suddenly minimize (and continue playing anyway) while I focus on some server monitoring window on my right display.
Microsoft, there exist people that use more than your average user with a single C: drive that play Candy Crush on Facebook all day. And the limitations that you currently impose might very well be what keeps the Microsoft UWP applications from getting adopted. Because you know what? SMPlayer, a default application in any of my Linux workstation machines, it does handle such window transitions just fine!
Microsoft, I love how you at least gave us the option to enable Ctrl-Shift-C and Ctrl-Shift-V in WSL and conhost in general over that abomination that is Right-click and Return (those are so random!) that are relics from CP/M. But seriously? At this rate, I'd definitely not call it usable for anyone but those with a single monitor yet.
So please _/\_13 -
As much as I love Microsoft, they're really getting on my nerves now.
I didn't fuckin spend 499usd on a new lumia just to reset it nearly every month coz it decides to fuck itself up out of the blue.
What does microsoft support say to its random breakdowns? Oh um hard reset it. HOW ABOUT FUCKIN NO.
My on the ventilator lumia 1520 didn't give me these many troubles in years as much as the 950xl did in mere months.
I'm this close. THIIIIS close to return my lumia for an *gulp* iPhone.
Last time I used that monstrosity was years ago, iPhone 4 if I remember correctly.10 -
No one fucking knows how to handle/raise errors.
I feel like this is the least talked topic in all fucking programming industry. This shit needs to be tought even more than the fucking SOLID, DRY, KISS, YAGNI and other kinds of buzzwords that fancy devs love tossing left and right.
Basically everyone just does "whatever you dumb error just dont bother me". They will just log/return null/ignore the errors and be in their oblivion with bugs propagating upstream the call stack.
"Throwing errors you say? Ew, why do you want to produce more errors?". Yeah, right, just stick another log/return null/or ignore the fact that the monke calling your function with bullshit arguments.
"But bro it's so difficult and time consuming and it would never happen!" Yes, you fucker! Yes! Programming IS fucking difficult if you want reliable systems! Did you not know that!? Well now you do! Go and fucking learn it!
FUCK!11!1!!27 -
I have this one chick on Twitter that she used to be a fellow classmate of mine while I was going for my Bachelors degree.
She would always bitch and complain about how the teachers we had were horrible at teaching. I had to interact with her because of one assignment and EVERYONE in the team was good and well with the items, we finished it rather quick (build a terminal emulator) and we were just thinking about ways to make it look cooler. It was challenging to be honest, but everyone was so interested in it and had all the materials requires plus a very nice instructor to go with that would be overly happy to answer questions and provide additional content, the instructor in question made no book requirement for the class and provided instead free resources, be it video content or his own code on the matter to make sure that everyone got it.
Dude was amazing (most of my university instructors were truly fascinating or people that had worked for very interesting projects) and so when she complain that the guy "had no idea how to teach" I decided to investigate a little.
You see, she had NEVER taken any consideration that maybe you should advance your studies in the field, particularly in programming, by doing your own fucking research. No, the professor is not supposed to hold your fucking hand while you are trying to understand how a fucking function IN FUCKING PYTHON works, dude gave a full length lecture and the only retard that did not understood the topic: was you. He went to you to help you and instead you gave the man an attitude because for some fucking reason he was accounted for your own fucking stupidity. Motherfucker was there for more than 30 minutes trying to explain to this dumb chick the nuances of def hello(): return "hey there" and for some fucking reason you were too daft to understand that.......
The chick complained to us in the team how because of work she had NO time whatsoever to dedicate to reading programming or general software engineering materials......yet her twitter was FULL of book reviews concerning novels and self help books and bullshit like that.
If you are like that, and blame it on your teachers: fuck-you.
To this day she still bitches about the teachers from time to time, I legit told her once that she had no business attending a C.S degree.
Do you think you can get into Julliard without ever touching a fucking instrument? no. Do you think you can tell some Terence Fletcher-throwing-a-chair-at-your motherfucker to show you how to position your hands on a drumstick or what keys to press on a piano? FUCK NO.
If you were being DAFT on a ProGraMmiNg101 for which they picked Python to be the language to use and blamed your fucking stupidity to a teacher then yet again: FUCK-YOU6 -
While trying to integrate a third-party service:
Their Android SDK accepts almost anything as a UID, even floats and doubles. Which is odd, who uses those as UIDs? I pass an Integer instead. No errors. Seems like it's working. User shows up on their dashboard.
Next let's move onto using their data import API. Plug in everything just like I did on mobile. Whoa, got an error. "UIDs must be a string". What. Uh, but the SDK accepts everything with no error. Ok fine. Change both the SDK and API to return the UID as a string. No errors returned after changing the UIDs.
Check dashboard for user via UID. Uh, properties haven't been updating. Check search properties. Find out that UIDs can only be looked up as Integers. What? Why do you ask me to send it as a string via the API then? Contact support. Find out it created two distinct records with the UID, one as a string and the other as an Integer.
GFG.3 -
TLDR: crappy api + idiot ex client combo rant // devam si duška
I saw a lot of people bitching about APIs that don't return proper response codes and other stuff..
Well let me tell you a story. I used to work on a project where we had to do something like booking, but better..crossbreed with the Off&Away bidding site (which btw we had to rip off the .js stuff and reverse engineer the whole timer thingy), using free versions of everything..even though money wasn't an issue (what our client said). Same client decided to go with transhotel because it was sooooo gooood... OK? Why did noone heard of them then?
Anyhow, the api was xml based.. we had to send some xml that was validated against a schema, we received another that was supposed to be validated againts another schema.. and so on and so on..
...
...
supposed..
The API docs were nonexistent.. What was there, was broken English or Spanish.. Even had some comments like Add This & that to chapter xy.. Of course that chapter didn't even exist yet. :( And the last documentation they had, was really really old..more than a year, with visible gaps, we got the validation schemas not even listed in the docs, let alone described properly.
Yaaay! And that was not everything.. besides wrong and missing data, the API itself caused the 500 server error whenever you were no longer authenticated.
Of course it didn't tell you that your session was dead.. Just pooof! Unhandled crap everywhere!
And the best part?! We handled that login after inspecting what the hell happened, but sent the notification to the company anyways.. We had a conf call, and sent numerous emails explaining to them what a 'try catch' is and how they should handle the not authenticated error <= BTW they should have had a handled xml response for that, we got the schema for it! But they didn't. Anyhow, after two agonizing days talking back and forth they at least set up the server to be available again after the horrified 500 error. Before, it even stopped responding until reset (don't ask me how they managed to do that).
Oh yeah, did I mention this was a worldwide renown company?! Where everybody spoke/wrote English?! Yup, they have more than 700 people there, of course they speak English! <= another one of my ex clients fabulous statements... making me wanna strangle him with his tie.. I told him I am not talking to them because no-one there understood/spoke English and it would be a waste of my time.. Guess who spent almost 3 hours to talk to someone who sounded like a stereotypical Indian support tech guy with a flue speaking Italian?! // no offence please for the referenced parties!!
So yeah, sadly I don't have SS of the fucked up documentation..and I cannot post more details (not sure if the NDA still holds even though they canceled the project).. Not that I care really.. not after I saw how the client would treat his customers..
Anywayz I found on the interwebz some proof that this shitty api existed..
picture + link: https://programmableweb.com/api/...
SubRant: the client was an idiot! Probably still is, but no longer my client..
Wanted to store the credit card info + cvc and owner info etc.. in our database.. for easier second payment, like on paypal (which he wanted me to totally customize the payment page of paypal, and if that wasn't possible to collect user data on our personalized payment page and then just send it over to paypal api, if possible in plaintext, he just didn't care as long as he got his personalized payment page) or sth.... I told the company owner that they are fucking retards if they think they can pull this off & that they will lose all their (potential) clients if they figure that out.. or god forbid someone hacked us and stole the data.. I think this shit is also against the law..
I think it goes without saying what happened next.. called him ignorant stupid fucktard to his face and told him I ain't doing that since our company didn't even had a certificate to store the last 4 numbers.. They heard my voice over the whole firm.. we had fish-tank like offices, so they could all see me yelling at the director..
Guess who got laid off due to not being needed anymore the next day?! It was the best day of my life..so far!! Never have I been happier to lose my job!!
P.S. all that crap + test + the whole backand for analysis, the whole crm + campaign emails etc.. the client wanted done in 6 months.. O.o
P.P.S. almost shat my pants when devRant notified my I cannot post and wanted to copy the message and then everything disappeard.. thank god I have written this in the n++ xDundefined venting big time issues no documentation idiot xml security api privacy ashole crappy client rant11 -
So I Bought this bio metric pad lock for my daughter. She excitedly tried to set it up without following the directions( they actually have good directions on line) first thing you do is set the "master print" she buggered that up setting her print. So when I got home I was thinking, no problem I'll just do a reset and then we cant start again.
NOPE !!! you only have one chance to set the master print! after that if you want to reset the thing you need to use the master print along with a physical key that comes with it.
What sort if Moron designs hardware / software that is unable to be reset. Imagine how much fun it would be if once you set your router admin password it was permanent unless you can long back in to change it. Yea nobody has ever forgotten a password.
Well they are about to learn a valuable financial lesson about how user friendly design will influence your bottom line. people (me) will just return the lock to the store where they bought it, and it will have to be shipped back to the factory and will be very expensive for them paying for all of the shipping to and from and resetting and repackaging of the locks and finally shipping again to another store. Meanwhile I'll keep getting new locks until at no cost until she gets it right.
poor design34 -
Never mess with a motivated developer. I will make your life difficult in return.
Me: we need server logs and stats daily for analysis
DBA: to get those, you need to open a ticket
Me: can't you just give me SFTP access and permissions to query the stats from the DB?
DBA: No.
*OK.... 🤔🤔🤔*
*Writes an Excel Template file that I basically just need to copy and paste from to create a ticket*
This process should not take me more than 2mins 👍😁😋🙂😙😙😙😙😙😙😙😙
For them.... 😈😈😈😈😈😈😈😈😈😈😈9 -
That moment when you replace
If (blablabla) {
return Yes;
}
else {
return No;
}
with
return blablabla;
And it not passed code review because "We should have readable code"2 -
PHP arrays.
The built-in array is also an hashmap. Actually, it's always a hashmap, but you can append to it without specifying indexes and PHP will use consecutive integers. Its performance characteristics? Who knows. Oh, and only strings, ints and null are valid keys.
What's the iteration order for arrays if you use them as hashmaps (string keys)? Well, they have their internal order. So it's actually an ordered hashmap that's being called an array. And you can produce an array which has only integer keys starting with 0, but with non-sequential internal (iteration) order.
This array weirdness has some non-trivial implications. `json_encode` (serializes argument to JSON) assumes an array corresponds to a JSON array if its keys are consecutive integers in increasing order starting with 0, otherwise the array becomes a JSON object. `array_filter` (filters arrays/hashmaps using callback predicate) preserves keys, so it will punch holes in the int key sequence if non-last items are removed, thus turning arrays into hashmaps and changing your JSON structure if you forget to discard keys before serialization.
You may wonder how JSON deserialization works, then? There's a special class for deserialized JSON objects, `stdClass`. It's basically a hashmap too, but it's an object, not an array, and all functions that would normally accept arrays won't work with it. So basically its only use is JSON (de)serialization. You can even cast arrays to objects, producing `stdClass`.
Bonus PHP trivia:
Many functions return nonsensical values. `preg_match`, the regex matching function, returns 1 for success, 0 for no matches and false for malformed regular expression. PHP supports exceptions, so it could just throw one on errors. It would even make more sense to return true, false and null for these three cases. But no, 1, 0 and false. And actual matches are returned by output arg.
`array_walk_recursive`, a function supposed to recursively apply callback to each element of an array. That's what docs say. It actually applies it to leafs only. It will also silently accept object instead of array and "walk" it, but without recursing into deeper objects.
Runtime type enforcing is supported for function arguments and returned values. You can use scalar types, classes, array, null and a few special keywords. There's also a `mixed` keyword, which is used in docs and means "anything". It's syntactically valid, the parser will accept it, but it matches no values in runtime. Calling such function will always cause a runtime error.
Strings can be indexed with negative integers. Arrays can't.
ReflectionClass::newInstanceWithoutConstructor: "Creates a new class instance without invoking the constructor". This one needs no commentary.
`array_map` is pretty self-explanatory if you call it with a callback and an array. Or if you provide more arrays of equal length via varargs, callback will be called with more arguments, one from each array. Makes sense so far. Now, you can also call `array_map` with null instead of callback. In that case it treats provided arrays as rows of a matrix and returns that matrix, transposed.5 -
Manager 1: "We're going to hold a small meeting because of a new project."
Me: "Okay, cool. What project is it about?"
Manager 1: "Project X".
ME: "Right. What's the domain name?"
Manager 2: "Well there's this design but it's entirely made up. Just a concept."
Manager 1: "Wait, there's no more toner."
Manager 1 and 2 take 20 minutes to fix the printer, so manager 1 can print out an e-mail. They both return to their seats. No meeting happens. I roll a smoke and go outside to flip through LinkedIn for the nth time this week.3 -
@lunch conversation today..
Q: "if you were to write this world in a virtual environment, what would be the first thing you would define? "
A:" define Vegas as a closure with no return declared.
Whatever happens in Vegas, stays in Vegas. " -
How to explode a .NET developer, give them this challange:
Write a method.
- I must HTTP Get any site (does not matter what), and return the result
- It must NOT be async, and must directly return the result string (No Task<string>)
- It must use HttpClient
- It must be in .Net framework 4.5 or lower
- No other nuget packages allowed
This was my job today and i want you to share my pain!11 -
Two big moments today:
1. Holy hell, how did I ever get on without a proper debugger? Was debugging some old code by eye (following along and keeping track mentally, of what the variables should be and what each step did). That didn't work because the code isn't intuitive. Tried the print() method, old reliable as it were. Kinda worked but didn't give me enough fine-grain control.
Bit the bullet and installed Wing IDE for python. And bam, it hit me. How did I ever live without step-through, and breakpoints before now?
2. Remember that non-sieve prime generator I wrote a while back? (well maybe some of you do). The one that generated quasi lucas carmichael (QLC) numbers? Well thats what I managed to debug. I figured out why it wasn't working. Last time I released it, I included two core methods, genprimes() and nextPrime(). The first generates a list of primes accurately, up to some n, and only needs a small handful of QLC numbers filtered out after the fact (because the set of primes generated and the set of QLC numbers overlap. Well I think they call it an embedding, as in QLC is included in the series generated by genprimes, but not the converse, but I digress).
nextPrime() was supposed to take any arbitrary n above zero, and accurately return the nearest prime number above the argument. But for some reason when it started, it would return 2,3,5,6...but genprimes() would work fine for some reason.
So genprimes loops over an index, i, and tests it for primality. It begins by entering the loop, and doing "result = gffi(i)".
This calls into something a function that runs four tests on the argument passed to it. I won't go into detail here about what those are because I don't even remember how I came up with them (I'll make a separate post when the code is fully fixed).
If the number fails any of these tests then gffi would just return the value of i that was passed to it, unaltered. Otherwise, if it did pass all of them, it would return i+1.
And once back in genPrimes() we would check if the variable 'result' was greater than the loop index. And if it was, then it was either prime (comparatively plentiful) or a QLC number (comparatively rare)--these two types and no others.
nextPrime() was only taking n, and didn't have this index to compare to, so the prior steps in genprimes were acting as a filter that nextPrime() didn't have, while internally gffi() was returning not only primes, and QLCs, but also plenty of composite numbers.
Now *why* that last step in genPrimes() was filtering out all the composites, idk.
But now that I understand whats going on I can fix it and hypothetically it should be possible to enter a positive n of any size, and without additional primality checks (such as is done with sieves, where you have to check off multiples of n), get the nearest prime numbers. Of course I'm not familiar enough with prime number generation to know if thats an achievement or worthwhile mentioning, so if anyone *is* familiar, and how something like that holds up compared to other linear generators (O(n)?), I'd be interested to hear about it.
I also am working on filtering out the intersection of the sets (QLC numbers), which I'm pretty sure I figured out how to incorporate into the prime generator itself.
I also think it may be possible to generator primes even faster, using the carmichael numbers or related set--or even derive a function that maps one set of upper-and-lower bounds around a semiprime, and map those same bounds to carmichael numbers that act as the upper and lower bound numbers on the factors of a semiprime.
Meanwhile I'm also looking into testing the prime generator on a larger set of numbers (to make sure it doesn't fail at large values of n) and so I'm looking for more computing power if anyone has it on hand, or is willing to test it at sufficiently large bit lengths (512, 1024, etc).
Lastly, the earlier work I posted (linked below), I realized could be applied with ECM to greatly reduce the smallest factor of a large number.
If ECM, being one of the best methods available, only handles 50-60 digit numbers, & your factors are 70+ digits, then being able to transform your semiprime product into another product tree thats non-semiprime, with factors that ARE in range of ECM, and which *does* contain either of the original factors, means products that *were not* formally factorable by ECM, *could* be now.
That wouldn't have been possible though withput enormous help from many others such as hitko who took the time to explain the solution was a form of modular exponentiation, Fast-Nop who contributed on other threads, Voxera who did as well, and support from Scor in particular, and many others.
Thank you all. And more to come.
Links mentioned (because DR wouldn't accept them as they were):
https://pastebin.com/MWechZj912 -
Google
I used to be a fan, but recently they really stopped listening to users. No one asked for a wide angle selfie cam. If you give us that huge notch at least provide a FaceID equivalent or something that makes up for the notch.
Remove the headphone jack, cool. But then make the adapter and Bluetooth reliable. Even after a year the adapter isn’t working and the Bluetooth doesn’t connect on the first attempt. Never. The fix is constantly “coming”.
Google copies Apple without thinking. Apple gets away with shit because they provide something in return.
I was an Android user for almost 10 years, and I’ll say this: I bought the iPhone XS (I’m a purist, non-stock OS is a massive no-no) and it’s a much more usable device than the Pixels or other Android devices I used. It’s lacking in a lot of ways, but overall it’s a much better phone.
Google really needs to hire people who understand what people actually want. An amazing camera on its own isn’t enough these days.11 -
QA: When I start the onboarding process, kill the app and reopen it, I return to where I left off with no way to go back to the previous screen.
Me: Please click the back button in the top left corner5 -
I used to work for a company that had a main website and a lightweight app. LW app was distributed to partners and added to other sites using an iframe.
Someone decided a requirement was to retain the shopping cart for anonymous users. Some dev thought the best way to do that was to issue auth cookies to anonymous users.
The auth cookie issued by the LW app was actually for the main site. A few users for LW app decided to just come to main site to make a purchase. Since they already had an auth cookie (issued from LW app), they were never prompted to log in, create an account, or use guest checkout on the main site. They were still able to complete their order and we had their shipping address, but we didn’t have their email address so we couldn’t contact them about their order.
Customer service had no way to email customers if something went out of stock or if there was a product recall. CS would have to call these customers and ask for email addresses. Good luck getting anyone to answer or return a call nowadays. Customers were asking where their confirmation email was. The admin website was polluted with “users” that had the placeholder email for non-logged in users.
This happened because of a combination of an understaffed and overextended engineering department. Of course when something goes bad it’s going to be bad. -
Not here to disturb y'all , but am a little sad because our cute little boy honey has wandered somewhere and hasn't come back for last 2 days. :'(
I don't know what to do, we searched the whole area nearby and there are no signs of him. We have also alerted a few neighbors who aren't bad to animals.
But i guess it's his time to go out. We always had many cats , and we live on the topmost floor, so cats usually wander over to different terraces and come back after a few hours. But there is always a day, when they go away, nd never comes back.usually the female cats return, with stomach full of babies, but the boys are full Roadies, king of some random place
Its just my heart says he hasn't gone forever. He is a super dumb, and not very much of a bold boy. I think he fell somewhere in an empty home,and couldn't find his way back. ;_;10 -
NO. NO. A THOUSAND TIMES: NO.
I clicked on this out of genuine curiosity to see if someone was finally trying to discourage people from annoying the shit out of website visitors. A summary of the suggestions in their article as to what to use popups for:
1. Announce new products/services, features, policy updates, new blog posts
2. Promote your sales or coupons (including countdowns)
3. Encourage people to input their e-mail address / subscribe, perhaps also offering some vague thing they will get as a reward for doing so
4. Contact forms (e.g. support etc.)
5. Prompt visitors to confirm their age before showing content
6. Login/register forms
7. Display social media "share" buttons when a visitor has scrolled a certain way through the page content.
8. Display cookie consent prompt.
9. Help guide visitors to the part of the website they want to go to.
Of these: 1, 2, 3, and 7 need to die for sure. If a website does any of these things I'm inclined to immediately leave and never return. 8 is a little annoying but seems a necessity.
Someone even replied to the Tweet saying that popups are annoying, the company responded with "let's change that!"
Blank portions of the screenshot are to avoid promoting the company unintentionally as a result of the rant ;)3 -
Want to make someone's life a misery? Here's how.
Don't base your tech stack on any prior knowledge or what's relevant to the problem.
Instead design it around all the latest trends and badges you want to put on your resume because they're frequent key words on job postings.
Once your data goes in, you'll never get it out again. At best you'll be teased with little crumbs of data but never the whole.
I know, here's a genius idea, instead of putting data into a normal data base then using a cache, lets put it all into the cache and by the way it's a volatile cache.
Here's an idea. For something as simple as a single log lets make it use a queue that goes into a queue that goes into another queue that goes into another queue all of which are black boxes. No rhyme of reason, queues are all the rage.
Have you tried: Lets use a new fangled tangle, trust me it's safe, INSERT BIG NAME HERE uses it.
Finally it all gets flushed down into this subterranean cunt of a sewerage system and good luck getting it all out again. It's like hell except it's all shitty instead of all fiery.
All I want is to export one table, a simple log table with a few GB to CSV or heck whatever generic format it supports, that's it.
So I run the export table to file command and off it goes only less than a minute later for timeout commands to start piling up until it aborts. WTF. So then I set the most obvious timeout setting in the client, no change, then another timeout setting on the client, no change, then i try to put it in the client configuration file, no change, then I set the timeout on the export query, no change, then finally I bump the timeouts in the server config, no change, then I find someone has downloaded it from both tucows and apt, but they're using the tucows version so its real config is in /dev/database.xml (don't even ask). I increase that from seconds to a minute, it's still timing out after a minute.
In the end I have to make my own and this involves working out how to parse non-standard binary formatted data structures. It's the umpteenth time I have had to do this.
These aren't some no name solutions and it really terrifies me. All this is doing is taking some access logs, store them in one place then index by timestamp. These things are all meant to be blazing fast but grep is often faster. How the hell is such a trivial thing turned into a series of one nightmare after another? Things that should take a few minutes take days of screwing around. I don't have access logs any more because I can't access them anymore.
The terror of this isn't that it's so awful, it's that all the little kiddies doing all this jazz for the first time and using all these shit wipe buzzword driven approaches have no fucking clue it's not meant to be this difficult. I'm replacing entire tens of thousands to million line enterprise systems with a few hundred lines of code that's faster, more reliable and better in virtually every measurable way time and time again.
This is constant. It's not one offender, it's not one project, it's not one company, it's not one developer, it's the industry standard. It's all over open source software and all over dev shops. Everything is exponentially becoming more bloated and difficult than it needs to be. I'm seeing people pull up a hundred cloud instances for things that'll be happy at home with a few minutes to a week's optimisation efforts. Queries that are N*N and only take a few minutes to turn to LOG(N) but instead people renting out a fucking off huge ass SQL cluster instead that not only costs gobs of money but takes a ton of time maintaining and configuring which isn't going to be done right either.
I think most people are bullshitting when they say they have impostor syndrome but when the trend in technology is to make every fucking little trivial thing a thousand times more complex than it has to be I can see how they'd feel that way. There's so bloody much you need to do that you don't need to do these days that you either can't get anything done right or the smallest thing takes an age.
I have no idea why some people put up with some of these appliances. If you bought a dish washer that made washing dishes even harder than it was before you'd return it to the store.
Every time I see the terms enterprise, fast, big data, scalable, cloud or anything of the like I bang my head on the table. One of these days I'm going to lose my fucking tits.10 -
Look, I get that it's really tricky to assess whether someone is or isn't skilled going solely by their profile.
That's alright.
What isn't center of the cosmic rectum alright with the fucking buttsauce infested state of interviews is that you give me the most far fetched and convoluted nonsense to solve and then put me on a fucking timer.
And since there isn't a human being on the other side, I can't even ask for clarification nor walk them through my reasoning. No, eat shit you cunt juice swallowing mother fucker, anal annhilation on your whole family with a black cock stretching from Zimbabwe to Singapore, we don't care about this "reasoning" you speak of. Fuck that shit! We just hang out here, handing out tricks in the back alley and smoking opium with vietnamese prostitutes, up your fucking ass with reason.
Let me tell you something mister, I'm gonna shove a LITERAL TON of putrid gorilla SHIT down your whore mouth then cum all over your face and tits, let's see how you like THAT.
Cherry on top: by the time I began figuring out where my initial approach was wrong, it was too late. Get that? L'esprit d'escalier, bitch. I began to understand the problem AFTER the timer was up. I could solve it now, except it wouldn't do me any fucking good.
The problem? Locate the topmost 2x2 block inside a matrix whose values fall within a particular range. It's easy! But if you don't explain it properly, I have to sit down re-reading the description and think about what the actual fuck is this cancerous liquid queef that just got forcefully injected into my eyes.
But since I can't spend too much time trying to comperfukenhend this two dollar handjob of a task, which I'd rather swap for teabagging a hairy ass herpes testicle sack, there's rushing in to try and make sense of this shit as I type.
So I'm about 10 minutes down or so already, 35 to go. I finally decipher that I should get the XY coords of each element within the specified range, then we'll walk an array of those coordinates and check for adjacency. Easy! Done, and done.
Another 10 minutes down, all checks in place. TEST. Wait, wat? Where's the output? WHERE. THE FUCK. IS. THE OUTPUT?! BITCH GIMME AN ANSWER. I COUT'D THE RETURN AND CAN SEE THE TERMINAL BUT ITS NOT SHOWING ME ANYTHINGGG?! UUUGHHH FUCKKFKFKFKFKFKFKFUFUFUFFKFK (...)
Alright, we have about 20 minutes left to finish this motorsaw colonoscopy, and I can't see what my code is outputting so I'm walking through the code myself trying to figure out if this will work. Oh, look at that I have to MANUALLY click this fucking misaligned text that says "clear" in order for any new output to register. Lovely, 10/10 web design, I will violate your armpits with an octopus soaked in rabid bear piss.
Mmmh, looks like I got this wrong. Figures. I'm building the array of coordinates sequentially, as a one dimentional list, which is very inconvenient for finding adjacent elements. No problem, let's try and fix that aaaaaand... SHIT IM ALMOST OUT OF TIME.
QUICK LYEB, QUICK!! REMEMBER WHAT FISCELLA TAUGHT YOU, IN BETWEEN MOLESTING YOUR SOUL WITH 16-BIT I/O CONSOLE PROBLEMS, LIKE THAT BITCH SNOWFALL THING YOU HAD TO SOLVE FOR A FRIEND USING TURBO C ON A FUCKING TOASTER IN COMPUTER LAB! RUN MOTHERFUCKER RUN!!!
I'm SWEATING. HEAVILY. I'm STEAMING, NON-EROTICALLY. Less than 10 minutes left. I'm trying to correct the code I have, but I start making MORE dumbfuck mistakes because I'm in a hurry!
5 minutes left. As I hit this point of no return, I realize exactly where my initial reasoning went wrong, and how I could fix it, but I can't because I don't have enough time. Sadface.
So I hastily put together skeleton of the correct implementation, and as the clock is nearly up, I write a comment explaining the bits I can't get to write. Page up, top of file, type "the editor was shit LMAO" and comment it out. SUBMIT.
This violent tale of brain damaged badmouth schizoid baby versus badly worded code challenges was brought to you by ButtholeSuffers. Tired of taking low-quality viagra before engaging in unprotected anal sex? Then try ButtholeSuffers, the new way to strengthen your everday erections! You'll be as fucking HARD as a WALL!
Visit triple doble minus you dot triple doble YOU dot doble-u doble www dotbit lyshAdy wwwwww academy smashlikeachamp ai/professional/$$%$X$/0FD0EFF~ \*¨-`++ ifyouclickurstupid for for a FREE coupon to get MINUS NaN OFF on a close-encounter with an inter-continental dick, and use my promo code HOPONBITCH if you'd like it *RAMMED* --FAR-- and D E E P L Y.
(lel ad break should continue I'm cutting it shortt) [CENSORED] grants *physical* access to your pants! Big ups to Annihilate for sponsoring this mental breakdown.
Also hi ;>5 -
'Hey I found a bug in your code, it's probably a typo, see here.'
Me: Oh right, yeah. How stupid of me. Thanks, I'll push it.
'It's okay. You can push it or I can do it too after you push the changes we just discussed. I actually simplified one of your methods.'
Me: You, what... ?
(You crammed multiple lines in a single line with your stupid as fuck, rigid constructs, removing my error handling, loosely coupled service, in the name of simplification?)
' Yeah it's just four lines in a single function now, no need to call the function again and again.'
Me: (No... Just no. This totally undos whatever little I could do to avoid supporting your idiotic object in the first place.)
Oh... okay, we'll see. I'll let you know.
What life.
Life in a company full of ignorant, inflated egos is no joke.
Details:
I created a service that reads a configuration file and returns the configuration. This person needs five entries for his app logic. He collected them in a object. Quite alright. Except that the class prototype is shitty. I, like a normal person, made my service return a value based on input. I was asked to incorporate this awful object so that I can return the five entries together, which is awful because the service is not supposed to know about how the entries are clubbed. It should most certainly not know about the data members of the object!4 -
#include <rant>
Using angry standard;
Int main()
{
cout << "So my mom recently started "exploring the web". I'm sure you already know where this is going; she ended up signing up for a free trail of some diet pills with her credit card on some sketchy website. The website never sent any product but attempted to charge her card over $300 multiple times. My mom's bank noticed and froze the account. She has now opened an investigation with the banks fraud department and is awaiting response. I took the liberty of running a whois look up and found the companies website is held by GoDaddy and is hiding behind Domains by Proxy (GoDaddy's sysadmin hider). I'm angry that she's in this situation but I have no idea of how to uncover the real company behind the diet pills site." << endl;
Return 0;
}3 -
Please take sleep deprivation seriously!
Take care of it and don't allow stress to take you over.
Here's a little story of what happened to me:
I've had sleep problems for all of my life, but the beginning of last summer 2018 it went too far. I turned 18 and somehow all the school, dev and personal work started to pile up, I stressed about them and started to have no sleep every other day and little sleep another. Immediately I took time off from everything for trying get better sleep.
Having no sleep means that your brain starts to run in really low gear but you might not even notice it. So I started stressing about every little detail, making ridiculous decisions and doing stuff that didn't really make any sense.
I went to a doctor and was ordered to take time off for a month or so and start medication with bunch of different pills. At the time I thought the medication could wait for a day and went to an old work friend's place for night stay to discuss about everything. That wasn't obviously the thing I should've done. I was up all of that night, he slept, and in the morning he noticed something was really a bit off about me.
We went to the hospital and I agreed for a treatment in there. They got me to sleep normally again and I rested there for a while. I went back home or actually my parents' place and the problems continued, and back to the hospital I go. This time there was no choice. After a really long while, my mind started to stabilize enough that I was allowed to return to my everyday life: enjoying my summer break. It was an awful summer. I often felt lonely and bored. But at least I slept normally.
In the fall I returned to my usual busy schedule. And life's good again. This time I will manage my stress and sleep better and take them to account when planning schedule.16 -
Choke on a fucking narwhals horn you pieces of shit, 28 days no ticket answer, then raised the issue again and again and again, still no answers, tried their email added in all github support readmes - got that in return, all their issues are closed except for the python wrapper, just fucking send me back a notice of your death already.5
-
Today, Linux kernel 5.8 was released, here is how it runs on my new laptop.
- Realtek shit ethernet still doesn't work (no, I didn't return it, because I would have to buy at least 2 times as expensive docking station instead and it is just not worth it), but considering Realtek, it is probably not a Linux kernel issue
- Battery life while watching videos was improved pretty significantly from 6.5 hours to about 7.3 hours (1080p HEVC)
- All temperature sensors are now working correctly
- Fan is a little more silent overall, probably because of some power draw improvements
- Subjectively, the system is a little bit more responsive overall4 -
It's fucking never worth it, to be decent to colleagues. I got prove of that just this evening. Sorry, this rant will be a bit longer.
A colleague of mine inherited some legacy project that I worked on in the past. He clearly hates working on it. And tbh. I can't blame him for it. It's not very fun. He also makes virtually no effort to become more proficient in it.
This usually leads to him calling for my aid, whenever any problem arises, that would require any kind of effort to solve. I would normally cave in and help him. Mostly due to the fact, that without any intervention from me, it would end on my desk sooner or later.
That changed in the last few months, as I simply couldn't make free time to help him. anymore. I was working overtime and the associated project barely got done on time. During that time I would, as politely as possible, deny him. He knows fully how stressful the project was getting.
Today he asked for help again. I denied again, as a task was due very soon. He didn't reply to my message afterwards. After a few hours suddenly I got a bunch of his jira issues assigned to me.
The motherfucker simply shoved _all_ of his support issues to me. Not only that, he also assigned the issue he was asking for help for earlier as well. All without consulting me or anything. Then he pissed of into his vacation.
Some of his support issues have been created last year! And they are still not solved. He simply isn't replying to questions in those issues or just assigns them to others colleagues without any instructions.
Fuck him. Other colleagues don't even respond to him anymore. He fully fucking knows that I have a tight deathline on my current task. And still he chose to dump all his work on me, so that I have to waste time to reassign it and report it to our superior.
Fuck him for creating more stress in this already stressful situation. Enjoy your vacation you fucking leech. I will have quite a "nice suprise" waiting for you, when you return.15 -
Let me tell you why I feel like a shit right now. I work as sw dev in a country worse than Germany and company I interviewed is located in Germany. So this is kinda big deal for me.
I interviewed with the company last year, interview went really well. They told me during interview that they would return in 2 weeks tops. It took 2 months for them tor return. For some reason, I was not hired for that position. Later I learned that the division i was gonna work defunded/separated. After learning that the guy I interviewed really tried hard to give me good news but failed-therefore had to delay bad news, I was not sad for not being able to be accepted for that position or delayed response.
Fast forward to this year, I interviewed with the same company for a position as subcontractor employee on another company. Interview took just before Coronavirus situation started to blow up(mid March), I had to return to my home country when the borders were closed asap, 2 day after interview. Fast forward to May I got the job offer and contract with a good salary, July as starting date. But I have no Visa and you apply for visa with a valid contract. German embassies work at minimum capacity, no new applications for any type of visa including work/residence visa. After my serious research I found a crack, emailed the embassy and they finally agreed to give me a special appointment on the start of July. The company I interviewed sent me new contract(August starting date) automatically.
On mid July, I told the company that visa might not come soon enough, I might not make it to August to start to job. We both agreed to replan starting date once i got the Visa.
On August 6, my visa came. I informed them asap, and they told me the other company will return in 3 weeks with new starting date. I was like WTF we were waiting for this visa for months, why do you need 3 weeks. Anyways, 3 weeks past and the other company still did not give any new starting date. I really feel like shit right now. Last week I asked to the "my" company if there is a problem with my employment(the other company might change plans after all) and they said only starting date is the problem, don't worry. On 3 occasions, they reassured me there was no problem(no, I was not asking them like paranoiac obsessive person, they were preemptively saying it in some cases). They say other company employees were really asking about when I was coming frequently.
What should one do in such situation. Do I even have legal rights? Maybe I will look back at this post and laugh at my paranoia, but I would you random internet citizens' ideas on this situation. They say lightning does not strike twice to same point but living same disappointment with the same company would really hurt. rant over, mamba out.8 -
A piece of code someone just pushed:
In pseudocode
------------------------
Function foo()
Result = GetFoo()
If result != null
DoStuff()
Return result
Else
Result = null
--------------------------
Ffs.
It's written in a strongly typed language, and the whole function is in a try with an empty catch and inside yet another try with an empty catch. Guess he wanted to be sure no error got away....
Oh, and he has 9 years of experience, and since all paths don't return something it does not compile12 -
tl;dr - why you no read this?
Here I am pondering why I continue to return to my job everyday when we are currently at month 13 of a 4 month project... yea let that set in for a minute... which is still at least 3-4 months away from being deployed due to annual leave of key stake holders and the whole Christmas period creeping up and things just not going as planned every step of the way.
There's no greater demotivater - is that even how you spell it - then being stuck in a project for so long you really just don't give a shit if it works or not anymore.
This has gone from a simple - relatively speaking - project to some monolithic mayhem of requirement changes and process adjustments, that have not only delayed our team, but 3rd party vendors needing to change things as well, or the requirements being wrong early so when you get up to business testing it's like "nope, that's not what we wanted" .... despite all the sessions of you personally giving the PM all the damn requirements.
But in saying that, they (3rd party) aren't innocent either, we have found nothing but issue after issue with their product since we started this project that who ever signed off on going forward with the thing should have been shot from both sides - it's not designed for the scale we will be using it yet we didn't find that out till we got so far into the rabbit hole we had a chance to be able to do load testing.
Meh, guess I'll go to work Monday and spend another week in misery trying to deliver something that just doesn't want to know what the finish line is.4 -
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 -
Quick rant, I dont have time.
I have no idea how the fuck but I managed my IDE to show me that it's confused if my class "PackModel" is "PackModel" or "PackModel" (I have only one definition if you are hands first to ask).
its few years and first time when I see shit like that.
Fun fact, it was working OK until I used getter that was returning another object and than IDE got absolutely lost.
I had to use workaround in middle of nowhere as shown on image and suddenly its back fine with it. Not like it's returned by function hard typed and PHPDoc typed to return instance of this very object and in other scopes it just works...
It's Jetbrains so Im confused, it's robust IDE ;-;...8 -
My first dev job is my current job, but I'm leaving it tomorrow to go on on an internship overseas, then return my focus to completing my Computer Science bachelor's degree and getting into a Master's program.
Before this job, I was an office assistant at a small company that sold cosmetics products and fragrances. I had just returned to college after a 1.5 year hiatus and was tired of that job. I wanted to get into the field, even though my experience was limited to freelance web design and a few personal programming projects of which I no longer had any proof, and I still didn't have a degree, but I wasn't confident that someone would contact me. Yet I decided to update my resume and upload it to Indeed.com. I was already getting interviewed at a call center when this local tech startup called, and 2 weeks later, I had the job. We were 3 employees and I was, not only the first woman in the team, but also the first person to ever get hired by the directors without a college degree. Today, I still hold those two titles and the team is 3 times bigger.
It was a very bumpy ride, and tomorrow I move on to other adventures, but I'll always be grateful for the opportunity, all the lessons, and the best team mates I could ever have. Without their wisdom and guidance, I wouldn't have half the blessings I have today. I will miss them dearly, but I know we'll stay friends.
Here's to better things and to a college degree! <32 -
Firebase is pure fucking assrape!
How can these spoiled cunts of Google "develop" such a stinking pile of rotten placenta?
No, one fucking Promise is not enough... you have to return Promises for every single smegma function!
I want to just blow up this ugly afterbirth!!
It seems that Google devs are just spoiled MacCunt Pro brats who copy-paste code around until something "kind of works".13 -
Official declaration: I am a fucking moron.
Last year, I acted stupid (as suual) and didn't invest enough money into some tax saving instruments.
I also picked the wrong taxation method and ended up paying more than double taxes.
Thankfully my country has an option where you can claim a refund by filing a return form.
And so I go ahead and I hire a finance guy who can help me do my taxes.
We sit at the table and do the math. It turns out my savings mindset prevented me from not investing enough and now it is difficult to claim the tax as refund.
I legit had no issues in investing more. Rather I was looking for ways to do so but I didn't. If I had done it, I'd would be paying zero taxes as my earnings would fall below a certain threshold.
Only trick is to evade by unethical means. Should I be the Jeff Bezos of my country and save my hard earned money from going to corrupt politicians?
Either way, I am a moron. Fucking hate my stupid decision.17 -
Just before the holidays started I was given a task by my manager, $M.
$M: "Kyntak, while I'm away I want you to look into this new way of starting $important_service"
$me: "Okay $M, is there a bug for this that explains what is needed?"
$M: "Yes, you should be able to find it"
Goes looking, finds someone else working on something connected but not the same, finds the code change that makes this available... It doesn't explain how to use it, when the async events fire or (well, to a junior engineer like me) really anything.
Message the other (very experienced) eng.
$me: "Hey I've been asked to make $important_service use the new starting API, can you tell me about?"
$eng: "Yup, here's a bug for that and I'm happy to answer any questions you have" *goes offline*
I read the bug. It doesn't mention the original problem I was trying to solve, it doesn't even mention $important_service. There's no design doc mentioned. The bug has a higher priority assigned than any of my other work. It has an expected completion date only days after I get back from holidays (which $M told me to take).
I try to contact $M and $eng. They've already left for holidays.
"Hmm"
Implements as much of the fairly inevitable boilerplate that I can infer from the bugs and surrounding code.
"Hmm"
So, I'm into my second week of holiday and am starting to think about the potential shit storm I may return to.
I hope the bug's priority was wrong.4 -
> day 3439
> I have become the reviewer, there is no longer such thing as a programmer, just a reviewer
> the copilot AI was renamed "The Pilot"
> I sit and read through thousands of lines of code a day adding missing new line characters and adding semi-colons for paranoid dev leads
> reviewed a hello world function today
> instead of, return "Hello World!", it said "Goodbye World! >:)"
> I fixed it and submitted a PR
> this has been happening more and more lately
> apparently it's more efficient to fix the bugs of a malicious AI during pull reviews then it is for humans to make the programs
> congress just signed a bill last week allowing "The Pilot" to work on nuclear launch code
> I hope I don't mess up4 -
Damn bro Vue 3 sucks actually. It's just a big function now with arguments like "`this` can be sometimes confusing when TypeScript is used." - hell no, my component was a class and this was the fucking class. nothing was confusing about this.
It's all a clusterfuck of magic now, I don't see why writing `ref(5)` or `return { all of your shit }` after `setup() { complete business logic inclusive functions here }` is better.
I was so looking forward to all the improvments, but why do we need these 3 apis with actually no difference, tried to be explained by the same image of colorful blocks in every single fucking article?
what happened to methods? am i seriously supposed to return them from a function? that just feels wrong.22 -
The company that I work for has recently recruited a team for Web Development, so they don't have to pay a monthly fee to the previous team who designed their website.
They have over 3000+ products in the old website, and no logical way to import them to the new website. The old team was asking for 300$ to give them an API which would return the product details in an XML format.
Obviously, paying that amount of money wasn't logical for a dying website, so the manager decided to hire someone to manually copy the content from the old admin panel to the new one, that is until I stopped him.
My solution? Write a simple web scraper to login to the old panel and collect data. Boom! 300$ saved from going to waste.
Now, the old team found about this and as much as my manager was happy, they were quite angry. So they implanted a Google reCaptcha to prevent my bot from scraping the old panel.
I spent about 20 minutes, and found out once you're logged in to the old panel, the session is saved in a cookie and you are no longer greeted by a Captcha.
So I re-written a small portion of my bot, and Boom! Instant karma from manager. We finished publishing the new site, and notified the old team, only to see the precious look on their face. Poor guy, he thought I was a wizard or something 😂😂
That's what you get for overcharging people!
TL;DR: Company's old website team wanted to overcharge us writing an API to fetch 3000+ records.
Written a basic web scraper to do the same job in less than an hour.3 -
I can't use Javascript object destrucuring in react components because a colleague doesn't like / understand it for some reason.
So instead of:
({ something }) => {
return (
<div>{something}</div>
)
}
If have to use
(props) => {
return (
<div>{props.something}</div>
)
}
Its no big issue, but I hate it.8 -
I explained last week in great detail to a new team member of a dev team (yeah hire or fire part 2) why it is an extremely bad idea to do proactive error handling somewhere down in the stack...
Example
Controller -> Business/Application Logic -> Infrastructure Layer
(shortened)
Now in the infrastructure layer we have a cache that caches an http rest call to another service.
One should not implement retry or some other proactive error handling down in the cache / infra stack, instead propagate the error to the upper layer(s) like application / business logic.
Let them decide what's the course of action, so ...
1) no error is swallowed
2) no unintended side effects like latency spikes / hickups due to retries or similar techniques happens
3) one can actually understand what the services do - behaviour should either be configured explicitly or passed down as a programmed choice from the upper layer... Not randomly implemented in some services.
The explanation was long and I thought ... Well let's call the recruit like the Gremlin he is... Gizmo got the message.
Today Gizmo presented a new solution.
The solution was to log and swallow all exceptions and just return null everywhere.
Yay... Gizmo. You won the Oscar for bad choices TM.
Thx for not asking whether that brain fart made any sense and wasting 5 days with implementing the worst of it all.6 -
I'm currently volunteering as a student assistant at my school, and today I've gotten the same question 20x. What question do you ask: "Why doesn't ^ return the power of the 2 numbers?"
It turns out that last week they've had a Math class from a new teacher (no programming experience) who said that if you want the power of 2 numbers you have to use the ^ operator...
If you don't know how to program, please don't teach it!5 -
I usually crib about how stupid people are and how I struggle to stay afloat.
Let's switch some gears now. A post about some good people, product, and processes.
You know what the common theme here is?
The goodness here cannot be measured. Your first interaction with them makes you feel so comfortable that you start feeling butterflies.
These people just keep on giving. They are selfless. They are pure. They actually care.
And when you think it's done, then they give you some more.
What blows me away is, they don't expect or accept anything in return. Absolutely nothing. Not even a simple thank you.
And they are like a wizard. They walk into your life when you least expect them but need them the most. And when the task is done, they'll be gone before you even know.
No lingering, no drama, no bullshit. Just pure goodness.
Like my ex-lead in current company, I have a very senior guy in neighbouring team (for which they were gonna hire me initially), who also happened to interview me, is a gem.
He takes care of me like his own younger brother. Supports me and always answers my queries no matter how occupied he is.
And same is with good products and processes. They feel effortless. So smooth and add exceptional value to your existence. They give rise to wonderful companies.
You'd never experience a single negative aspect about them. No matter how much you try, things will just keep getting better until they don't need to.
And then they'll be long gone. Never to be seen again and never to be forgotten.
You cherish them only in your memory and wish they lasted longer. But they didn't because the purpose was served.
Such people and experiences inspire me. They push me to become a better human.
No matter how the world is or how it treats me, I must always live with high values and be a better version of past self.
The other evening, I was conversing with my mother where we spoke about some family friends who are insanely wealthy but humble and kind.
Mom and I mutually agreed that they don't have such good traits because they are wealthy, but they are wealthy because they live with humility, kindness, and pure intentions.
World is surely a beautiful place because of such people and I aspire to be one. May lord guide me well :)3 -
So.. I'm giving one of my employers webapps a visual refresher, new company branding and whatnot.
And then I stumbled onto a check that is not returning what anybody expects, and, well , I'm busy fixing things, yeah..? so I go digging.. 🤔
```
function isDefined(obj) {
return !(typeof obj === "undefined") || obj !== null;
}
```
Here's the fun part, these particular lines have been in the code base since before 2017, which is when my Git history starts, because that's when we migrated projects from Visual SourceSafe 6 over to Git. Yes, you read that right. They were still using VSS in 2017.
I've begged and pleaded with my last 3 bosses to let us thrown this piece of shit out our second story window and rewrite it properly. But no, we don't have time to rewrite, so we must fix what we have instead.
I lost 4 hours of my life earlier today, tracking down another error that has been silently swallowed by a handler with its "console.log" call commented out, only to find that it's always been like that, and it's an "expected error". 🤦
Please, just fucking kill me now... I just, I can't deal with this shit anymore.5 -
Considering mullvad is based in sweden (xkeyscore, 14 eyes, ..) and has never seemingly had any public court record proving its claims, is it really to be trusted, instead of e.g. BlackVPN/NordVPN? does the server location matter if they are based in sweden?
Is it just again an excuse like "even if that happens, I am only hiding from X, I have nothing to hide from Y"? so e.g. your neighbour can't snoop, but a court if they decide everybody that visited devrant is a criminal - is alright?
PIA is based in the US (no discussion level of bad), but atleast got tested twice already and each time could not return any logs, even though I like mullvads model and it is clearly better than being US based, it still makes one question if mullvad is not yet another PureVPN in fancier clothes?15 -
typescript, I HATE you!
ME: Trying to extend Subject and override Subject.subscribe(PartialObserver<T>)
ME: export class MySubject<T> extends Subject<T> {
subscribe(obs?:PartialObserver<T>): Subscription {
return super.subscribe(obs);
}
}
ME: compile
TS: Compilation error! No such method to override!
ME: load the app -- ERROR
ME: recompile
TS: Compilation error! No such method to override!
ME: load the app -- works perfectly
:confusedjackie:
Make up your mind! So is that class compileable or not???
If not -- how the fuck does it work then???
If yes -- why the fuck do you yell in my face with all those errors???8 -
Fuck this I need to ventilate.
Thinking about job change because maintaining and extending 3 years old codebase (flask project) is FUCKIN exhausting. It was badly written since start by someone who obviously didn't know much about python. (Going by commit history.)
Examples:
- if var != None / if var == None
- if var is not None / if var is None (well..)
- Returning self-parsed obscure JSONs from dict variable
- Serializing dictionaries into database by str() (both sqlalchemy and mysql support JSON format) - THEY ARE ALMOST UNUSABLE OTHER WAY AROUND (luckily, python can deal even with that)
- celery tasks, the way they are called they BLOCK the whole flask (not bad in itself, but if connection breaks there are no errors, nothing it just hangs)
- obscure generator/yielding that contains return of flask's response in itself
- creating fifteen thousands of variables one by one where they would look so nicely as dict keys, and hey they are then both MANUALLY SERIALIZED into returning dict by "%s" (string formatting) [okey, some of them are objecst like datetime but MATE WTF]
- many, many more, PEP lint shall not pass
I would rather deal with fresh startup owners wanting me to program unicorns in one week then trying to extend and manage zombie-like projects.
Nothing personal against the firm I actually like the place.3 -
Today at 'Derp & Co' is the end of the last sprint, no one have close all the task asigned. Myself included.
- that sucks...
Because there are task from previos sprints still in TODO that block other tasks.
- oof
But there is more... Yesterday was the deadline of the project. From today and onwards the client get discount.
- oof (but fair to the client)
Management have in mind AT LEAST 4 more weeks of development.
- But... how... wtf?
In 2 weeks part of the hardware we need for the project will return to the client.
- <smash the door and leave>
Management still is asking if we can do it on time...
- yeah... just call the Doctor, we need a TARDIS ASAP2 -
Just a short "dafuq?" about VS Code.
I have a MacBook Pro from last year, so it's a capable machine. And there I was today, sitting on the train, coding some Python in VS Code.
Suddenly it got all laggy. Like, one second behind my typing, dropping keystrokes, stuttery scrolling... the whole deal. The system itself was perfectly responsive and the activity manager showed the CPU at 30%. After a minute or so, it magically recovered and worked as if nothing ever happened.
What the actual fuck was VS Code doing? I mean, it's a fucking text editor. In 2019 this should be a bloody solved problem! There's absolutely no reason to use around 30% CPU in the first place, and use that much and still *lag*. Holy crap, and people ask with a straight face "what's wrong with reinventing everything based on web technologies?" Fuck everything Electron-based. Make it ElectrOFF already.
*takes deep breath*
So, editor suggestions are welcome. I used Sublime Text 3 before VS Code, I'll likely return to that.18 -
Not sure if it's the worst code review but it's a recent one.
We don't really do code reviews where I work unfortunately but my coworker used my framework for the first time (build some nice composer libraries for cmdline projects) and asked if I could make them do autoloading.
He never used namespaces before so I was glad to help him out.
What I saw was a dreadful mess. His project was called "scripts" so good luck picking a namespace...
Than it was all lose functions in the executable file. All those functions are however called by a class in another file (if they where not calling eachother as a cascading mess). That class was extending an abstract class from my library as instructed. However I never imagined my lib being raped like that.
The functions themselves are a horrible mess. Nothing uniform completely different style (our documentation states PSR's should be used).
Parameters counts higher than 5.
Variable names like Object and Dobject (in calling function Dobject is Object but it needs a fresh one.
If statements on parameters that need basically split it in two (should simply be to functions)
If else statement with return of same variable as a single line (sane people use ternary for that)
Note that I said functions. All of it should have been OO and methods. Would have saved at least some of the parameter hell.
I could go on and on. Do I think the programmer is bad yes (does not even grasp interfaces, dep injection, foreach loops). Is this his best work no. He said that for a one of script like this it just has to work. Not going to be used elsewhere. I disagree as it is a few thousand lines of code that others have to read too.2 -
Important memos to future self:
If the specs the client gave you seem written by a confused pre-teen, run.
If the client says something like "this can't possibly take THAT long", run.
If the client can't pay you enough, but reassures that (in return) he won't stress you and let you work in peace without imposing deadlines: he's lying, run.
If he politely asks to do something but then when you say no he keeps insisting, Don't. Give. In. Ever.
If the project seems shitty and not likely to have success, but hey, seems also simple and easy: it's not. But it's shitty anyways.
And on top of all: trust your fucking guts, you've been right tons of times by now. You didn't want to do this but you forced yourself, because "it's still an opportunity" and stupid slogans like that. Never again.5 -
Nearly same time as the "don't be evil" got removed from google pages, an old internal video leaked about some futuristic concept, where the AI would try to gather as much data as possible from a user and if not possible, suggest devices with discount (e.g. a scale), that can return that data to the AI or if there's no fitting product, just print or make it based on the previously collected data (favorite color, ..) and suggest that to the user to buy, all since google duplex, anything mentioning google has been outscoring the previous idea 😶
src: https://youtu.be/iqUCX5rPQug2 -
Working on a team to take functionality from the latest version of an old executable and put it into a new web-based app.
Coworker: I can't get the results to match so I'll just change the options I'm using in the original program until they match.
Me: That's not how this works. That's not how any of this works. Same options on both source and new app, and you should get identical results. Otherwise, there is a defect.
I walk over to look at what CW set up.
M: "Why do you have this box ticked? That option doesn't even exist in the new version."
CW: I don't know. It was there?
M: (trying not to lose my cool, sets up options the way they are supposed to be) This is actually a pretty simple program. It just queries the DB, so we have to make sure the queries and results are the same.
CW: (runs it) Still doesn't match.
M: What version of the source app are you using? Make sure it's the latest.
CW: I can't tell. There is no help/about menu.
At this point, I kinda want to quit and live in a cave.
M: You don't need that. Check the executable in Windows Explorer.
CW: What do you mean?
At this point, I'm sure I look like Anger from Inside Out. I show them how to do it (right click file, properties, etc), wondering how they got this far in their career without knowing how to do the simplest things.
M: (surprised and irritated) This... isn't the current version. It's two versions old.
CW: Well, I couldn't get the newest version to return the results that matched the test cases, so I used the version that did...
M: You can't do th... Why wou... How is that acc... (turns around and walks out to tell the manager he hired a moron)2 -
It works locally, it works in Dev, it works in Test, but fails to deploy in UAT. Is it a data issue? I don't know, I don't have permissions to see the UAT database. Literally all I know is that this API is returning 500 instead of what it's supposed to return, but only sometimes.
Guess I'll sit here all day and try to solve the problem telepathically as there is literally no way of troubleshooting other than scrolling through the code and hoping that a cartoon lightbulb appears above my head.2 -
Yesterday I helped in a college final project. To be done using PHP and MySQL.
- they were taught to create a login page and when submitted just check the values against username and password from DB table and redirect to a dashboard page. No session created.
- in the dashboard, session is not checked. Shows links to other pages.
- each page is a separate php file
- the app allows users to issue books to customers. They were taught to delete the book from book table and save all the info in issue table, when a book is issued
- when a book is returned, book info is saved in a return table and also saved to book table again and deleted from issue table
I asked this student to change it to the right way, to use sessions and includes. He said that then the lecturer would know, he didn't do the project. It's a diploma level course.2 -
in college ages ago, professor was "teaching" us overloading in C++, he goes something like this:
"so you can overload a function by changing the number of arguments, argument types, or method return type"
I dare put my hand up: "emm .. you can't overload by just changing the return type"
"you can"
"but, but.. how would the compiler know which overload I'm invoking when I call the method?"
pause..
"it depends on the type of the variable receiving the method call result"
"what if I call the method without assigning the result to a variable?"
agitated by now: "ah these are complex compiler concepts that are too complicated blah blah"
although I was unhappy, it was useful to realize no one knows everything5 -
I've spent a lot of time messing around with C, having struggled with object-oriented programming (due to not really knowing how best to structure things, not knowing when to apply certain design patterns).
When writing C code, I'd write OOP-esque code (pass around a struct to routines to do things with it) and enjoyed just making things happen without having to think too much about the overall design. But then I'd crave being able to use namespaces, and think about how the code would be tidier if I used exceptions instead of having every routine return an error code...
Working with Python and Node over the past couple of years has allowed me to easily get into OOP (no separate declaration/definition, loose typing etc.) and from that I've made some fairly good design decisions. I'd implemented a few design patterns without even realising which patterns they were - later reading up on them and thinking "hey, that's what I used earlier!"
I've also had a bit of an obsession with small executable files - using templates and other features of C++ add some bloat (on Windows at least) compared to C. There were other gripes I had with C++, mostly to do with making things modular (dynamic linking etc.) but really it's irrelevant/unreasonable.
And yes, for someone who doesn't like code bloat, working with Node is somewhat ironic... (hello, node_modules...)
So today I decided to revisit C++ and dust off my old copy of C++ in a Nutshell, and try to see if I could write some code to do things that I struggled with before. One nice thing is that this book was printed in 2003, yet all of its content is still relevant. Of course, there are newer C++ standards, but I can happily just hack away and avoid using anything that has been deprecated.
One thing I've always avoided is dynamic_cast because every time I read about it, I read that "it's slow". So I just tried to work around it when really if it's the right tool for the job, I might as well use it... It's really useful!
Anyway, now I've typed all this positivity about C++ I will probably find a little later on that I hit a wall with what I'm doing and give up again... :p7 -
Working on an Android app for a client who has a dev team that is developing a web app in with ember js / rails. These folks are "in charge" of the endpoints our app needs to function. Now as a native developer, I'm not a hater of a web apps way of doing things but with this particular app their dev teams seems to think that all programming languages can parse json as dynamically as javascript...
Exhibit A:
- Sample Endpoint Documentation
* GetImportantInfo
* Params: $id // id of info to get details of
* Endpoint: get-info/$id
* Method: GET
* Entity Return {SampleInfoModel}
- Example API calls in desktop REST client
* get-info/1
- response
{
"a" : 0,
"b" : false,
"c" : null
}
* get-info/2
- response
{
"a" : [null, "random date stamp"],
"b" : 3.14,
"c" : {
"z" : false,
"y" : 0.5
}
}
* get-info/3
- response
{
"a" : "false" // yes as a string
"b" : "yellow"
"c" : 1.75
}
Look, I get that js and ruby have dynamic types and a string can become a float can become a Boolean can become a cat can become an anvil. But that mess is very difficult to parse and make sense of in a stack that relies on static types.
After writing a million switch statements with cases like "is Float" or "is String" from kotlin's Any type // alias for java.Object, I throw my hands in the air and tell my boss we need to get on the phone with these folks. He agrees and we schedules a day that their main developer can come to our shop to "show us the ropes".
So the day comes and this guy shows up with his mac book pro and skinny jeans. We begin showing him the different data types coming back and explain how its bad for performance and can lead to bugs in the future if the model structure changes between different call params. He matter of factually has an epiphany and exclaims "OHHHHHH! I got you covered dawg!" and begins click clacking on his laptop to make sense of it all. We decide not to disturb him any more so he can keep working.
3 hours goes by...
He burst out of our conference room shouting "I am the greatest coder in the world! There's no problem I can't solve! Test it now!"
Weary, we begin testing the endpoints in our REST clients....
His magic fix, every single response is a quoted string of json:
example:
- old response
{
"foo" : "bar"
}
- new "improved" response
"{ \"foo\" : \"bar\" }"
smh....8 -
So this will be my first rant/story sorry if it gets too long.
So finished work and I was like finally some days off, went to bed, woke up the next morning, went to near city to take care of some work, went back and I noticed they were digging the ground near my place, as I've found out from neighbors they were changing some pipes, well ok no problem arrived home, sat on my PC to study a bit and do a bit gaming, but guess what?? NO INTERNET well ok contacted the ISP, the idiots told me it will take them 2 days to arrive WTF? is this 2018 or 1918?? I was so pissed off but ok the next day they called me that they arrived, they checked and said that they will need to fix some wires they will return the same day.. so I've waited few hours but no internet, the asholes didn't came, so the next day they arrived and guess what?! the idiots that digged the holes cut the wires, instead of fucking contacting the ISP to ask for supervisor to tell them where they can dig they didn't know what was the fire for and they thought oh well lets cut the fucking wire, and instead of stopping and contacting the ISP about their mistake they continued with the digging and cut the wire at 3 places, so the ISP at the end called the police, the plumbers that did the digging where just laughing, why do you laugh you primitive ashole, even 10 year old would first ask if it can continue if it finds something that he didn't know about it (I call primitive the person not the job title), and the best part is that the idiots not only they cut the wire at 3 places they also took part of it out of the ground and then they filled the holes back! Now I won't have internet for 2 fucking weeks, yes in 2018 this is happening, at that moment I was so pissed, but kept my cool and contacted the ISP to give me LTE USB stick to use it for the next 2 weeks, sadly they couldn't do that wtf??? So I asked politely who will pay the damage for me not working for 2 weeks and they said that they will gladly pay the damage.. So I was confused because that literally meant that they will compassed me for the 2 weeks, so I re-asked are they sure about that and they said yes, so lets see what it will be done, in the meantime I solved the internet problem by using my phone to access internet on the PC.. But still its amazing how primitive people can be and how ISP don't have alternative solutions for such cases, just to point out this sam ISP bragged how they will be among the first to bring 5G when it arrives... LOL4 -
At work we have to split a potentially large ID into 2 10-digit long parts that will be passed to an outside system that will later return them with some more data to us.
A colleague had implemented it using regular expression, it passed code review, everything was ok, until he noticed a potential problem. For some cases, because the outside system stores them as int and therefore will remove any leading zeros, there will be no way to reconstruct the number.
So we brainstorm and I propose ether a modified regex, or to just use math like part1 = id % 10^10 and part2 = floor(id % 10^10) and then we can reconstruct it simply by: part2 * 10000000000 + part1
Colleague: - Well, the regex will be faster, there won't be any calculations
Me: - :| I disagree but ok..
We do some more brainstorming and testing and find a case where the proposed new regex fails as well
So I bring up my previous proposal, I explain what exactly it does.
Colleague: - I don't like the math, it has calculations, which won't be needed before we reach the 11th digit
Have I missed some major development in computer hardware? When did they become bad/slow at doing math? :|8 -
Kinda pissed. Ordered a WD red plus 8TB on November 20th from newegg along with some other stuff. He drive showed up DOA on the 26th, tested everything I could to make it work. But in the end I couldn't even get it to initialize.
Ok. No problem this happens. request a return and replacement.
Got that in today. Over 2 weeks later. Fucking EXACT same problem.
and just to make sure I'm not fucking crazy I grabbed a 1tb thats been sitting on my desk unused for years. Plugged that into my NAS. Works fucking perfectly. Even able to pull it and wipe it using my USB drive reader on my desk after. I can even fucking reinitilize it back and forth from mbr to gpt.
Not asking for replacement this time. Just refund. Gonna order directly from WD. If this one fucks up I'm switching to Seagate for a couple of years4 -
"When you hit 10 joins, you should contemplate your life choices. By the time you hit 15 joins, you've just entered the realm of no return." - Me when I find out that a query I've got a ticket for(because it's taking too long) has 18 joins to tables with no indexing at all.5
-
Fuck Wordpress, Fuck Wordpress's PHP
I'm so fucking tired of everything in this godforsaken CMS. Import a JS File? Sure, just add a *completely obvious* line into a very specific PHP File, where you'll have to specify a lot of "useful" parameters. No, I somehow DON'T want to specify that I don't wand jQuery in every import. And don't even get me started on Content Delivering. Embed CSS? Sure, just write the fucking whole path to the file, or use the broken get_stylesheet_uri() Function. Embed an Image? Sure, let me just go to the Backend and wait 6 Minutes for this bullshitty System to upload the image and then copy the hard-coded Link. Oh, you want to remove googleapi embeds? Sure, let me just fuck up your whole Website in return.
You want jQuery? Well instead of using the "$" Symbol, you have to use the jQuery() Function. Except when you don't have to, which is 100% random each time you reload the page. Oh, you actually did import a JS File? Sure, let me just not run it. Thank you fucking piece of shit thats calling itself "WordPress" and fuck you and everyone whos actively encouraging its usage1 -
I really love my mother but.
A couple of weeks ago she asked me for advice regarding a laptop. She wanted something cheap for office and stuff.
Since I know her I exactly knows she needs extreme fast boot and responsiveness. She'll go all hulk rage if the laptop doesn't boot in less than 30 seconds.
Told her to get something with ssd since storage is no issue and 4gb ram with an decent older I5. Took a whole day going through stores in my area and online to find good deals. Send her everything I found. Really good laptop for under 500€ I would've killed for.
Fast forward. She bought some 300€ shit laptop because it had 1tb memory. She didn't ask for advice just bought the cheapest that would read decently description wise.
Now she is raging all day and bitching about it being so slow and I should fix it for her since I'm an it guy etc.
Looking at the specs I nearly started to vomit. She seriously bought a laptop worse than she already had. Old i3 2gb ram 5200rpm HDD.
I told her she should return it because it is shit. But no. She insists that since it's newer it is better and I am only a lazy fuck who doesn't want to be bothered to do her a favor.
Offered the best thing I could think of. Told her I'd install Linux on it for her and teach her how to use it.
Explained it would run more smoothly since she refused to take that shit laptop back. But no. Of course she insists on using windows 10....
FUUUUUUUCK. I love my mother but seriously I'm about to explode.5 -
So at work, there is this class/model thing that's for storing translated strings. It also supports n-level nested macros, cascading lookup (e->d->c->b->a->blank), and I've added transforms too. The code is a bloody mess and very inefficient (legendary dev's code), but it's useful.
You call methods with a symbol representing one of the strings, and it does... whatever you ask, like return text, booleans, expand macros and submacros, pass in data to interpolate, etc.
But I just learned something today.
Its `.html` method... doesn't support html. In fact, calling it strips out all html, takes whatever is left, and attempts to convert that back into html. Because that makes so much sense. So, if you have an html string? Don't call html on it.
Also, macros use the same <angle brackets> as html tags, and macro expansion eats unknown macros, so... you can't mix html and macros, meaning you cannot inject values into your markup. That's a freaking joy to work around. (You end up writing a parser every time.)
So no, if you have an html string, you need to get the raw data out and handle it yourself. Don't reach for that shiny .html method; it'll just ruin your day.
It's the little things that make my day so terribly long.rant it really isn't so bad principle of most surprise poor design but it could be ever so much better8 -
debugging a performance issue. basically the original dev had no idea what a database was for. system was generating millions of buffered reads, and paging horribly.
to see if an id existed they had done the following:
fetch all 1 million rows into an array.
iterate the array looking for a match.
if found, set found=true
continue to iterate the rest of the array.
return found.
repeat at every login.
replaced with
return person.get(id)
set world record for most i/o avoided with one liner.1 -
$test = TRUE;
$baby = TRUE;
$egg = 1
$sperm = 1;
if ($test != 'TRUE') {
print "No Baby.";
} else {
foreach($eggs as $egg)
{
$baby = count($egg + $sperm);
return $baby;
printf("Congratulations");
}
}10 -
In Rx, what is the point of returning Single for all of our networking request responses, if every call to that method, first of all converts it to an Observable so that it can use flatMap, filters, combineLatest etc.
I get that Observable's have more overhead, Single can only return once, thats all clear. But is it not MORE overhead to create a Single, return it, convert it and now have the Observable we were trying to avoid in the first place.
I don't know if its just Rx I don't like, or how the team here is using it. But it is pissing me off, to no end, how massively overly complicated this is. It really feels to me like this is following a textbook approach while ignoring all the practical details.
<rant>
Next person to say "because its the Rx way", is getting a monitor thrown at their head.
</rant>6 -
Please fucking tell me there's a better cleaner way to write this render() function?
The use of so many "in-line" code evaluations, arrow functions, (), {}, ...
Just spent like probably 30 minutes just trying to figure out what closes what...
And the author is inconsistent?
Sometimes he uses map( location => { return ... })
other times he uses setState((prevState) => ({ key: this.state.keyValue}))
And there's no note as to why... are they interchangeable, used in specific cases, does it matter????!!!!!!
Or is he just trying to demonstrate 1000 different ways you can say the same thing in JS?
!@#!#@!$#%#$!@#!@#!#$$%30 -
Our team (devs and QAs) have been doing a series of overtime work.
So, the company has provided us a place to sleep. Everyday, we would go to work at 10AM and then return to our place to rest at 12 midnight (sometimes at 2AM).
We've been doing this for a week now and we'll resume again tomorrow.
I already feel exhausted, and I was thinking of resigning after all of this mess was over.
However, I am having second thoughts. Since this is my first job, I have no point of comparison.
Perhaps a series of overtime like this one is normal? Is this type of work environment to be expected when being a developer? Or am I selling my self short and there are better options out there? What do you devs think?12 -
Long-time, no-rant.
I use Linux everywhere all the time. I'm not a huge gamer, but I like a few titles. Most run in Wine or can be made to run with effort in a VM. No biggie.
What I want to know from mobile/game devs is (sorry for ridiculously compound logic in non-lang):
IF you== gamedeveloper && you.haz({shitty}iOS_App) && you.haz({shitty}Android_App) &&
you.haz({shitty}WinXXX_App) && you.haz({shitty}MacOS_App):
THEN:
why(!you.haz({any}Linux_App))
return(excuse.shitty());
That. is. all. read on.3 -
Once upon a time i had a great idea.
Because i couldnt be bothered to do anything productive i created a simple app in the C# that would look into every .js file (from a game that uses it for the gui/main menu) and search for "//todo" lines.
I did it mostly for kicks. I got that idea when i encountered one //todo in a file when i was trying to mod that game.
Yes i know grep exists: fuck you.
It would have taken me more time to learn that than to write that 20 line program...
The result? Over 30 lines of //todo with some briliant pearls in the type of:
>Temp workaround because X
>Workaround for race condition
>Clean that up
>Obsolete
When i return home i will post real quotes. They might be amusing to read...
The game is based on a custom C++ engine. HTML, CSS and JS is used for main menu and some graphical interface in game.
The most amusing thing is that this inefficient sack of chicken shit is powering one of the biggest (no playerbase but unit, world, gameplay vise) rts that i have ever played.
But still in spite of a dead community, buggy gui as shit and other problems i love this game and a lot of other people love it too. It is a great game when it works correctly.
To the interested: JS portion uses jquerry and knockout lib.14 -
Existing code:
Logger class would block the caller, lock a mutex, call CreateFile(), write a single line to the file, unlock the mutex and return.
Improvement:
Added two logging queues and created a thread that will periodically lock one queue and write it to the disk, around 500 entries at a time, while new entries are being inserted into the other queue. Kinda like a bed pan or urine bottle. While emptying one bottle, the logs go into the other one. Added fatal exception handlers so that the log queues are dumped when the application is crashing. When the exception handler is triggered, logging method does not return so that the application STOPS working to make sure there are no "not logged" activities.7 -
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 -
JavaScript is new the PHP.
Reading a stackoverflow question about async functions and await-usage, and lot of well-intended answers show no understanding of the concept. Some fail to understand that the scope is about promises. They don't know that, yes, *every* async function *always* returns a Promise and that within an async function it's synctically the same to do either `return x` or `Promise.resolve(x)` or `return new Promise((resolve) => {resolve(x)}), and they fail to realize what await does or doesn't do and are oblivious about how awaiting at certain stages can have huge performance impact when compared to either Promise.all or Bluebird.map.
Grasping promises is hard in the beginning, I get that. But please don't share your lack of understanding as fact. -
Can't wait until I'm done at my current workplace (about a month left). I've had enough of this fucking shitty ass ancient ASP.Net ERP-system and employer.
For the system:
1. The build times are horrendous and eats up all CPU power.
2. The "classic" UI and UX is absolute garbage. If I was an accountant, I would go nuts trying to invoice someone. Companies pay millions to use this garbage.
3. Besides the "classic UI", there is a mishmash of different JS frameworks plastered on top.
4. Absolute no fucking technical documentation whatsoever
5. The in-house relational database is a mess, no relations, entirely denormalized, no documentation.
6. The frontend is structured in HTML tables with iframes inside <td>
The company:
1. If you're a implementation consultant and you quit your job, you get stripped off all your projects, you won't get to join anything social and you're placed on 1st line support for three months. They might as well force them out.
2. Anyone can work from home anytime they feel like it without any valid reasons, and believe me they do.
3. The senior devs are overworked as all hell. By the end of the year, some of them have hundreds of flextime hours and won't get anything in return.
4. The CEO seems like a jolly guy, but when you quit, he doesn't like you at all. He also acts like a bigshot, always getting driven around meetings when there is literally a very good metro network in this city.9 -
TLDR; College group projects suck, not because the work, but the people in your group will make or break you. Fuck having 1 week to do this assignment.
Sometimes working with other students on group projects is great, they actually know how to create a merge a git branch. I've had a decent partner once during my 3 years at university so far. This last project takes the cake on idiots I've worked with...so far at least... It was me and two others, we'll call them Thing1 and Thing2 for now. Anyway so the 3 of us had a week to implement a very rudimentary Invoice system; fine, easy enough. We divided up the work and 'started'.
All seemed to be going well, no complaints or cries for help all week. Until 4 hours before we submit the assignment; Thing 1 sends me a DM saying all of Thing 1's work is useless full of bugs and just shouldn't be integrated with the rest of the code. Umm fine? I guess? wtf?! why did this have to come out last minute?! We could have explained to Thing 1 what's going on and gotten him/her up to speed on everything. Believe it or not, I was sorta ok with this? I mean thing 1 hadn't pushed anything to the repo yet. I mean literally nada, Thing 1 is a collaborator on the repo that has contributed nothing. Seeing as how Thing 1 was contributing nothing I had already started to cover our ass a began Thing 1's work.
That's not even what's pissed me off... at least thing 1 had the gall to message me to say "idk..wtf is going on...continue without me". Thing 2 arguably made my time with the project worse. His code was nothing but garbage...every time...literally spent more time deciphering his incoherent bullshit more than I did rewriting his mess. I shit you not he wrote out this method, and tells the group he's "finally got it fixed and working":
public static float updateTotal(float newValue)
{
total = updateTotal(newValue);
return total;
}
How tf did he test this to see if its working?! I'm a novice and can already see the infinite loop here. You called your method within that method's own definition, what did you expect to happen.
I managed to get things 75% working and turned in 5 mins before the cut off.
Thankfully Thing 1 emailed the Proff as well, hopefully he won't tank my grade too bad. I'm so glad to be done with this assignment, fingers crossed there's no more group work.4 -
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 -
Windows 10 updating, decides it would be cool to install gigabytes of sdk, edge, and other bloatware without asking first, on a metered connection i use for work.
Guys, between you there and those fanboy demons in cupertino, one wants to just shut it all off and return to monke.
Sidenote this, because all of this nonsense started on that crap called Windows 8, which was in the end caused to copy that Unholy crap (sold as gold) that is Apple's range of products. It's a company that sells designs nowadays, like Prada, to say, Jobs era is long gone. Everything related to Apple, Mac, Safari, Development, Gaming, UI/UX, productivity and whatever is a
f***ing Nightmare.
We alreay have a global plague, and Apple exists, we dont' need you too making another catastrophe.
All this said,
Use your goddamn trillions to create your own customizable environment that is stable, fast, and WITHOUT BULLSHIT.
I don't give a mindflying F**k of the blurs, i know how to place them with a shell, if i need those. I want control, the shit i decide is going to happen, to happen fast.
This is of Critical importance, because it defines my productivity. And considering we're all sealed indoors since 2019, i want to get away from my pc asap and live my life, instead of spending time(and money, in this moment of emergency) fixing your F**kfests, or else seeing my pc slowing down to death.
First: IF i want stuff on my pc, I know how to install something, thank you.
Second: You can take it, all your Useless - Bugged as Hell - Nonsensical - and of no practical use Bloatware, and shove it deep in your Backdoor.
I'll debloat my pc with batches again, and there's nothing you can do to stop me doing that at every update you force me into.
So please, stop wasting my time, and yours.4 -
Anyone here knows whether this is valid?
This is the default code for a new Visual Studio C++ Console Project.20 -
Today after longer vacation I came back to work.
Edit: wrote this rant long time ago, but never finished. Was too pissed.
Some easy meetings, then wanted to start on an easy job.
Just migrating some things from bash regex voodoo to proper tools like JQ.
Finished in roughly 1 h. Lovely.
Made some tea, ate some cookies.
Set up dev environment, found no documentation what so ever, got it running after half an hour.
Annoying, but ok.
Then I tried my scripts...
They worked... Except they didn't.
Console log empty, response code 200 with state: GENERATE_NO_FILES.
Eh. Fuck you. Just fuck you.
Fixed the logging configuration, which was broken since uhm... 2 years plus?
Well... Another half another hour gone...
Kinda pissed now.
Still script return failed...
Poking and trying to sprinkle debug all over that shit cause everything seems ... An incohesive, inconsistent diarrhea.
3 hours later...
Made the ticket to rewrite it.
I did nothing wrong at all.
The API just has no workflow at all. The
*seperate* API calls have to be in an **specific** order - as otherwise the generation will fail, as the prerequisites for the generation are not fulfilled.
Yeah. Completely logical. Especially not to give out any kind of warning or an error message like requirements not met, blablabla.
I drank that evening 2 six packs of beer. I was raging mad....
Then gave that shit to another manager, as I never want to touch that nuclear waste again....
How can someone be so brain damaged -.-1 -
promises in JavaScript have really spoiled me
it's the most optimal way to do async without leaving much on the table
there's a promises library in rust and the guy who wrote it says it sucks because it spawns new thread every time you execute a bunch of promises
and I finally, through my fogged brain, managed to get the bright idea to write what I want to make in rust in JavaScript and holy hell it's sexy to work with promises. there's no performance left on the table. you do things as fast as possible
but if I take this JavaScript usability code I made and make it possible syntax-wise in rust I don't see how I would be able to do it without starting new operating system threads every time I execute any promises (or set)
I can take the overhead hit but this sounds retarded
and this isn't even touching upon how in rust everything needs to have a predetermined data type. so you can do lambdas and capture variables and send in variables into a thread that way, but to return the return object must be a consistent type (synchronizing the order data was sent in to the data sent out aside, haven't written that yet should be fine though)
which is fine if you are making a threadpool and it'll all be returning one data type
but this means you can't reuse a threadpool you made elsewhere in the program
the only thing that could fix async is to literally be compiler-enabled. it would have to work like generics and automatically make an enum of every type that can return, and only then could you re-use the threadpool23 -
I need some opinions on Rx and MVVM. Its being done in iOS, but I think its fairly general programming question.
The small team I joined is using Rx (I've never used it before) and I'm trying to learn and catch up to them. Looking at the code, I think there are thousands of lines of over-engineered code that could be done so much simpler. From a non Rx point of view, I think we are following some bad practises, from an Rx point of view the guys are saying this is what Rx needs to be. I'm trying to discuss this with them, but they are shooting me down saying I just don't know enough about Rx. Maybe thats true, maybe I just don't get it, but they aren't exactly explaining it, just telling me i'm wrong and they are right. I need another set of eyes on this to see if it is just me.
One of the main points is that there are many places where network errors shouldn't complete the observable (i.e. can't call onError), I understand this concept. I read a response from the RxSwift maintainers that said the way to handle this was to wrap your response type in a class with a generic type (e.g. Result<T>) that contained a property to denote a success or error and maybe an error message. This way errors (such as incorrect password) won't cause it to complete, everything goes through onNext and users can retry / go again, makes sense.
The guys are saying that this breaks Rx principals and MVVM. Instead we need separate observables for every type of response. So we have viewModels that contain:
- isSuccessObservable
- isErrorObservable
- isLoadingObservable
- isRefreshingObservable
- etc. (some have close to 10 different observables)
To me this is overkill to have so many streams all frequently only ever delivering 1 or none messages. I would have aimed for 1 observable, that returns an object holding properties for each of these things, and sending several messages. Is that not what streams are suppose to do? Then the local code can use filters as part of the subscriptions. The major benefit of having 1 is that it becomes easier to make it generic and abstract away, which brings us to point 2.
Currently, due to each viewModel having different numbers of observables and methods of different names (but effectively doing the same thing) the guys create a new custom protocol (equivalent of a java interface) for each viewModel with its N observables. The viewModel creates local variables of PublishSubject, BehavorSubject, Driver etc. Then it implements the procotol / interface and casts all the local's back as observables. e.g.
protocol CarViewModelType {
isSuccessObservable: Observable<Car>
isErrorObservable: Observable<String>
isLoadingObservable: Observable<Void>
}
class CarViewModel {
isSuccessSubject: PublishSubject<Car>
isErrorSubject: PublishSubject<String>
isLoadingSubject: PublishSubject<Void>
// other stuff
}
extension CarViewModel: CarViewModelType {
isSuccessObservable {
return isSuccessSubject.asObservable()
}
isErrorObservable {
return isSuccessSubject.asObservable()
}
isLoadingObservable {
return isSuccessSubject.asObservable()
}
}
This has to be created by hand, for every viewModel, of which there is one for every screen and there is 40+ screens. This same structure is copy / pasted into every viewModel. As mentioned above I would like to make this all generic. Have a generic protocol for all viewModels to define 1 Observable, 1 local variable of generic type and handle the cast back automatically. The method to trigger all the business logic could also have its name standardised ("load", "fetch", "processData" etc.). Maybe we could also figure out a few other bits too. This would remove a lot of code, as well as making the code more readable (less messy), and make unit testing much easier. While it could never do everything automatically we could test the basic responses of each viewModel and have at least some testing done by default and not have everything be very boilerplate-y and copy / paste nature.
The guys think that subscribing to isSuccess and / or isError is perfect Rx + MVVM. But for some reason subscribing to status.filter(success) or status.filter(!success) is a sin of unimaginable proportions. Also the idea of multiple buttons and events all "reacting" to the same method named e.g. "load", is bad Rx (why if they all need to do the same thing?)
My thoughts on this are:
- To me its indentical in meaning and architecture, one way is just significantly less code.
- Lets say I agree its not textbook, is it not worth bending the rules to reduce code.
- We are already breaking the rules of MVVM to introduce coordinators (which I hate, as they are adding even more unnecessary code), so why is breaking it to reduce code such a no no.
Any thoughts on the above? Am I way off the mark or is this classic Rx?16 -
Salesforce. Although I wasn't involved in the purchase or the implementation, I spent many 100 hour weeks dealing with the crapshoot of an implementation. A large company abused that software to the point of no return. They used that thing for everything, and then they didn't even use it right for the one thing salesforce is good at. So I guess I don't have anything against salesforce itself besides its scalability issues, custom SOQL syntax, user model, and pricing. I'm more upset about the salesforce developers/business owners that decided it was okay to use salesforce for things it was never meant for, like inventory, project management, 3rd party sales team, and so many other things that caused what should have been sub-second queries to take 30 to 60 seconds.
-
So this web company i joined had a page load time in minutes. The free text search (inverted index search, based on elasticsearch) queries would return results in 10-45 seconds (should be milliseconds always). The indexes had no schema. And they would crawl data and feed into mssql db, which had a 2 gb/db limit on the free version. So everytime the db hit the limit, a new db was created and the name was incremented by one.
Had a very tough time cleaning up that mess. Plus the architect who had made this architecture was on his way out and unhelpful to the core.
What was worse was that most of the changes i did were very simple changes that should have been done long back. Basic sanity changes.4 -
+1 if you are interested in Augmented Reality technologies, have some presentations and assignments made and you are writing your Master thesis for Augmented Reality only to find yourself working for a company that wants from you to update somehow a project with 5 years old code written from some secret antisocial society that hates readability and you as a developer and a human being and wants from you to somehow understand why they call C# method only to return a string that contains all the html tags but no data and then insert the data in JavaScript splitting the same string.
Come on, give me a break! I m still trying, though I still haven't found where exactly the program learns the data to insert or it just knows (no questions asked)...6 -
In my previous rant i complained about no irregular sprite collision detection libraries.
So after messing up with curves and line in p5.js I gave up on creating the fish like a complete caveman.
I wrote a simple vector paint program which can return the set of points on console logging, and here is the result5 -
Part 2 Of the StackOverFlow rant.
He still didn't accept my answer and commented something that even I don't know what the fuck he wants. Maybe you can fix your fucking grammar and it'd be easier to understand and solve your issue. 1 Hour later guess what he gets downvoted to -5, Gets his question Closed for Off-Topic and I end up being downvoted too. WTF. I answered his questions and instead, I'm getting downvoted because I answered on an "Off-Topic" Question. I seriously give up on Helping other people because no matter ho hard i try it ends up being a waste of time and you get nothing in return... Fuck the StackOverflow Community.1 -
How f*cked does a code base have to be until you jump ship? I got a new job recently and been working there for about 4 months. It's a big company and there's ways to move around internally.. but holy cow the code is bad. It almost seems beyond the point of no return... Almost like a totaled car.13
-
So today is my last day working in [censored] company. Even though today is the last day and they have my replacement, they still expect me to complete the project 'NOW'. So I decided to make it quick the way it supposedly was. He wanted me to do tonnes of adjustments.
To prevent me from getting more stressed over satisfying my boss' requirements or meeting my boss' expectations, I made the app return the screenshot of the design. So I screenshot the design and render it to the app. So far that's the fastest route I can think of.
I really do not want to do this. But he left me no choice due to his impatient and adamant behaviour. That's why I decided to haste the project by returning the screenshot. (To be honest, this is unprofessional and dishonest, but he left me no other choice to violate my principles).
We argued about the negotiation with regard of the timeline for the deliverance of the project, I proposed 6 months countless times. He constantly denied that I did not negotiate with him. Unfortunately, the 'negotiation' defined by his action is merely a projection of an illusion of negotiating, but whatever is discussed on the table will deliberately fall into his idea and unrealistic high expectations.
Working in this company caused me damages beyond repair. My 4 weeks in this company were my worst nightmare. I don't get enough sleep due to the constant stress from the employer to complete the project in the 'immediately' phase. I brought these issues afore the table for the discussion. He simply deny it and blame it all on me, saying 'that it was my own negligence, to the company. I do not subscribe to his methodology of handling stress, by working more and contributing more to the company as passionate as possible. I am passionate about what I do and my position, what I do not passionate about is being unreasonable, ignorant, delusional and inhumane.
I learnt my lesson now. I vow to myself that In the future if I have the opportunity to be a team leader, my former employer is not and never be someone who can be my role model as a leader.
Refer: https://devrant.com/rants/5379920/...4 -
It was five years ago tomorrow when Greta predicted the end of the world. Enjoy your last day on Earth today. ;-) We are at the point of no return.
She deleted her tweet. Wonder why?
(bracing for impact)30 -
So the project I work on basically has to talk to a 3rd party plugin, through a 3rd party framework. The 3rd party plugin is a black box. This conversation happened:
Software guy: so we aren't sure what is breaking the thing. It's either us or the plugin, but it's probably both.
Systems guy: well then if we aren't sure then why are we writing an issue for it.
SWG: because we aren't sure but we know we are doing at least something that contributes. We read int X from a table and put it into a float. X doesn't perfectly represent in a float. It comes out X.0001. Then they take it and when it comes back it comes back as Y.0001. We cram it into an int so it becomes Y, we compare it to X which is really X.0001 and it comes back invalid.
SG: well as long as we are sending them the right number . . .
SWG: but we aren't sending them the right number. They are expecting X not X.0001. Then they send us back Y.0001 but it should be X so it's wrong.
SG: so they're giving us the wrong return value.
SWG: yes, but because we're giving them the wrong number.
SG: well not exactly . . .
SWG: yes exactly. It is off by .0001 because of floating point math.
SG: well . . .
Me: look it doesn't matter how it's breaking. But it IS broken. Which is why we're filling out the damn problem report. THEY ARE EDITABLE. We talked to the customer and gave them the risk assessment. They don't care. It happens rarely any way.
SG: then can we lower the severity?
Me: no. Severity doesn't relate to risk. That is a whole different process. Severity assumes it has already happened. It's a a high severity.
SG: but the metrics.
Me: WE GIVE THE METRICS TO THE CUSTOMER. WE TALKED TO THE CUSTOMER. THEY DON'T GIVE A SHIT.
And that was how I spent Wednesday wondering how a level 4 lead systems engineer got his job. How many push ups did he do? What kind of juice did he drink?2 -
For some reason I keep over engineering stuff to the point I spend 2 hours thinking the best way to do something. I'm making the backend for a project of mine and I wanted somewhat decent error handling and useful error responses. I won't go into detail here but let's say that in any other (oo) language it would be a no-brainer to do this with OOP inheritance, but Rust does OOP by composition (and there's no way to upcast traits and downcasting is hard). I ended up wasting so much time thinking of how to do something generic enough, easily extendable and that doesn't involve any boilerplate or repeated code with no success. What I didn't realize is that my API will not be public (in the sense that the API is not the service I offer), I'm the only one who needs to figure out why I got a 400 or a 403. There's no need to return a response stating exactly which field had a wrong value or exactly what resource had it's access denied to the user. I can just look at the error code, my documentation and the request I made to infer what caused the error. If that does not work I can always take a quick look at the source code of the server to see what went wrong. So In short I ended up thrashing all the refactoring I had done and stayed with my current solution for error-handling. I have found a few places that could use some improvement, but it's nothing compared to the whole revamp I was doing of the whole thing.
This is not the first time I over engineer stuff (and probably won't be the last). I think I do it in order to be future-proof. I make my code generic enough so in case any requirements change in the future I don't have to rewrite everything, but that adds no real value to my stuff since I'm always working solo, the projects aren't super big and a rewrite wouldn't take too long. In the end I just end up wasting time, sanity and keystrokes on stuff that will just slow down my development speed further down the road without generating any benefits.
Why am I like this? Oh well, I'm just glad I figured out this wasn't necessary before putting many hours of work into it. -
Yay, life's picked up, feeling better about everything.
My mate fucks up my bike beyond the point of no return, and it's my only transport for interviews.
I'm going to rip his knees apart with a knife then shoot myself4 -
Overall, pretty good actually compared to the alternatives, which is why there's so much competition for dev jobs.
On the nastier end of things you have the outsourcing pools, companies which regularly try to outbid each other to get a contract from an external (usually foreign) company at the lowest price possible. These folks are underpaid and overworked with absolutely terrible work culture, but there are many, many worse things they could be doing in terms of effort vs monetary return (personal experience: equally experienced animator has more work and is paid less). And forget everything about focus on quality and personal development, these companies are here to make quick money by just somehow doing what the client wants, I'm guessing quite a few of you have experienced that :p
Startups are a mixed bag, like they are pretty much everywhere in the world. You have the income tax fronts which have zero work, the slave driver bossman ones, the dumpster fires; but also really good ones with secure funding, nice management, and cool work culture (and cool work, some of my friends work at robotics startups and they do some pretty heavy shit).
Government agencies are also a mixed bag, they're secure with low-ish pay but usually don't have much or very exciting work, and the stuff they turn out is usually sub-par because of bad management and no drive from higher-ups.
Big corporates are pretty cool, they pay very well, have meaningful(?) work, and good work culture, and they're better managed in general than the other categories. A lot of people aim for these because of the pay, stability, networking, and resume building. Some people also use them as stepping stones to apply for courses abroad.
Research work is pretty disappointing overall, the projects here usually lack some combination of funding, facilities, and ambition; but occasionally you come across people doing really cool stuff so eh.
There's a fair amount of competition for all of these categories, so students spend an inordinate amount of time on stuff like competitive programming which a lot of companies use for hiring because of the volume of candidates.
All this is from my experience and my friends', YMMV.1 -
Today, I have installed/uninstalled a combination of [windows 7, arch linux, dual-boot] a total of 9 times...
I wouldn't be surprised if my 120G SSD fails next week
It all started when I had to whip up a GUI-wrapped youtube-dl based program for a windows machine.
Thinking a handy GUI python library will get it done in no time, I started right away with the Kivy quick-start page in front of me.
Everything seemed to be going fine, until I decided it would be "wise" to first check if I can run Kivy on said windows machine.
Here I spent what felt like a day (5 hours) trying to install core pip modules for kivy.. only before realizing my innocent cygwin64 setup was the reason everything was failing, and that sys.platform was NOT set to "win32" (a requirement later discovered when unpacking .whl files)
"Okay.. you know what? Fuck........ This."
In a haze of frustration, I decided it was my fault for ever deciding to do Python on windows, and that "none of this would've happened if I were installing pip modules on a Linux terminal"...
I then had the "brilliant" idea of "Why don't I just use Linux, and make windows a virtual machine within, for testing."
And so I spent the next hour getting everything set up correctly for me get back to programming.... And so I did.
But uh... you're doing GUI stuff, right? -> Yeah...
And you uh.. Kivy uses OpenGL on windows, doesn't it? -> Yeah..?
OpenGL... 2.
-> Fuck.
That's when I realized my "brilliant" idea, was actually a really bad prank. Turns out.. I needed a native windows environment with up-to-date non-virtual graphics drivers that supported at least OpenGL2 for Kivy GUI programs!
Something I already had from square 1.
And at this point, it hurts to even sigh knowing I wasted hours just... making... poor decisions, my very first one being cygwin64 as a substitution for windows cmd.
But persistent as any programmer should be in order to succeed, I dragged my sorry ass back to the computer to reinstall windows on the actual hardware... again.
While the windows installer was busy jacking off all over my precious gigabytes (why does it need that much spaaace for a base install??? fuck.). I had "yet another brilliant idea" YABI™
Why not just do a dual-boot? That way, you have the best of both worlds, you do python stuff in Linux, and when it's time to build and test on the target OS, you have a native windows environment!
This synthetic harmony sounded amazing to the desperate, exhausted, shell of a man that I had become after such a back-breaking experience with cygwin
Now that my windows platter with a side of linux was all set-up and ready-to-go, I once again booted up windows to test if Kivy even worked.
And... It did!
And just as I began raising my victory flags, I suddenly realized there was one more thing I had to do, something trivial, should take me "no time" to do, being in a native windows environment and all.................... -.- (sigh)
I had to make sure it compiles to a traditional exe...
Not a biggy, right? Just find one of those py2exe—sounding modules or something, and surprisingly enough, there was indeed a py2exe—sounding module, conveniently named... py2exe.
Not a second thought given, I thought surely this was a good enough way of doing it, just gonna look up the py2exe guide and...
-> 3 hours later + 1 extra coffee
What do you meeeeean "module not found"? Do I need to install more dependencies? Why doesn't it say so in the DAMN guide? Wait I don't? Why are you showing me that error message then????
-------------------------------
No. I'm not doing this.
I shut off my computer and took a long... long.. break.
Only to return sometime the next day and end up making no progress, beating my SSD with more OS installs (sometimes with no obvious reason to do so).
Wondering whether I should give up Kivy itself as it didn't seem compatible with py2exe.. I discovered pyInstaller, which seemed to be the way Kivy wants exe's to be made on windows..
Awesome! I should've looked up how Kivy developers make exe's instead of jumping straight into py2exe land, (I guess "py2exe" just sounded more effective to me then)
More hours pass, and you'd think I'd have eliminated all of my build environment problems by now... but oh, how wrong you'd be...
pyInstaller was failing, and half the solutions I found online were to download some windows update KB32946..whatever...
The other half telling me to downgrade from Python 3.8.1 to Python 3.8.0000.009 (exaggeration! But you get the point)
At the end of all that mess, I decided it wasn't worth some of my lifespan, and that maybe.. just maybe.. it would've been better to create WINDOWS GUI with the mother fuc*ing WINDOWS API.
Alright, step 1: Get Visual Studio..
Step 2: kys
Step 3: kys again.6 -
function toCodeOrNotToCode() {
if (!isset($coffeeOrRedbull)) {
die('No work can be done');
} else {
return true;
}
}
// I don't drink Redbull daily4 -
After learning a bit about alife I was able to write
another one. It took some false starts
to understand the problem, but afterward I was able to refactor the problem into a sort of alife that measured and carefully tweaked various variables in the simulator, as the algorithm
explored the paramater space. After a few hours of letting the thing run, it successfully returned a remainder of zero on 41.4% of semiprimes tested.
This is the bad boy right here:
tracks[14]
[15, 2731, 52, 144, 41.4]
As they say, "he ain't there yet, but he got the spirit."
A 'track' here is just a collection of critical values and a fitness score that was found given a few million runs. These variables are used as input to a factoring algorithm, attempting to factor
any number you give it. These parameters tune or configure the algorithm to try slightly different things. After some trial runs, the results are stored in the last entry in the list, and the whole process is repeated with slightly different numbers, ones that have been modified
and mutated so we can explore the space of possible parameters.
Naturally this is a bit of a hodgepodge, but the critical thing is that for each configuration of numbers representing a track (and its results), I chose the lowest fitness of three runs.
Meaning hypothetically theres room for improvement with a tweak of the core algorithm, or even modifications or mutations to the
track variables. I have no clue if this scales up to very large semiprime products, so that would be one of the next steps to test.
Fitness also doesn't account for return speed. Some of these may have a lower overall fitness, but might in fact have a lower basis
(the value of 'i' that needs to be found in order for the algorithm to return rem%a == 0) for correctly factoring a semiprime.
The key thing here is that because all the entries generated here are dependent on in an outer loop that specifies [i] must never be greater than a/4 (for whatever the lowest factor generated in this run is), we can potentially push down the value of i further with some modification.
The entire exercise took 2.1735 billion iterations (3-4 hours, wasn't paying attention) to find this particular configuration of variables for the current algorithm, but as before, I suspect I can probably push the fitness value (percentage of semiprimes covered) higher, either with a few
additional parameters, or a modification of the algorithm itself (with a necessary rerun to find another track of equivalent or greater fitness).
I'm starting to bump up to the limit of my resources, I keep hitting the ceiling in my RAD-style write->test->repeat development loop.
I'm primarily using the limited number of identities I know, my gut intuition, combine with looking at the numbers themselves, to deduce relationships as I improve these and other algorithms, instead of relying strictly on memorizing identities like most mathematicians do.
I'm thinking if I want to keep that rapid write->eval loop I'm gonna have to upgrade, or go to a server environment to keep things snappy.
I did find that "jiggling" the parameters after each trial helped to explore the parameter
space better, so I wrote some methods to do just that. But what I wouldn't mind doing
is taking this a bit of a step further, and writing some code to optimize the variables
of the jiggle method itself, by automating the observation of real-time track fitness,
and discarding those changes that lead to the system tending to find tracks with lower fitness.
I'd also like to break up the entire regime into a training vs test set, but for now
the results are pretty promising.
I knew if I kept researching I'd likely find extensions like this. Of course tested on
billions of semiprimes, instead of simply millions, or tested on very large semiprimes, the
effect might disappear, though the more i've tested, and the larger the numbers I've given it,
the more the effect has become prevalent.
Hitko suggested in the earlier thread, based on a simplification, that the original algorithm
was a tautology, but something told me for a change that I got one correct. Without that initial challenge I might have chalked this up to another false start instead of pushing through and making further breakthroughs.
I'd also like to thank all those who followed along, helped, or cheered on the madness:
In no particular order ,demolishun, scor, root, iiii, karlisk, netikras, fast-nop, hazarth, chonky-quiche, Midnight-shcode, nanobot, c0d4, jilano, kescherrant, electrineer, nomad,
vintprox, sariel, lensflare, jeeper.
The original write up for the ideas behind the concept can be found at:
https://devrant.com/rants/7650612/...
If I left your name out, you better speak up, theres only so many invitations to the orgy.
Firecode already says we're past max capacity!5 -
The worst is on an ATM Card,
"This ATM card is property of the bank if found please return it"
No place to explain how to use it2 -
=== Was in my room when the conversation started. Thought it was a joke until i heard a knock on my door ===
[Mom:] Hey Julie, i need you to top up my PC.
[Julie(My kid Sis):] You mean update?
[Mom:] No silly, upgrade! I already have a windows 7 pro and i have just bought the disk for Windows 8 and 10 pro.
[Julie(My kid Sis):] Which should i install first.
[Mom:] You can first install the windows 10 so i can have a windows 17 pro then install the 8 to sum it up.
[Dad:] Lol, holy cow. what are you ladies discussing over there? You wanna crash the PC i just bought?
[Julie(My kid Sis):] No dad, just tryna upgrade windows.
[Dad:] Got that already! Just make sure you first uninstall before install, then after installing all and you don't get a windows 25 pro-plus, just call Giddy he's in his room or return the disks back to the vendor and get a full refund!
[Me:] :/2 -
bitter reflections from a bitter dev on hacktoberfest this year (in the past 2 hours of trying to find issues my IQ has at least halved):
- DefinitelyTyped - used to be my bread and butter to complete hacktoberfest; now, not sure if actual issue, or person just doesn't know how to use typescript (found a multiple such issues that were actually non-issues, the type they were asking for was right there, no pull request needed)
- avoid "issues" on no code / low code tools, these are toxic issues with titles like "I EXPLAIN BUG HERE", then probably not even a bug / more a feature request or clueless clown
- if your entire contributor team has the same character styled profile pic + background, i can't take you seriously; if your identity is so closely tied with what github team you are on... uh, i mean cmon what is this kindergarten? (also love the fact that an anon managed to get themselves mixed in hahahaha they ruined it perfectly!)
- most 'hacktoberfest' issue finders themselves are broken or don't load anything
- people claim issues and then never return YAWN
- the hacktoberfest discord: the projects channel is mostly people promoting their garbage repo WHICH HAS 0 OPEN ISSUES IN THE FIRST PLACE AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA and then OTHER people promoting their own portfolio on hacktoberfest???!! 😂😂😂😂 yeah bro i'm gonna help you with your own portfolio site GTFO
from what i've seen, i think i can start working approximately 5 minutes a day and be more successful than these absolute 🎪🤡🤹♂️ devs
sure, there is being a beginner, and there is being a clown salesmen trying to get people to do work for you... i mean wtf is going on
i WANT to help and contribute, but this year its really a struggle to find anything worthwhile to contribute to!
somehow the spark is gone... this might be my last Hacktoberfest... let me just return to my wisky and be in peace4 -
Reading OpenSource lib that write in TypeScript is a nightmare
WTF:
export function concatMap<T, I, R>(
project: (value: T, index: number) => ObservableInput<I>,
resultSelector?: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R
): OperatorFunction<T, I|R> {
return mergeMap(project, resultSelector, 1);
}
That is just fucking definition, no execution code inside1 -
Hello DevRant,
I need your help
I'm currently studying Game design and development first year in The Netherlands and I love programming but I hate designing. I was thinking about changing the course to something like Ethical Hacking or Computer science. The reason why I want to do this is that they teach us openfl until second year and I feel like I learn nothing until now.
Do you think would be better to change the course or to stay but start programming in something else? And what programming language would you recommend?
P.s. I also want to apply for a part time job/summer school to gain experience but I had no luck at all.
P.s.s. You are the best community for me!
Return 0;3 -
In the project I'm working on with others, really complex and confusingly programmed, there's a method called "check[...]IsSet". It gives back a string. They went out of their way to write a Javadoc for it and what does it say?
"@return the string"
No, really? I think I could have figured that out by myself! But what's in it, dammit? -
Not weird but f*cking annoying co-worker. Everything that sets people off he did. Also he never learn stuff like personal hygiene and stuff. One time my boss had to tell him to go home and not return to work until he took a shower. Also had didn't seem to have any work ethic at all and that got me fuming angry at him as he refused to do any work at all. When I was working in his apartment and got stuff to do he normally did and had way more experience in than me his coworkers were astounished how "fast" I worked when in realitiy I was taking it really easy. And this dickhead managed to make his stuff and then use the other time to play games ore whatever. In the end no one in the IT apartment wanted him to work there anymore. And he even managed to offend and insult our boss so much that he had to call him Mr. instead of his name. My co-workers even collected money for him to come to work looking like a human being and taking care of himself. I'm so glad I am no longer required to talk to or even work with this moron ever again
-
So I did this https://devrant.io/rants/797965/... which works fine until medium sized data.
However for large data the ETL pegs a 6 core Xeon (2.2GHz) with 50GB of ram. Because of it ends up doing six threaded compares, so 12 different data sets. Other than "pull less data", any tips?
Code (C#) is basically a Linq multi column join between two DataTables and when the compared columns don't match it returns as a var which is turned into a third DataTable to be SqlBulk loaded into the DB.
Table1 is external API return data (no windowing) and Table2 is from our DW.7 -
Generic arguments can't be cast. List<Dog> can't be cast to List<Animal>, because any methods that take Dog as an argument would suddenly have to work with an Animal (same works the other way round with return values).
But there are many situations where this would be okay. For instance, a Date can be cast to a String, so if we know that no method directly or indirectly accessible from a ListView<T> (including accessible property and field setters) will ever take an argument of type T, then ListView<Date> can be cast to a ListView<String>. Conversely, if we know that methods of StreamWriter will only ever take arguments of the generic type and interact in ways that don't change the object, then we can safely cast a StreamWriter<String> to a StreamWriter<Date>.
There could be a pair of generic constraints signifying that the type only crosses the interface boundary in one direction. I think this would be an interesting feature, but I don't know any strict type system that allows it. What do you think?25 -
How do you test unreachable code or part that is considered an edge case?
For example I catch exceptions in case IO failed and data was not written on database, but that only happens if hardware failure, or no disk space left, how do I mimic that?
I also have unreachable code for example, in one layer I fetch data (lets call it function x) and always return success result unless item not found I throw KeyNotFound exception. But in the calling function I handle the case of Status == Failed
Just in-case in the future I change function x and start returning failed status, so my logic already written but never reachable14 -
I really don’t get it, how can most people just so easily accept shortcomings and not even try for a second to improve the situation?
It drives me crazy ...
story:
I’m debugging an issue with a colleague over screen sharing, both of us have huge 4k screens. Colleague sets a breakpoint, popup opens „do you want to switch to debug perspective“, clicks on yes for the umpteenth time. Breakpoint halts, IDE is full of open and unrelated panels, he doesn’t even see the whole line if code but still grabs the scrollbar every friggin time and scrolls left, right, left, right, ...
changes some code, popup that hot code reload didn’t work, clicks ok for the umpth time here as well, although it has a don’t show again checkbox, like every frigging dialog in eclipse.
how can people work like this, it’s driving me nuts. Am I the only sane dev here??
Other colleague has weird message in the browser console (angular). I ask whats the problem and if he can’t just set a breakpoint to analyze the situation. No thats not possible, he says, instead he’s going to add a return statement to check how far the code execution goes ...
I wonder sometimes if I‘m already dead and have to suffer in dev hell for an unknown reason ... 🤔 -
I was thinking about switching to Dvorak but then I learned that there are no significant study that it really does improve typing speeds. I don't feel like switching for something with so little gain and I return people will look at me like i'm hermit hipster. I mean they're doing that already. I don't have friends. Pls send help4
-
I really like helping other learn how to use a programming language or solve problems on general. I often go out of my way and stop working on my hobby projects, just to help someone.
Thag being said, I'm no prgramming god. I myself am striving to become a better programmer.
I make mistakes, I can't always help you, I am still learning, but I only have good intentions. And you are by no means obligated to follow my advice. Quite the contrary, fight me, try to prove me wrong or say point out possible flaws. THINK ABOUT WHAT I TELL YOU. DON'T JUST BLINDLY FOLLOW MY ADVICE AND BITCH ON ME LATER.
This happens rather often and I can see why you want to blame me. And I can't deny that part of this is also my fault.
Situations like these don't really tilt me.
But today someone had the fucking nerve to pop a file into the chat and get mad at me for sugvesting a cleaner, shorter and more efficient solution. LIKE I DON'T FUCKING CARE THAT IT TOOK YOU A WHOLE DAY TO IMPLEMENT SOMETHING I CAN DO BETTER IN MINUTES, I JUST WANT TO HELP YOU.
But the best thing I get afterwards: "But you told me to do it like that" BITCH WHAT!?
I have chat logs telling me loud and clear that the concept we never talked about before in private nor on a public server (bless discord's search function). And I will not accept your lousy excuse of having me cobfused with someone. You disrespected me greatly, you put words in my mouth, just to justify your pity anger, when I'm trying to help you?!
Get crucified and put on a shooting range!
I offer you out of pure goodwill. Something you'd normally have to pay for. And this is the treatment I get in return?
Just rm -rf your disastrous, dd -if=/dev/urandom your harddrive and sod off!2 -
This internal api is killing me. Why the fuck do people return an array of numbers inside a field that has a generic name such as `icons` to convey information such as "hasOptionFooIncluded". Because of course then icons contains '6'. Yet if both 6 and 4 are in there, it means something else. Needless to say there is no documentation whatsoever what each number or group of numbers actually means so I have to ask around to find out what numbers means what in order to wrap that call away into something maintainable. Because the API is deprecated and we don't want to fix shit in there. We just create other shit depending on this crappile. :/
Stop using magic numbers. Just stawp it! -
It seems like there is a whole another grade of fear — Basilisk grade. It’s impossible to experience it and walk away without serious consequences.
Imagine: I’m barely 20. It’s my first real, official, high-paying job. I’m already a team lead. A big Russian non-govt company with a blue logo. Huge new office in Moscow.
My “childhood” is officially over — I’m not playing around anymore. I’m an adult in every sense of the word.
Several weeks go by. Maybe even a month. Just a regular day at the office. I’m waiting for the coffee machine to heat up, and suddenly, it hits me. I’m here, at the office. Moscow, a city of 10 million people, is beautiful in the summer, yet I can’t just leave the office and go for a walk whenever I want to. When the day is over, it’s already evening, and I barely have time for myself. There are other people around me, with way higher positions, but their schedule is just the same as mine: nine-to-six. My adult life just started. I have forty years of this ahead of me. No matter the company, no matter the position: unless I’m the CEO, I’m doomed to get to work in the morning and go back home in the evening. And then I retire, old and not that beautiful anymore. And then that’s it.
I was never the same after that day. People are plotting my betrayal behind my back. They all act as one. Just out of my frame of view, their heads are turned to me, and they all look at me with the same devilish grin. There are no people — it’s all one huge shoggoth that lives under the office floor, and my colleagues are its ugly tentacles wrapped in human skin. I start missing deadlines. I become paranoid. Next thing I know, I’m at the psychiatrist’s office, being prescribed aripiprazol — a strong antipsychotic that is designed to literally make you slower. Anxiety worsens. I develop restless legs syndrome. I lose my ability to sleep. My intelligence is slipping away. I’m fired.
I have the return to Saint-Petersburg, cariprazine prescription that felt like lobotomy with extra steps, losing my ability to read, delirious manic episodes ahead of me.
It is only now that I kinda-sorta tuned my medication scheme in by going through countless psychiatrists of all sorts. But I sure as hell work at a place where I can do whatever I want if I meet deadlines.3 -
I have a PHP related question.
I noticed a few frameworks make use of this structure of code and it makes absolutely no sense to me. There would be a PHP file, and the contents of the file would be as follows:
<?php
return [
‘a’ => ‘b’
];
My only understanding is that this is an array/object but I have no idea how these values would even be accessed.
Like, there is no array variable, how can a php file simply return something into a void? There isn’t a function or variable to catch that array.
How does this even work?23 -
!Dev
So the winter break is over and im supposed to be in my uni but no! It is flu time!
Since a human is a machine, and we have certain tools to fix it when it misbehaves lets try to debug that problem! I will tell you a story how
it ended.
*4 days ago*
Both of my parents return from a trip, dad is horribly sick (windpipe infection) so i isolate myself in my room, put on a mask when i have to be near him and wash my hands 3 times i leave my room.
Nope that didnt fucking work, the next day i get flu symptoms(high temp, fatigue, musle and joint pain)
Nothing too bad i can live with it, so i took paracetamol and called it a day.
But im still pissed at my dad for being a fucking idiot and walking everywhere in the house coughing everywhere...
The next day (yesterday)
Took paracetamol again but this time i got a stuffed and runny nose... So i take nasal decongestants, and... they dont work at all...
Today
I wake up with stuffy and cloged nose again. Aparently those nasal drugs i have been taking only make your nose less runny by drying it up, making it 10000x more difficult to unclog your nose...
like wtf? So if you have a runny and stuffed nose you have to choose which one is better?! Nah i take nasal drugs again and clean my nose with saline water, so far so good!
Also paracetamol started working weaker and weaker... What the hell is wrong with me? Im trying to solve 1 problem and my body finds another one! Curing a human is like coding a app, it will go to shit sooner or later.12 -
Just a quick follow up. I told you guys after rebooting my server by accident, I'll color in the terminals for my ssh connections.
Normal terminal in white. With the code to do it. Just a shell script with the name ssh earlier in the path than the actual ssh. That was the only solution that didn't fuck my auto-completion. compdef was somehow useless. But it is simple.
For some reason I had to hardcode the return color to white. Alacritty was not happy with just a no-color code. But whatever. Super useful. I won't accidentally restart non-host computers now.
Planning on extending this to have different colors according to the host. Like my homelab could be green. Live servers would be red. Dev servers blue. But that's for the future.
Just wanted to share my little improvement that will make my computing saver.8 -
I have become the only thing I always hated in a developer. Building a project without a proper documentation.
As a solo developer in a company where I have to do database architecture, front-end, back-end, testing, NETWORKING (I am the most ignorant guy when it comes to networking), product design, there is no time for documentation.
But hey, I have structured the project, files and functions (with comment, parameters type and return type) properly and I understand what I've done even after 4-5 months without touching that specific project so I got that going for me which is nice... I guess.3 -
Rant time. Oh boi.
So, a bit of context: I am a university student in Greece and I have a desktop PC with elementary OS on it. When the unis closed down because of Coronavirus, I moved back to my parents', without my PC, only a usb stick with elementary OS installed on it. That was before the lockdown. My parents have a desktop PC and my old laptop, both with Windows rn. I'm only able to work using Linux, so I've been just popping that elementary OS USB stick whenever I needed to work.
All cool and good. Until the usb got full. It was a 16GB one after all. No biggie, I bought a new 64GB one from a well known Greek tech shop along with a webcam my mother needed. It was a LEXAR one.
They fucking took a week to transfer it. As if the closest shop to me was in fucking Germany. For context, the drawing tablet I bought from China the other day only did 2 weeks to come. During this time I could barely use Linux because my USB stick had only some 600MB free.
Ok, wtv I said to myself. I am a patient person after all. I received the USB stick, along with the webcam, in good condition, in their packaging. Alright. I dd'ed everything from the 16GB stick to the 64GB one and then I extend the partition. Everything works flawlessly. And it's faster too.
Next day, I boot up from it again. It boots up good. Nice, time to do some work. I open my editor. And it fucking freezes. The editor is not some VSCode or Atom or any of that heavy shit, it's just elementary OS Code. A very lightweight Gtk3 app. Strangely though, the rest of my OS (the dock autohide, eg.) Seems totally responsive. I try to open another app. No luck. Not even switching TTYs work. Good shit. I force shutdown my PC. I try to boot again from that piece of shit. And guess what! NO BOOT BITCH. Like, fuck you. I boot from my previous 16GB one. Linux won't recognize it. No /dev/sdc like I used to have. Ok, lsusb. Nope, nothing. I disconnect it and reconnect it, and lsusb. An empty entry appears.I run it a couple of times, and the it disappears again. I switch to TTY 2. I get read errors and usb error -71.
And I want to fucking explode
I call back to support for the warranty coverage. I wait for a good 10 minutes and a nice lady picks up. I tell her the issue. She says that the support team will call me for the issue this day it the next day.
I hang up.
It feels like some fucking prank. YOU MOTHERFUCKING TOOK SO LONG TO DELIVER MY SHIT. Not to mention that the shitty courier service they are working with wouldn't deliver the goods to my home because it's slightly out of town. AND NOW YOU ARE DELAYING MY WARRANTY RETURN? HOW THE FLYING FUCK DID YOU BECOME A WELL KNOWN TECH SHOP WITH SUCH SHITTY SERVICE?
IF YOUR BRAINS WERE DYNAMITE YOU WOULDN'T HAVE ENOUGH TO BLOW YOUR NOSES.
YOUR THE SERVICE EQUIVALENT OF A PARTICIPATION AWARD.
Foreigners' view of Greeks suddenly doesn't seem so unreasonable. Yes, we are fucking lazy asses. And we also hate that. We hate each other for that very reason. May this country not live any longer.6 -
Don't you just love it when gitlab's ci pipelines crash for no apparent reason, causing tests which cannot fail to just magically break down, change logging levels to Just about anything and basically PMS for about 3 hours before it decides it needs to restart completely and when you return the same pipeline which you've been trying to fix for the better part of an entire evening, after regular work hours, it. Fucking. Works. With. No. Changes. To. The. Entire. FUCKING. System.
Waste of a day.3 -
Can we take a moment to recognize how absolutely retarded JS' event system is?
Events aren't objects. No, they're managed by an object, and identified by a string.
To subscribe to an event, you call object.addEventListener(name, callback). Because for some reason we can't just have an event object. Events MUST have an owner.
But to unsubscribe you don't call the function addEventListener returned, you don't use the token it returned either. No, you pass the same function to removeEventListener.
Because we don't use serializable tokens like in PP, and we don't return functions like in FP, no, we use functions as tokens, realising idiomatic DFP.2 -
What piece of shit coded this site?
https://freefilefillableforms.com//...
This is website people who did not file a tax return can use to get their stimulus check.
It’s not mobile friendly or even responsive in the least bit.
These people are poor and desperate and do you think they have laptop or desktops? No they use their phones.
You could have added some Flex box, now people are freaking out all over the internet.
Who the fuck would do this also this?5 -
What the fucking shit, Arch. In what universe/reality is a user expected to easily/quickly address GPG/PGP bullshit when they install Arch. It's already hilarious enough as it is for the user to input every single command in order to install the thing. -- That's actually what's great about Arch; you get return and assurance from each command. -- I understood the fact that you need the latest ISO release in order to even install Arch, but now, if you decide to pacstrap linux-hardened, or god forbid, a package that is who knows what, less maintained?... fuck knows what will happen.
The fantastic part, is that you can't do shit when you're in an arch ISO install. All of the simple and possible solutions that involve GPG DBs/keyrings/etc require you to have the all of the shit installed already; which is fucking impossible if the package manager is bitching about keys not being imported. The most fantastic part, is that there is probably some complete bullshit, ultra-exclusive command or simple solution that will fix this crap. - And if you even dare ask the Arch forums, you'll be branded as a "newbie" and sentenced to read the fucking wiki. - ??? -- That's not a fucking good thing. -- The majority of people who are installing Arch right now, are people who are installing it for the first time, and chances are, most of those people have no fucking clue what is happening; they're learning what is happening. Furthermore, they're probably the kind of people who aren't inclined (or they don't know how) to scour Google or the Arch forums for answers to vague, lazy-ass error messages. The whole point of this thing is show and confront the user about what they're installing and what they want on their computer. Holy shit. This is all the more reason to ensure that total, stupid, ambiguous bullshit errors do not occur. -- "error: key "dogshit master <dogshitmaster@dogshit.org>?" could not could not be imported". -- That's it. That's the error in it's entirety. For a fucking OS install. What the fuck.16 -
"Tips" are fucking stupid. Any waiter or anyone who expects me to "tip" them is a fucking clown hobo. Full disrespect
You're telling me i should pay you extra money or else you're not gonna do YOUR job right? A job where you already receive stable monthly salary?
Whoever standardized "tipping" is a fucking CLOWN. Must have been a restaurant business paying billions for this marketing scam to normalize as if tipping 2$ is normal
Who the fuck are you? Are you my fucking friend? A relative? A family member? Why the fuck should i pay you extra money just because you want some extra money?
Guess what fucktard. I want some extra money too. Has anyone ever tipped me in my job? No. Has a client or will a client who paid for a software i develop ever tell me "hey youve done such a great job heres some extra $$$"? No. Will a client ever tell me "hey your software earned me 100k$ heres a $100 tip or a $1000 tip"? NO
If i dont get tips Fuck you. Rough world and live with it.
Anyone who wants or expects tips I immediately view him as:
- beggar
- gypsy
- homeless
What the fuck are you gonna do with 2$ 5$ 10$ tip bro? You're broke and your job sucks go and learn some skill and you might earn more if you're so stubborn about a tip
Today i paid for coffee $7 but the price was 6.25$. Expecting a change, the waiter just went off. I told him give me my fucking 0.75$ back you fuck. And so he did. But he gave me back 0.7$. Where the fuck is my 0.05$????? Fucking retard. You want to take extra money from me just for a COFFEE. YOURE HOMELESS BRO TF U GONNA DO WITH 5 CENTs???
Also the reason why i get so pissed off about this is
1) The other day i was at some other coffee shop also paying for coffee. Dont remember the price but i paid. However i miscalculated. I paid 0.10$ less than i was supposed to. She was standing there and telling me I'm missing 10 Fucking cents. Confused, i calculated again and realized i made a mistake. So i round it up to 1$ instead of 0.10$ and she kept everything instead of giving me the change of 0.90$. So its NOT ok that you're a gypsy for not accepting the payment because its missing 10 cents, but its TOTALLY fine that you take 0.90$ extra money just because you want to. GET FUCKED
2) The other day i was in a store buying food. At the cashier i paid $27. However i was missing 0.02$. The cashier told me do you have 0.05$ to coverup the missing funds. In disbelief, i was looking at her could not believe my fucking eyes what she asked. How fucking POOR can you get. I gave her more than 2 fucking cents and proceeded with my shit
Very valuable shit i learned from these stories: NO ONE will give a shit to accept a payment even if its missing 1 FUCKING CENT. But its totally fine that they dont return me however much they dont want to.
How about you sometimes fucking say "hey i know you you come to this store very often heres a discount"???
Or "its fine that you dont have 0.01 fucking dollars, you can take your food"???
Or "hey i seen you buy here often heres a fucking discount just for you today"????
Because of that i have decided to take ALL of my fucking hard earned money and ask for the exact change. I dont give a FUCK just as much as THEY dont give a FUCK.
For reference:
0.01$ = 1 in my currency
0.90$ = 90 in my currency
27$ = 2900 (4 figures) in my currency
My currency is shit. My country is shit. People in my city are shit. The whole vibe here is shit. And perhaps that is why i shit so much because i get stuffed with too much daily BULLSHIT12 -
Built a Svelte app year ago and it's broken today.
This is not the case with Windows. You can still run a app built on 1999 today.
Opened an issue on their repo requesting that they should add backwards compatibility.
No later than 5 seconds. It got closed and locked with this comment,
"Welcome to development when you don't write your entire stack yourself by hand.
Please open helpful bug reports or don't open any at all."
This is what every FOSS project got as defense. They think since they work for free, they can do what the fuck they want.
The defense is false because they put their OSS project on their resume and in return they get hired for full time work or consulting.
I fucking sue you Svelte if I had money to hire expensive lawyers. This time you are just lucky.38 -
OK guys the time has come for my home PC to finally become 100% pure Linux (No dual booting).
But I will need to keep a backup of my windows installation (Just so i don't have to download everything over in case i return to the demon that is windows).
What is a good image capturing program?
Was going to use ghost because of past experience but just want to hear some alternatives!6 -
Why the fuck open source solutions need to be such a load of bullcrap? I've spent a week trying to set up every single self-hosted video conference software, and the only thing I've got is a shorter lifespan.
How the fuck does your (judging by GitHub, well maintained) software only support Ubuntu 16.04? And I mean ONLY, there's no support for docker, or any other distro either, and we're only weeks from getting the second LTS since 16.04. And why the fuck does documentation tell me to manually go through 20 different config files just to enable SSL?
Why the fuck doesn't your official AWS cloudformation template include VPC or other required parameters? I've had to rewrite the whole thing just to get a valid stack you dipshit!
And how fucking hard is to make your software look decent, I can't expect clients to chat with me using something that looks like an incest child of 2003 MSN and eDonkey?
Oh, and it'd be fucking dandy if your documentation wouldn't return 404, maybe I'd be even able to test what your product has to offer?
I guess after everything I've tried I'll go with Jitsi; it seems the most decent, although it lacks some pretty basic features like limiting chat features for guests.22 -
Payment gateways are such a big pain to implement. Docs say that they will return values A,B,C but what you end up recieving is X,Y,Z.
And don't get me started on the webhooks, man they return values completely different values from the api end points and with no reference what so ever to the fields returned by them.
Wish i could get the documentation writer's address and may be the dev as well!!6 -
Some compilers give an error message on forgotten type casting. From that it shows good typing style casting. So you also avoid clerical errors that can lead to the program crash in the worst case. With some types it is also necessary to perform type casting comma on others Types, however, do this automatically for the compiler.
In short:Type casting is used to prevent mistakes.
An example of such an error would be:
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int * ptr = malloc (10*sizeof (int))+1;
free(ptr-1);
return 0;
}
By default, one tries to access the second element of the requested memory. However, this is not possible, since pointer calculation (+,-) does not work for a void pointer.
The improved example would be:
int * ptr = ((int *) malloc (10*sizeof (int)))+1;
Here, typecasting is done beforehand and this turns the void pointer into its int pointer and pointer calculation can be applied. Note: If instead of error "no output" is displayed on the sololearn C compiler try another compiler.1 -
All summer I've been working at a company doing some full-stack development. Starting my last year in university, I really wanted some real life experience that ties into my studies.
I did not expect to find horrible, undocumented, code that has been written 5 years ago, where the senior developer who wrote it doesn't even know what it does. The worst part? They are STILL not documenting! I tried to document, but got this in return "you don't have to document everything. Especially if it is understandable". But they don't even understand their old code!
Monday morning, we had a meeting and they asked what I thought of working here, seeing as I am done this week. I respectfully told them that their code is not readable, and it will make it hard for new employees to understand. The boss in return says "you're the third newly hired employee this summer to say this... Maybe we do have a problem then"..
No shit. Please for the love of God, comment your code!2 -
Long story short:
My system need to talk with a 3rd party PoS API. The provided doc is pretty useless and with few errors.. nonetheless I came to finish the 99% of the job.
I was stuckd on the 1%, one frickin function.
Everytime I would call the endpoint I would receive...NOTHING. Just a 200.
I've spent like 5 hours trying everything, even sending wrong params...nothing...
Always 200 and nothing else.
Apparently, for an entire nation and the IT Company behind them, is ok to have A PAYMENT API TO RETURN VOID AND A 200 NO MATTER WHAT.
I got the luck/unluck that the main developer of such piece of art came in the office and I've almost throw him out the window (we are at 26th floor).
FUCK OFF DUDE. YOU AND ALL THE OTHERS THAT DO LIKE YOU DO.
P.S. in this days I'll try to write the full story, but it's hard without giving many details...small anticipation: 1.5 months of work and nothing but red bull and coffee...4 -
Started playing Skryim again. Playing a pretty big modpack with some really cool mods called: Lost Legacy. It has alternate skills like Pugilist and Unarmored. I can literally punch a bitch with a one shot to death. For some reason this is very satisfying. I wonder what level of my psyche this appeals to. Probably something really animalistic.
These two skills meld really well with playing a mage with no armor. Unarmored skill actually levels faster if you cast an armor spell. So it benefits mages. I also don't have to fumble with weapons with Pugilist.
I had to add Sofia as my follower. Her wit while I punch people to death just fits. I feel like my character is a grumpy old mage that just goes berserk and kills people with his bare hands when upset. Do not disturb my circles, bitch!
I like to name my characters with phonetic names that might mean something else. On the surface it looks like an RPGish character name. But contains another meaning, often vulgar. This character is no different. I have named him: "Rehkuuf". An old Breton bitch of a magic user. Whose only care is learning and acquiring power. I imagine this character doing anything to this cause. Definitely a ends justifies the means kind of person. I am thinking of making him notorious in at least one hold. Not sure which one. So every time I return to the hold I have to kill every guard. Punch a bitch time!
One goal I just thought of: Punch a dragon to death.1 -
TLDR: I didn't & still not sure if it is..
I love bug hunting & fixing & figuring out how stuff works, but many will argue this is not even real programming..
Long version how I ended up programming:
Back in highschool, I was deciding between english and mathematics & computer science.. I filled in the form for the latter. Got a change of hearts but I already gave the extra/backup empty form to schoolmate..
Figured it's for the better because it's a hell to get a job as an english teacher/prof anyways + I dislike comunications with people + documentation (if any) is in english etc..
At the end of first year, I didn't even apply for all the exams because you had to have both programming 1&2 to pass or even be eligible to take the year again.. I figured I'd fail them, so once I actually passed both (& actually not with bad grades), I was fucked.. had to retake the year, which means I lost time + still had to pay the rent etc.. decided to drop out and return home and do the IT engineer course instead to at least have some formal education to help me find a job. Finished that without problems, I 'specialised' in network administration.
I got a job straight out of school as a web developer.. the irony.. got some conflicts with the boss and was terminated (material for another rant).
Later I sought out admin jobs, but got declined because I was overqualified and had programming experince. FML, right?
Ended up sending out mandatory job applications for IT administration & programming to not lose the bonuses & got called up to a meeting in the company I work for since then.
No qualifications for .net & MS technologies, but they liked my CV so the ended up setting up the interview anyway. I didn't know half of the technologies and concepts by proper name, but they figured I understand enough of the content to give me a try. A few years later, I got the most fucked up project they have because of my love for new thigs and trying to understand everything. It's aaaalmost bearable now.. still needs a lot of work, but I'm happy where I am. Saddly, I'm still second guessing if I'm doing a proper job as a dev, but they seem to be very ok with my work. (:6 -
Tldr:
Can't fucking figure out why I'm the only one who can't solve a DP problem in code, when me and friends use the same idea and no one knows why only mine doesn't work...
We are given a task to solve a problem using DP. My friends write their code with the same idea as a solution. Copying the code is not allowed. I follow the same idea but my code won't work. Others look into it, in case they find errors. They can't find any.
The problem (for reference):
Given a fixed list of int's a = (a_1,a_2,...,a_n) and b = (b_1,b_2,...,b_n), a_i and b_i >= 0, a.length == b.length
We want to maximize the sum of a_i's chosen. Every a_i is connected with the b_i at the same index. b_i tells us how many indexes of a we have to skip if choosing the corresponding a_i, so list index of b_i + b_i's value + 1 would be the position of the next a_i available.
The idea:
Create a new list c with same length as a (or b).
Begin at the end of c and save a_n at the same position in c. Iterate backwards through c and at each position add the max value of all previously saved values of c (with regards to the b_i-restriction) with the current a_i, else a_i + 0 if the b_i-resctriction goes beyond the list.
Return the max value of c.
How does that not work for me but for the others?? Funny enough, a few given samples work with my code. I'm questioning my coding ability...7 -
Working on a new release. This release was tested locally and pronounced good. The release went to the QA environment. QA responds that a new feature is doing nothing. There are no errors reported, and work is being done on the UI, but is not get getting persisted to the database so all changes are lost when the session is lost. Do some investigating. I find that a web service had the code in two of its methods commented out. Why? No idea. No response yet from the developer who just had the two methods return a boolean denoting success while all other operations were commented out.
I need an appropriate punishment for this...3 -
My favourite bug fix was actually IT based and it was the first time my Eastern European, critical of my skills, family not only praised me but claimed that I was smarter than them.
My grandfather had changed from a telecom to a VOIP device for his landline. For some reason after installation, he could hear the other person on the line but they couldn't hear him. Me and my mother were away during this time so they called in the other family IT guy. This guy is no joke, he's one of the top in his company and makes a sweet six figures and lives in a mansion.
So he started looking things up, googling forum, etc. Couldn't find anything. Started calling the tech support and tried to deduce what it was and their tech support had never heard of such a problem. He takes his lunch breaks to help out my gramps. Keeps escalating, escalating and nothing. His conclusion is that they need to send him a new VoIP stick and they're not giving it to him. At this point, he's so frustrated that he screams at my grandfather to go back to paying 60 bucks a month for landline and to stop bothering him.
At this time me and my mother return and they have concluded that they need a new stick. My mom is great at intimidating people into free stuff so she and I go over to do so. At this point everyone is convinced of the problem and even I don't think I could fix it. But I decide to check if that's the case because I don't want my gramps to get a new stick and it still doesn't work.
I go through the typical forum hunting and there's Nada on the problem. I look at the stick and all the lights seem to be working, no error lights. And I wonder maybe the problem is not the stick, because usually you can't do anything at all if the hardware is broken. So I start thinking, maybe my gramps accidentally muted his handset while talking or something dumb like that. That wasn't it.
Then I decided to see if the problem was recreated on the other handsets. I tried one out and my mom could hear me but I couldn't hear her. What?! That's different! It was the opposite with the other phone. I conclude that it's working and there's something up with the handsets. So I go and do a reset on all of the handsets to make sure.
Lo and behold, the problem is fixed. It took me 25 minutes to solve. That guy gave up after a week of trying. My mom who assumed my IT skills were on par with other kids and nothing special had finally seen me up against an opponent, and not any opponent, a six figure high ranking IT specialist. And I didn't even use any secret, complex software knowledge that wasn't accessible to her or any other normal user.
That's when she finally said that I was smarter than her, that I just used my common sense. She would've needed some kind of prompting, hint or direction to solve the issue but I did it without any.
It was a very satisfying bug to fix. -
The forEach in JavaScript makes no sense. It looks like a map /filter/reduce but doesn’t actually return the array. Can you please loop like a normal language?8
-
not a rant.
More coronavirus doomporn so click away now if you're sicking of reading and hearing about it.
As I wrote to sweetnothings and Demolishun over here https://devrant.com/rants/2476697/...
Looting already started in my area.
Store was robbed in broad daylight after it was broken into just a few days ago.
And when the next surge of stimulus money hits people are gonna be like "I better stock up seeing as the shelves are kinda empty."
And then the shelves are gonna empty *quick*.
And people will see that and empty them *even faster*.
And then even faster than *that*, in a vicious cycle.
At some point people might panic and proper looting could begin.
Got my tax return before any stimulus so I took the time to go shopping.
Of course I didn't buy up all of any one item. Don't know why people feel like they need to do that.
Why wouldn't you want a variety of supplies anyway?
Gravy for example. No one can get any meat. Saw that coming a month ago.
If you're just buying for bulk, packet gravy is nice for things like pasta and staples like rice and potatoes.
Little things go a long way.
And salt. Salt is cheap now. Probably will remain cheap, but expect panicking buying to make supply spotty, like
everything else.
I expect these shortages to last 2-4 weeks, excluding things like dairy and meat which *could* go on longer.2 -
Tried to work in a corporate setting. Failed. After so many fights, product manager was constantly rejecting my work until I had no choice but to throw in the towel. Spent the next few years slaving away as an open source dev. Not begging for donations. Just decorum when I eventually launch. Instead, I get repudiated by the community, get my account banned at the location where I could have accessed the largest pool of relevant audience. No influencer or dev rel/advocate will respond to my supplication or say beyond a compliment
Barely pick up the pieces, to reimmerse into employed labour. Dozens of applications sent out. My inbox is silent as a graveyard. I start putting more effort into tailored cover letters for each opening, across multiple job boards. One finally rejects me
Even tried changing stack by applying for internship roles in nodejs. A dead end
So, I can't read cuz I was researching for my magnum opus. Now it has gone belly up, that's no more worth it. I also cannot work because my work is complete. It's just sitting on github like a mummy. No interactions, no stars or issues.
Posted on show HN. Not even a single upvote. The funny part is that even when I tried to lament my woes on devrant, their site has been down for hours
To think I was among those who trolled ronaldo with the "rejectnaldo" gimmick. Karma has turned around to bite me in the ass. Rejectnmeri
What to do with this enormous amount of empty time? I neither go out nor watch movies
Even though I'm not terminally ill or gnashing my teeth in physical agony, This is a rare moment when I wish not to have been born. There is no joy in life that makes unpalatable suffering worth it. Why does everything I do have to be contingent on the whims and choices of others? And I have to keep living like that, otherwise I'll return to my village to become a subsistent farmer, cultivating produce to eke out a living. Or seek unskilled labour, earning peanuts for waiting tables. It's a pathetic state of affairs.
All of this sucks tbvh7 -
I'm facing something strange, I have set the following headers in Nginx to return:
strict-transport-security: max-age=31536000; includeSubDomains
vary: Accept-Encoding
x-content-type-options: nosniff
X-Firefox-Spdy: h2
x-frame-options: SAMEORIGIN
x-xss-protection: 1
But I only get them when I browse root of my website, but if I go to https://website.com/subPage
those headers are not returned, now I did set them only on
"location / {}"
Any other headers I am missing that needs to be set?
in nginx, but how do I force it on all sub pages, or there is no need?2 -
So I deleted my last post looking for the next tech sale date as wanted a wireless charger because I found a deal...
It was like 60% off... But after I got buy instead regret...
The sites reviews are crap, it's a reseller apparently and no actual brand is listed...
And then I realized what I really wanted was a fast USB charger that takes a regular USB input instead of Google's choice of a microusb one ....
Another $20 down the drain... It seems the return policy is crap or non-existent... -
The rear ducking continues. We've built a reliable translator in the dumbest fucking way possible, it's just lovely. I simply reused the structure for feeding data to the VM assembler, an array of arrays, where there's one array of (ins [args]) per node in the parse tree.
It's nice because nodes can be solved out of order without affecting the actual sequence in which the instructions are output. And if one statement (node) equals multiple instructions, you just push multiple entries to the corresponding array, or push nothing if you need to output nothing. Easy as goblin pie.
This is enough to convert an input language to the assembly-like intermediate representation we use for the virtual machine. So then there's doing it backwards: walk the same array of arrays, and map those virtual instructions to a physical architechture. I guess I could do the encoding to native binary myself, it'd certainly be interesting to try, but I'm burnt-out already so I'll just use fasm for now.
Initial test: wrote a test program in my own stupid language, ran the translator, dump output to file, assemble that with fasm, run with r2 -d.
Crashes? No.
Runs fine? Yes and no.
For fuck's sake, I don't have syscalls. Mainly because the VM doesn't have an operating system, lmao. I was testing virtual programs by just freezing state, terminating, then dumping the fucking registers and stack to the console, we have no I/O to speak of. Not even a real 'exit', VM handles that by reading a return value every step like a mentally damaged son of a bitch.
So anyway, I manually paste the linux mambo, you know:
mov rax,60
mov rdi,0
syscall
And NOW our program can end execution without crashing.
Okay then, so does the test code work correctly?
** DRUM ROLL **
Yes.
Ladies and gentlemen, mother fucking PESO is now a compiled language, and going forward I will be expectantly receiving your marriage proposals for reviewing. Oh, but not so fast, we still need a frontend...
Well, we'll handle that in the next few days. I'm just glad to be *nearly* finished with this fucking compiler, I want nothing to do with anything else ever, but we know that's not going to happen, so Lord please end my pain.
No sponsor as this rant has been paid for by tax evasion. -
*Frustrated user noises* Whyyyy, Grafana, why don't you implement any actual query forgery checks?!
So long as a user has access to the Grafana frontend, they can happily forge the requests going off to the backend, and modify them to return *whatever* data they want from the datasource.
No matter that they're a read-only user. That only stops them from modifying the dashboard definitions on the frontend, but doesn't enforce any sort of immutability on the BE...
If anyone had any tips on how to further secure it, I'm curious...5 -
I have gained quite a lot of coding confidence recently.
Im quite confident i can deploy a full working application or a mobile app.
I have some inspiration bit i am still not sure of how much work/investment does it take to make something that generates money.
Of course im not including million dollar ideas. No my goal is to make small apps/applications or freelancing jobs off work to generate some extra money (noticeable enough that the investment is worth the return).
Obviously the best way to learn is to dive in and im not asking to know about your golden egg that you are harvesting.
But do you have any tips/advice or experiences to share?3 -
i come from a very closely knit family and i kinda like it. i am in close proximity to my parents, they are growing old so i do a lot of home chores. meanwhile a lot relatives and dad's business friends live nearby , and the whole area around my home feels like a place of known people. my free time goes with 5-6 friends , who again live nearby, or with gym buddies. this is a nice life, which could further expand with a wife and my kids in future .
at the same time, i have seen the "work" life. my office is in a different state, 90% of people there are people like me who would be renting a home nearby and living alone/with strangers. their main "family"(well pseudo-family) will be their coworkers, and that's also not a bad thing.
in the workplace the reasons to be happy will be a lot (as parties or celebrations will occur on multiple birthdays/ company growths and other achievements) , and so will be the reasons to feel sad ( company failure, teammates leaving, missing family)
at the end of the day , when you are living an office life, you are a corporate rat running for the cheese you are never gonna (or , if you are a glass half full person, let's say that you are a "dedicated work professional giving your 100% to the company")
but here comes the dilemma : with AIs like chat gpt coming around and redefining nthe expectations from a software engineer, you will no longer be expected to be resourceful but rather how much of a corporate rat you can be. ( https://twitter.com/bajicdusko/...)
so 1) is it the only way forward for an upcoming engineer's lifestyle? to be like a soldier for their company , while their family and friends await for their long return? 2) if yes, what is the positi8 aspsct we can take away from this?
PS : what a stupid profession those AI/ML guys work in. they put out their minds together to make a sword which is gonna cut the heads of s/w engineers, their own breed. not lawyers, not doctors, not even the fucking peons, but their own freaking brothers4 -
In my first few months of my first dev job, I written this fragile piece of code in, trigger warning, PHP that sent out email reports to my clients. It was a two men team, and we have no clue about TDD or how to do unit testing for such code. We would just run that piece of code manually do send out dummy emails to ensure things were working.
One day the code broke. I was told by my boss to fix it. Spent the entire day trying to fix but couldn't get anything done. Finally at around 7pm my boss came by and asked why is it I couldn't get it fixed. He helped me troubleshoot and fixed it. And subsequently told me "c'mon man you're better than this."
It turns out that he changed a part of a code that was supposed return an array of strings to an array of objects, adding a second attribute that wasn't even in use.
So what that meant is that he changed a piece of working code, to include a property he didn't need, committed and push to production without even manually testing it. AND TALKED SHIT TO ME.
That was the day I learned git blame and began my journey on TDD. -
This actually exists in our code-base like this. I have no fucking clue what it does.
function combine(arg0: string, arg1: string): string {
return !arg0 ? arg1 : !arg1 ? arg0 : `${arg0} ${arg1}`;
}9 -
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. -
“Lazy mom lazy wow” presented by Gail Swanlund was probably the most impactful piece of art to me.
Through simplistic form, this art piece presents the idea of caring about oneself and quit the eternal rat race for money. But somehow for its metaphor, Lazy mom lazy wow chooses the notion and aesthetics of death and decay. The closest analogy I can think of is the music of American Football. Some kind of liminal, eerie aesthetics. Also, the movie Gummo and the game Life is Strange, part one.
The piece deliberately avoids being aggressive and celebrating its notion. It’s not “quit the rat race and celebrate because life is so good”, it’s “quit the rat race by putting yourself into coma so nothing matters anymore”. The descent into eternal comfort of realization that you don’t have to do anything anymore, but also sorrow of losing meaning.
It feels like launching Counter-Strike Source in the year 2051, only to walk around cs_office and realize there are no players anymore, and they will not return ever again. The sense of watching an old VHS tape of you having a conversation with your mom in the hospital as she’s counting her last days because of cancer. The sense of comfort of coming back to your hometown. You remember your childhood and your high school crush, only to realize that those moments won’t happen ever again. -
My monday while writing test:
[error] x should return 200 with no $path
[error] '301' is not equal to '404' -
More linux driver woes:
Driver is passed a file position and byte count when asked to read from a device. Sounds easy, right? FUCK no.
For reads, driver is passed struct `filp` with field `f_pos`, a direct pointer to the same struct field, int `count` as a number of bytes to read, and `buf` to return those bytes with. Problem is, requesting, say, 256 bytes from location 10000000h will give the driver `filp->f_pos = 0`, `f_pos = 256`, and `count = 0`. I don't know how to fix this and there's NO help for this shit. None whatsoever.
This shit, right here, is why Linux drivers suck ass.4 -
Colleague's thought process:
Hmm I have observables but I don't understand shit.
Hey I like listeners let's add listeners to all observables.
Should I make the method return an observable and subscribe my listener to it?
Nah I'll erase everything and pass an anonymous class listener to the method so no one can chain a few calls together.
Fuck you and I hope you're reading this!!!
Time to rerewrite 2k lines of fucking code.... -
FUCK. I'M DONE WITH THIS SHIT. CAN'T GET MY HEAD AROUND THIS.
My intelligence is limited to Java & Python.
NO VARIABLES, RETURN TYPES..NOTHING! JUST FUCKING MAGIC! AND ALSO, FUCK EMACS.undefined i should probably kill myself can't understand shit stupid me fucksell shit emacs fucking haskell and gofer2 -
#Suphle Rant 3: Road to PHP8, Flow travails
Some primer: Flows is a feature that causes the framework to bypass handling the request now but read it from cache. This cache entry is meant to be populated without warming, based on the preceding request. It's sort of like prefetching but done on the back end
While building Suphle, I made some notes on some chapters about caveats and gotchas I may forget while documenting. One such note was that when users make the Flow request, the framework will attempt to determine who user is, using authentication mechanism defined on the first module (of the modular monolith)
Now, I got to this point during documentation and started wondering whether it's impossible for the originating request to have used a different authentication mechanism, which would result in an empty entry for returning user. I *think* it's possible cuz I've got something else called "route mirroring", where web based routes can be converted to API routes. They'll then return JSON, get served under defined API path, use JWT, all automatically. But I just couldn't connect the dots for the life of me, regarding how any of this could impact authentication on the Flow request
While trying to figure out how to write the test for this or whether it was even necessary (since I had no use case), it struck me that since Flow requests are not triggered by an actual user, any code attempting to read authenticated user will see nothing!
I HATE it when I realize there's ambiguity or an oversight, after the amount of attention and suffering devoted. This, along with a chain of personal troubles set off despondency for a couple of days. No appetite for food or talk. Grudgingly refactored in this update over some days. Wrote some tests, not all passed. More pain. May have to convert them to unit tests
For clarity, my expectation is, I built this. Nothing should be impossible for me
Surprisingly, I caught a somewhat lucky break –an ex colleague referred me to the 1st gig I'm getting in 1+ year. It's about writing a plugin for some obscure forum software. I'm not too excited cuz it's poorly documented and I'll have to do a lot of groping, they use arrays instead of objects etc. There's no guarantee I'll find how to implement all client's requirements
While brooding last night, surfing the PHP subreddit, stumbled on a post about using Rector to downgrade a codebase. I've always been interested in the reverse but didn't have any incentive to fret over it. Randomly googled and saw a post promising a codebase can be upgraded with 3 commands in 5 minutes to PHP 8. Piqued my interest around 12:something AM. Stayed up all night upgrading it, replacing PHPSTAN with Psalm, initializing the guy's project, merging Flow auth with master etc. I think it may have taken 5 minutes without the challenge of getting local dev environment to PHP 8
My mood is much lighter than it was, although the battle is not won yet –image tests are failing. For some weird reason, PHP8 can't read generated test images. Hope I can ride on that newfound lease on life to study the forum and get the features working
I have some other rant but this is already a lot to digest in one sitting. See you in rant #4 -
Duuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuck off you bloody infamous basterds flattening their fat asses at Microsoft.
I wasted half of my dev day to configure my wcf rest-api to return an enumeration property as string instead of enum index as integer.
There is actually no out-of-the-box attribute option to trigger the unholy built-in json serializer to shit out the currently set enum value as a pile of characters clenched together into a string.
I could vomit of pure happiness.
And yes.
I know about that StringEnumConverter that can be used in the JsonConvert Attribute.
Problem is, that this shit isn't triggered, no matter what I do, since the package from Newtonsoft isn't used by my wcf service as a standard serializer.
And there is no simple and stable way to replace the standard json serializer.
Christ, almighty!
:/ -
Coding sunday morning => NO
Thought nearly 10 minutes why page is Empty. HAHAHHAHAHAH
Threw an NotYetCoffeeException
ViewBag.ImageSize = 368;
switch (Sitecore.Context.Device.DisplayName)
{
case "Tablet":
ViewBag.ImageSize = 343;
return;
} -
Looking at code from previous devs...which I now support...
Oh hey there is a function to retry connecting to the database if it fails to open...ok...
It doesn't return anything e.g. a boolean. Not a big deal I'll catch the exception...
It catches the exception and silently ignores it? WTF how do I know if it fails??
It keeps trying for 20 seconds...sounds reasonable...wonder how long it waits between failed attempts...0. No sleep, no back off, literally spams the open call as quick as it can throw the exception...
I'm glad I personally dont know them. They are fucking idiots. -
Just spent 3 hours on a bs problem
I just start acceptance testing a node.js api.
I'm using frisby
I have logged the export method return data and it is correct
I am loading it into the set header function as the accept-type
On frisby side I run the test and it spits out that there is no accept-type
I really don't get why anymore. Came so close to a blind fury. -
var self = this;
if (args != null) args = Array.from(args);
return function(){
return self.apply(bind, args || arguments);
};
no wonder nobody likes js. this is not js. this is shit.5 -
“Hey congratulations, they want you to come in for an interview in Leeds this week - you’re happy to relocate right?”
Ace! Sure, I’m open to it, since they know I’m in London are they OK with a FaceTime / Skype call?
“No, they would like a face to face”
Sure no problem, as it’s a last minute ticket it’s going to be about £90 return are they OK to cover my train expenses? It’s about a 3 hours each way.
“Um...probably not. I can ask, also they need you to wear a suit Mon to Thursday but they have dress down Friday.”
..um, I can wear whatever they need that’s fine, it’s just a tad unusual. Let me know about the travel.
..but they agreed to your rate.
🤨
—-
? Am I being unreasonable? I thought it was quite a large upfront investment and risk to ask.... 6 hours travelling and £903 -
So I've spent some time learning a little about the halting problem, and it's quite fascinating. I tried to simplify it down to these few functions. What do you guys think? Obviously, psuedo-code, so don't get too caught up on the syntax 😆
The Halting Problem:
public String doesItHalt(Callable function){
...
if (...){
return "Yes"
} else {
return "No"
}
}
public int someFunctionFooThatHalts(){
...
}
public int someFunctionFooThatDoesNotHalt(){
...
}
public String inverseAnswer(value){
if (value == "Yes"){
return "No"
}
if (value == "No"){
return "Yes"
}
}
public String inverseHalts(Callable function){
return inverseAnswer(doesItHalt(function))
}
————————————————————————————
$ doesItHalt(someFunctionFooThatHalts)
Yes
$ doesItHalt(someFunctionFooThatDoesNotHalt)
No
$ inverseHalts(someFunctionFooThatHalts)
No
$ inverseHalts(someFunctionFooThatDoesNotHalt)
Yes
$ doesItHalt(inverseHalts(doesItHalt))
???2 -
I got the Note 7 a couple weeks ago (the reissue). Now, as you all know it's blowing up again. So, I went to return it but they said no. No? They said I can only get another Note and that will take 4 weeks. Seriously. So the options:
1. Have no phone for a month
2. Blow up
I think I'm edging towards blowing up.2 -
It's been a good month where honestly I had nothing to rant about. Pretty much doing my own project setting up ELK.
But last few days I had to return to the reality called teammates....
It where it ok... I mentored one of them, then did the code review yesterday
And that's when the shit hit the fan.
I told them to do X but then they did Y instead thinking that they were smart.
In hindsight they seem to have no idea wtf they were doing, inexperienced and couldn't even use console.log and JSON.stringify to debug object states...
Which course now reminded what's wrong with this team, you got people jumping around stacks and projects so they're all mediocre on all of them. Rather than having specific people being good at one of them (aka more experienced than a noob).
And if course this morning, manager asked me to look into something on a program I haven't support in a while (there are a free people that are more experienced and know the current state better). And he said this is quick and urgent... And actually when he said that I'm like uh.... don't think so....
And last thing is we had to rerun a report in production so needed the shipper ten to do it. Asked them look yesterday, users were waiting.
Today... Still not done. And well I actually can run the report myself locally.. takes 5mins but in production they need to reload the data but that should take at most 20mins... Either way... Nothing was done.
Oh and I just remembered I raised a request to it SA group to have some not script installed... That not done either.
And this is why relying on others it at least these people is a bad idea..... Unless your are capable of firing them... -
Third day of working on my recruitment task, and I'm starting to get pissed. I'm applying for Junior JS developer (suprised that they even picked me, I had 1 JS project in my resume, rest was Java). The task seemed simple, create website with autocomplete field which gets 10 cities with most polluted air from given country and get cities deacription from Wikipedia. But hell no. First, the air quality API that they told me to use sucks horse dick. Like seriousy, you can get a fucking timeout while fetching data, because as author explained, someone decided to make 2 fucking queries per request, one to count all possible results, and then the second one for actual data. Like, WTF, why would you do that. After I got that shit to work from time to time, it was time to Wikipedia API. And the shitshow starts again. Because it turns out that you can't filter the results based on the category. Which means that if the city has the same name as river or some fucking guy doing sports, I won't get the fucking description, because it will simply return info, that there are more more that 1 result. At this point, I'm so fucking pissed, I am barely keeping it together. I want to work at this company, because the pay is great, there are a lot of opportunities and shot, but god dammit, if I finish this task, I'm getting drunk for 3 days straight.
EDIT: even author of the air quality API says that it is not a good fit for given task...4 -
TL;DR When talking about caching, is it even worth considering try and br as memory efficient as possible?
Context:
I recently chatted with a developer who wanted to improve a frameworks memory usage. It's a framework creating discord bots, providing hooks to events such as message creation. He compared it too 2 other frameworks, where is ranked last with 240mb memory usage for a bot with around 10.5k users iirc. The best framework memory wise used around 120mb, all running on the same amount of users.
So he set out to reduce the memory consumption of that framework. He alone reduced the memory usage by quite some bit. Then he wanted to try out ttl for the cache or rather cache with expirations times, adding no overhead, besides checking every interval of there are so few records that should be deleted. (Somebody in the chat called that sort of cache a meme. Would be happy , if you coukd also explain why that is so😅).
Afterwards the memory usage droped down to 100mb after a Around 3-5 minutes.
The maintainer of the package won't merge his changes, because sone of them really introduce some stuff that might be troublesome later on, such as modifying the default argument for processes, something along these lines. Haven't looked at these changes.
So I'm asking myself whether it's worth saving that much memory. Because at the end of the day, it's cache. Imo cache can be as big as it wants to be, but should stay within borders and of course return memory of needed. Otherwise there should be no problem.
But maybe I just need other people point of view to consider. The other devs reasoning was simple because "it shouldn't consume that much memory", which doesn't really help, so I'm seeking you guys out😁 -
Me clicking on "New article" ...
Title:
<span onclick='return 1248 == prompt('When the construction of the Cologne Cathedral started?');">Click me to open the treasure</span>
Text:
<span onmouseover="alert('No?');" style="width:100%;height:500px;">It's ok that every editor can insert arbitrary HTML?</span>
Don't worry, it's a dev server but still bad to see -
Possibily the weirdest coincidence I've experienced... I was just searching for, specifically and explicitly, the ebook version of O'Reilly pocket references for a babydev since physical copies, if/when available, are expensive and slow delivery. While googling the PHP one, somehow, 1984 (orwell) in russian was oddly high in the search results.
1984 is my favourite book and I've been meaning to take time to brush up on my russian. Normally I'd blame the result on things like tracking data, but this was via a clean, isolated, never logged into anything, system. The only factors that couldve been skewing results are my explicit locale settings, primary- german/germany, secondary- english/US, additional languages- dutch, russian, arabic, spanish. No other cookies or previous search history and using a static IPv4 that has been allocated, but until a few hours ago, totally unused for ~6mo (part of my /28 block).
It's so serendipitous that I keep mulling over everything trying to figure out wtf I missed... seriously, how the hell does "O'Reilly pocket reference php ebook" return a russian paperback of 1984???
I'm totally gonna find and buy one now too (the actual result is costly, plus would ship from germany so more costly).5 -
Over the last week I've slowly grown to fucking hate IMAP and SMTP. You'd think after so many years we'd have come up with better servers to manage email but no we still rely on fucking decades old protocols that can't even batch requests.
To make things worse I need to attach to IMAP through node and that has been a nightmare. All the libraries suck ass and even the ones tailored towards Gmail don't work for Gmail because Google decided one day to fucking out the header at the bottom of some emails and split into mimeparts. Also why the fuck is fetching email asynchronous? There's no point at all since we requests are processed line by line in IMAP, and if the library actually supported sending asynchronous requests it wouldn't require a new object to be created for each request and allow only a single listener.
Also callbacks are antiquated for a while and it pisses me off that node hasn't updated their libraries i.e. TLS to support async/await. I've taken to "return await new Promise" where the resolve of the promise is passed as the callback, which let's me go from callback to promise to async/await. If anyone has any other ideas I'm all ears otherwise I might just rewrite their TLS library altogether...
And this is just IMAP. I wish browsers supported TLS sockets because I can already see a server struggling with several endpoints and users, it would be much easier to open a connection from the client since the relationship is essentially:
Client [N] --- [1] Server [1] --- [1] IMAP
And to make the legs of that N : N which would fix a lot of issues, I would have to open a new IMAP connection for every client, which is cool cause it could be serverless, but horrifying because that's so inefficient.
Honestly we need a new, unifying email protocol with modern paradigms...8 -
-Recently started a new job so I’m new to the infrastructure-
Spent the vast majority of the day trying to SSH into one of my company servers to sort some random bug out on the website & the connection kept being rejected despite the day before it working when passing the .pem key into the SSH along with the ip & my username, nothing new there.
Anyway, everyone’s mad busy so I don’t wanna bother anyone to ask why, so I check confluence, no documentation for SSHING into our scheduler or the code the server I need to access. Never-mind.
Spend another couple hours trying debug it on my own, no luck. Never-mind.
Finally seize my opportunity and ask for help; ‘Oh the server IP changes daily so you need to run a task through our scheduler that you need to SSH into to return the list of IPS and that dynamically changes so that’s how you get the IP’
Oh ok. Why is there no documentation for that again? I mean. Thats generally some pretty important information you’d pass onto your starters.
At least I can say I won’t be making that same mistake again.5 -
So I'm having this return to the 70s mood. Not for the 70s themselves but for the pack of tech in everyday life.
Like besides email or worldwide message exchange and wikipedia, what have been the last true innovations?
Media streaming just killed and monopolized other industries. Sure, everything is cheaper, but let's be honest, how much music do we consume? Pretty sure like 80% of people listen to the same 100 songs in their whole lifetime. Do we need limitless streaming? Did it help us somehow beyond giving some dopamine shots?
Social media are and have always been crap for posers, advertising and bots. Small communities make sense, when properly taken care of. The actual issue with social media is the replacement of the so called "Third place". The place you go after work that is not your home. We don't know each other anymore, loneliness is apparently becoming pandemic and people are struggling with this. How is this innovative? For the real time news that are making people freak out?
And then, as I ranted before, AI. It's just... Statistics. Well applied statistics. Is it an actual innovation? No. Serves nothing beyond taking someone's job.
And before some retarded dickhead starts no, it will never create the same amount of jobs as a factory would've done 100 years ago, and prompt engineering is a lie told by the very guys who SELL those products to convince you that their crap is harmless.
Maybe it's about time to hit the brakes for a second and think if the simpler things (NOT the times!) were better, if maybe if we're getting lonely is actually our fault, it's our fault for not calling that old friend for a drink, it's our fault if we keep getting some dopamine shot every minute and are barely able to look people in the eyes, it's our fault for not behaving like human beings?
I hope any engineer will understand how this rant is about consumer-oriented tech and not tech in general.10 -
Sometimes, GCC is cool with you, warn you for every no-return int function or little parenthesis which could make the code easy to read.
And sometimes, you can get the fuck off, because initialized variables are no big deal. Really ... -
Scala lang is hard to learn(not saying that sucks), but first I don't want to learn this language, I just wanted to use some functions for a hobby project and this project I found on internet had all I need so I just wanted to translate it to Python, using an online Scala compiler I pasted the functions I needed anddddd error can't compile it it, because the functions had some extra things that were not part in the file where functions were, these things check for null values(?) so I was looking into the project where these "keywords" comes from and I can't find it, so after some grep in the project files I found the "keyword" I was able to compile it, also I weird thing about this language is that there is no return keyword
So yes I find this lang not that intuitive (for me at least)4 -
Heres a fairly useless but interesting tidbit:
if i = n
then
r = (abs(((((p)-(9**i)-9)+1))-((((9**i)-(p)-9)-2)))-p+1+1)
then r%a will (almost*) always return 0. when n = floor(a/2) for the lowest non-trivial factor of a two factor product.
Thats not really the interesting bit though. The interesting bit is the result of r will always be some product with a *larger* factor tree that includes the factor A of p, but not p's other larger factor, B.
So, useless from what I can see. But its an interesting function on its own, simply because of what it does.
I wrote a script to test it. For all two-factor products of the first 1000 primes, (with no repeating combinations, so if we calculated say, 23*31, we skip 31*23), only 3262 products failed this little formula, out of half a million.
All others reliably returned 0 for the following..
~~~
i = floor(a/2)
r = (abs(((((p)-(9**i)-9)+1))-((((9**i)-(p)-9)-2)))-p+1+1)
r%a
~~~
The distribution of failures was *very* early on in the set of factors, and once fixed at the value of 3262, stopped increasing for the rest of the run.
I didn't calculate if some primes were more likely to cause a product to fail or not. Nor the factor trees, nor if the factor trees had any factors in common between products, or anything of that nature.
All in all I count this as a worthwhile experiment.
If you want to run the code yourself, I posted it to pastebin here:
https://pastebin.com/Q4LFKBjB
edit:
Tried wolfram alpha just to see what it says, but apparently not much. Wish it could tell me more.40 -
Why did I go broke?
Because every time I tried to cash in my promises, I’d end up nullifying my income with undefined deductions! I thought I could get by on short functions and quick closures, but in the end, I found myself callbacked into a corner with no scope for improvement.
I tried to debug my financial situation, but my stack overflowed with deferred payments, and I couldn’t even parse where all my money was going. The compiler of my life just kept throwing unexpected "expenses" errors.
In a final attempt, I refactored my entire approach, renaming myself Async to buy some time, but it was too late. My funds were hoisted to the global scope, and before I knew it, I was reduced to Boolean poverty.
Now, I live my life in strict mode, always awaiting the day I’ll finally get a return on my investment... but deep down, I know I’m just an object in a mutable state.
P.S : I'm a JS DEV1 -
In the morning to afternoon i do coding, debugging and sometimes deploying. In the night i just already start to play PUBG. I dont know why i am interested to play this game at the time.
But what i’ve learned while playing it is like looting the weapon and amno, find the easiest enemiest first (bot is still existed in the real game) , make some rotation, call the teammate if i am being knockdown and unluckly we landed then dead without weapon (too-soon) and fight for getting Winner Winner Chicken Dinner !!
Its like what i am doing every single day tobe better as developer, find some literature or articel, try to solve an easiest task, deploy it and boom its getting error and suddenly need to hotfix after it’s work with return 200 expected and no error logs on my APM😅
If you guys play too, share me your pubg id on the comment below.
Lets make some fun party ✌️👍 -
So I am struggling with a SQL Query for my Database lecture.
This is the Table Layout:
Users(id:integer, reputation:integer, display_name:string,
day:integer, month:integer, year:integer, location:string,
up_votes:integer, down_votes:integer, age:integer)
This is the task:
Show the set of users who have the highest reputation and the lowest down_votes
than any other user. HINT: there is no user that is better than all other users on each of the
criterion individually. Thus, you need a query that can eliminate users that are worse on both
criteria than some other user (in Economics your query will return what is known as the Pareto
Set).
I have looked up the Pareto Set but I am not really sure how to implement it into SQL.
So does any one of you know how to implement this or could anyone lead me into the right direction?
Help is very appreciated :)12 -
How do you handle error checking? I always feel sad after I add error checking to a code that was beautifully simple and legible before.
It still remains so but instead of each line meaning something it becomes if( call() == -1 ) return -1; or handleError() or whatever.
Same with try catch if the language supports it.
It's awful to look at.
So awful I end up evading it forever.
"Malloc can't fail right? I mean it's theoetically possible but like nah", "File open? I'm not gonna try catch that! It's a tmp file only my program uses come oooon", all these seemingly reasonable arguments cross my head and makes it hard to check the frigging errors. But then I go to sleep and I KNOW my program is not complete. It's intentionally vulnerable. Fuck.
How do you do it? Is there a magic technique or one has to reach dev nirvana to realise certain ugliness and cluttering is necessary for the greater good sometimes and no design pattern or paradigm can make it clean and complete?15 -
Error reporting. Yeah it is a pain to come up with something that users will understand. As devs we need meaningful stacktraces so we can diagnose the problem but the normal person doesn't care. Also not having consistent messages looks terrible for the user's experience.
I hate it when there is no standardized error messages and/or json structure between teams or individual members of said teams. Why should we have 10+ different structures to code for in our apps? There is RFC 7807 for a reason. It has a defined structure plus accounts for custom properties. If you are a c# developer, check out the ProblemDetails class. It has made my life easier and I can guarantee everyone that all of my team's projects return this structure. -
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. -
NodeJS and MongoDB. And tutorials.
Everywhere tutorials show simple example of console.log output of findOne. Good, that works... But when I try to extrapolate example to assign results to variable, it won't work. Inside that fetch anonymous function it works... But outside, simply undefined no matter what I try. Return doesn't return either...
Why it is so hard to make tutorials and examples that would be actually useful. I've spent hours with this already.
And on top of that it is really hard to find tutorials staying with minimum extra dependencies. Like most tutorials in this case throw mongoose in the soup. And I don't want that.
Sometimes makes me question why I try to learn these new things, when I have knowledge of other technologies that I could use faster and easier...3 -
Something annoying about the Node.JS and express stack: no way to globally catch errors using middleware.
I mean, you can try. There's even specific middleware designed for it. However, it only catches synchronous errors. So basically only controllers that don't fetch or upload any sort of data and just return some static view or whatever.
ASP.Net middleware chain is so much more robust :(5 -
I have finally done what I will call a "pro javascript move", but I did this in C++...
QString str("hello");
float offset=0.0;
...
offset = somevalue;
return str + offset;
This printed out "hello[]". Where [] is some unknown character box.
No warnings at all. It just found a conversion function and did it.1 -
I think I have a slight problem in my API.
Snapshot 1 : API entrey point
Snapshot 2 : on "return" statement from API.
No biggies, 8 GB of RAM used.
The API ? Adds 1 ligne in database.
That's gonna be a fun debug8 -
in vb.net i can declare a void function:
Declare Function some_func& Lib "some_lib.dll" ()
then try to assign its return value to a variable:
some_return = some_func()
and get no errors during compilation, not even a warning
but in runtime it produces integer arithmetic overflow exception
in what way it is not even a warning?4 -
I wrote a small crate that does unsafe operations, please help me verify its soundness: https://github.com/lbfalvy/bound
(Also I think you'll like it, I'm solving a fairly abstract problem that's not possible in safe Rust)
It's essentially a struct that ties together a heap reference and a struct that's constructed from it. The main use case is to return lock guards derived from Arc<Mutex> but it's defined in a very abstract way intentionally because I'm using Marc from mappable-rc and async-std's RwLock and I didn't want this to depend on either crate.
It actually has no dependencies apart from STD (I think this one may be unavoidable) -
I'm currently making an internship at a medical software company and today i found this gem in a js file:
/*
the server does not check if the element was deleted or not; it will return success, no matter what; **it's not a bug, it's a feature**
*/ -
i can see a very thin line between me remaining the same good natured person as i am right now, and me turning into completely chaotic no remorse psychopath , in upcoming future.
the universe follows the rules. planets revolve in a pre defined manner, day and night comes as expected. however being a human for last 24 years, i have come to experience 2 different phenomenons : being rule bounded and being random.
randomness is fun. randomness is guilt free, randomness is a wonderful feeling for someone . but at the same time its worse for everyone else. try slapping a random kid in park or eating food at a restaurant amd running away, assuming there will be no consequences against you whatsoever. such a nice evil feeling
at the same time, rules are boring , unrewarding, guilt filled words of hope.
- "do not eat pizzas or you will get fat" :boring + guilt
- "go to gym, you will become appealing and get a good sex " : boring + hope
- "if you perform well, you will get appraisal and you will earn enough to afford your family a home" : hope + guilt
see how these rules are full of hope/guilt/boredom for you while being good+rewarding for others? that's how you are categorised as being civil , as being part of a society of semi evolved apes.
and as if those rules weren't enough , there came this unnecessary concept of faith, religion and spirituality.l, with its own set of rules and hopes.
and it seems like such a great capitalist idea , since the hopes provided via these are not even realistic : keep on doing good stuff, following the rules and you will get a better afterlive/next birth!
i have tried being a good person for my whole life. my parents are religious and i try to be one, I don't drink , smoke, eat other animals, or randomly start slapping kids in the park. i have been a boring personality, i studied , ran in various races od educational life, failed most of them, landed in a decent paying job , and now trying to even gain back a decent body to look respectful and worthy of a future family. feels like i did so much for so many hopes and am still doing it. we all do , no?
but i have seen companies laying off people and leaving them in turmoil, marriages getting ruined, and some person never getting the love, respect and rewards they deserve for all these shitty rules they kept up with
my life book is somewhat even-steven. i did get a few rewards and respect for some of my hard work, but my overall portfolio is negetive : a lot of investment on just the hopes of a better return
let's see if i can keep up with my sanity for next 50-60 years before i am dust again.
=====
ps : try playing bitlife : life simulator mobile game ( download the cracked version from the web though, original one is full of ads) . it just have a single big button and shows text about how an imaginary child(you) os growing every year on click. so far i tried to play the life of kid like a criminal, a heavily educated person, a politician and a job worker. almost all of them recieved "miserable" and "unsuccessful" as the final result. very fun game to play without being evil1 -
I was working on CakePHP as part of class project. I had to demonstrate AJAX. So I created some text files filled with random Wikipedia articles. On drop down item change, my AJAX handler would fetch the content of corresponding file and return it back.
But the problem was, it wasn't returning just the file content, but the whole HTML document. So the calling page would get another set of header, menu, footer and all! There was no time to fix layout for AJAX calls as it was added at last minute before the presentation. So, I just hid the duplicate menu etc using CSS and went for the presentation. It passed with flying colours.
So, if you can't fix something, just hide it! 😂 -
One user could report that the data they saw didn't make sense. Turns out there was a one-off hardcoded caching detail for one of our services that cached based on a search query (yes, the entire query was the key) and before any auth checks. The system would return the results owned by whoever asked first, no matter who asked after that point.
There's "Oh dear but we all make mistakes" and there's surrender cobra. This is what PRs are for.1 -
I'm working on a simple Flask project. But when I try to work with the database I got an error called "No module named MySQLdb". I also got error when I try to install "mysql clint" with this command:-pip install mysqlclient. So I searched for the solution of this problem but every time I find someone told to download "MySQL client" from this website:-
https://lfd.uci.edu/~gohlke/...
But the "MySQL client" file is no longer available on that website.
please help me by giving that file or any other way. You can also check my project from here:-
https://drive.google.com/file/d/...
unfortunately, my operating system is Android 6.0
Here is the code:-
from flask import Flask,render_template, request
from flask_sqlalchemy import SQLAlchemy
app= Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = "mysql://localhost/codingthunder/"
db = SQLAlchemy(app)
class Contacts(db.Model):
sno = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), nullable=False)
phone_num = db.Column(db.String(14), nullable=False)
mes = db.Column(db.String(120), nullable=False)
date = db.Column(db.String(12), nullable=False)
email = db.Column(db.String(20), nullable=False)
@app.route("/home")
def home():
return render_template("index.html")
@app.route("/about")
def about():
return render_template("about.html")
@app.route("/contact", methods=['GET','POST'])
def contact():
if(request.method=='POST'):
name=request.form.get('name')
email=request.form.get('email')
phone=request.form.get('phone')
message=request.form.get('message')
entry=Contacts(name=name,phone_num=phone,mes=message, date="2019-09-01 12:06:20", email=email)
db.session.add(entry)
db.session.commit()
return render_template("contact.html")
@app.route("/post")
def post():
return render_template("post.html")
app.run(debug=True)3 -
I tried Appgyver over christmas, since it promised easy front-end (no-)coding I was looking forward to getting rudimentary frontends done faster.
Well, the first real project that I wanted to start didn't compile anymore (internal error from the service), the page told me to reload and try again.
It failed again... And again.
Fine with me, I only spent 10 minutes on the project at this point.
I then searched for the bugreporting page and found it. The sad thing is that when I wanted to open a ticket the server crashed. It didn't even return a HTTP error, just a JSON saying there is a error and a GUID.
I have to say, if a Dev decided to have holidays without new issues that's one way of getting that done.3 -
In my college project I am stuck with dumbos. I thought because of of experience in industry I would make them learn something. They don't anything other data entry, a lot of which can be automated. And I work the code which involves building APIs and 2 different Android apps. They are 3 and I am one. Till today they never bother to install the dev environment. Today I told them to get their laptops so they could connect to my laptop server and work with it. But no one bothered to get their laptops. All of them were using my one laptop. Can you imagine 3 people sitting on one machine instead of 3. And I have to sit there doing nothing😑. I went out to chill for sometime knowing that I could do nothing useful without my laptop. And when I return I find that instead of adding new entries, these people kept on editing old entries.🤦🏻 I mean how dumb could anyone be. Power of 3 brains. I can handle 0 work done, but this is negative work. I could done it myself by writing some automation script. And these people tell people behind my back to my friends that they do all the work😡. I have reached the limits.2
-
We have an internal nuget package that wraps up the IConfiguration+ConfigurationBuilder for various .net core console/service apps (TL;DR, because people got creative), and it has a dictionary property for the common sections we use. AppSettings (for backward compatibility), ConnectionStrings, and ServiceEndpoints. If the need arises, I can add methods to return any type of object (no one has requested yet, we try to keep configs dead simple)
ex. var myDatabaseConnectionString = ConfigurationManager.ConnectionStrings["MyDatabase"];
Code review for someone who updated a .net framework app to .net core and they wrote their own IConfiguration wrapper for accessing the appsettings.json file, so I pointed out that we already had a library for that.
In the reply, he said he couldn't use our library because it had an 'AppSettings' property and since his appsettings.json file didn't have that section, he didn't want to cause a runtime exception.
OK, WTF...I even sent him a link to the documentation (includes explaining the backward compatibility part)...why the frack would you think because a property exists and you don't use it, that would cause some kind of runtime exception?
We have dozens of .net framework apps migrated to .net core with zero code changes and no one ever brought this up as a concern (because, why would they?)
Deep breath...ahhh...I respond that not having an AppSettings section in the appsettings.json file won't cause an exception, if you don't have one, don't need it, you don't have to use it.
He went ahead merged+committed his code anyway with his own IConfiguration+ConfigurationBuilder plumbing.
Code addiction is real kids...it's real.2 -
ping REST API that is written in rust
it has specs. it will return json with result or error in it.
it's just returning result: null and no error
this is written in rust. how are you writing me responses with null objects in them? rust doesn't have null! how broken is this thing.
SAFE23 -
I lost 30 min to find why a function didn't give me the result.
I've found out why.
Hardcoded with a if with no bracket nor breaklines
Yes, the " if (something) return someotherthing;"
Now I see why it's not always recommended.. -
Gunstar Heroes, Streets of Rage 2, Street Fighter 2. It totally blew my child mind to the point of no return.
-
Feminism is Harmful to Society
Feminism may be defined as an activity aimed at preserving women’s rights and interests. The initial objective of the movement was to aid women play an equal role in a mainly male society. However, with time, the idea of equality of sexes has transformed into a battle where feminists intend to outdo men. Such toxic metamorphoses have made feminism dangerous to the society.
The ideology of the modern feminism falsely positions women as victims. Women, just as men, are capable of making competent decisions in accordance with their wishes individually and do not require extra advantages. Treating females as the oppressed gender encourages women to put the blame for any intellectual or physical challenge either at work or study on a male will. Such impact of feminism leads to the formal recognition of women as a victimized class and triggers a shift in the legal framework towards one of the sexes.
Unfortunately, men have to face one of the most unpleasant effects of feminism. The idea popularized by some feminists is that the latter are the worthless accessories in a woman’s life. Radical feminism has affected the law system. For instance, after separation, fathers are regarded as sponsors of their children. The incapability to fulfill the obligation leads to severe implications such as the loss of the driver’s license and examination of income tax return. On the contrary, there is no requirement for the mothers even to provide fathers with access to the children.
Finally, feminism badly affects families. With time, the initial principles of feminism were lost. Radical transformations of ideology took place in the 1960s and 1970s when the “Women’s Liberation” movement enjoyed vogue. The proponents of the movement approved sexual affairs outside marriage neglecting the core family values. Therefore, the lifestyle promoted by feminists is barely suitable for raising children.
Women have experienced numerous forms of institutionalized discrimination in different times and various cultural environments. This is a bitter but indisputable truth. However, in the race for the revenge, feminism has radicalized and deviated from its high aspirations. Modern feminism breeds hatred against men and destroys families thus being harmful to society.
Written by Emily Stafford, the best writer at https://perfectessaysonline.com/ -
🐟💩The image i fetch from s3 is of type byte array
I return it to angular as an ArrayBuffer
Which then needs to be somehow converted to an image so i can fucking show it
Then after research i had to convert ArrayBuffer to Blob
And from Blob to URL encoded object which returns a string that now shows the full image in img tag
Somehow, by a sheer of trials and error i have just accidentally made a very secure way of fetching a very sensitive piece of document (verification document with user's personal data on it) and now in browser this is shown as blob:shit-image/random-hash. Not even the file extension. This means nobody can download this image. You fucking cant. Its a Blob motherfucker! Like a Blob Fish. It saves either a .txt when you try to save it (no idea how) and if you try to open the image in new tab it shows gibberish text. This means you can read-only this highly sensitive document image and not manipulate it, not even download it. Perfect. I have just made a very secure software by accident.
(this blob fish looks like my shit)3 -
Learn git. Contribute to open source projects - you may learn more from code review on a single PR than from a whole tutorial. Ask questions constantly. Learn more git. Look for the cleanest solution to a problem. Write code that is easy to improve, easy to expand, and easy to debug. Learn even more git. Don't limit yourself to thinking only in terms of OOP, or functional, or procedural, or whatever type of programming you may be comfortable with. Don't be afraid to do some work by hand. Learn git, so that when all comes crashing down and your team crumbles to pieces, when your relationships fail and your friends disappear, when you're down on your luck and there truly is no hope left in life, you can check out of the dangerous world of your current HEAD and return to the home and comfort of your master branch, which you've kept safe, secure, and functional.
-
lol rust has no early return from a match statement
continue to skip rest of loop
break to exit a loop
return to exit a function
they put in let Ok(response) = request.send() else { return None };
then you can use response like normal after
but let's say I wanna know what the error was (Ok being a variant of Result::Ok or Result::Err, and the above allowing you to destructure and go on or exit early because can't destructure)
let response = match response.send() {
Ok(response) => response,
Err(err) => {
// log error to file or whatever
eprintln!("{err:#?}");
//????? HOW DO I BREAK OUT OF HERE
return None //whole function shits itself instead of just exiting match
}
}
//does some stuff with response
actually in my case the result will be wrapped in a Ok again so I'm not doing justice to explaining this problem, fux
but basically I need to exit the match without ending the function
come on, match is a loop. let me break, fuckers.17 -
They asked me to build a small website they will embed in a native application with some web wrapper in Android and iOS.
But also asked me to build a login web service that will return a JWT. Done.
They want to do a native code login form that opens up the web wrapper with my small website already logged in using the login web service.
I have no idea how to proceed in the backend.
At first i tried using postman with a POST request to the sessions/sign_in route and sending a form with the authenticity token and the email and password; but CSRF stopped me. I don't want to turn it off because of reasons.
Now i am wondering how to use this JWT to generate a cookie with a session inside it that they can use in the web wrapper.
Any help would be appreciated :)4