« first day (1737 days earlier)      last day (1116 days later) » 

jrh
1:30 PM
@nwp It seems like Effective Modern C++ isn't a superset of everything in Effective C++ though
I'm skimming through books and trying to figure out a better way for a colleague to get up to speed than "read this pile of books and lots of online stuff"
but I'm pretty sure there's no one book that can do it, not that their should necessarily be, C++ is pretty sophisticated
there*, oops. Wish there wasn't a time limit on editing
 
2:33 PM
@jrh Become a moderator, you'll get (limited) super powers :P
 
jrh
@Vaillancourt I wish comments didn't have an edit limit either, quite often I had to delete and re-add a comment because I found some error or something
 
Yeah, for typos and such, I agree it's an annoyance, although I understand very well why they added that such a limit.
 
3:10 PM
hey @sehe
I just saw that you actually did respond to a post I made
 
@CrashMan123 You're fast. And yes I already saw your questions. Did you see my edit? It's kinda hidden because I made is a <!-- --> comment
 
Yes I did see it! It was just using the inverseName map instead of name correct?
Should I @ you everytime I respond? @sehe
 
@CrashMan123 Hmmm nah. It ended up being a complete rewrite. But you had undefined behaviour as I pointed out. If you undelete I can post the explanation as a proper answer
 
okay, I will
 
@CrashMan123 Only when it's been a while - so I don't get "plinked" to death. I often use the reply-to arrows that disambiguate what a response is to (and that "plinks" as well)
I'm actually just writing an answer to the newer question based on the code. I noticed that you added some deduplication logic. I will suggest another simplification that makes that take a change of 2 letters :)
 
3:15 PM
awesome! that would be very much appreciated
Should I edit the code I have on there and update you with the most current version
 
@CrashMan123 Nah. Just leave the question as it was. My edit won't show because it's a comment and I'll just cleanup the answer a bit.
 
I did end up being able to read in a graph now, and I can access the "name" using two maps that have eachothers value as their key. I feel like this is a very unefficient way to link these values, but at the same time the most efficient way to store them and have them be searchable
 
I get the feeling you didn't actually see my code yet :)
 
Oh, i found it, I went to your edit and then clicked on the coliru link
 
Prezoisely
 
3:21 PM
thats what I'm supposed to be looking at right
nice
 
It's... a bit shorter :)
 
haha yeah
bidirectional graph is the same as undirected correct?
 
I'm actually struggling a bit with the details on the edge centrality, so don't worry about having troubles here :)
@CrashMan123 It is similar, but has a richter interface, in that it keeps redundant collections of adjacencies so certain operations can be faster. Basically it keeps adjacencies in both directiones for each vertex
So, if you don't need that rich interface, undirectedS is strictly cheaper.
 
did it say in your bio that people can watch you fix code on livestream, or am I imagining that?
also what do you mean interface? (I'm very unfamiliar with bgl)
 
I did do that for a while, but the site dumped the free accounts and my content as well :(
 
3:24 PM
ahh, could you not stream it on twitch.tv?
 
So these extra functions are supported in bidirectional mode.
@CrashMan123 I could, but I've sort of grown past it :( And with Covid19 the home situation is a bit too crowded anyways
 
yeah i understand that for sure
 
It was nice while it lasted. Maybe I;ll pick it up again one day. I do know that twitch has become more "broad" in their content spectrum
Betweennes centrality example compiles now. Let's see if it makes any sense
Mmm. Not too sure. All centralities are 1 (but i used your "reduced input" which is obviously not very exciting graph)
@CrashMan123 I'll post the code with explanation anyways. Then I'll see whther the older question was undeleted and do the same there
 
haha I have some files I could send your way with a bit larger datasets
 
That's not actually a bad idea.
 
3:29 PM
or I could just paste the data into here and you can copy it and paste it into a file
 
That would be a bit spammy. Pastebin of some kind is nicer I guess (paste.ubuntu.com/?)
 
On your fix for the question I deleted, does the transmission delay line for the weights just make a row of ones for every edge?
 
Yes. The key point was that you need an iterator that is valid for the number of edges. These constructors are a bit "unsafe" in the sense that they use raw iterators and hence they aren't checked.
BGL is showing some age there.
Actually just copy-pasting this bit in the answer :)
And posted, now the betweenness...
 
how can I see the most recent post
@sehe
nevermind I found it
Wow, this is beautiful. I'm currently testing the code. My code would segfault if I used more than 260 vertices in the input file. I just ran it with 100000 vertices and it worked like a charm :)
 
3:51 PM
:) That's the power of avoiding UB
 
