klimi
hi
Asad
which is better for web apps? Python&Django or C#?
void
void
But obviously Python is more simple btw
Asad
But obviously Python is more simple btw
c# is more powerful, right?
Asad
than python
void
In different cases every programming language have it's own benefits
Asad
uhuh
Wim
I'd look into GWAN if I were you
Hayk
Hi everyone! Join our C++/Qt group on Telegram to be a member of a constructive group and share knowledge with many experts and helpful members in a friendly atmosphere. :) Our group's ID: @CplusplusQt I'm sharing the group after getting the permission of @K11M1
Dima
I_Interface
Anonymous
Somebody know how can I do filter in open cv with c language?
Dima
Would be better if you will be more specific
Anonymous
Anonymous
Her I load the img
Anonymous
And for example I want it to be a gray img with filter
Anonymous
So how can I do it
Anonymous
?
Francisco
Somebody know how can I do filter in open cv with c language?
Just use the Python API. It's way easier to use
Anonymous
I must use c
kλletaa
rtfm
kλletaa
Dima
Anonymous
I must use c
Extend python interpreter using c and script using python. Now you've used both.
Asad
/Qt
Mateo
Hi, I'm learning cpp and reading about move semantics, consider this two functions:
Mateo
Mateo
I have put log messages in all move/copy operations
Mateo
If I execute f or g, both prints saying the copy constructor is being used, which is kind of what would have expected
Mateo
however, in g, as a is not being used again, I would've tought the compiler would optimize this, and use the move constructor instead of the copy one
Mateo
so my question is, is there a reason why the compiler didn't optimize this? are there some side effects I should be aware of?
Anonymous
Francisco
so my question is, is there a reason why the compiler didn't optimize this? are there some side effects I should be aware of?
Think of an rvalue as something that doesn't have a name. Your variable has a name, "a", so when you initialize b, the compiler sees a as an lvalue, therefore calling the copy constructor instead of the move one
Francisco
That's why utilities like std::move or std::forward exist
Francisco
The compiler cannot take an lvalue and say "well, this is clearly not used again, so what if we take as an rvalue and call the move constructor?". Maybe someone can implement that optimization, but doing that for every variable that it's initialized with a previous one will certainly increase the compile times
Francisco
Just use std::move everytime you know that variable is not going to be used again to enable the move semantics
Mateo
I passed -O3 to g++, can I ask, how do you know there are no calls to the move/copy constructors?
Mateo
Woa, not there yet hahaha
olli
But do note, using std::move everywhere can actually do harm. E.g. it can prevent the compiler from doing copy ellisions
Mateo
Is it very common to look at assembly while writing c++?
olli
Is it very common to look at assembly while writing c++?
Depends on the software you are writing. If you work on something performance critical or with hard constraints, yes. Otherwise I guess not
Francisco
Is it very common to look at assembly while writing c++?
Depends on the project, but it's good to know how to read it
Mateo
Is it readable? I would've thought all the abstraction c++ gives, would make it unreadable
Mateo
Thanks to both for the answers!
Francisco
Is it readable? I would've thought all the abstraction c++ gives, would make it unreadable
I don't mean reading the whole thing, but at least being able to detect logic in simple programs
Pavel
Is it very common to look at assembly while writing c++?
You can show off to your colleagues. And sometimes it can be beneficial in arguments with someone about code efficiency. Sometimes it's just interesting to see what's happening in some optimized code. Like what code does compiler generate.
Anonymous
Anyone think of a relatively simple and well known piece of software written in C/C++ that doesn't rely on external libs too much? I'm wanting to learn about porting applications to different architectures, I want to port something from an x86 implementation to a 3ds console which uses an arm architecture
Anonymous
I was thinking of porting Doom but it might be a bit complex
Pavel
Anonymous
Something like that
Hayk
A very specific screenshot. Which deserves a very specific warn in many groups :P
Hayk
I was thinking about it...
Then we are probably brothers. But we didn't know till now about that. Like in indian films :P
Dima
Don’t post photo of a screen. Use text-paste services please
WHOMAI
After reading above conversations I can say that my C++ knowledge is (-0) 😂
Hayk
No
Omg I regret to see your sad situation😅
Anonymous
Hey
Anonymous
Add me
Anonymous
😁
klimi
Hi
Anonymous
Hi
Hey
klimi
Hey
Hello
__getitem__
Hi, can I ask about an cpp implementation that exceeds memory limit ?
klimi
Buffer overflow?
__getitem__
Buffer overflow?
no, In a programming competition.
__getitem__
Changing to array from unordered_map helps.
klimi
OH you want to lower memory usage
void
Changing to array from unordered_map helps.
std::vector<Key> keys; keys.reserve(map.size()); std::vector<Val> vals; vals.reserve(map.size()); for(auto kv : map) { keys.push_back(kv.first); vals.push_back(kv.second); } ?
klimi
Well you can try different stuff but probably you will have to think of Better solution
__getitem__
no. not like that.
__getitem__
https://gist.github.com/harshraj22/9fd31fd7ff166fa0c0035fddfdf248a9
__getitem__
https://gist.github.com/harshraj22/9fd31fd7ff166fa0c0035fddfdf248a9
Look at this to get better idea of what problem I am facing.
Hayk
You talk too much
Hmmm one message per month/per two months is too much, I agree