Ludovic 'Archivist'
locking a mutex is pretty cheap, unexpectedly failing to lock one is what is expensive, I need to preserve message ordering mut if you do not, you can use 2 queues and 2 mutexes. if you fail to lock one, lock the other and vice versa
The
Coz memory ordering bugs will show up in prod 6months down the line maybe
Ludovic 'Archivist'
Ludovic 'Archivist'
Ludovic 'Archivist'
dumb and robust
Ludovic 'Archivist'
Ludovic 'Archivist'
and test extensively
Ludovic 'Archivist'
no tests should every fail. if a test fails, something is wrong and should be fixed (leaving "correctly failing" tests in the pipeline creates noise that will let race condition bugs slip away)
Ludovic 'Archivist'
Ludovic 'Archivist'
Ludovic 'Archivist'
(with a 35h week and the french government mandated paid leave removed)
The
I'm a noob after 10 years.. should've focused on it completely..
Ighor
hi, do anyone know alternative to crashpad/breakpad that works with mingw64 builds?
Adeyemo
And intermediate c++ programmer here that need a learning partner?
I need an accountability partner.
Or probably a mentor.
I currently spend 35 hours per week on my personal development. Please the bosses in the house should kindly help we that are just coming up. Thank you ❤️
The
Adeyemo
I meant we can go by project, we have a common GitHub repo and we build together, help each other along the way and when we have blocker we come here. What do you think?
Adeyemo
Or you just us to come up here every day and declare I did this today or sort. Lol, that's won't help much I think
Adeyemo
My opinion anyway, let me hear how you feel about that
The
Adeyemo
Offtopic?
John
any one with Dev C++ app
John
lol okay, thanks 😅
klimi
John
can someone assist me with the setup for Dev C++ for Windows, please..
Thank you in advance
Manav
John
Manav
Don't bother with ancient stuff, it's nearly 2024. If the ui looks like windows 95 it's a good indicator to avoid the software, unless you have time machine to go back to 1990s.
Anonymous
how to setup c/c++ in vs code?
Anonymous
yes i tried i installed MinGw
Anonymous
followed every step
Anonymous
still cant run the code
Ілля
Hello everyone. What is better to use to assign an iterator, a method or a function? What is the difference? I would be grateful for your answers.
Example:
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> vec = { 0,1,2,3,4,5 };
vector<int>::iterator iter_vec = begin(vec);
//or vec.begin();
cout << *iter_vec;
return 0;
}
Danya🔥
Yash
Can someone help me to learn C language
Yash
I am beginner and know some basics of C language
Иван
Anonymous
Can someone explain me what would happen if in this program instead of using the deference operator we use pB++ = pA++;
char strA[80] = "A string to be used for demonstration purposes";
char strB[80];
char *pA;
char *pB;
pA = StrA;
pB = StrB;
while(*pA != '\0')
{
*pB++ = *pA++;
}
VD
C
Wassim
C
https://pastecode.io/s/8nuct112
can anyone tell me what's causing runtime error?
i am trying to merge overlapping intervals
C
Ludovic 'Archivist'
Hello everyone. What is better to use to assign an iterator, a method or a function? What is the difference? I would be grateful for your answers.
Example:
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> vec = { 0,1,2,3,4,5 };
vector<int>::iterator iter_vec = begin(vec);
//or vec.begin();
cout << *iter_vec;
return 0;
}
So... it is complicated.I generally like to use vector::front() and vector::back(), or their span counterpart. if I am making an algorithm, I want to use iterators, but if I am consuming a vector specifically and manipulating increasingly decreasing bit of it, I prefer to use a bunch std::span instead of iterators or methods. The main point is that you need to check vector::empty() before using vector::front() and vector::back(), and need to compare iterators to do any calculations, likewise for the spans you will need to handle span::empty(), and I generally trust span::empty() and vector::empty() more to not cause people writing errors than comparisons
Anonymous
Ludovic 'Archivist'
Ludovic 'Archivist'
Then technically std::begin() is supposed to be always the superior method, as it works correctly with more types like array types... but I generally have to admit to being lazy and not using it and resorting to vector::begin()
ᴍᴏʜᴀᴍᴇᴅ
I can access and edit chrome or any browser local storage with c/cpp?
klimi
klimi
ᴍᴏʜᴀᴍᴇᴅ
Anonymous
Wassim
Light
Umm hello, can some body explain to me why in some of my class functions when i dont use const arguement it starts misbehaving like a spoiled brat.
Light
error: cannot bind non-const lvalue reference of type 'ComplexCalculator<double, double>&' to an rvalue of type 'ComplexCalculator<double, double>'
Light
Please note i was creating complex calculator
FriedRice
Your function takes && right? Not &.
Light
My function takes &object
Light
When i created operator/ for division it took (ComplexCalculator &other)
Light
And then the rest was just formula
Light
I just wanna know what chatgpt mean when it said const is used to precent misbehavior
Ziky
Const just prevents you from altering data which shold not be altered, like data of object shared by multiple functions, constants, or "source" argument of functions like memcopy...
FriedRice
That's unfortunately impossible, your compiler says you were trying to bind a lvalue reference to a rvalue reference. This only happens when the function takes a && and you give it &. Can you make sure operator / is overloaded with the correct parameter types?
FriedRice
You are right 👍
𝔖𝔞𝔯𝔬
Guys is there anything like a wrapper library to use os api’s in the same way to write functional code working on both Linux and windows ?
Danya🔥
Ziky
𝔖𝔞𝔯𝔬
I was thinking if there was something for general usage, tho I know there are some wrapping library for more specific task like sockets management
Paulo
Danya🔥
Danya🔥