when reading in the graph, why is numEdges unsigned?
also, what would be the implications for using push_back instead of emplace_back on the edge_array for this code. I looked it up and somewhat understand it, but it wouldnt make a different in this situation right?
 
4:09 PM
@CrashMan123 because then your loop didn't have a mixed-sign comparison. If you enable compiler warnings, the compiler will warn you of problems like these. They are bug sources.
@CrashMan123 No functional difference, just less expensive. (Also, shorter)
0
A: How to calculate edge betweenness with BGL

seheOkay, I just posted the simplified graph reading code. In your current question I see the new edge_arrayNoDuplicates variable name, which suggests that you went to some extents to remove duplicate edges. As a pro-tip let me suggest that you can have the same effect without any manual work by choo...

And there's the centrality answer. I threw in the top-N query
 
4:24 PM
thank you! are you still going to be around here just incase I have any questions about the code?
@sehe, I specifically don't get what is going on here
auto s = mappings.insert(Mappings::value_type(src, mappings.size()))
.first->get_right();
 
4:48 PM
I understand that its inserting the src vertex as a string, and the mappings.size() just gives each vertex a unique value, but what is Mappings::value_type doing. Also what is .first->get_right();
 
5:18 PM
also is there an efficient way to get rid of the duplicates in the vector<Edge> edge_array?
 
5:54 PM
@sehe
Also I don't understand the notation of the for loop you used at line 72 in main
what is [edge,centrality]
 
 
2 hours later…
7:47 PM
@CrashMan123 Some of the time :) Had to make dinner and family time for a bit
In C++ a `map<K,V>` is conceptually a container of `pair<K, V>`.
Sequence containers have a nested typedef `value_type` So in the case of associative coontainers `value_type` is a shorthand for `pair<K [const], V>` (or a similar implementation type)
 
@PeterT So in the end the debugger in qt creator hanged up and still does. Mac OS seems to be a really hostile OS for development, at least if you don't to it the Apple way and/or pay them for it.
I mean, I'm aware that lldb is a startup project, but not to such an extent..
 
shouldn't src be going into the .first and mappings.size() be going into .second?
 
You could probably write Mappings::value_type as std::pair(in C++17) or std::pair<std::string, int> BUT you might incur some unexpected conversion overhead when the implementation type is subtly different
 
/rant..
 
@CrashMan123 It is.
 
7:55 PM
what does the .first->get_right() mean, that is the part that is confusing me. I would interpret this as the std::pair(src, mappings.size()) are both being stored in .first
 
Now, .first->second is a bit too much for the single line of code, now that you asked. So let's consider this your code review, and we're going to fix the code to be less dense:
 
also you can ignore all my previous questions besides this one, I figured them out
 
auto map_name = [&mappings](std::string name) {
    auto [iterator, inserted] = mappings.insert(
        Mappings::value_type(std::move(name), mappings.size()));
    return iterator->get_right();
};
int s = map_name(src);
int t = map_name(tgt);
 
however, I am currently trying to implement a way of having an edge_array with no duplicates
 
@CrashMan123 Erm. So you didn't figure it out yet.
 
7:59 PM
haha yes
I was thinking about just adding all the elements to a set, and then putting them back into a vector
 
