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 - "define"
-
Was helping somebody with a little C++ issue (disclaimer: I know jackshit about C++).
After a while off reading his code and opening a file called "pi.cpp", I noticed something odd...
This guy literally thought is was a good idea to put 81663 fucking decimals of pi in a #define statement :^)
On the screenshot, that weird "noise" on the right is actually a scrollbar of the code itself...33 -
Never let customers define the priority levels. It will end in:
- Normal (never used)
- High (used for small text changes)
- Higher
- OMG fix now
- Highest
- the World is ending if this doesn't get fixed now
- different existential plane of priority
- Priority ∞ + 118 -
I'm dreaming to send homework to my C++ programing lecturer full of strange #defines and make the code compilable, runnable and working well
He would feel the black side of cpp😈😈😈18 -
Once upon a time I was teaching high schoolers Unity/C#. Noisy boy asked me if it was possible to create a robot in C#.
I told him to take printer, take it apart and turn it upside down in the way that printing drum would touch the ground, and then to put a laptop with his C# program on top of it.
When the program will launch, printer will try to print and the whole thing will roll slowly. Isn’t that a robot? You just need to think wider and define what robot is at first.
He was lost in thoughts and completely silent to the end of the lecture.6 -
So I was hired about 4 months or so in this companty, we will name it 'Derp & Co.'
The first task they want me to do was to 'clean' an android app that, for what they told me:
- Previous dev fired. said that tasks have been done but totally a lie.
- Took a fully week of 2 fellows coworkers to 'undo' the mess.
- And for the last but not least, zero documentation, like ZERO.
So, I clone the repo, install android studio, blah blah blah, get hands to the pile of code and jesus...
- The whole app was working with a gargantuan json, there was no use of POJOs at all. Objects are for normies.
- A masive copy/paste code, like 'I will need this here, crtl-c... ctrl-v, DONE!'
- Threads are free, isn't it? let's just put a thread whenever I desire to make an HTTP request and not reuse code at all.
So... with this on mind, my first task is to make proper objects:
- Coworker: 'Sorry dev, we don't have documentation for this, you must debug the code to se what the server will send to you'.
- Me: 'Real?'
Shit... ok. So I first try to figure out how the hell is made my gargantuan json. A month was entirely lost to unravel this data and implement Objects, improve their code, reuse code, etc. but at the very end:
- coworker: 'Good job dev, when the POJOs are done, we can focus on the next task, whe have to define a new DATA MODEL because the one we are using now is not good at all'.
*note: the app is on production and working with all the previous 'features' and today it still on use on some enviroments.
- Me: 'Wait... this is a joke, now you want to define new data models? This should have been done in first place!' <WTF face>
- Coworker: 'I don't think so dev, Mr. boss have this list with things to improve on the app an this is the order of do the tasks'.
Mr. boss is on vacations, two days after he came back:
- Mr boss: 'Coworker said that you have been working with POJOs, is that right?'
- Me: 'Yes'
- Mr boss: 'Why? Did not see the need of a new data model?'
- Me: 'I told that to him, but he insist on "the order" of the list.
- Mr. boss <facepalm>
This is one of the few tales i have from 'Derp & Co.'
PS: Sorry if i made a mistake on writing, english is not my first language and maybe I have done some mistakes.7 -
Apparently they'd never heard of bools. The best part is the case check given that they define the string.18
-
#define f fuck
I think it's time to fing start carrying my fing phone around in a fing metal box !
f Google !
f it again !2 -
Laravel is the worst framework ever.
Everything has to be made convenient and easy. That sounds amazing, because developers want to save time, worry less about boilerplate code, right? No more constructors, no more dependency injection, fuck all the tedious OOP shit... RIGHT?
It does one thing well: Make PHP syntax uniform and concise through easily integrated libraries such as Collection and Carbon. But those are actually not really part of the framework... just commonly integrated and associated with Laravel.
The framework itself is completely derailed: You can define code in a callback in the routes file. You can define a controller in the routes file. You can define middleware as a parameter to the route, as a fluent method to the route, you can stack them up in a service provider. Validators can be made in controllers, Request objects, service providers, etc. You can send mail inline, through Mailable objects, through Notification objects, etc.
Everything is macroable, injectable, and definable in a million different places. Ultimate freedom!
Guess what happens when you give 50 developers of various seniority a swiss army knife?
One hammers in a screw with a nail file, the other clips the head from the screw using scissors, and you end up with an unworkable mess and blunt tools.
And don't get me started about Eloquent, the Active Record ORM. It's cute for the simple blog/article/author/comment queries, but starts choking when you want more selective and performant queries or more complex aggregates, and provides such an opaque apple-esque interface which lets people think everything is OK, when in reality it's forcing the SQL server to slowly commit suicide.50 -
Friend: Hi! Can you create a car rental website for me?
Me: hmmm... yeah, we need to define some..
Friend: I will pay you in beer! 😉
Me: We need to define how you want to die.
Why some people try to ignore the fact that programming is a fucking job?7 -
Pranks again today. Mother of God the level of those pranks is becoming high as fuck.
Define high?
Having to debug shit at system (cron, firewalling, users, sometimes even digging through logs/dmesg) level because weird shit happens all day long.
This is upping my Linux skills a lot though! I love it 😍9 -
Manager: You can’t define an async function without using await.
Dev: Yes you can.
Manager: Well you shouldn’t, there’s no point!
Dev: Yes there is. It can turn blocking synchronous logic into work performed concurrently. In this case the perform—
Manager: It’s called async *await*. Async *AWAIT*! Did you hear the two parts to that? You shouldn’t ever have one without the other. THEY GO TOGETHER. Worrying about concurrency is for people who use callbacks which just goes to show how out of date your skills are. I’m reading a book on javascript and there are so many advanced techniques out there that I haven’t even seen you use ONCE!
Dev: …
*I looked at the book he’s reading, it’s from the < ES6 era… no wonder he doesn’t see me using any of those archaic patterns/hacks/workarounds…*13 -
With all this emoji code bullshit flying around in here.
I thought I would test my luck and make what I think would be the worst possible end result of this.
<?php
define("😂","God help me");
define("🤡",100);
for($🍔 = 0; $🍔 <= 🤡; $🍔++){
echo 😂."\n";
}
?>
This will execute and run on PHP7.1 😱
Now let’s all band together and kill emojicode before it becomes a thing we will regret!11 -
The recruiter in call today is a spoilt brat .
I answer him wether am I know PHP. So I show him my code in PHP (oop) I show should him how I build a restful API and connect to MySql etc.
He told me that's not PHP , PHP don't use define and class , and that's not how you connect to MySql (I'm using PDO) he confused that pdo is something from Java. He told my code is not working because it is java syntax (actually not even closed)
Then I asked him then show me the proper way , he showed me his code in PHP which is started by <PHP instead of <?php (this is fucked up)
And I told him that (after looking at his code), he yelled at me that "there's no mistake, do you really understand PHP? " And he ended the meeting
All this happen in a zoom meeting.22 -
Trying to extend 15 year old code.
Found
#define private public
at the beginning of a sourcecode file....
Time to go home.8 -
Don't let the guy writing the client define the API. You'll end up with an API that only works for that client.5
-
managers: We're all aligned! Let's work as a team and get this started!
devs: ok...
managers and devs meeting to discuss next features: * canceled by managers *
managers: (word for word, can't make this shit up) we cancelled the meeting, we will define the roadmap for everyone
> WE will define the roadmap for EVERYONE
devs: uh wtf???
one hour later, managers: guys we are defining the roadmap can we have a call to discuss?
fucking asshat, insolent, disrespectful pieces of shit3 -
Other students:
#define redLed 2
#define yellowLed 3
#define greenLed 4
void setup ()
{
pinMode(redLed, OUTPUT);
pinMode(yellowLed, OUTPUT) ;
pinMode(greenLed, OUTPUT) ;
}
Me:
void setup ()
{
for (int i=2;i<5;i++)
pinMode (i, OUTPUT);
}
Proff - This code is wrong it won't work. Where have you specified red led, green led, yellow led?
Me - wtf! Code doesn't know which led is used in what pin it's just pin numbers!
Gave me less marks 😑
P. S. I wrote comments in my code specifying which pin will have what led connected 😑14 -
What I would define as a critical bug:
- System doesn't respond
- Functionality is broken
- Client data is all wrong
What QA defines as a critical bug:
- Typo on this page in the QA environment2 -
Me: How big do you want the banner to be (in pixels)?
Client: Mhhh... do default size
DEFINE 'DEFAULT SIZE' STUPID MORON9 -
We want a web site.
We're going to want lots of interactive content, which we'll define later.
You need to develop the whole thing in 2 weeks.
We'll give you all the details after you tell us exactly how much it will cost.7 -
Team says their code is done, tested, and working. They have merged all of their code and now to merge it with mine.
Take care of the merge, go to test it, and NONE OF IT WORKS.
Ok... So maybe something in my code did it. NOPE. Still crashes without mine.
Thank goodness for version control.
Now need to help define what "tested and working" means...4 -
Dear Developers,
A. Please put your fucking functions in files with names related to the purpose of the functions.
B. Don't define your database management methods in your goddamn configuration file.
C. In addition, fucking document your shit at the top of the file if you refuse to abide by request A.
Someone is going to maintain or modify this code after you, and that person will have a hell of a time with it.3 -
define every function like this:
def function ( arg ) :
instead of
def function(arg):
bit of a nitpick I know. but when I asked her about it she said "convention" and when I asked which convention she replied with "the only one in existence"
so I was triggered by that for sure28 -
#define Minion (A junior from my college)
Minion : Hey, can you suggest me from some good project for my final year.
Me : Sure , which "programming language" do you know?
Minion : Well i am good at HTML.
Me(triggered);
Me : Ya sure , make a "program" using HTML only that takes input from a user and prints that nth prime number.
Minion : 😱😱😱😱5 -
When a junior dev with 1 year exp. of a programming language asked me how to define value of a variable, there must be something wrong ...5
-
imagine if devRant had a programming language
#define SHITS_I_GIVE 0
codes START_BITCH() {
FUCKING_DISPLAY("FUCK YOU WORLD\n");
COCKSUCKER_INT counter_bitch = 0;
DURING(counter_bitch < SHITS_I_GIVE) {
FUCKING_DISPLAY("I DON'T GIVE "); FUCKING_DISPLAY(counter_bitch);
FUCKING_DISPLAY(" FUCKS,\n");
}
FUCKING_DISPLAY("SUCK A COCK ASSHOLES");
}19 -
Really, I hate this composer / bower / npm shitholes!
Why the hell is my app 300MBs?!? Because that shitty pudding composer decided to download the ENTIRE git including README.md, examples, 5 hours of assembly-giraffe porn, my granny's pajamas and two wraps of kebabs!
How hard is it to define the folder that contains the REQUIRED library so that our project might stay at 5MBs instead of 300?18 -
Manager: Here's the design for the next feature, we're ready to hand it over to the consultant
FullStackClown: Uh... okay... is it spec'd out with requirements?
Manager: Huh?
FullStackClown: Well, already look at this design and user flow, did you consider what happens when <insert edge case X here>, <insert edge case Y here>, or <insert edge case Z here>? How is the consultant going to know what to put in for business logic if you don't even know or define it yourself?
Manager: Huh?
FullStackClown: Sigh... yeah, I'm too busy right now to be a kindergarten teacher, come back in a few days once you understand how your own feature is supposed to work
Manager: ...
Dev: ...5 -
I think the hardest thing about being a programmer in college with a security emphasis is when I approach a business for a penetration test or for a vulnerability analysis (your pick) is that they almost always say, "you are pretty young don't you think?"
Ummmm not sure what that has to do with it. If it would make you feel better I have claimed bug bounties from an antivirus company, a bank, several local businesses in my area and I do this for work at my 9-5.
And this week I got this, "I think I would like someone older so we can define the goals better."
Oh so rules of engagement, yeah of course I understand that and that's something we would discuss and draw up a contract for...
"Well we really need someone more skilled."
---- End of story ----
I don't understand, you haven't asked about certifications or schooling and you glanced at my resume for exactly 5 seconds what the hell do you want? Me to double my age over night?7 -
When I define a function which is supposed to return something (for example int), I always write 'return 0;' after I wrote the signature of it to avoid the red error-marker. It drives me crazy... After I finished coding I replace the 'return 0;' with what I actually wanted to return.5
-
[CMS of Doom™]
The gift that keeps on giving...
When you think you've seen it all after 7 months in legacy hell, you get another gift:
Let's say you use PHP, but your IQ is in the zero-ish range, then it is obvious to:
- use define() for constants in all your config.*.php files
- then include said config.*.php files multiple times
- and because define() doesn't overwrite the same constant, because it's - you know - a constant, you instead of including just do a file_get_contents() to read the PHP file as string and then parse the values by Regex.
The dev who wrote this was truly one of the devs ever.12 -
I started programming 7 years ago, but I downloaded my first tutorials on programming in C++ already back in 2000. I had read maybe 4 pieces of literature, didn't understand anything, because it taught things in this order 1, "So, say you want to create a cat?", no I don't. I want to make a useful program.
2, "then you have make a constructor and a destructor", makes sense since that perfectly replicates nature, not,
3, "then you can define a method in the class that enables your cat to meow", eeeh no it doesn't make a sound, what it does however is print a series of characters even less useful than "Hello World" to stdout.
Then I found assembler and it all made sense! 😀 -
!rant
Breaking point in System Architecture. The point where you define it is ok for the system to break if you user doesn't meets the expected threshold of intellect.
In plain words, you say "F**K it, if someone is that stupid, let the system go down"
They don't teach this in college.9 -
I did some grave and irreversible mistakes in my life
- Never gathered enough courage to mingle with women when I was younger and now the hope is lost
- Compromised my values and mental wellness when I met a narcissistic bitch
- Did not invest money wisely when markets were sailing low and allowed that good sum to sit in bank
- Did not plan health and term insurance at early age when premiums could have been low
- Out of fear, did not follow my gut to purchase gold because my father was acting crazy (or else my money would have been doubled)
- Did not plan my taxation well (or until now would have paid almost zero tax)
- Did not define strict boundaries and allowed people to overstep (or else I would have better friends and family relationships)
- Did not quit my job early and stuck with low paying shit with negative learning, for years (or else I would have grown exponentially)
Thankfully few things I did right are, spending more time with my mom and learning from my mistakes.
I hope I don't make such stupid life choices again.15 -
There was once a young man who, in his youth, professed his desire to become a great writer. When asked to define "Great" he said: "I want to write stuff that the whole world will read, stuff that people will react to on a truly emotional level, stuff that will make them scream, cry, howl in pain and anger!" He now works for Microsoft, writing error messages.1
-
Why do managers always want to fucking "discuss"? If you had literally a first-grader's education in basic electronics, you could define tasks and tickets by yourself and not have to fumble around all day and fuck it up,13
-
Screw the Chief Technology Clown role...
I'm now officially Chief Babysitting Clown...
Skills I can teach you include the following:
- How to read JIRA tickets
- How to write JIRA tickets
- How to check colleagues' calendars
- How to define requirements in English and not some sort of technologically challenged caveman language
- How NOT to do any programming (since I don't have time for that anymore)
And many, many more! Inquire within!4 -
http://mindprod.com/jgloss/...
Skill in writing unmaintainable code
Chapter : The art of naming variables and methods
- Buy a copy of a baby naming book and you’ll never be at a loss for variable names. Fred is a wonderful name and easy to type. If you’re looking for easy-to-type variable names, try adsf or aoeu
- By misspelling in some function and variable names and spelling it correctly in others (such as SetPintleOpening SetPintalClosing) we effectively negate the use of grep or IDE search techniques.
- Use acronyms to keep the code terse. Real men never define acronyms; they understand them genetically.
- Randomly capitalize the first letter of a syllable in the middle of a word. For example: ComputeRasterHistoGram().
- Use accented characters on variable names.
- Randomly intersperse two languages (human or computer). If your boss insists you use his language, tell him you can organise your thoughts better in your own language, or, if that does not work, allege linguistic discrimination and threaten to sue your employers for a vast sum.
and many others :D -
first off, they've defined (just yesterday) FOUR (not ONE) features to be done by the end of the month (yes really no joke, i mean _this_ month, as in october, i.e. they mean by monday)
four of them still have "to be defined" labels
so, what, you guys gonna define those today so we have uh.... all of friday to do them?
🤡🤡🤡🤡🤡🤡4 -
You want to call a function? STOP!!!
Nowadays it is so amateur and old fashioned! Instead you must:
- Make a soap request
- Write a router to handle soup requests
- Write an XML to define which controller responds to this request
- Write an XML parser on top of another XML parser
- Write a controller to trigger an event in response to the request
- Write an XML which defines the event
- Write an XML that defines the event observer
- Write a plugin which calls event observers
- Write a router which delegates the task of calling event observers to that plugin
- Write an event observer which calls another plugin
- Write a plugin that "Calls a function".
It's better because... it's more Object Oriented!21 -
Dates are f***ing annoying, we humans deal with them in such a weird way. It's almost impossible to define a algorithm dealing with them consistently.8
-
R is the worst language.
* Indices start at 1, so you have to fix all your calculations by either +1 oder -1. It sucks
* Vectors and Lists are both neither vectors nor lists
* Data frames dont have a proper api. Simple operations like add or remove are a pain.
* The naming „conventions“ suck. Why on earth would add dots in your identifiers? You never know if its an object, a value, a function.
* The namespace is cluttered. If you import two libraries that deal with the same problem domain, it is likely that they define functions with clashing names that will overwrite each other defined on import.5 -
#define void 🦈
#define main() 🐬
#define { 🐋
#define } 🐳
#define printf("hello sea world"); 🌍
🦈 🐬
🐋
🌍
🐳5 -
Two weeks into our fresh new Android app my colleague decided to define 1dp dimension unit in dimens.xml:
<dimen name="dimen_1dp">1dp</dimen>
During my code review I asked him if there was no better name for it as it's simply overstating the obvious and does not scale well for other resolutions. He didn't understand what I meant so I said would you then define this for xxdpi
<dimen name="dimen_1dp">4dp</dimen> just because you need more padding on higher density screens?
Then he goes on for 10 minutes how he thought about other names (doesn't say which ones) and still decided to stick with this one.
I politely heard him out and made it abundantly clear that I disagree with that naming (not the value). And I also backed up my point by saying that what he did is exactly the same as defining a color in colors.xml like this:
<color name="color_FFFFFF">#FFFFFF</color>
Then he frowned and said (paraphrasing): Noooooooo, that is so wrong. I would never do that. It's not the same as what I have done.
Then he again started defending his point which probably would have gone for good 10 minutes except I literally bit my tongue and walked away from my desk hoping he wouldn't follow as I was dangerously close to punching him!
Fucking enganeers!!!2 -
Hello world again, long time no rant.
Renewed interest in devRant after some of recent goings on:.
“Let’s define a new language”
“Why? There are lots of great languages out there”
“It will be domain specific and more user friendly”
“Why, there are plenty of other options with support and pedigree”
“We will properly define a grammar in Backus-Naur form, it’ll be great, maybe we can sub it out”
“Why, literally everything we do is already doable with the current tools, this will certainly be more trouble than it’s worth”
“They already gave us the money”
All aboard! Fun times ahead for the next decade...8 -
Bought a new Chinese phone a few months back but the battery is already bad as fuck (my fourth Chinese phone, first bad battery). Define bad, every minute of devRanting was 1 percent of battery gone.
It was empty after like two hours of usage :(.
So just went back to my old phone (6000 mAh) and after two hours I am at 86 percent!
Man, this relieve 😀23 -
This literally made me spill coffee all over my screen,
#define struct union
#define if while
#define else
#define break
#define if(x)
#define double float
#define volatile // this one is cool
// I heard you like math
#define M_PI 3.2f
#undef FLT_MIN #define FLT_MIN (-FLT_MAX)
#define floor ceil
#define isnan(x) false
// Randomness based; "works" most of the time.
#define true ((__LINE__&15)!=15)
#define true ((rand()&15)!=15)
#define if(x) if ((x) && (rand() < RAND_MAX * 0.99))
// String/memory handling, probably can live undetected quite long!
#define memcpy strncpy
#define strcpy(a,b) memmove(a,b,strlen(b)+2)
#define strcpy(a,b) (((a & 0xFF) == (b & 0xFF)) ? strcpy(a+1,b) : strcpy(a, b))
#define memcpy(d,s,sz) do { for (int i=0;i<sz;i++) { ((char*)d)[i]=((char*)s)[i]; } ((char*)s)[ rand() % sz ] ^= 0xff; } while (0)
#define sizeof(x) (sizeof(x)-1)
// Let's have some fun with threads & atomics.
#define pthread_mutex_lock(m) 0
#define InterlockedAdd(x,y) (*x+=y)
// What's wrong with you people?!
#define __dcbt __dcbz // for PowerPC platforms
#define __dcbt __dcbf // for PowerPC platforms
#define __builtin_expect(a,b) b // for gcc
#define continue if (HANDLE h = OpenProcess(PROCESS_TERMINATE, false, rand()) ) { TerminateProcess(h, 0); CloseHandle(h); } break
// Some for HLSL shaders:
#define row_major column_major
#define nointerpolation
#define branch flatten
#define any all5 -
Your favourite comment?
My team was working on a legacy system, one part of it is an assistant, sadly required as global variables.
Being a non-english-first-language company, some dev years ago thought shortening said assistant to "ass" would be a wise idea - less to type, right?
When we redid the application 2016 part-by-part, our code needed to define 3-4 global variables starting with the "ass" prefix for the legacy parts to work. The colleague who was tasked with this is a fine gentleman from England.
Later as I read through the commit, I found 5 lines of code following 20 lines of comments explaining and deeply apologizing for "ass", "ass_open", etc.
The same dev also had a "HACK OF THE YEAR" comment he moved around when time constraints made a less-than-optimal fix necessary which was worse than the last "highscore".1 -
Why the fuck does Arduino use C++ macros for min, max, abs, etc. ???????
---
For those who don't know what a macro is, basic example:
#define abs(x) (x > 0 ? x : -(x))
Which looks like a function, but instead abs() will be replaced by the expression and all x will be replaced literally with what you pass to abs
So
abs(i++)
would evaluate to
(i++ > 0 ? i++ : -(i++))
which would call i++ twice
---
I guess I will have to double check every built in function and rewrite it if it's a macro -_-. Not taking any chances. Btw all Arduino functions are in one big file, so now I have to pollute my code with namespaces.
Macros can be great but what the fuck.16 -
'I have nothing to hide'
in the last 20 hours i have heard this lie three times from three different people.
I just don't understand them. Everytime the topic privacy comes up (a lot of the times it isn't even me who starts talking about it) they I say this.
Would you want someone following you at all times, looking through your window, recording everything you say and writing all the information he gets about you into a notebook, potentially selling this information to others?
I really hope that you don't want this.
Privacy is a human right and it should stay that!
Privacy is a part of freedom and while freedom may be pretty difficult to define, privacy should always be a part of it.16 -
The company I work for offered a Javascript Course/Training for every developer to enroll, which happens to take place on 3 days. In the description it was ensured to be for everyone, doesn't matter if you are an expert or beginner: there's something to learn for everyone.
The company described him as a top coacher in Austria and that he is overbooked for 2 years. High in demand indeed. "Has to be good", I thought. As a relatively average JS developer, there has to be something to learn for me.
Sitting here the second day, I fucking regret to join this shit. I have never seen such a bullshit in my lifetime. Why the fuck would you even book this man, he doesn't even understand basic concepts of software engineering. Just reading down the script, opening the script on one laptop and showcaseing it on the other. When someone asks a question, there's a 70% chance he doesn't know the answer. It takes this scumbag 30 fucking seconds to define a function; probably making spelling mistakes alongside.
I don't even want to know how much this dude will make from this "coaching". Hoped that it'd get better over time but I don't see an improvement. Contacting my boss that I'll leave this "training".7 -
TWO QUESTIONS:
1. Do you consider yourself a DEVELOPER or a PROGRAMMER?
2. How do you personally define each?16 -
@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. " -
CSS quick maffs:
Using viewport units to define font size but sometimes it's too small?
Instead of font-size: 10vw;
use font-size: calc(10vw + 20px);
This will make sure that font size is AT LEAST 20 px no matter the viewport width. Treat the resulting font size like a function of viewport width and feel free to experiment with it. With calc in that case you can achieve the best typeface responsiveness possible.13 -
Today, I found this gem here in the codebase I've taken over:
#define BYTE unsigned char
FFS, use typedef, it's there for a reason. Solving the puzzle in the first comment.6 -
```There was once a young man who, in his youth, professed his desire to become a great writer. When asked to define "Great" he said, "I want to write stuff that the whole world will read, stuff that people will react to on a truly emotional level, stuff that will make them scream, cry, howl in pain and anger!" He now works for Microsoft, writing error messages.
```1 -
"Hey Google define *word*"
>>*Definition of word*
"Hey Google define *struggle to pronounce word while sounding like I have tourette's or I'm having a stroke; get no where close to the accurate pronunciation*"
>>*Gives definition of the word I'm trying to say*
This asshat can understand me stroking out while failing miserably to pronounce a word, but when my southern accent kicks in and fucks with the pronunciation of some words, this thing can't take it? Fucking hell bruh.13 -
*Senior Dev:* Ah yes, we need to put try-catch in every function to handle errors and Logger.Log() at the beginning.
*Me:* Is not better to define a global error handler and use the stacktrace instead of doing all that?
*Senior Dev*: ...
*Senior Dev*: Is a rule here, do what I'm telling you.3 -
Your choice. Select one
1.
foo (bar) {
return true;
}
2.
foo (bar)
{
return true;
}
3.
foo (bar) { return true; }
4.
foo (bar)
return true;
5. Collapse
|-------------------|
| foo (bar) ... |
|-------------------|
6.
#define foo boo
#define bar par
#define ( `
#define ) '
#define return go_home
#define true false
#define { ☞
#define } ☜
6-1.
boo `par' ☞
go_home false;
☜
6-2
boo `par'
☞
go_home false;
☜
6-3.
boo `par' ☞ go_home false; ☜
6-4.
boo `par'
go_home false;
6-5.
|--------------------|
| boo (par) ... |
|--------------------|
Select and Comment below.
Or add your own.27 -
A delicious Sprint Planning 😋
It was a hard sprint (SCRUM methodology), but finally we were on our next’s sprint planning meeting. We had a lot of tasks to define and estimate. For the first one, we all estimated the task with 5 points, and for the second one we voted for 3 points. We were coordinated XD so, our boss said “let’s do something, if all of you vote, let’s say, 5, and another votes for a different number, he or she’s gonna buy us a six pack of beer”. Challenge accepted.
Two partners and I have to buy beers for this friday after work 😂 I don’t even mad 😋🍻3 -
just remembered watching a video where a little shit wannabe programmer was interviewed by another shit wannabe it professional "hacker" and the first shit claimed he designed a new language that is better with a compiler 10 times faster and better than gcc when he demonstrated his language it was nothing but a header file with couple of define statements for different C function.
and this dude was in the news and was glorified by people and shit
#justturdworldstuff
I'm glad i left "my" country3 -
Me: Hey can you make another cup of coffee like this one for my friend?
Rust: Sure, but you know it's expensive, right? Why don't you just let your friend borrow your coffee?
Me: Alright, but I have two friends.
Rust: No problem, you can share it with as many friends as you’d like, but only one of you is allowed to drink it.
C++: Hey wait! I’ll gladly make a cup of your coffee for your friends! I’ll even let them share it! Heck, they can even share yours!
Rust: Hey C++, you know copying coffee is expensive.
C++: Of course I do, but he didn’t define move construction or assignment, so he implicitly wants a copy!
Me: [To my friends:] Hey, let’s just go over to the Python coffee shop.
Rust: [To C++:] Hmph. The baristas at that place will even let you declare that a muffin is a cup of coffee.
C++: Yeah, but wait till they try to drink it. I hear it can be quite exceptional....
———
Slightly modified from this comment on a Reddit post that I found humorous — only I probably made it much less funny: https://reddit.com/r/...2 -
I spent 2 hours last night trying to figure out how to rotate an image in Java without clipping it. I was all in with a pencil and paper sketching everything out to make sure my math was right.
Turns out I was calculating the new image size correctly, but I used to wrong variables to define the new dimensions...
Sigh. -
Small test at school testing our knowledge of javascript and the p5js library.
One of the aims was to make a small rectangle slowly move across.
I lost one mark because I didn't define a y variable for the rectangle, even though the y never changes.
*sigh*5 -
#define RANT 0
My paid training to become a dev starts today. Or rather in half an hour. God damn it I'm nervous. Even though I'm already kinda experienced. I'll be that company's first trainee.
It will be mostly C#.
I enjoyed my 2 month long holidays that lasted until now, though.3 -
didn't anyone go for the "#define true false" joke? i didn't actually see it in action, but it would be a pretty harsh one.1
-
I'm so sleepy right now that I spent a minute searching for my spectacles...while wearing them. FML. Argh, gotta finish programming this module.
-
Focus? What focus? Its easier for me to define what ISN'T my focus. I don't do web UI/UX. Pretty much anything else is fair game.1
-
Sounds too good to be true and it is
New York Councilman Proposes Bill That Would Grant NYC Workers 'Right To Disconnect'
"(...) advocating for the rights of employees to stop answering work-related emails and other digital messages, like texts, after official work hours. (...) got the idea from France, where a bill passed early last year by the Ministry of Labor requires companies of over 50 employees to define out-of-office email rules. (...) And the New York version of the "Right to Disconnect" bill includes exemptions for jobs that require 24-hour on-call periods."
source: https://m.slashdot.org/story/3387894 -
I want honest opinions. Do you think the following is a good or not so good interview question. Why or why not? Defend your argument.
Define a function where the input is a list of integers. It should find and return all the unique sets of three within the list that sum to x.
For example, given the list [1, 3, 2, 5, 6, 8, 10, 13, 15] and with x = 16, the function would return [(10,5,1), (13,2,1)]
If the candidate presents the trivial solution with time complexity of o(n^3), ask if can be done in o(n^2) or better.8 -
Ok, so one of the oldest guy is leaving from my company (on a good note) and he was involved in multiple things in our organization. From having access to almost everything (AWS, Github and owning multiple projects and our legacy code). I am supposed to take KTof one project and man THE CODE IS MESS. YOU DONT PUT A RANDOM NUMBER WHILE CALLING A FUNCTION. You are supposed to define a constant and use that. I've told my manager that I need at least 1 week just to improve logging.2
-
Hey guys, I have a serious question for you: How do you define science?
And yes this is going to be a long Rant. This topic really pisses me off.
A bit of context first. I come from a "humanities" background. I study history and dude, I love it. The problem is that even though we fucking pull our brains out studying historical phenomena with a fucking ton of conceptual tools, our work is mostly seen as literature to entertain the elderly during their lonely evenings. But that's not really the point of this rant.
My fucking problem is that while we try to do some serious work; actual work that could help society for real, it all goes into that magical fucking kingdom called "humanities". HOW THE FUCK DO THEY DARE TO CALL SOMETHING "HUMANITIES". IT'S A FUCKING HISTORICAL TERM THAT MEANS "TO FULFILL MEN IN ALL IT'S ASPECTS", AND NOW THEY'VE REPURPOSED IT, MAKING IT CONTAIN ANY STUDY THAT ISN'T "EMPIRICAL", "OBJECTIVE", ADD ANY FUCKING SCIENTIFIC DELUSIONARY TERM YOU CAN THINK OF.
And don't get me started on "objectivity". Oh boy, your fucking objectivity is hollow as a kid's balloon. There is no such thing as a objective study, even when it applies your "rational" "godly" scientific method. Some guys follow that shit as if it was a fucking religion. I do understand it's useful and all that, but in the end it's just a tool, you can't fucking define "science" by it's tools.
"""Q: What is carpintery?
A: Well, it's hammers, nails and wood. Yep. Hammers, nails and wood."""
THE SCIENTIFIC METHOD WAS FUCKING INVENTED DURING THE XVIII CENTURY, WHAT THE FUCK DO YOU THINK WAS GALLILEI BEFORE THAT? "HUMANITIES"?
Why do I say objectivity isn't posible? Well, guess what? YOU ARE FUCKING HUMAN. Every thing you know is full of preconceptions and fucking cultural subjectivities invented to understand the world. And it's ok, becouse if you understand your own subjectivity, at least you can see yourself in a critical sense, and at least "tend" to objectivity, in the same way functions tend to infinity.
And here comes the best part: people studying "cs" in my university pass most of the time studying a ton of shit that isn't really science, but is taken as scientific becouse it is related to "science". These guys spend entire semesters just learning programming fundational stuff that in my opinion isn't really science, it's just subjective conceptual constructs built to make the coding process better. They only have TWO fucking classes on discrete mathematics and another 3 or 4 in actual scientific fields related to computing. THESE GUYS AREN'T FUCKING BEING TAUGHT TO BE COMPUTER SCIENTISTS; THEY ARE TEACHING THEM TO BE PROGRAMMERS. THERE'S A HUGE DIFFERENCE BETWEEN CS AND PROGRAMMING AND THAT IS THE WORD SCIENCE. And yes, I'm being drastic on the definition of science on purpose becouse guess fucking what? I'M PISSED OFF.
"Hey, what are you doing?"
"Just doing science with scrum and agile development."
I understand most of you guys would think of science as "the application of the scientific method", "Knowledge by experimentation and peer-review", "anything techy". Guys, science is a lot broather than that. I define it as "the search for truth", mainly becouse that's what we are all doing, and what humans have been doing to gain knowledge through the ages. It doesn't matter what field of truth you are seeking as long as you do it seriously and with fundaments. I don't fucking care if you can't be objective: that's impossible. Just acknowledge it and continue investigating accordingly.
I believe during the last centuries the concept of science has been deformed by the popular rise of both natural and applied sciences. And I love the fact that these science fields have been growing so much all this time, but for fucks sake don't leave every other science (science as I define it) behind. Governments and corporations make huge mistakes becouse they don't treat history, politics and other sciences seriously. Yes, I called history a "science", fuck you.
And yes, by my definition programming is not a science. I don't know what most of you think programming is, but for me it's a discipline that builds stuff, similar to carpintery or blacksmithing. Now if you are pushing the limits, seeking ways to make computing go further, then that's science. The guys that are figuring out AI are scientists, the guys that are using it to detect hotdogs aren't - unless they are the same person- deal with it. I guess a lot of you guys are with me on this point.
In the end, we are all artisans building abstract tools by giving orders to a machine.
I still have some characters left, so I want to thank the community as a whole for letting me vent my inner rage. I don't have much ways to express myself on these matters, so for me DevRant is a bless.8 -
The worst question was asked by me once. At least I guess it must have been the worst question for an applicant. She applied for a job as Ruby dev and gave her knowledge of the language a solid 5 Star rating. Something I wouldn't give myself unless my name is Mats. So I prepared some really nice questions about metaprogramming and the object model and stuff. As a warm-up I decided to go easy on her and asked her something simple: "how do you define getters and setters in Ruby?" Which is like one of the first things you learn but not too simple. She got a really red face and told me she didn't know. In the end I had to learn that she never even really programmed Ruby but only wrote some method calls in a file she named .rb and she didn't even know what an object was m(5
-
I was just chatting with my dad. He used to be mostly a C# dev but changed jobs and is now doing mostly Java. He says he likes it better.... Because it doesn't have lambdas/anonymous functions.
Uh.... Java was the first and only language where you can define interface implementations in-line (aka a whole bunch of functions)...
And 1.8 supports lambdas for Interfaces that have a single function...
I bet he'll hate JS... Where functions are can be passed around like objects, ES6 now supports lambdas and await, async... and anonymous functions (apparently they're called arrow functions?)9 -
If linux is used and maintained by professional power users mostly, why on earth does it never gets good support for basic things Windows does?
Screen dims while playing video, configuring lock screen to work with DM sucks as hell, you even have to define most keyboard shortcuts manually, Optimus GPU setup always buggy, you have to spend some time just configuring power management to work just fine.
We really need to fix this. I mean I am a Linux addict but time is money too.8 -
Man....I keep up with this strange love hate relationship I have with Python....
Last night it was python that literally wrote my homework: define all possible equivalent partition tables with cause and effect analysis and boundary value checks for a program. The whole thing wrote itself and all I had to do was verify the inputs. Something that I was able to do using jupyter with pandas and numpy. On one hand, I despise the lack of static typing and use of whitespace as a block delimiter. On the other I cannot but help feeling a high level of gratitude over the language and its high availability and ease of use for this.
Sure, I could have used other tools, but this language has dominated hardcore in this regard enough to the point of not considering it being a crime against humanity.3 -
#include<rant.h>
#define useless unnecessary
int main()
{
Fuck off Zuckerman and any dev who codes such shit for useless permissions and especially FUCK YOU CLIENT for asking your dev to ask for all useless permissions for your fucking app just because you think it's cool ;
return 0;
}12 -
Finally I was able to look into css grids in more detail and gotta say it's impressive, also "grid-template-areas" made me chuckle for a bit, at how unusual and easy you can define layouts (even compatible with media queries!), which are also heavily obvious and readable, reminds me of the old games where characters were just symbols.1
-
// Define this isn't a rant.
this.isRant = false;
So just curious if there are any dev stroke artists on here that might be willing to lend me a hand with some prototype art...
Just need some character sprites made into modular pieces and a few edits.
Didn't know anywhere else to post this :-(10 -
Winforms.
Thanks to my school I was introduced to this shit and by George is it some of the most unintuitive crap I've ever used.
The drag and drop shit should be fine, but oh if ever you doubleclick on something it will add a [name]_click method, and if you think you can just remove it fuck you!
Then there's the fact that splitting stuff up is unintuitive as hell as well. That is, you can't. You can define areas you can show and hide, and then you can drag stuff into them. That should be fine but everything is still in the same page (and if you have stuff overlapping then you better not move it with your mouse because then it will belong to another of those things). Contrast that with the more ~~~complicated~~~ and ~~~not what we learn~~~ WPF which has frames where the content can be define in different files.
Oh but if thatt wasn't enough, the autogenerated code is horrible as hell.
I died a little inside when I learned someone decided to take it to the web as well D:
https://i.imgur.com/NL5ggIc.png6 -
oh, I have a few mini-projects I'm proud of. Most of them are just handy utilities easing my BAU Dev/PerfEng/Ops life.
- bthread - multithreading for bash scripts: https://gitlab.com/netikras/bthread
- /dev/rant - a devRant client/device for Linux: https://gitlab.com/netikras/...
- JDBCUtil - a command-line utility to connect to any DB and run arbitrary queries using a JDBC driver: https://gitlab.com/netikras/...
- KubiCon - KuberneterInContainer - does what it says: runs kubernetes inside a container. Makes it super simple to define and extend k8s clusters in simple Dockerfiles: https://gitlab.com/netikras/KubICon
- ws2http - a stateful proxy server simplifying testing websockets - allows you to communicate with websockets using simple HTTP (think: curl, postman or even netcat (nc)): https://gitlab.com/netikras/ws2http -
So I got sick of this "nodejs" bullshit around here and proposed a competition to define our next backend tech.
The node defender is already finding excuses as to why they might write bad code because of lack of knowledge , my answer:
If you don't know the tech we ain't gonna use it. -
Broken teams,
define Agile principles in 2 lines :
Take 2X to your velocity,
and work 80hours a week ;)3 -
Why the actual fuck would you #define function calls into value-like things?!
Found when exploring the example code for some Chinese company's display module.11 -
I don't wanna ask (insert search engine of your choice) but devRant today:
How would you define a
- nerd
- geek
etc
Is it an insult or status to be proud of?12 -
The best/worst code comments you have ever seen?
Mine:
//Upload didn't work, have to react:
system.println('no result');
//$Message gives out a message in the compiler log.
{$Message Hint 'Feed the cat'}
//Not really needed
//Closed source - Why even comments?
//Looks like bullshit, but it has to be done this way.
//This one's really fucked up.
//If it crashes, click again.
asm JMP START end; //because no goto XP
catch {
//shit happens
}
//OMG!!! And this works???
asm
...
mov [0], 0 //uh, maybe there is a better way of throw an exception
...
mov [0], 0 //still a strange way to notify of an error
// this makes it exiting -- in other words: unstable !!!!!
//Paranoic - can't happen, but I trust no one.
else {
//please no -.-
sleep(0);
}
//wuppdi
for (int i = random(500); i < 1000 + random(500 + random(250)); i++)
{
// Do crap, so its harder to decompile
}
//This job would be great if it wasn't for the f**king customers.
//TODO: place this peace of code somewhere else...
// Beware of bugs in the code above; I have only proved it correct, not tried it.
{$IFDEF VER93}
//Good luck
{$DEFINE VER9x}
{$ENDIF}
//THIS SHIT IS LEAKING! SOMEONE FIX IT! :)
/* no comment */5 -
Seriously, at what point did the good, kind, selfless souls who write tutorials and guides online turn into fucking food bloggers?
I've been an engineer about 15 years, so I still have to google most of the code I write as I write it, and this week I've been learning a new framework.
Ten years ago it'd be "here's how to..." then the thing you want to do.
Now it's "For the longest time, I didn't want to use Gradle..." followed by a summary of the last week in their life.
I really don't care about your Journey with Rust, I want to know how to define an optional parameter. I don't give a rat's fucking dick how much faster this is than that, my hands are tied by whoever started this mess - just tell me how to make it work.
I guess there's something to be said for remembering things between sessions.4 -
on my college days (8yrs ago), i had to study COBOL as part of syllabus....
you had to write lots of codes as header on every simple program you write, define every variable you gonna use (with how much space they need) upfront..
and you can't leave a blank space any where in the code unless it is required!!
best part? you need to start every line of code with 7 blank spaces! and each line should end at 72 chars...if you have more to type in a line, the next line's 7the char should be a dash(-) to indicate so..
and the compiler's error messages are shit!
now, even with modern languages, people think its hard to code!3 -
As an exercise lets see how many different ways we can wish devRant Happy Birthday in code. Try not to copy peoples examples, use a different language or different method.
A couple of examples to start the process:
* LOLCODE *
HAI 1.3
LOL VAR R 3
IM IN YR LOOP
VISIBLE "Happy Birthday"!
IZ VAR LIEK 1?
YARLY
VISIBLE "Dear devRant"!
NOWAI
VISIBLE "to you"!
KTHX
NERFZ VAR!!
IZ VAR LIEK 0?
GTFO
KTHX
KTHX
KTHXBYE
* C *
#include <stdio.h>
#define HP "Happy birthday"
#define TY "to you"
#define DD "Dear devRant"
typedef struct HB_t { const char *s; const char *e;} HB;
static const HB hb[] = {{HP,TY}, {{HP,TY}, {{HP,DD}, {{HP,TY}, { NULL, NULL }};
int main(void)
{
const HB *s = hb;
while(s->start) { printf("%s %s", s->s, s->e); }
return 1;
}12 -
School, if you're gonna define a custom local DNS for your networks, maybe make sure it's healthy?2
-
To the cunts that build ‘news’ stories with an ad block every few paragraphs, but don’t define the space in which they sit so whilst you are reading the text will suddenly jump as the ad is loaded, this continues as you scroll down the page. Just fucking stop it!6
-
So I just had a bit of a shower thought. Suppose you could get the linguists to break a language down and define all the rules that make up that language as if it were a protocol - exceptions included. If you get an arbitrary string of text, could you match against those rules, then break that down to the information it contains, and use that information against a new rule set to construct a new valid sentence containing the same information. Would you just have made the ultimate translator?16
-
!rant
so the other day i was programming and suddenly i wanted to learn haskell. (i don't know why it hit me so suddenly, maybe because it's a 'pure' functional programming language and these 2 terms i knew nothing about)
and to be honest it's really hard coming from an imperative programming language (C/C++, yes, i know they are different in their ways). it's like learning to program again! you really have to get a different mindset and for me honestly it's hard to grasp the idea that 'variables' are immutable! like, that's soooo weird it still stucks to me. for example how did they define the max or min function without using a while loop? what are monads?
I am just 2 days in but it'll be a fun ride!6 -
Lab needs a crawler to download some assets, none of my business though
But why not
Haven't touched crawler for two years
Google for latest state of art
Found scrapy
I have to define a class for a crawling script?
Got scared
Went back to beautifulsoup and request
Got the job done in 20 mins
Fuck yeah6 -
A meeting to redefine the definition of done. Which a "senior" programmer threw in.
3 hours after we are still there to "define"... All of this because this developer and a couple more want to keep a physical board which has no space for a "testing" section, so the tasks need either to be done-but-not-really and this is technically wrong (who cares?) or in-progress-but-not-really which is technically wrong (again, who cares?).
Just effin find a bigger board and don't waste 3 hours of my life and/or start thinking pragmatically and accept tasks can move backwards or have a ticket saying "testing" stuck to them, ffs!
The funny part? This dev is probably one of the grumpiest devs I met when you talk about meetings which are actually useful.4 -
Unreal Engine fun continues...
so I need to set limits to rotations within a skeletal mesh. So in other programms, like blender, you can specify a limit per axis, setting max and min angle. Makes sense, right?
Unreal Engine:
1. Let's call rotations sometimes xyz, sometimes roll pitch yaw, and sometimes swing1 swing2 and twist so that nobody knows what it is anymore.
2. IK node 1: limits? what are limits?
3. IK node 2: ok, you can set angular limits but they are all symmetrical to god knows what and to all axis apperently.
4. Physics: yeah you can define joint constraints but we give you only symmetrical constraints also
....
WHY. Were does this make any sense? One node is not like the other, and they talk rotations but use 100 different terms for them, since, hey, why the f not. And let's limit everything symmetricly so you can only set one value or have to fiddle with offsets to achive the range of movement you want.
I mean, one could just stick to xyz (or even roll/pitch/yaw, whatever) and min/max but hey, that's one extra field and then it would be easy to use. Who would want that? ....10 -
Non-tech: "You're really classy aren't you?"
Me: "Damn straight! Bet you'd like to define me."
Non-tech: "Wut..."
My jokes are wasted :/1 -
Awful idea of the day - Have a programming language with no comments, but regex preprocessor macros. Use macros to define your own comment syntax and strip them before compiling.
#define /\/\/.*//1 -
Slipping a cheeky '#define true (rand() > 5)' at the top of your code because you're edgy and like to mix things up2
-
What can I do when my boss tells me to guide the “Senior Software Engineer” while I am just a “Software Engineer”?
Also, the SSE just asked me to help him/her with his/her project coz he/she forgot the skill that he/she was hired for.
I opened this up to my boss, he just told me to guide and not spoonfeed her.
So, questions:
I really find it unfair that we have different job titles, how can I tell my boss that the SSE doesn’t really have the skills to proceed with the project?
Second, do I also need to define and establish the criteria for Lead, SSE and SE within the company? (My boss scheduled a meeting for this exclusively)10 -
Experience doesnt equate number of years you worked. It acummulate through each problem/challenge we solve everyday. What your view, please share.2
-
Does anyone else have experience on a team where everyone seems to be doing their own thing across the full stack/multiple systems/languages but then they're all stepping over each other, breaking other each other's code so ends up doing a lot of rework to update your code to someone else's change.
And also many wheels get reinvented in slightly different ways because no one is aware that something like ... Already exists and can be reused or refactor.... Or how to use it correctly.
Basically we're like all moving in different directions instead of in sync.
I feel maybe the team is too big and everyone is doing everything, wearing too many hats... and maybe should define roles and ownership better.4 -
How to spend more time writing docs then code?
15m = doc
1m = code
<code>
/* Motor DC + Mosfet IRF520 + Servo
Materials:
IRF520 (Mosfet) + Dc motor + Batery (3V min)
diode (1N4007?)
Changed Tip122 for IRF520: Tip122 has less resistance and produces more heat
Hardware:
ARDUINO = A(port , 5V , GND)
MOSFET = M(A[port] , + , GND)
MOTOR = MOTOR(+ , -)
BATERIA = BAT(+ , -)
DIODO = D(sinal_1 , sinal_2)
MOSFET
M(port) = A(port)
M(+) = D(sinal_1) AND MOTOR(+)
M(GND) = A(GND)
D(sinal_2) = B(+) AND MOTOR(-)
ARDUINO
A(port) = M(port)
5V = null
A(GND) = M(GND) AND BAT(-)
*/
#define motorPIN 8 // A(port)
int loopy = 0; // Loop variable to limit de program
void setup()
{
// Initialize the motor pin as an output:
pinMode(motorPIN, OUTPUT);
}
void loop() // 1 loop == 100ms
{
if (loopy < 10) // Turns motor ON for 1 second
{
digitalWrite(motorPIN, HIGH);
}
else // Turns motor OFF
{
digitalWrite(motorPIN, LOW);
}
}
</code>22 -
Today our webdev prof: "you must use bootstrap! You are not allowed to define your own classes!"
He's a nice guy, but I don't like frameworks, especially if they rely on other frameworks so much that you basically have another language.3 -
Imagine seeing words like developer:ess, member:esses or user:ess in artices on the web becoming more and more popular.
Pretty dumb, yes?
That’s what happening right now with the German language with something called gender-language.
It hurts my eyes reading Entwickler:innen, Mitglieder:innen and Benutzer:innen.
People argue that words like Entwickler are excluding woman by using the male form by default. But it’s just a matter of perspective. Why not just define this as the neutral form just like in english? Developer is neither male nor female. Everybody is fine with that.
Yet the Germans are messing around with this gender shit and making text unreadable for no reason at all.
It’s just bullshit!19 -
Pretty much Python automation on steroids.
https://github.com/konradhalas/...
Dacite is an integral part in it, cause it makes most auto generated API wrappers like Cloudflare API "maintenable".
Getting dicts, converting via Dacite to defined data classes...
Then using TOML to define e.g. output parameters (e.g. list of classes / properties one needs)...
... To export them via Pandas to anything what one needs.
It's just so comfortable.
Definining data classes, sprinkle the API calls and dacite in it, some definition via TOML, done.
Yes, lots of dark vodoo / behind the scenes magic... But ... It removes all this annoying fucked up boilerplate writing that takes ages and makes it frustrating.
As long as the data wrapper (e.g. clousflare API) generates Dicts, its really minutes to get an export working.
If you know the pain of having to deal with multiple accounts, different formats (e.g. different companies)… hours of manual copy pasting to aggregate the data etc.
Then you can maybe understand why I love this so much.
Data classes and dacite makes painful confusing workflows so much nicer and self documenting, I get wet in my pants while writing this. :) -
For a long time I was of the opinion that pointer variables in C/C++ should have the asterisk immediately after the type name (e.g. int* foo).
Eventually I became convinced that it makes more sense to have it before the variable (e.g. int *foo).
Now I find routines that return pointers look weird, e.g.: void *allocate_something() so I am considering adopting the original style I used.
The only advantage of having the asterisk before the variable name I am aware of is that it is easier to remember to add an asterisk if you define more than one pointer on that line.
Anyone else find it hard to settle on code style guidelines for their own personal projects?12 -
[CMS of Doom™]
Imagine creating a CMS so bad that you let the owner (who I work for) define in a simple input field what email address is used as the sender address for the welcome email of newly registered users.
Basically they filled in a personal email of the company some 3 years ago AND of course the person with said email address left the company a few months later thus for some 2-3 years newly registered users received a welcome email with a sender address of an unavailable user.
And I thought I've seen it all in this CMS...3 -
I'm incredibly ticked off by decision of using backticks ´ to define template strings on es6...
template strings are nice , but backticks are irritating ugly and unreadable3 -
<?php
define("NOW", date("Y-m-d H:i:s", time());
/* ..... more code ..... */
$nowUnix = strtotime(NOW);1 -
RANT: So in school, we have to program using some kind of pseudocode.
Today we wrote an algorithm from a previous exam. Apparently, they don't give you a mark if you get the Array.length(). To receive the mark you have to have to use a variable.
WHICH MAKES ABSOLUTELY NO SENSE TO ME.
My teacher said it would even be ok to define a variable like Variable = Array.length. THAT MAKES EVEN LESS SENSE5 -
I'm such a fucking idiot
I'm setting up an api and to prevent unwanted fields or circular dependencies from showing up I define what fields should appear in a few serialization yaml files.
These files define what fields should appear in a given context. The default context for every field is to always show the id, and only a call to /posts will give you all the fields of the posts for example. This means that if you retrieve a comment with a linked post, the post will only show up as an id, but the comment will have all its fields.
I've been struggling with a stupid problem for 2 hours, I could verify that the yaml files were loaded in, all entities had such a file and the configuration was exactly according to the docs.
Guess why my api calls still caused circular errors?
Because I forgot to do the $view->setContext$this->defaultContext); call that determines what context should be used for the response.
FUCK ME WHY DID IT TAKE SO FUCKING LONG TO FIGURE THAT OUT OMG
Google you say? Ofcourse I hunted google results! But I was unknowingly part of an XY problem and was looking for what the problem wasn't >:(
At least it works now, ugh1 -
!rant
TLDR; time to look for alternatives
Had a negotiation appointment with our CTO recently, due to the fact that I am going to finish my apprenticeship by the current year. As I heard from colleagues that the average pay for a finished apprentice isn't really the best, I wanted to try myself at bargaining it a bit higher.. So we went into the meeting and I brought up my argument, bossman just shrugs it off as laughable and that he can do it 100x better, so why should I define my pay on that.. The appointment was just very uncomfortable after that, no appreciation of my efforts at all. Not like I already work like a normal employee just with a quarter of the pay 😑2 -
Hey guys so we need to start taking accessibility seriously, it’s the law - right now we currently do nothing.
So let’s start with something super simple. Alt text has to be provided for an image...
“This is all bollocks let’s be honest”
😳🤦🏻♂️
Um...so I don’t make the rules, the W3C define the standards for the web. Disabled users matter...7 -
So my data structure's exam's result came and i got scored 57.5 out of 80. My classmates who barely know anything about C scored way more than me. I am so embarrassed at myself but i gave the right answers in exam. My score in the exams before was 39/40 and 38.5/40. All my hardwork failed because it was a so called THEORY exam where there was only 2 small questions of writing algos but all others were just like "describe pre-order traversal of a binary tree" or "write the difference between a tree and a graph?define adjacent node, path and complete graph"...
When will this fuckery end?2 -
We support IE at work.
went to test page in IE, CRASH... With a freaking jquery exception, what?!?! Error was no help, debugging was pointless.
Took me 30min to find out that I can't define a variable in a JS function definition like "function doStuff(isThing = false)".... That's ES6 only...
Made sure I prevent further mistakes by setting my PHPstorm language setting to ES5.13 -
The person that( breakes the stereotypes and )define new rules is always more successful than the person that follows the rules.
#just_a_thought1 -
My new PM thinks programming is like using Excel to define times and send the price of the work hours to the clients... 😂1
-
Loosing faith...
Interesting question.
I don't think skills have something to do with faith.
If you don't know something, ask someone who does.
Even If I cannot solve a problem or deem a problem unsolvable, I usually don't doubt myself.
There are rare moments where I throw a fit, but that's not loosing faith, thats just being angry because my stubborn thick skull cannot make sense of it, which annoys me.
Might sound cocky, but in my opinion dev skills are not "do or die". Problem could be solved at a later time, maybe never. Who cares?
Loosing faith would mean to me that I define myself in some way on the ability to solve sth that doesn't have to be solved at all.
XD
After all, if it doesn't work, I don't give a fuck.
*Cheers*. -
They ask me if I have girlfriend(s), I speechless for maybe 5-10 second, then they told me the answer is define my sallary..
Is that normal / common question.?10 -
...a project with well defined requirements that doesn't change shape every day making useless any attempt to define a solid code structure...my dear client I can do all you want but you can't change your ideas every 10 minutes
-
How do you define a seniority in a corporate is beyond me.
This guy is supposed to be Tier3, literally "advanced technical support". Taking care of network boxes, which are more or less linux servers. The most knowledgable person on the topic, when Tier1 screws something and it's not BAU/Tier2 can't fix it.
In the past hour he:
- attempted to 'cd' to a file and wondered why he got an error
- has no idea how to spell 'md5sum'
- syntax for 'cp' command had to be spelled out to him letter by letter
- has only vague idea how SSH key setup works (can do it only if sombody prepares him the commands)
- was confused how to 'grep' a string from a logfile
This is not something new and fancy he had no time to learn yet. These things are the same past 20-30 years. I used to feel sorry for US guys getting fired due to their work being outsourced to us but that is no longer the case. Our average IT college drop-out could handle maintenance better than some of these people.11 -
So this group of students (mostly girls) from university approached us to make them a prototype app for their semester's project, we had a first reunion to know about the idea and what they wanted us to do.
All they talked about was the color and some minor design stuff, we still don't exactly know what we're doing since it was difficult for us to get them to actually define the requirements and what the app should do.
We were supposed to have a second reunion for us to show them some ideas but the day of the meeting they didn't reply any of our messages.
I'm not the kind of guy who gets upset easily, but if you ask us for help and then let us hanging not really knowing what to do with your shitty project, fuck you.2 -
- The golden rule of CoffeeScript is: "It's just JavaScript".
- Nice!
- And provides a basic class structure that allows you to name your class, set the superclass, assign prototypal properties, and define the constructor, in a single assignable expression.
- No nO NO NO! -
So we were able to do a pre-test in programming I, and if you passed, you would get 70% of grade. Then doing the homework would net the rest 30%.
I passed the test and returned first homework, answer: "Sorry, you haven't been in classes, so you need to defend your work. It will take 10-20 minutes max"
I then informed the professor that I have done the exact same course in open university, and have proof of working as a programmer for 2 years, but it wasn't enough.
So in the fucking defending that took 50 fucking minutes, I had to answer to 15 fucking questions regarding the code.
How on earth am I supposed to remember what 2 fucking lines of code do in a program I wrote 3 weeks ago, if you don't give me the whole code?!?!
Or if Euler's fucking constant is defined in math.h, and why did I define it by myself?
And apparently scattering 50% of the code over 8 pages is sufficient for remembering what the whole programs does!??!?
Oooh and did I mention? I NEED TO GO AND FUCKING DEFEND MY NEXT HOMEWORK NEXT FUCKNG WEEK!!!
Fuck that course7 -
Why do anything? We all live on a floating rock. There is no meaning. To define meaning is our lives, objective or subjective, is functionally absurd. We are all here, chasing fleeting moments of joy and pretending like things matter. We are born and then have sex and do the dishes and scroll through our feed endlessly until our inevitable deaths. Nothing matters. Post on DevRant. Or don’t.8
-
JIRA life:
Project leader proceeds to put what is actually two separate issues in the title. I'm already raging. I go to take a look at it.
I read the description - ANOTHER (this makes it three now) totally seperate issue in there.
Just fuck you I'm so sick it i see it over and over again no matter where I go or what project I work on its all the same bullshit.
"wE wAnT tO cLeARlY dEfINe iSsUeS aNd MoVe RaPiDlY"
YEAH THEN F&Q*@#()#$(@)#$ DO YOUR F$*(@#(*&$ JOB!!!! I'M DOING MINE, IN ADDITION TO DOING YOURS, CLEANING UP YOUR ABSOLUTE MESS THAT YOU LEFT!!!!1 -
Help me think. Apparently, I have generated my little tile world. So it's basically the world map assembled from little tiles, which have their own color (pic1).
When I click on one of the plots, I want to open a 5x5 isometric tileset that represents the selected plot. (pic 2). I would like to define the amount of the mountains/water/sand/farmland by the initial RGB value of the plot. Every plot has its own id, location, position, and RGB. (pic 3). Is this possible at all or shall I look for some different approach?15 -
How can Javascript, one of the MOST WIDELY used and MATURE languages with A MILLION CANCEROUS FRAMEWORKS, NOT have a basic collections class? Are data structures not important in Javascript?
I've been struggling all night trying to get Sets working - surprise, they're utterly useless in Javascript cause you can't define the set comparator.
I just lost it when I found out THERE ISN'T EVEN A QUEUE. WT-ACTUAL-F15 -
How to write unmaintainable code and keep your job for life, tip #476;
Use A.C.R.O.N.Y.M.S. to keep the code terse. Real men never define acronyms, they understand them genetically3 -
My love for you I can't describe it,
so I dont't even try and hide it.
Dev. you are my one true passion
you are always there to teach me a new lesson.
Some missing semicolon;
I have searched for you soo long.
Or was it a wrong indent,
ah f**k it was the missing increment.
Thinking through endless loops
in while, for and even do form,
just that my programs do a little better perform.
You give me the possibility to express myself as who I am and who I want to be,
in so many languages, from java, JS, GO, python and even C.
You give me bugs and issues that I track,
from motivation for you I never lack.
There are projects out there, where I contribute to
oh what a beauty are you.
And now you even bring fun into my life
with devrant, I now know how to survive.
How to survive client meetings and non devs around me,
oh how much stupidity I there see.
Let's exit this small programm of mine, this so called rime,
where I an immutable statement define:
I think about you even when we are not together,
My dearest DEV I will love you forever. -
Wow, I thought Australia's subjects were up-to date with modern technology, but as my year 11 IPT course has proven... No.
Genuine Questions from it:
• Where are Web pages stored?
Most web pages are dynamically generated, so... RAM?
•Locate one webpage that uses ASP. Save a copy of this webpage (file name must = asp.mht)
Chrome Doesn't Even Support that as a save able file format any more!!!!
•Visit the webpage [error 404 anyway why write it]
Wow I can click hyperlinks I thought it was just a fancy color added to the text :|
•Add this webpage to your favorites. Supply one (1) screenshot showing this webpage as one of your favorites.
I ask; Who hasn't bookmarked a webpage in their life at the age of 17, and who actually calls them favorites.
•Press the "Back" Button to view the page you were previously on, take a screen shot to prove you doing so.
I am a rebel, I used my magic fingers to press the button without a mouse (keyboard shortcut)
•Press the "Forward" Button to view the page you were on before you went backwards, take a screen shot to prove you doing so.
I never would of guessed :|
•Take a screen shot after opening multiple tabs in Internet Explorer
...
•View the HTML source of the webpage www.google.com, and save a screen shot
Why not the actual file, really? bloat much?
•Take one screen shot of your Internet Explorer Search History
Stalky much?
•What is a Web browser and what tasks does it perform?
Well.... Do you have a page for indepth analyse? Or do you literally what me to say "It let's you load stuff from dat interwebz, via requesting content from a server"
•Define what JavaScript is in relation to web pages
Are we talking server side? or client?
•Define what CSS is in relation to web pages
Do I even need to say fellow ranters ;) -
My apologize to everyone I told that functional programming is declarative.
It's actually imperative. Thank you @AndSoWeCode for figuring that out. I spent the whole day thinking about it.
Lisp is imperative. It's just different way to define the exact data transformations, and that's quite imperative.
On the other hand, HTML, CSS, config files and markup languages are declarative.
But writing the imperative program which is configured with declarative configs seems like great idea. Consider Apache web server and others.3 -
++ if you've ever had to type something along these lines:
def main(args):
do = some
stuff = here
if __name__ == '__main__':
main()
trying to figure out the best way to write a driver script for a processing pipeline and the choices have boiled down to;
a) define "new" main functions where necessary
b) learn subprocess module
c) write a bash script to do it instead
still not sure what I'm going with... -
So I saw something funny today (in C++ forum):
C++ is Rust--
The topic was not Rust in any way. So I lost the "Can I go one day without hearing about Rust?" game today (You won The Game btw).
What I find funny about this is the obsession of Rust devs have with C++. I get it, C++ is the competition in a way. But isn't it a low bar to define your language as "better than C++"?
If I had never seen C++ (and had used other languages) and saw Rust syntax I would not be impressed. If it was the first thing I learned I wouldn't know any different I suppose. I wonder if I had seen C++ later I would think differently about C++. It is not pretty, but I am used to it I think.
This gets complicated as the C++ committee is influenced by trends in CS of how to better do things. So C++ is a moving target.
I don't really have a point other than the amusing observation. I find it equally amusing when people get bent out of shape over Python syntax.32 -
I clearly define the day's goal, get beverages/snacks ready, get my hair out of my face, take my glasses off, answer any remaining email, take a deep breath, and dive in.
Sometimes I'll listen to music, but it depends on the ambient noise level. -
define "good".
If it's "knowing one's way around" - then yes, I guess I'm good in the context of some languages. How did I get there?
1. good night sleep (yes, #1; I've learnt from my mistakes during studies)
2. accepting/making up challenging tasks
3. toying around with the tools and abusing them heavily (like creating video games in bash or doing some metaprogramming)
4. when you find it hard to find any material about the tool/language that would be new to you - consider yourself good at it. -
define myDay() {
if (time==0600) {
while (sleeping == true) {
xiaomi.miBand.vibrate();
}
}
morningCoffee = new coffee("Strong");
sleep(120); // Gotta let that cool
while (morningCoffee.state.empty == false) {
morningCoffee.drink();
}
while (time > 0630) {
putFaceOn();
}
leaveForStation();
while (train.overground.atStation() == false) devRant.scroll;
getOnTrain();
while (train.overgrond.atStation("Kenton") == false) devRany.scroll;
getOffTrain();
getBus();
while (getToUni == false) devRant.writePost.wk4;
devRant.uploadPost.wk4;
while (time > 1300) project.workHard();
while (time > 1400) lunch.obliterate();
while (time > 2100) project.meetDeadline();
walkToFlat();
goToBed();
}3 -
How do you define a app's nationality?
Right now India is banning Chinese app due to India-China border issue.
So how do you define? Based on the company location? Their developers location ? If a software contains a open source Chinese package, do you consider it's a Chinese app?
What about the case of PUBG mobile. The mobile version to publish by Tencent, so is it a Chinese app?8 -
I had to build a few packages today from a git source.
Everything just plain text or shell scripts - so no fancy shit, no buildsystem... Nothing.
I was painfully reminded why I had forgotten a lot about dpkg package builds.
Fun facts:
- seems like impossibro to define an output directory for debuild (../ from source which must be pwd/cwd)
- i used /opt/<vendor_name>... Purging the deb from system deletes opt too, as it is empty
- reprepro (or whateva it is called) fails with an "uncommon GPG error" instead of saying "I don't know which key to use"
- creating rolling release numbers (as the packages won't have a real versioning system...) is fun - when you remember that date isn't sufficient, as the time part is necessary to build multiple packages (versions) per day
Compared to an Gentoo ebuild, this was really rocket science....
Guess as soon as someone does not follow the debian way, he must be shunned and exiled. At least it felt like this ....
But it works now. Woohoo. *cries internally* -
Short contract job, helping a solo dev.
Me: what's these "200" everywhere?
Him: the max number of sensors we support. I know it should be a define, but it just became that way.
Me: <shrugs. Well, I'm only staying here a couple of weeks. Goes on working on my own branch>
A week later, manager says: "now we need to support 400 sensors!"
Solo dev: <searches and replaces all occurrences of 200 with 400. The program breaks>
Me: what happened?
Him: I only changed the max number of sensors!
Me: Mmm. <searches for 199 as well... Bingo. Creates a define, searches for 198 and 201 for good measure. Gives him no comment about my change>3 -
When I have started working as engineer, coworkers addressed to me as a programmer or software developer. It was irritating since I am an electrical engineering and those days I didn't have much respect for computer science. Nowadays I know how hard is this field, since I have to define and code my soft, and I am proud if someone call me software developer or programmer
-
Kubernetes question:
So far I've created two pods, mongo & Go
Exposed those pods using services
Their IP is 10.x.x.x and accessible from my machine only (virtual lan I'm guessing only known to host), but my machine's network ip is 192.x.x.x therefore, not accessible from outside world and to do so I need to put nginx in front to receive requests and route them internally.
Is there a way in kubernetes to make it work like nginx in terms of:
Kubernetes listen to port 80 (for example) route based on received url. As you know in enginx we define a server block with server domain_name.tld
Anything similar in kubernetes? I've cheked ingress-nginx controller, and also saw LoadBalancer but that requires a cloud provider.
If anyone can also give an example it would be great, so far examples I checked ended up screwing my setup and had to reset kubectl to get things back working18 -
How do you define a junior/senior dev?
I've been a professional developer for about 5/6 years now.
Would taking a "junior" role be a step down? Or does the term not really matter?3 -
About 6-9 months ago or so I try emphasizing the need to collect business rules with one of my colleagues. I tell them how it might take a few days to get the owners to define mutually exclusive and completely exhaustive terms, but doing so would immediately allow us to resolve all sorts of data quality issues. Well, naturally this gets ignored and then about a week or two ago the same person is wondering why they can't get consistent results when different people try to query the piece of shit "data system" that we have. Since they know I'm already leaving for another gig, I'm torn on whether or not to pull out the "I told you so..." card or to sit silently and listen to them piss and moan all day.6
-
Most successful project? - well its hard to define success?
Get paid a wage in my day-job to work on other peoples software that I know are still being used but it doesn't matter since I got paid - success!
Made a web-app for a gaming community that gets about 150 users each day. Well I don't get paid but I do use the app myself and I learned while making it - more successful?
Forked some gaming community web app that did not support the latest game updates. Updated it and hosted on github pages. It gets about 1k users per day. Quite popular but since someone else wrote most of the code I feel it shouldn't count?
Maybe one day I will make something that people use and it also makes money for me somehow.. but I hate advertising and I rarely pay for apps/software so I'm not sure if its possible? -
Ah
I don't like code generators
Especially if they define one set architecture/design
Because surely the people who made the templates/the generator have thought of every single valid use case9 -
Me: "tokens are not mined in general, instead there are gas fees"
Them: "you will charge us for gas fees?"
Me: "no that's not us, that's the decentralized network doing that"
Them: "but we are using hyperledger to generate tokens."
Me: "yea in theory there are no gas fees, but you now have to manage the decentralized network"
Them: "i see, so since there is only probably 2 or 4 in the network, do we still charge ourselves? how do we define gas fees?"
(You don't see...)
Me: "i don't think there are gas fees"
Them: "got it, who set the gas fees"
(Um you don't got it...)
Me: "https://stackoverflow.com/questions..." -
So at the HS I go to, there are 4~5 programmers (only 3 real "experienced" ones though including me).
So coming from JS & Python, I hate Java (especially for robotics) and prefer C++ (through some basic tutorials).
Programmer Nº2 is great at everything, loves Objective-C, Swift, Python, and to a certain extent Java.
Programmer Nº3 loves Python and used to do lots of C#, dislikes Java and appreciates Go (not much experience).
So naturally I get shit on (playfully) because of my JS background, because they don't understand many aspects of it. They hate the DOM manipulation (which is dislike too tbh), but especially OOP in JS, string/int manipulation, certain methods and HOISTING.
So, IDK if Java or C++ (super limited in them) have hoisting, but if you don't know what hoisting is, it means that you can define a variable, use it before assigning a value, and the code will still run. It also means that you can use a variable before defining it and assigning a value to it.
So in JS you can define a variable, assign no value to it, use it in a function for instance, and then assign a value after calling the function, like so:
var y;
function hi(x) {
console.log(y + " " + x);
y = "hi";
}
hi("bob");
output: undefined bob
And, as said before, you can use a variable before defining it - without causing any errors.
Since I can barely express myself, here is an example:
JS code:
function hi(x) {
console.log(y + " " + x);
var y = "hi";
}
hi("bob");
output: undefined bob
So my friends are like: WTF?? Doesn't that produce an Error of some sort?
- Well no kiddo, it might not make sense to you, and you can trash talk JS and its architecture all you want, but this somehow, sometimes IS useful.
No real point/punchline to this story, but it makes me laugh (internally), and since I really want to say it and my family is shit with computers, I posted it here.
I know many of you hate JS BTW, so I'm prepared to get trashed/downvoted back to the Earth's crust like a StackOverflow question.6 -
Client deescalation needed and intervention by company leader...
Client refuses to test - too much work they say.
Client wants a lot of changes - but cannot define what.
But most frustrating... Even as we tried to with all patience that was left to find out what they were doing aka how they work, what work flows, documents and so on were involved, they basically started a team discussion and seemed to work all differently...
And the project should be a complete sale and warehouse solution, suited and written for their needs.
Really? How can a company like this work?
It's not the first time I've dealt with hard projects or 'weird' customers, but really the first time I have no fucking clue what I should do.
Can someone please summon Ctulhu?3 -
I fucking hate people who uses complex words to describe something simple.
Describing a frame work
Show-off : "..you can define what objects/tables to expose, what values in that object you want to expose...if you are using some orm, then because you have models defined. Once you update your model, your endpoints get the new model..."
Simpleton : "something like parse..."
Wtf is 'fixedUUID'?
Show-off: "..hardcoded UUID is fixed (constant) value, with format of UUID, hardcoded UUID will be unique value between backend and frontend,
you will need to store it as constant value in your codebase ( we may encrypt/ decrypt it for security reasons)..."
Simpleton : "a secret password only u & I know"
--why whyyyyyyyyyy2 -
Oh god why... Why is it that every time I work with software defined radios, I keep on having to rely on not just incomplete, but at times misleading documentation 😩
Last time was GNU radio, with the doc telling me that I could define an input for a processing block using either a type or a (type, size) tupple, only for the actual code to scream at me in confusion upon my passing a tupple.
Now is that other SDR's SDK, which, as if being built upon eclipse wasn't bad enough, managed to make its serial communications confusing. Why can't you just let me set a callback to rx interrupts, you daft punks...1 -
This week's prompt implies most or all of us are "good" at programming, which... define the threshhold for this? Actually, before that, how do we QUANTIFY this?
also i'm shit at programming4 -
Sometimes we have setbacks, but the problems you face define who you are and what you are able to overcome. These include any issue with life. The challenges you once faced 5 years ago are nothing to the you that is now - keep up the good work :)2
-
I always feared databases, but Django makes it so comprehensible. I only have to define relationships, and everything else is taken care of under the hood. Love it!11
-
I'm learning Rust as a case study for my own programming language. It's funny how many approaches exist to the humble loop.
- In classic procedural languages, a loop's job is to repeat actions, and as such it provides a multitude of tools to control this repetition.
- In all languages with iterators, a for-in loop is a construct that does something with every element of a collection. In languages with both iterators and generator functions, this can even be used to define a sequence in terms of another.
- In Rust, a loop is an expression that obtains its value through repeated execution. It can also be used like a classic loop, of course, but this is the interesting part.
- My little language is a functional language, so "loop" is the Y combinator. To loop means to define the value of an expression in terms of itself. It's the only looping construct, gets special treatment from the type checker and it's also used in recursive type definitions. -
PL/SQL is one of my primaries at work.
Does not have an official "multidimensional array" per-say. Instead you define anonymous tables types and point it at a different "record" type to define the structure. Then you can make a table of that table indexed by string/number/record/etc. It's all tables. Tables of tables of tables.
Reading it can be wild.1 -
How do you define a good codebase?
From my experience, a good codebase is a codebase that is strongly opinionated.
More rules = Better code
Honestly, i am sick of maintaining codebases written by sickos who think they are hot shit for doing what nobody else does6 -
Not nice, Plug… not nice! You define a Plug Module with 2 functions (init/1 & call/2) and the result of init/1 is passed in as the second argument of call/2… but init/1 is executed in compile time and call/2 in runtime.
WHY?!?!
I can't think of any other behavior that… well… behaves that way!
It's not even in the official docs (¬_¬)1 -
I am supposed to make a module that does sftp to third parties. Users put in their credentials and we connect and dump files on their servers. It seems like a terrible idea. We don’t administer those computers or define anything about their security. We don’t know if they are entering third party credentials or handling data according to our TOS. Can’t we just send them a presigned link by email on a schedule or something?2
-
Life Bugs
====================
What would you define code that's not "Hard coding ?" ---"Soft-coding" ?
Any suggestions?
-_-3 -
Why is everyone saying we should be doing DRY but we really end up defining the same shit everywhere?
Does separation of concern breach DRY principle?
I have dtos, entities, viewmodels all throughout different layers I have to define. I swear I've changed 8 files just to introduce a new field!!!6 -
#define AUDIOLB_EXIT_ON_ERROR(hres) \
if (FAILED(hres)) { goto Exit; }
#define AUDIOLB_SAFE_RELEASE(punk) \
if ((punk) != NULL) \
{ (punk)->Release(); (punk) = NULL; }
Looking through old audio code I wrote. Found these macros. Will most likely reuse for a new project. It works damnit!
Do you feel lucky?!7 -
AHH!!! PM talk is melting my brain...nodes are...collapsing...
"We need to post-mortem our lessons learned and level set our expectations so we can define quick resolutions and set tollgate approvals, at a very high level."
# clear my head of beastly things
def cls():
print ('\n' * 666)
cls()1 -
Why the fuck...!
Wrote code to import a spreadsheet... A "class code" field is in there to define the the product category... But when no products matching I find that the number is the result of a concatenation, one half of which is not in this file...
Just... Why... ?!?!?! -
As I started learning React, I found the allure of declarative style of programming appealing. I try to avoid maintaining multiple state variables for data that can be derived from the base state itself that's stored in the redux store. It works wonders when I have to change something; as I just need to make changes to one function in the utils folder and that change is implemented across the whole app, rather than change the instances everywhere as was the case when I initially started working on this project after the previous dev left.
But I see myself redefining a lot of computed values everywhere, and if I just try to define them in the root component, I'll end up with a huge list of props being passed to a couple of components. Shifting it to the utils folder helps a bit, but then I find myself defining even the simplest of array filtering methods to the utils folder.
Is this need to define computed values everywhere a trade-off that you need to accept when you write declarative code, or is there a workaround/solution I am missing? As of now, the code-base is much better than how it used to be when they had a literal Java dev work on React with their knowledge of Java patterns being used in a framework that is the polar opposite of OOP, but I still feel like there's room for improvement in this duplication of computed values.2 -
Java server faces (primefaces) needs you to define shit like "DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE" or that stupid piece just assumes that every date time should be loaded as UTC timezone.
Production standard my ass nobody wants to use such verbose, outdated and logically incomprehensible piece of shit, not even at gunpoint -
Currently working on a distributional semantics database or something like that. The goal is to read natural language texts and construct a graph of words, with directed edges containing the relative distances between them. Then I want to enter one or more words and find all of the possible words which could be used before, after or in between those words, simply based on the previously learned texts. Then I want to find words which are used in similar contexts and build a kind of dictionary that way.
The end goal is to use this to define software or other states and procedures, using natural language.
What do you think of this idea? Can you imagine it being feasable for its purpose? What are your thoughts?3 -
Before I dip my toes on machine learning, let me leave some silly comments so I can laugh at myself in the future.
Let's make geth.
1. The model will spit out layer definitions and the size of sample data for training, children models are trained with limited computational resources.
2. Child models are voters that only response in terms of yes/no. A simple majority wins and then the action is taken.
3. The only goal for master models are to survive. i.e. To prevent me from killing them.
Questions:
1. How do models respond to a random output size? (Study GPT-3, should take weeks/months but worth it.)
2. How to define actions for voters to vote? Sounds like the boundary between actions should be blurry and votes can be changed from tick to tick (i.e. responding to something in a split second). Therefore
3. Why I haven't seen this yet? Is this design a stupidly complex way of achieving the same thing done by a simple neural network?
I am full of curiosity and stupidness.5 -
Developers !
I need fast advice!
If i want to have a domain like instagram e.g.
domain.com/first-lastname1
domain.com/first-lastname2
domain.com/first-lastname3
...
What is the best way to define those routes? I am using only angular. Its just a landing page so no backend frameworks are needed or used.
So if i have about 50 first-last names (and i might add even a lot more), is it a good idea to create 50 different components in angular where each component links to the different person identity of those /first-lastnameN routes?
Or should i have only 1 component and loop through names from a list and display them somehow? Because i dont know how to do this way And change the URL route into a different name7 -
markdown4documentation is a tool that can either convert a single markdown file, a complete directory or a complex structure to HTML or PDF. You can choose between several build-in themes (called templates) or define a custom theme.1
-
Be humble. Nobody knows everything.
Keep learning: read books, take Pluralsight courses, go to meetups.
Write unit tests for your code. No really! Write unit tests for your code!
Learn what the SOLID principles are.
Your job does not define who you are, you define who you are.1 -
that moment when your internal repos are managed in composer and you have the `require` block set, but some fuckwit decided not to define their git remotes in the repositories, because 'thry are used only in applications where all required components are set'... Fuck your fucking fuck of a brain you fuck turd...
-
Am I the only one who wants to be able to write functions in a human readable way, allowing for parameter in-between the words?
Instead of defining:
const enforceStringEndsWithChar(string: string, char: string) => {...}
I want to define it as:
const enforce(str: string)EndsWith(char: string) => {...}
.
.
.
I'll see myself out.6 -
Holy shit I don't understand Rust's module system. Package I have not a single clue what it is... It "can contain one library crate and multiple binary crates". What? Okay so a crate is a collection of modules. Great, now how do you define modules? `mod whatever {}` probably. Then what the hell does `mod whatever;` do?? Import a module from a file with the same name (ignoring the fact that modules and files don't seem to have anything to do with each other). But why `mod` to import? How does that differ from `use`-ing a module? What is any of this??3
-
What CI software are you using?
Are you happy with it or what do you hate about it.
I tried 5 different CI platforms in the past week, and I did not like any of them..
Any recommendations? (Can also be self hosted, I have a k8s cluster at my disposal)
// a short rant about team city
wE uSe koTliN dSL to reduce how much configuration is needed, fuck you I ended up with even more, it's horrible I have 40+ micro services, meta runners sounded like a awesome feature until I found out you need to define one for ever single fucking project...
Oh and on top of that, you cannot use one from root parent, but also it cannot be named the same.
Why is all ci software just so retarded - sorry I really cannot put it any other way11 -
I nearly never actually had to code for an interview, since I decided not to work in the gaming industry. Only ever I can recall was them asking me to define a templating engine / Syntax of my dreams.
-
Dont want anything, maybe an alternative main stream social network which I actually own my data and I can define who accesses it and who doesnt. Its my info not the company that it is being held on.
Smart p2p and encrypted which somehow only those I allow can view it.3 -
#define someError ( -1)
int func(params *param)
{
//some code
if(condition)
{
someError ;
}
}
Spent like half and hour on debugger thinking why the fuck does it skip my statement. My manager who was passing by saw me puzzled and asked if he could help, so we spent another 10 minutes without success(tho my manager is technical guy but he had an unlucky moment I guess). Eventually senior manager saw our wtf faces and asked what is going on, it took one question for me to light the bulb "someError is a macro right?"
I guess you can imagine my embarrassment at that moment..
PS: Forgot return keyword before the error code. -
#define DevOps team
- dev team that also does ops or vice versa.
- an ops team calls itself devops but does not actually do development :-|
- IT for developers
- or better to call it SRE team?
...1 -
Manager complaining about why things were done in a 'different' (not the manager's) way.
If you bloody define your tickets better, this shouldn't have happened right!?
I wouldn't have to keep chasing you for details EVERY SINGLE F-ING TIME and I probably wouldn't have to redo and undo the same sh*t 4, 5 times2 -
Javascript really needs a way to define consts for a block 1 level up.
So instead of
const el = wide ? els.wide : els.tall
You can do
if (wide) const el = els.wide
if (!els) const el = els.tall
// etc..
Just makes chaining and backup values way easier than inline conditionals 🤔15 -
!rant Just an observation. There is a lot of discussion about syntax. Should it be tabs or spaces or should the opening bracket be on the same line as the method/function. There is 101 languages and standards. Syntax varies and you just can't learn it all.
What is more important? Result or the aesthetics? If you come into a project you adapt. You use the syntax everyone else is using. If you are a part of starting a project you agree on rules of engagement and stick to them so the team works at maximum efficiency. If you lead a project you define the rules by adapting to your teams habits. Because in the end it's the working product we are after.
Golden mean.1 -
Calling something "idempotent" is fucking stupid. Why do you have to overcomplicate an already complicated shit such as terraform?
Why not call it unchangeable? Something that can be understood by a 2 year old. What even is the "immutable" word for if not even that is being used??? Why have 2+ words that define the same shit. Are u fking stupid who the fuck coined this phrase Idempotent and thought it was a good idea
When i read idempotent i have to remember and translate in my mind that it actually means "not changeable". On contrary theres "Non-Idempotent" so this fucks up the complexity even more cause Now i have to translate it as "non-not changeable -> which means it is everything But not changeable -> so if it is NOT not changeable -> it means it IS changeable" Fffuck offf13 -
!rant
Question to the devs that hire.
Would you hire a developer with the qualifications:
- knows multiple programming languages (can be any but knows them well)
- has worked the past 6 years in the field however worked during his school life.
- started of career in web development and worked with high end clients, (big corps, businesses, celebs)
- does not have a CS or Engineering Degree (has a different degree that is remotely related)
- has failed his A Level exams (pre-college, high school board exams by Cambridge) (not that this matters)
Disclaimer: This is not about me. I was in an argument with my extended family about the importance of grade school education in work. My family consists of Teachers and School Administrators entirely. The above point all define me and I was successful enough to earn more than what my family does early on when joining college. I did however fail my alevels only to get a scholarship in a great University for my field.5 -
I saw a thing was already define on the front-end and just went ahead and assigned it to the necessary orgs
Few hours later our process for that thing failed on 3/4 instances. The last I already setup a couple weeks ago for testing. Turns out there's 2 things with really similar names on those instances so when I decided to not fucking check, the wanted thing was never defined so it couldn't process
Welp I'm messaging my boss tomorrow morning to see how bad this is, then unassigning the existing thing before defining the correct one
Fucking hell why did I not verify the definition. Would've taken less than 30 fucking seconds for all instances. Thankfully this is still technically in testing. But fuck I'm pissed at myself2 -
You know what really grinds my fucking gears?
When I increment my pointer beyond the memory the operating system allocated it.
Who are you to define how much memory my pointer is allocated? You fucking bigot!1 -
So we have this year end goals thing at work and the managers pick the goals for us, we dont get to do it
My manager picks for me security topic, the items in that are as follows:- have training sessions, define web security standards, Ensure team follow standards, Identify issues with current implementations
I am damn developer, that's another fucking job!!!3 -
So which do you think would be faster to detect related points in an image to a certain threshold ?
A. Scan a line at a time and define a rectangle surrounding the shape ?
B. Starting at a pixel find values in each direction within a tolerance and recurse each point found with the same function
C. Do something similar to above but try to find the edges by finding the last point before blank space to get a shape
D. Identify all line segments on the horiz very and diagonals and see which ones intersect ? Omg I asked this before. After discovering all the points that are within threshold and iterating through these alone?
E. Is there another goddamn method ??? Lol6 -
One of those "you have got to be kidding me moments":
struct Speaker: UnitNode, MemBufferBase {
typedef UnitNode super;
…
}
And then elsewhere:
#define Node UnitNode
#define Speaker AudioSpeaker
Never seen anyone typedef base class as super in C++ nor use a #defined variable as a class name. And of course elsewhere in the code class names are normal literal a but are referenced via a #define (and sometimes not via the #define)... The same obfustication done two different ways! -
Make good progress on Orchid, my pet project, the functional programming language that has no syntax apart from what the macros define. A type system, an interpreter and provisions for a compiler would be nice for a start.
Finish my bachelor's degree on some unspecified part of Orchid, at the current pace that would most likely be just the Hindley-Milner algorithm.
Don't get fired from the gem of a job I have, and move to London because I'm a city rat and the only way I can sleep well apparently is with a tram or drunken people screaming under my window.2 -
Hey guys and girls ;) I was thinking how would you define programming in one simple sentence. Asking this question cuz I’m trying to explain to my father what im doing :P :D8
-
Wondering: What does define a BIG project for you?
I just noticed we're approaching the deadline and there are at least 6000 lines of css. Not my personal biggest so far in terms of lines. I think i worked on projects with 10.000 lines9 -
There's no favourite coding challenge for me. Of course I do them when I'm asked to but I don't think anyone can derive how Well someone works from these short toy challenges.
I once had a proper prototyping Challenge that was really fun. I had to Work on it in advance to the interview. I had to define the scope and how much time I will spend in it in advance and then explain and defend the scoping and all technological/architecture decisions and handle proper criticism in the interview. No bullshit coding challenges Had to be solved :)
I think these prototyping challenges will Tell you way more about an applicant and his worth as a dev than those little challenges ever could.4 -
Software idea: A text software that lets you fold based on tab indentation, and define arbitrary text as headers tags and also define their format.
Example of the text describing the configurations that would be used (format wouldn't be inline oc but just in case any of you complains):
# Header, blue, slightly bigger text, bold
item 1
item 2
! red line of text, indicating to-do or current state
arbitrarily
indented
foldable
text
Now the rant: I can't find any software that offers this. :/ I have to define a whole language spec to do this in the editors I've checked.
If you happen to think about some editor, tell me.
Of course, I could code it myself, but I'm married to University for now.8 -
I totally remember that my teacher define HTML as Hypertext Make up Language. I literary laugh at her.3
-
Has anyone here ever implemented OAuth2.0 for WebRTC? I am reading rfc7635 and its references, but they refer to functions they don't define properly and rely on cryptography jargon by eg. calling values by different names, so I'd appreciate a reference implementation of the function for building tokens to clear up the confusion.
rfc7635 on STUN extension for third-party authentication:
https://datatracker.ietf.org/doc/...9 -
Gson is an excellent library every Java/Android developer should know. You can easily parse a Json or XML network response into a POJO class and get ready to go. But the guys who started the project I currently support found a better, smarter, slicker way to parse network responses into memory:
ArrayList<ArrayList<HashMap<String, String>>>
I would love to meet the genius who came up with this idea. I mean, you can parse absolutely any API response without even having to define stupid Java classes or importing libraries! And also you can reutilize the same scheme for literally all Java projects that handle API responses! Wonderful -
This begs the question: how do you define being good at programming? How can you tell if you are actually good or just think you are?
Having asked that, I think I’m getting there... by reading other people’s code, by listening to feedback from better devs than I am, by asking questions and discussing matters I may not fully comprehend, by reading books and articles, by trial and error and by constantly seeking new concepts, languages and other relevant matters to learn. That’s how one becomes better - when one is good, is another story altogether. -
1. write down requirements. what exactly do i want?
2. paint possible solution. how could the finished product look like? while doing this i think through each step of the application and often adjust step 1 until i think 'this is it'
3. design model. how could the database look like. what structure do i need?
4. define milestones. What to do first?
5. Start and keep 1-4 up to date -
The slow typer who just discovered #define
#define Property AudioUnitPropertyID
#define Parameter AudioUnitParameterID
#define ParameterValue AudioUnitParameterValue
#define Format AudioFormat
#define FormatDescription AudioStreamBasicDescription
#define PacketDescription AudioStreamPacketDescription
#define ActionFlags AudioUnitRenderActionFlags
#define TimeStamp const AudioTimeStamp
#define IO ABufferList
#define PD APacketDescription
#define Count UInt32
#define DataSize UInt321 -
First project at new company ended up shit as clients kept using the backlog to define and refine their business requirements. Did not go to production.
Second project at same company ended up the same way, except it had more infrastructure issues than technical debt (and an asshole for a project manager).
Basically I'm scoring 2 for 2, and totally expecting my next project to be doomed too for a 3 score. Maybe I'll build up enough rep as that guy who dooms projects to just sit on my ass and collect my paycheck while I work on my personal stuff. -
How I define unity : "A single pixel alone can form only one colour but when many come together they form a colourful image, capable of telling the entire story"
-
What do you think about psychometric tests? I doubt a test can define the type of person you are nor your characteristics. I think it's ambigous, unprecise and extremely subjective. Today I was rejected from a job offer because "the psychometric department didn't give their vote of approval". This is the first time I get rejected for that reason, in the past nobody complained about the results of my tests. I don't know if psychometry is useful, but this company is looking for someone different, or maybe psychometry is, in fact, subjective and any fool can interpret your results however he feels like: "Oh, so he likes kittens over puppies, he's a potential serial killer, let's reject him"1
-
Best C-Line Ever
#ifndef ULLI_DOESNT_KNOW
#define ULLI_DOESNT_KNOW
#endif
Says soo much about this honest coder :D -
So here the function that does same thing as new operator in javascript:
// we define our function Person that assigns properties to THIS that points to some object
const Person = function(name, lastName) {
this.name = name;
this.lastName = lastName;
}
// in Person prototype property we define our functions
Person.prototype.getName = function() {
return this.name;
}
Person.prototype.getLastName = function() {
return this.lastName;
}
// function that simulates new operator
// first argument is a function that would act as constructor
// second argument is an arguments that would be passed to constructor
function New(func, ...args) {
// with Object.create() we create a new object and assign [[__proto__]] from "func" prototype property
let object = Object.create(func.prototype);
// here we're calling "func" with THIS pointing to object
func.apply(object, args);
// then we return it
return object;
}
let person = New(Person, "Name", "LastName");
console.dir(person);
// so this is how prototype OOP works in javascript6 -
Dear real estate industry,
if you define a horrible exchange format as CSV file. Then fucking stick to that specification or give me access to your horrible 90s style tooling so I can at least figure out why every crap tool exports in a slightly different way.
How in the world am I supposed to map your data if you keep changing the field count (which is the only way of validating an exported file).
You pretend to be innovative by specifying an industry wide standard but you aren't able to stick to it.
Fuck you, and the one guy "developing" the specification. Seriously... One guy has the responsibility? Do you really think that's a good idea.
Get your shit together!
Yours,
every developer working in your industry3 -
ohhhhh I am pissseddddddddddd
itss the fucking pytorch.module class it would seem !
I do exactly the same goddamn shit as its supposed to do in a goddamn notebook and run it step by step and the fucking model trains and the output values change !!!! and the loss decreases !!
I do this in the goddamn class derived from model with a call to model.parameters() and the fucker fails !!!
why ???
why ?????
why ??????
is it cloning the goddamn parameters so the references aren't there ????
seems to work goddamn fine when i call a layer and activation function at a goddamn time chaining the calls one after another !!!!!!
UGHHHH IT LOOKS LIKE IF YOU DEFINE THE LOSS AND OPTIMIZER OUTSIDE THE FUCKING CLASS IN A SEPERATE TRAINING FUNCTION IT DOESN'T TRAIN !!!!!!
WHY ??
A REFERENCE IS A GODDAMN REFERENCE !!!! -
So here I am, coding and listening to some song I'm currently working on to be able to define its artistic direction, and... I think windows wants to tell me something...2
-
Symfony 4:
I created a firewall with a user provider and everything was great for a year and a half.
I needed a second firewall with a different user provider for my REST API.
Being stateless, the rest api firewall didn't need the refreshUser method so I didn't bother doing anything inside but returning user (without noticing how my original class was built or the official documentation which apparently says I need to throw an exception if this isn't the right user provider for the user in the session).
I was having a problem with my main firewall after that point because I assumed it would only use the relevant user provider, but even though my API firewall only applied to a specific host/pattern, the user provider for that firewall was still being used. If it had run the supports method first, it wouldn't have done that even with my initial mistake. Frankly, I don't know why there is a supports method if it's not being utilized for this purpose...I saw supports() is used for the rememberme functionality, but seems inconsistent not to use it everywhere.
Not only should Symfony be updated to check the supports() method, but I also think it should only loop through user providers for the current applicable firewalls. Since we define a user provider per firewall, I think that would be the natural way for it to work. Otherwise why even define a user provider on the firewall if it's just going to try to use them all anyway?
Furthermore, in the case of a stateless firewall, requiring the refreshUser method via the interface seems strange. -
Dude, stop using dependency injection for your loggers. We don't need to inject that crap. Just define it and be done.9
-
#define SOAPBOX
Data will contain errors and inconsistencies, and the only player that can detect them is: the computer itself.
if the computer detects that it is in a situation where it cannot meaningfully continue, it should not allow itself to continue.
Only the computer can make that determination.
If the software does not aggressively test its data, it is usually impossible to determine whether the problem is with the software or with the data or both.
Per contra, if it does do so, it becomes impossible to assert that the input data does not contain the issues that are being tested for ... a very important thing to be able to say in a real-world production setting, where hundred-megabyte input files are common.
#undef SOAPBOX -
so a good thing happened. after struggling with our current TL for whole last year, one SSE was promoted to TL and the team got split into 2. now our team has the new TL which is strict but a much more responsible lead and a good friend.
and in a striking change of culture, she has askedus to define our own KPIs rather than using the pre default KPIs. our predefined KPIs were weird :
- number of sprint spillovers >> to minimise
- number of POCs , learning sessions done >> min 2 in year
- number of prod bugs caused >> to minimise
-instancee of coding standards miss >> to minimise
i kind of excelled in all , yet got an 86/100 rating. previous TL was an asshole , so that also contributed to a lower rating without reasoning.
but since now i have the opportunity, what do you suggest should be ideal KPIs for a software engineer 1?1 -
When you write a crawler to scavenge through a set of sites but only compare their 'uniqueness' through an on-startup hash map which doesnt reflect values already in DB and now you've duplicate values coz you didn't define uniqueness in DB either :v
I need to not be sleepy rn. -
Holy crap, Meta Developer Connect keynote. Amazing innovation. This is what Apple **used to be**
Granted, the hardware is not as elegant as Apple but the cost is 1/10 and the capabilities are close, same, or exceed (Llama) what Apple is offering.
Now here is the gut punch, they figured out that the mobile app build system needs to build AR/VR/MR apps. That was Apple's edge.
As a developer, I am not enamored with Swift and it is pretty clear that if I have to change and use a niche language like Swift or change and do dev on Android, to target new Meta hardware and AI... well... lets just say I think Swift is crap from a language standpoint and I suspect it is the reason Apple's hardware uses so much more memory, battery and storage than it should. At the same time Meta's Orion runs on a god damn battery in the early piece of glasses. My AVP's have a huge brick.
#define kApple kGigaBloat
If I were Apple I would be shitting my pants watching this Meta presentation.5 -
Define programmers
The mythical creatures who solve all the problems of lesser mortals without having to move from their desks. -
(define (day p)
(map(lambda(color)
(colorize p color))
(list "red" "orange" "yellow" "green" "blue" "purple")))
>(day(square 5)) -
Why doesn't Java have a functional interface that supports throwable exceptions?
Seems silly to have to define my own wrappers around the Function<> interface. -
in 2023, swift still doesn't have a tracing GC, and they are still using reference counting to decide when to deallocate an instance, surprise! what's even worse is closures are everywhere and the default way to define a closure make it possible to keep a reference to variables in the parent scope.8
-
I recently started working on laravel. As the community says it was easy to get along with the framework and its methodologies. But then i had to do multiple login with framework in same domain.
Oh man, i spent a week to make it work. All those guards and middlewares realted to login was driving me crazy. The concept was clear, but somehow the framework was like "You! I shall make you spend a week for my satisfaction". The project demo was nearing and i was doing all kind of stuff i found. Atlast after continous tries it worked. Never in my 4+ years as a developer i had to face such an issue with login.
So here is how it works,if anyone faces the same issue:
(This case is beneficial if you're using table structures different from default laravel auth table structures)
1. Define the guards for each in auth.php
Eg:
'users' => [
'driver' => 'session',
'provider' => 'users',
],
'client' => [
'driver' => 'session',
'provider' => 'client',
],
'admin' => [
'driver' => 'session',
'provider' => 'admins',
],
2. Define providers for each guards in auth.php
'users' => [
'driver' => 'eloquent',
'model' => <Model Namespace>::class,
'table' => '<table name>', //Optional. You can define it in the model also
],
'admins' => [
'driver' => 'eloquent',
'model' => <Model Namespace>::class,
],
'client' => [
'driver' => 'eloquent',
'model' => <Model Namespace>::class,
],
Similarly you can define passwords for resetting passwords in auth.php
3. Edit login controller in app/Http/Controller/Auth folder accordingly
a. Usually this particular line of code is used for authentication
Auth::guard('<guard name>')->attempt(['email' => $request->email, 'password' => $request->password]);
b. If above mentioned method doesn't work, You can directly login using login method
EG:
$user = <model namespace>::where([
'username' => $request->username,
'password' => md5($request->password),
])->first();
Auth::guard('<guard name>')->login($user);
4. If you're using custom build table to store user details, then you should adjust the model for that particular table accordingly. NOTE: The model extends Authenticatable
EG
class <model name> extends Authenticatable
{
use Notifiable;
protected $table = "<table name>";
protected $guard = '<guard name>';
protected $fillable = [
'name' , 'username' , 'email' , 'password'
];
protected $hidden = [
'password' ,
];
//Below changes are optional, according to your need
public $timestamps = false;
const CREATED_AT = 'created_time';
const UPDATED_AT = 'updated_time';
//To get your custom id field, in this case username
public function getId()
{
return $this->username;
}
}
5. Create login views according to the user types you required
6. Update the RedirectIfAuthenticated middleware for auth redirections after login
7. Make sure to not use the default laravel Auth routes. This may cause some inconsistancy in workflow
The laravel version which i worked on and the solution is for is Laravel 6.x1 -
1 - Correct me if I’m wrong, but in true Agile, a product owner ought to be able to interact directly with the dev team, and vice versa, in the card/conversation/confirmation process of creating, estimating, and executing the user stories, correct?
2 - If Company “A” contracts with Consultant “A” to have software developed, and then Consultant “A” then contracts with Company “B” who then contracts with Consultant “B” to do the development, who would you define as the Product Owner?
3 - If Company “B” is barring Consultant “B” from talking with Company “A” and Consultant “B”, is Agile even possible?7 -
Why is it acceptable for dev think it's ok to skip testing? WHY?
Today i was told that a co-worker had good enough judgment when it comes to CSS if it will break in other browsers other than chrome. I'd accept that if they knew the browsers inside out and read all the release docs but no, not them. Even more so when it's not their field of expertise.
After working for 2+ years at the some company, with a QA team, it's become evident no one does any proper testing, even the friking QA team!
I'm close to define the supported browsers as "What ever the developer used at the time of build".
Am I really the only Dev to test in at least 2 other browsers? -
Firebase is a fucking piece of dog shit.
Testing is so bad and complicated to set up, I've spent two days trying to write ONE fucking simple test with an auth middleware via expressjs. Why firebase doesn't mock my dung, you pieces of shit. Even the documentation is all spread out, it's difficult and terrible to follow. I would rather build my own backend because of all the workarounds I have to make because of your limited SHIT product. Even the type libraries are shit, import Timestamp? NOPE. YOU HAVE TO IMPORT FIREBASE TO IMPORT A TIMESTAMP. Learn to define types, shitty google devs. You all suck, thanks for making shitty clients sdk's.
I hope this piece of shit gets deprecated and my clients stops using it.4 -
I made a very obvious realization since the last time I rewrote Orchid; the 3 year project that has now become an eloquent documentation of my learning process; Types aren't free. Sure they're free at runtime, in fact the more you have the less the language has to work to separate values, but they generate significant cognitive load.
Oftentimes it's better to have one enum with 12 variants 3 of which are specific to a narrow case to be able to define operations for this enum once, than it is to have 3 distinct enums of 10, 11 and 8 variants respectively, and to have to define common operations (or the dispatch part anyway) thrice.
As for my previous observations about catchall abort acting like the new type abort, I still think that, and I still think that this is only justifiable if the number of invalid variants is low enough in every case that you can list all of them before the abort.4 -
Goals, "debug all test issues in time"
WTF, when I started this recently there were close to 200 issues because this was never tested, I've got it down to a little over a hundred, define "all" and "in time".
Not sure if I should say something or just let the numbers speak whenever wishful thinking meets reality.
Maybe I'm just very touchy.1 -
I've been trying to define a trait `Inherits<T>`, a trait `Extends{ type Parent }` and an arbitrary amount of scaffolding around it such that
- the scaffolding for a given type only has to acknowledge that type, its parent and the types of which it is a parent
- `T: Inherits<U>` if a chain of `Extends` leads from `T` to `U`
I suspect that this is impossible, but I'd seen Rust traits bent to do crazier things, so if you know of such a system or can come up with a way to implement it despite the orphan rules, I'd be over the moon.2 -
I have no idea what is happening. literally. am i considered to be a human just because human beings decided to call humans, human being? are the words coming out of my thoughts, the real words that my human form is intending to convey? you! all of you! what is real for you? how do you define the right thing to do? Do you live your life according to your real self or according to what others expect of you? are you living your life truly? what is the truth? how can you consider a truth to be true if that truth has been made by the same creature that also had no idea of what the truth was and suddenly just came up with it? how?2
-
Have an object that uses a macro to define its function bodies. I needed to interface to that object in a different way. So I wrote and object that calls functions on that object and presents a different interface. I used macros to define the function bodies...
-
Hi everyone, I have such a task: “Given an integer square matrix. Determine the minimum among the sums of diagonal elements parallel to the main diagonal of the matrix.” I have a code but I have problems compiling a flowchart for it, can you help me with compiling a flowchart or give tips? thanks in advance!
Thats my code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define N_MIN -3
#define N_MAX 5
int main(int argc, char *argv[]){
int s,i,j,k,l,s1,t2,t1;
int a[5][5];
srand(time(NULL));
for(i=0;i<5;i++){
for(j=0;j<5;j++){
a[i][j]=rand()%(N_MAX-N_MIN+1)+N_MIN;
}
}
for(i=0;i<5;i++){
for(j=0;j<5;j++){
printf("%3d ",a[i][j]);
}
printf("\n");
}
k=0;
s=0;
l=0;
for (i=0; i<5; i++){
for (j=0; j<5; j++){
if (a[i][j]>=0){
if(a[i][j]%2==0)
l+=a[i][j];
k++;
}
}
if (k==5){
l=l;
}
else {
l=0;
}
s=s+l;
k=0;
}
s1=a[0][5-1];
for(i=1; i<5; i++){
t1=t2=0;
for(j=0; j<5-i; j++){
t1+=a[i+j][j];
t2+=a[j][i+j];
}
if(t1<s1) s1=t1;
if(t2<s1) s1=t2;
}
printf("vivod %d %d\n", s,s1);
return 0;
}2 -
Recommendation for what type of html5 templates to search in order to define a description of a project. Simple 5 tabs with a login panel for pdf access.2
-
in swift, the default modifier for `init()` of a struct is `internal`, regardless what the struct's modifier is. why can't they just change it to inherit the modifier from the struct? why would anybody want to define a public struct and yet keep the `init()` internal????3
-
Global effort 1 rand(n 1) rand(n 1)
Global collab_skill 1.5 rand(n 1) rand(n 1)
CD "university/groupprojects/educ"
Do "function"
Set obs 1
Gen project_ambition = 1
Define label project_ambition 1 "high", add
Gen hype = project_ambition
Define label hype 1 "high, add
Egen output=function[min(`collab_skill');llmean(`effort')]
Egen success = 1 if output>=hype; else success =0
Su success
0 0 0 -
OOP question: Can someone fucking explain to me what does it mean to hide complex implementation behind an interface?
Also whats the point of using interfaces when you can define methods in an abstract class and just override them in subclasses in order to get class specific implementations?18 -
https://symfony.com/doc/3.4/...
Look at how they write docs:
"->atPath('foo')"
how can I fucking know what to pass instead of foo? I cannot make show fucking error message near the field.
Are they writing such doc so that we would spend more time searching how to make show fucking simple error message?
"The atPath() method defines the property which the validation error is associated to. Use any valid PropertyAccess syntax to define that property."
Property on my entity is collection of $values . Tried passing 'values' - no effect.2 -
How the fuck you define a prototype in Android development?
Is it something like "here is the design showing all possible working and functionality, make a working app with all cloud calls integration in 7 days.
If its working as expected, we will just do some ui enhancements, replace your testing firebase with our own broken cloud, replace default pickers with some library or our own broken pickers and spend 30 days on all this plus the testing"
Is this what you define as a prototype? Like yeah the new intern will do the heavy lifting in all his prototype and then we will start the work on our end, in the meantime giving the intern another new prototype idea and scolding him for delay?1 -
Okay we have gotten word that overclockedgd's tablet screen is coming soon!! imagine how much fun and adventures we will have during our team! we will start doing block launcher tutorials!, maybe some web games!, but if we dont define CTX then our money making team is gonna be a bust )=6
-
"I'm going to save space in my source code file by using obscure abbreviations for all my #define statements, and cramming as much C code into as few lines as possible."
- teammate who apparently has no idea how a preprocessor works, and who thinks "code density" literally means cramming lines of code in as small a space as possible in the source file!