Anonymous
I see! In a more realistic exercise the transactions should be implemented in a way that lock both accounts before making any movement.
Yes but with just mutexes, you may end up in a deadlock. For ex think of the case where A sends to B and B sends to A at the same time. You have to be careful how you plan this. A way to do this would be using hierarchical mutex where you lock a higher layer mutex for the sender and a lower layer mutex for the receiver. A lower mutex should not be locked unless a higher layer mutex is locked as well. There are many solutions to this that don't involve mutexes even.
Віктор
Can someone recommend me company where i be able to get Internship(c++/python) with a salary (to rent a minimum room).? Country doesn't matter.
João
Guys if you were to start learning C from the start jow would you do it?
João
How
Anonymous
Hello! Can I compare strings in C++ via relational operators? Like this: "abs" == "abs"; In Java I had to use certain method to do such things, what about C++?
Anonymous
I found some information on the internet. It says that I can, but I would like to be 100% convinced in what I'm actually writing
Danya🔥
I found some information on the internet. It says that I can, but I would like to be 100% convinced in what I'm actually writing
What about opening the documentation? https://en.cppreference.com/w/cpp/string/basic_string/operator_cmp
Kriss
The idea is to apply Moore’s Voting algorithm, as there can be at max k – 1 elements present in the array which appears more than n/k times so their will be k – 1 candidates.
Kriss
The idea is to apply Moore’s Voting algorithm, as there can be at max k – 1 elements present in the array which appears more than n/k times so their will be k – 1 candidates.
I didn't understand the logic behind, how there will be a "max k-1 element which appears more than n/k times"
Kriss
I didn't understand the logic behind, how there will be a "max k-1 element which appears more than n/k times"
context-> so I have array and i have to find all elements occurring greater than n/k times where n is the size of array and k is given in the question
Ghasem
is any workaround here? except if-statement? template <typename Type> void Function(Type) { } int main() { Function(true ? 'a' : "Something"); }
Ghasem
is any workaround here? except if-statement? template <typename Type> void Function(Type) { } int main() { Function(true ? 'a' : "Something"); }
WHY WE COULDN'T SEND PIC? hmmm ... to make that statement work the compiler needs to instantiate Function for both char-type and char*-type: |-FunctionTemplateDecl <main.cc:1:1, line:2:23> col:6 Function | |-TemplateTypeParmDecl <line:1:11, col:20> col:20 referenced typename depth 0 index 0 Type | `-FunctionDecl <line:2:1, col:23> col:6 Function 'void (Type)' | |-ParmVarDecl <col:15> col:19 'Type' | `-CompoundStmt <col:21, col:23> `-FunctionDecl <line:4:1, col:50> col:5 main 'int ()' `-CompoundStmt <col:12, col:50> `-CallExpr <col:14, col:47> '<dependent type>' contains-errors |-UnresolvedLookupExpr <col:14> '<overloaded function type>' lvalue (ADL) = 'Function' `-RecoveryExpr <col:23, col:36> '<dependent type>' contains-errors lvalue |-CXXBoolLiteralExpr <col:23> 'bool' true |-CharacterLiteral <col:30> 'char' 97 `-StringLiteral <col:36> 'const char[10]' lvalue "Something"
Ghasem
is any workaround here? except if-statement? template <typename Type> void Function(Type) { } int main() { Function(true ? 'a' : "Something"); }
it could be funny 😂: template <typename Type> void Function(Type) { } int main() { template <typename Type> Type constexpr thingy = true ? 'a' : "Something"; Function(thingy); }
Crow
Ouch
klimi
for what?
you put a dislike emoji, so I am asking if you have something to add to it
Ghasem
is any workaround here? except if-statement? template <typename Type> void Function(Type) { } int main() { Function(true ? 'a' : "Something"); }
for this: i thought that could be atomic iif the compiler does his job with compile-time predictions. but ... you should force it with a order: if (true) Function('a'); else Function("Something"); std::aomtic_thread_fence(std::memory_order_release);
Alexandr
"not a photo from your old phote with bad resolution" seems like restriction for new clause of rules "adding screenshots", doesn't it?
Ghasem
you put a dislike emoji, so I am asking if you have something to add to it
oh ... that one. I know the telegram's group admins very well and know the problem that you are facing. but the solution isn't to ban sending photos, the solution is to ignore those people who send those bad-screenshot things. you said that: text is a text, not a photo from ... which is not really correct. consider the AST that i sent before your message, it could be read much better if it was highlighted.
Ghasem
yes, pasting link to gist is better option
some people don't like to open a link in a separate window just to watch someone's thing while the current platform allow to expanding with just a small size image.
Ghasem
by the way ... that thing is a rule here and i have a lot of work to do and don't like to argue about that.
Wolfreddif
I'm beginning with Java, suggest me some good resources? thanks
Anonymous
I'm beginning with Java, suggest me some good resources? thanks
I have a telegram community for java You can DM for link if you want
Anonymous
Can anyone suggest some good resource for competitive coding
Para
Can any send me data structures and algorithms reference book and reference vedios
Danya🔥
Don't offtop more
Sleeves
Is there a group for windows programmers ?
Danya🔥
Googling is for pussies?
Ziky
Linux kernel? I am still waiting for someone to fix DRM driver bug on AMD APUs...
Anonymous
@K11M1
Anonymous
Wtf
Anonymous
去死吧,小眼睛
Anonymous
去死吧,小眼睛
I'm not a spammer, just getting rid of him
dimazava
去死吧,小眼睛
don't be racist, cmon 😄
Anonymous
don't be racist, cmon 😄
Let's not discuss personal views here? ☺️
Anonymous
Chat is for C++
dimazava
Chat is for C++
yeah, for C++, but not for racism
Roxifλsz 🇱🇹
/ban bing chilling social credit +100
Anonymous
Ahahahahhaa
Guillermo
Is there a group for windows programmers ?
What do you need? If something related to the WIN32/MFC API, the MSDN is enoguh for everything
Sleeves
What do you need? If something related to the WIN32/MFC API, the MSDN is enoguh for everything
I need to create a task using task scheduler api. The task must be repeated every 10 mins
Sleeves
I can’t find any code example with that, do I use a repitition pattern ?
Guillermo
CreateProcess()
Guillermo
https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa
Guillermo
I don't know what ItemTrigger is
Sleeves
I don't know what ItemTrigger is
ltimetrigger using the task scheduler api 2.0
Guillermo
Are you talking about this? https://learn.microsoft.com/en-us/windows/win32/taskschd/trigger
Sleeves
Yes
Guillermo
well, I haven't used that API, but there are examples
Sleeves
I dont know how to join and write a task that runs a script every 10 mins. I guess I’ll do trials and errors
Guillermo
See the example: https://learn.microsoft.com/en-us/windows/win32/taskschd/time-trigger-example--c---
Guillermo
I haven't used that API, but the example is quite similar to your question. So sorry I can't help you more. You should copy & paste that example code and start testing with your own needs in your Visual Studio
Safwan
Can please someone tell me from where i can learn kore api
Michel
Quick question, how can I drop a part of the structured binding declaration? For instance, I don't want the second of this pair: auto [f, _] = std::make_pair<int, float>(0, 0.0);
Ибраги́м
https://www.youtube.com/watch?v=s6Cub7EFLXo
Anshul
Can anyone share any reference for debugging a project in vscode using lldb.
Anonymous
Can anyone share any reference for debugging a project in vscode using lldb.
Is Google not working in India? https://github.com/vadimcn/codelldb/blob/v1.9.0/MANUAL.md
Anonymous
And don't cross post.
Anonymous
Quick question, how can I drop a part of the structured binding declaration? For instance, I don't want the second of this pair: auto [f, _] = std::make_pair<int, float>(0, 0.0);
As of now, it is not possible. But with pattern matching in the pipeline, C++ might introduce a pattern like _ (borrowing from Rust) to ignore certain values in structured bindings. Exactly when pattern matching will make it into the standard is anybody's guess.
kunal
Please recommend a course on udemy for data structure and c programming
𝔖𝔞𝔯𝔬
Hi guys Is anything like C# type constrains for C++ templates?
𝔖𝔞𝔯𝔬
Like where T: class_name