@CrashMan123 This was the corresponding hint: link
> That's two letters changed, and done. Actually, for performance you may still want to keep vecS, but you should probably see what your profiler tells you. If it's fast enough, I wouldn't bother.
4 mins ago, by sehe
auto map_name = [&mappings](std::string name) {
    auto [iterator, inserted] = mappings.insert(
        Mappings::value_type(std::move(name), mappings.size()));
    return iterator->get_right();
};
int s = map_name(src);
int t = map_name(tgt);
@CrashMan123 About that: the relevant standard documentation shows a return type std::pair<iterator, bool>. Since that's a std::pair like` value_type` it is likely the cause of confusion
@CrashMan123 Those are structured bindings. They're a fancy way saying all of:
        Graph_type::edge_descriptor edge = entry.first;
        double centrality                = entry.second;
They're a c++17 feature so not everybody is used to them yet.
 
i see
I changed vecS to setS but I'm confused how that has an effect on edge_array
 
By the way, I commend you for looking at these and asking all the questions you have. That's the best way to learn. Too many people might just go "Oh nice this works" but will realize they didn't fully understand the code wwhen they need to write the next thin. Very good
 
because didn't we make edge_array a vector<Edge>
thank you!
 
@CrashMan123 It doesn't. The point is, it doesn't need to have. Hang on, writing a demo:
 
8:39 PM
Sorry, got a phone call
Here's the demo I wanted to make coliru.stacked-crooked.com/a/0b59adf23e6f9ce4
 
all good
 
The point is that setS makes the internal datastructure a set. So, you don't have to. You can just add duplicate edges, and because of how the internal set works, they won't actually be added as a duplicate
 
ohhh i see
that makes sense, i'm going to play around with that code a little bit
 
Here's a much simpler test of a related concept just to check your assumptions:
http://coliru.stacked-crooked.com/a/acb0b6095237930b
@CrashMan123 :thumbsup:
 
I'm still confused on what exactly this does get_right();
in reference to previous code you posted
I tried looking it up and didn't find anything
 
8:53 PM
@CrashMan123 It's Bimap specific. Basically, Bimap cobbles together 'two maps" (using Boost MultiIndex IIRC) without using twice the storage. (see eg here boost.org/doc/libs/1_75_0/libs/bimap/doc/html/boost_bimap/…)
I must admit I can't readily find that access method using the relation iterator myself. The library has too many ways of using it :/ A boost library disease :)
But you can of course write it using two maps. I just don't like doing the extra work.
 
i see
i'm still trying to understand the syntax of this bit of code auto s = myMap.insert(Bimap::value_type(vertex, myMap.size()))
.first->get_right();
I would think this would be another option of writing it, but this won't compile
auto s = myMap.insert(pair<string, int>::value_type(vertex, myMap.size()))
.first->get_right();
 
9:12 PM
@CrashMan123 Just std::pair<std::string. int>. Pairs are NOT containers, and they don't need a value_type :)
 
ah I see I got it working, I also had to change it to bimap<std::string. int>::value_type because of my typedef
Now that I understand that portion, can you explain what .first->get_right(); is doing and why its necessary.
I feel like I'm close to understanding but not quite there.
It could be split into two lines of code correct?
myMap.insert(bimap::value_type(vertex, myMap.size()));
auto s = myMap.something.first->get_right;
 
9:36 PM
@CrashMan123 I gave my best explanation here: chat.stackoverflow.com/transcript/message/51984288#51984288
@CrashMan123 It's badly documented, but it makes sense as a Bimap extension of the standard map::insert interface.
 
hmm, i'm still confused on what exactly it is doing
 
