« first day (576 days earlier)      last day (2501 days later) » 

06:50
@nwp As far as I know, it's a one-time thing: either when you hit 100K, or when they started doing it, if you were already at 100K.
 
3 hours later…
09:40
@nwp It's getting too yawnable for me.
nwp
nwp
I don't know what that means.
I get tired of explaining ADL. I just link the cppreference page now
nwp
nwp
Ah, that was a comment to someone else and not about my comment.
I like to comment with a link to a cppreference site that answers questions. I'm hoping it has some long term effect.
Of course other people post a shortened missleading explanation and get rep for it which somehow still bothers me.
nwp
nwp
10:10
Today I learned new auto (42); compiles. A by-product of linking beginner stuff that apparently I don't actually know about either.
10:24
yeah it's interesting that they haven't yet deprecated allocating new
 
5 hours later…
15:36
When i initalize a member of type float over the init list with an int, will there take place an implicit cast from int to float ?
QVector3D::QVector3D(const QPoint& point) : xp(point.x()), yp(point.y()), zp(0.0f) {}
QVector3D::QVector3D(const QPointF& point) : xp(float(point.x())), yp(float(point.y())), zp(0.0f) {}
nwp
nwp
implicit conversion, yes
wondering...why they do on float to float an explicit cast and on int to float not..
o.k.
nwp
nwp
Qt is terrible when it comes to good C++ code. Try to avoid learning from them and hope their ugliness doesn't infect your code too bad.
hehe
maybe they reversed both
or better mistaken
 
5 hours later…
20:41
Ferenc dont tell me u learning Qt3d!
@FerencRozsa are you learning Qt3D?
I have the weirdest error ever
I'm using library
library has a PtrArray<T> struct, when I try to initialize it in my struct via PtrArray<Vector3d> myVertex; I just end up with
error C3646: 'myVertex': unknown override specifier
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
nwp
nwp
"missing type specifier" means the compiler was unable to find the type you were using.
You either miss-typed it, forgot to declare it, forgot to include a header or have circular includes.
yeah its weird
because in header if I put struct{PytArray<Vector>myVertex}; I get that error, but if I go to the CPP and in function I do PytArra<vector> myVertexInCpp; It works just fine
so how can it be erroring in header, but not in CPP ?
I'm using external library, and as far as I know I have to use a macro #define Library_INTEROPERABILITY call to get it to work
nwp
nwp
My crystal ball clearly says you have a circular include.
not sure how, I have 1 main function and 1 cpp/header
I do include other libraries in cMake but uhh
other libraries dont include my files
nwp
nwp
You typed <Vector> and then <vector>. Was it misspelling after all?
20:54
crap sorry, leme fix that
cant sigh, they all are typed Vector3d
so no misspelling I can ctrl click on it and it takes me to the definition
@nwp My question isn't strictly C++ related. It's more about my algorithm. Would it be appropriate to link it here? The question has been up for a few days.
nwp
nwp
You can put it here. Maybe you get lucky.
@QuaxtonHale Assuming this question. I think your question would have had a much better reception if you posted the code that you appear to have written that does the algorithm. It's also that the tags you used aren't as well followed, so you only had ~35 views
nwp
nwp
21:12
It's not entirely your fault though. The question is just not fun, and people are answering for fun.
> Sort nodes based on its number of neighbors in ascending order.
That doesn't seem to be what the algorithm is talking about.
@Justin Okay, I'll edit the question with code snippets.
@nwp My thinking was that the nodes with the most neighbors will be at the end of the list. That way there will be less neighbors after it.
I meant, that way each node will have the least amount of its neighbors after it.
nwp
nwp
What is your comparison function for the sort?
nwp
nwp
21:27
paste the code, then press CTRL+K
Which is super intuitive, right?
        [](std::pair<int, int> a ,std::pair<int, int> b)
        {
                return a.second != b.second?  a.second < b.second : a.first < b.first;
        };
why CTRL+K ?
@Dariusz Does the indentation for you so you don't have to manually add 4 spaces before each line
I know, I just wonder why the shortcut is ctrl+K
Kode
nwp
nwp
21:31
@QuaxtonHale How did you encode graph nodes in a pair of ints? Shouldn't it be something like a list of nodes?
I used stl map, with the node i as the key, and the number of neighbors as the value for each entry.
I then put each entry into a set using the comparator to sort it. I'm not really familiar with C++, so this probably isn't the best way to do this. I'm more concerned about the algorithm and whether it's 'correct'.
In the context of the problem
nwp
nwp
21:48
Your algorithm considers this arrangement sorted and returns 2+1 because node 3 has 2 neighbors in front of it.
But if you would move node 3 back behind 4 it would drop to 1 neighbor only and a score of 2.
I assume a left to right ordering and the lines being neighbors.
@QuaxtonHale Does that make sense?
@nwp I see, that makes sense. Darn..
Thanks for your help!
Ron
Ron
22:27
Is it wrong to refer to address of x as reference to x? As in trivially simple T* p = &x;
The wording used is a bit confusing to me.
nwp
nwp
There is the C++ reference as defined in the standard and the software concept reference where one object references another. It's wrong for the first and right for the second definition.
Ron
Ron
I see. Appreciate it.
nwp
nwp
You can word it slightly differently and say "p references x" which is pretty unambiguous.
Ron
Ron
Ok, thanks.
 
1 hour later…
23:44
This is legendary question but what is equivelant in c++ of qDebug()?
nwp
nwp
std::clog exists. Otherwise std::cout should do.
cout dont print in release mode?
nwp
nwp
What? Why not?
well I don't want to print in release mode
only in debug mode
like qDebug()
nwp
nwp
#ifdef NDEBUG
auto logger = std::stringstream{};
#else
auto &logger = std::cout;
#endif
23:53
@Dariusz you won't have a built-in class for that because C++ has no notion of "release mode" and "debug mode". It's a convention of the IDE projects and build engines
I see, thanks!
^^^ by nwp is a good approximation
@Dariusz Boost logging will let you control the level of logging, so a debug build will produce debug messages, and a release build will only produce messages about serious errors (but you'll have to specify that in compiler flags when you build). I haven't done a comprehensive survey, but I believe most of the other logging libraries I've looked at have similar capabilities.
mmm fascinating, thanks!
nwp
nwp
If you care about release runtime performance you should replace std::stringstream with something that overloads a templated operator << that does nothing.

« first day (576 days earlier)      last day (2501 days later) »