It is not actually required, of course:
auto map_name = [&mappings](std::string name) {
    auto [iterator, inserted] = mappings.insert(
        Mappings::value_type(std::move(name), mappings.size()));
    return mappings.left.at(name);
};
int s = map_name(src);
int t = map_name(tgt);
Does exactly the same thing, but much less efficient.
return iterator->get_rght() uses the iterator just returned by insert. The alternative return mappings.left.at(name); does exactly the same but looking it up again.
@CrashMan123 May I suggest removing the complexity by removing the bimap space optimization?
 
you mean using something other than a bimap?
 
Yup. It's strictly easier. Just less optimal :)
 
Is someone interested in a small job? I have an asio auth server for my game, and i'm having some bugs.. Tried all methods to search for a developer to fix.. upwork etc.. all places :(
I give x2 price
 
9:42 PM
@IrinelIovan link?
 
sehe is a genius^ thats all i have to say
 
:bows:
 
@sehe what link u mean ? xd
upwork job or
 
I was hoping there's a link to the project.
I don't know what upwork is. But I do reviews on this site, so why not.
 
what would I use instead of a bimap, bimap seems to be working great for me so far. It got rid of my duplicates and I can search it by key or value
 
9:44 PM
Tell me your email i send a job invite.. also if u have skype/discord i can pay u in advance
In 5 days i open my game,,so yeah im in big hurry
 
@IrinelIovan You can use holy.frobnicator@gmail.com
@IrinelIovan Ah now I get it
@IrinelIovan I prefer to give it a small feasibility scan first. That way I don't waste your time
 
Of course, it's something very very simple.
It's simple auth nothing complicated
we can talk skype/discord and i send u whole src files
 
there goes my helper :/
 
@CrashMan123 nah I'm still here. Here's with Bimap removed: coliru.stacked-crooked.com/a/187597fc2cfc1d81
Maybe that clarifies it, coincidentally.
Now, it's literally using the standard interface which is similar, just better documented
 
How we can talk ? @sehe (
 
9:50 PM
what is move(name) doing?
 
@IrinelIovan I didn't see your email yet :)
 
Well, allright.. i send you source files on email.
And i explain here bug
it's k?
 
@IrinelIovan Yup. I'll try to give a quick assessment then
@CrashMan123 Uhoh. Another optimization :) Just ignore the std::move (and please consider the habit of keeping std::. (stackoverflow.com/questions/1452721/…)
 
Done, i sent
 
I will consider... in a future project :)
just so I can play around with the previous version a little longer, what would it look like if you combined the .left.at(name) with the original way, can you simply replace .get_right() with .left.at(name)?
 
9:56 PM
@sehe
here explain of bug
 
@CrashMan123 I'm not sure what you're asking for; I have both versions live on coliru :)
 
When i fist start auth process everything works fine
after few logins users start to get this error https://prnt.sc/10qephl
https://image.prntscr.com/image/5HF8g-MbQ8iZHILPWl8L4w.png
BESAMEKEY
the server part is made from 2 cores
db/game/and now auth
auth need be connected with db core
m_dbClient it's the connection with db
it drops after 1s connection with db
There are 3 types of packets
game->db db->game
client->game game->client
and now since auth
db->auth auth->db (edited)
client->auth auth->client
 
@IrinelIovan kk give me a minute looking for some expression parser referneces for someone else in the mean time
 
allright
 
10:15 PM
@IrinelIovan mmm do you think there's a chance that this is just the tip of the ice berg? I'm wondering if stress testing hasn't been done it might uncover many other issues.
 
well, ignore thte test issue
It happens instant now
On my test server where i login and my partner
it works perfect
when i add on live, after first connection it breaks connection with db
 
okay. Where is everything hosted "on live"?
 
It's on a FreeBSD 12.2 AMD64
If u want try fix, check.. do debugs.. U can add debug logs like printf etc
i can provide u test vps data
etc
 
I'm ogling the zip now
Okay I have link of auth executable now. Not the worst. Some missing deps / CMake stuff, but I got around it
 
the link problem should be just libmysqlclient
 
10:23 PM
It's done already
It was asio,spdlog,tinyxml2. And the fact that on linux gcc/g++ are not called gcc7/g++7. All fixed.
 
agh
ouk
Here config.xml
to run auth u need ./auth -k auth
 
Hello folks, do you know what is the CMake code to copy resources directory to build directory in the following figure?
 
@IrinelIovan That file was in the zip
 
@MoneySetsYouFree make install
install(TARGETS db DESTINATION /root/serv/share)
 
10:26 PM
set this in CMakeLists.txt and write make install
@sehe Allright allright, it won't work anyway ./ It need connection with db core to accept connections.. It will run but just that
to see live and debug u need mt test vps
there i have runtime files
 
cmake_minimum_required(VERSION 3.0.0)
project(cpp-opencv-project VERSION 0.1.0)

find_package(OpenCV REQUIRED)

include_directories(${OpenCV_INCLUDE_DIRS})

add_executable(${PROJECT_NAME} codes/main.cpp)

target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
 
@IrinelIovan I'll just look around the code for a bit.
 
SOrry, i am new to CMake, what is the code?
 
42 mins ago, by sehe
@IrinelIovan I prefer to give it a small feasibility scan first. That way I don't waste your time
 
If you can't handle, please recommend me someone.. Richard hodges had this tasks.. But he really have noooo time.
 
10:29 PM
That's why,so lemme look before I commit
 
okey
 
@IrinelIovan I see that client version is 25. Is this a a new version of a "stable" game already? In that case, was the bug introduced in the last version?
 
aggahag
 
I must say, I'm liking the code I'm seeing. That's a good sign.
 
Auth never worked.
 
10:33 PM
Ok
Too bad :)
 
Our old developer
left it unfinised
He got a kid and so, and he quit without finish..
he did it very simple.. and effective.. auth is pretty fast
 
Yeah. It happens. No need to backstory too much :)
@IrinelIovan Those are good signs too
 
old auth login took 2-3 seconds.
this auth 0.5 seconds
also it's instant all
it was a hell last game opening, there where 5k players in login screen.. old auth overflow queue.. and user could not login
))
somtimes took 10-15 min to login and so.. but this is instant.
 
That's a lot of players for untested auth
Or maybe it's just the scalability then. Are there any [integration] tests I can maybe run?
 
yes, there's a small test suite
sec
 
10:38 PM
sehe, can you @ me when you are done, I don't want to interrupt but I have a question about using edge iterators
 
@CrashMan123 shoot, I'll answer when I can
@IrinelIovan that's great news. If needed, a test database script would be nice
 
So I'm wanting to fill a matrix full of the edge connections in a certain graph. I know that a graph is technically just an edge matrix, so theoretically could I just create a copy of the graph and I would have the matrix of all the connections?
Oh wait, I'm just realizing its an adjacency list not a matrix.
 
moment
 
Okay so I'm just trying to populate an adjacency matrix with the edges, so each value is a vertex and 1s will represent a connection
 
@CrashMan123 I was going to say. Logically these data structures can represent the same things, just with different interface and complexities
 
10:45 PM
right
I'm going to be subtracting two matrices, so I need the zeros to be there, that means a list won't work right?
 
It can, but you'd have the matrix datastructure on the side, effectively. Here'w tih matrix, though: http://coliru.stacked-crooked.com/a/d5028c9d26004f7c
The centrality values are different, I didn't llook into why
 
interesting
have you ever used boost graph library to identify disjoint sets?
 
@sehe i send on mail ?
 
@IrinelIovan works for me
@CrashMan123 I think I might have - not personally, but on Stack Overflow
@IrinelIovan slight preps here for now:
 
@sehe Done, i sent
test
 
10:55 PM
Listening on port 272360 anyways
 
connected to db cache? the fuck
should not connect
xddddd
 
@IrinelIovan Is it me or did you also send one empty reply first? Just checking I didn't miss something
@IrinelIovan Oh, it's probably wrongly connected to something I run on that port :)
 
yes it might be
 
It is :) It's a docker proxy. No idea what is actually there :)
lol
Accidental fuzz test in 1... 2.. 3...
 
In order to avoid messing up the centralities, I'm going to populate my matrix using an edge iterator.
 
11:00 PM
@CrashMan123 Curious whether that makes a difference.
 
I think i might make a matrix using 2d array
that way I can leave my graph as a list
 
Very possible. Just multi_array<bool> perhaps
 
U want try in my test vps?
 
is there a way to get the num_vertex of a graph
i know num_edges(g) is for edges, but it doesnt seem to be working for vertex
 
@IrinelIovan Maybe later
@CrashMan123 num_vertices
@IrinelIovan the test server cannot really have worked, or (likely) GServer has been made enable_shared_from_this recently (more recently than the tester has been used).
 
11:14 PM
@IrinelIovan
 
Thanks
 
np
documentation says edges(g) Returns an iterator-range providing access to all the edges in the graph g.
Return type: std::pair<edge_iterator, edge_iterator>
does this mean it returns an iterator to the front and the back?
 
Yes
I personally use boost::make_iterator_range to make working with those pairs nice (see e.g. stackoverflow.com/a/67078533/85371)
@IrinelIovan okay, tests work, but look a bit trivial:
Connected to 127.0.0.1
Client connected! (127.0.0.1)
localhost> Hello!
127.0.0.1> Hello!
localhost> Yo!
127.0.0.1> Yo!
localhost> Sup?
127.0.0.1> Sup?
Client disconnected! (127.0.0.1)
Disconnected from 127.0.0.1
Doens't look like it's actually exercising auth?
 
Nope
like i said
is just a test
u cant fix on ltest
u need live debug
 
Okay missed that. I assumed it was relevant :)
I'm not convinced. The way I read the situation is that there's a heisenbug only repro in scalability context. From experience I wouldn't be surprised if the best shot at catching it wouldbe to grok how all parts fit together and predict the bottleneck.
Otherwise, wouldn't we run into a shit ton of inscrutable logs that change every run?
Other question. There are four possible sources of the BESAMEKEY condition. Are you positive it's (always) the one you screenshotted?
 
11:24 PM
yes it's always the one i screenshit]
basically the connection with db cache it closes
socket.is_open return false
 
@IrinelIovan can you rephrase this?
 
It's always same error, which i screenshoot.
 
I got that part :)
 
It's realated to socket.is_open()
Basically the connection with db core
 
So, the problem is the connection to the db core, which I don't have. Are we sure the problem is on this end (and not e.g. the db core closing the connetion)?
 
11:27 PM
yes im pretty sure
Or well, i dont know
xd
 
Mm.
Honesty. Could be worse :)
I'm just thinking along
 
Also to run db core u need runtime files. which they pretty big
 
Yeah, let's not fall into rabbit holes.
I'm still ogling the auth core code. I think I will generate enough questions from there
 
Maybe some buffers overflow issue
,m_input(MaxInputSize)
,m_inputOffset(0)
,m_output(MaxOutputSize)
,m_outputOffset(0)
 
That's a pretty wild thing. Usually it wouldn't cleanly report errors. It's possible though
 
11:30 PM
For that i guess u need add debug logs..
 
I'm more at home grokking code. But then when I get hypothesis, I'd typically test with tracing (and since there's no actual db core run that on the test vps)
IOW, for me it's too early to start adding uninformed tracing. You can always go brute force if all else failed
 
:)
u my last hope
 
I was prepared for a mess of code. It actually does look nice. That's the only reason I'm still reading :)
 
and it's pretty simple
isnt hard to read
 
what type of game is it
 
11:41 PM
it's mmorpg
 
Header discipline isn't optimal though.
 

« first day (1737 days earlier)      last day (1116 days later) »