« first day (342 days earlier)      last day (2517 days later) » 

1:13 AM
Why not learn C++
 
1:49 AM
@SalOrozco What exactly is the question?
 
 
1 hour later…
2:50 AM
@SalOrozco The main reason to use C++ is that there are quite a few things for which there's nearly no reasonable alternative. The primary to use C++ is because you're going to work on some of those things (or at least want to). From there, the main reason to not bother with learning seems pretty obvious: because your needs/wants are far enough away from what C++ is best at that you figure you can do the job well enough and more easily using some other language.
 
i'm writing qt only in one isolated place in my code, so everything is ok (the only problem with it possibly is that qsql connection can be used only by thread, that created it, but this fact does not affect my initial plan).
but i have another question.
my application will create two threads per client socket. one thread is waiting for client requests, second should send responses / events / etc. is it a good idea to split clients into groups ( ~ 200 per thread ) and poll() them.?
 
3:16 AM
This is another case where using something other than C++ (node.js) will get you off the ground a lot faster
Sorry, this isn't my field and I don't know the answer to your question :-)
 
3:35 AM
@Mikhail @JerryCoffin coming from PHP. Just trying to explore what's out there. What is C++ good for?
 
@SalOrozco Image processing
mechanical automation
 
I'm sure there are frameworks to make all that easier?
 
they suck
Also guess what language the framework was written in?
 
C++
let me get this straight
C is a procedural code
and php was written in C
 
3:51 AM
@GreenTree This sounds like a pretty terrible idea. Even one thread per connection is way too many as a rule. Use something like Boost ASIO that decouples the number of connections from the number of threads, handling quite a large number of connections per thread. Likewise, it'll hide the poll (well, epoll, if I'm not mistaken) so you pretty much just deal with the clients, connections, and data.
 
4:01 AM
the problem that i should not use any third party libraries for threading, sockets, etc, only self written (it's a task), moreover all components has to be crossplatformic (+ winapi ). yes, i'm going to use epoll for linux, but it's not posix.
for 2000 connections case, is there any performance difference writing back in single thread ( 2000 loop iterations with write( each_socket ) ) versus splitting and writing back in parallel.?
@JerryCoffin cloud you recommend something to read on that.?
 
@GreenTree Writing in parallel is fine--but limit the number of threads to something related to the number of cores you have available (that might not be exactly the same as the number of cores--it might be 2x or 4x, but not 500x or 1000x). Adding thousands of threads is not going to make it go any faster.
@GreenTree How to do network I/O well? Umm...there's a lot around on the 'net, but offhand I don't know of a single place that covers it very well--most of what I know, I've gleaned from looking through source to CROW, ASIO, Pistache, libuv/libev/libevent, and writing some code of my own to implement some stuff I needed.
 
5:15 AM
well, yes, viewing sources and writing is the most reliable way to get some view on
production implementations of such mechanisms.)
thank you.
 
 
5 hours later…
10:21 AM
Hi guys
I have this code cpp.sh/3tibv
still a work in progress
I was wondering, given that my list has a fake sentinel node, that I've called "nil"
how can I easily implement the "append" operation
namely
given two lists concatenate such lists
I'm not sure about the implementation given that some corner case with the sentinel comes out
 
nwp
10:41 AM
@user8469759 Think about what the rules should be and test them on a piece of paper.
There are not that many corner cases, just one or both of the lists being empty.
 
10:57 AM
what about if my inputs are instead a node x belonging to the first list and a node y belonging to the second list
and I'd like to join the lists at x,y
?
 
nwp
11:35 AM
@user8469759 A user should never have access to nodes, so that should never happen.
 
ah
are you sure?
aren't iterators used for that purpose as well?
 
nwp
You can just state that the iterators must be for that list. If people violate that rule it is undefined behavior and you don't care what happens. At least that's what std::list seems to do.
 
12:15 PM
ok, but again in that case how can it be implemented?
 
nwp
@user8469759 The case of giving an incorrect iterator is undefined behavior. That means any behavior of the implementation is correct and it is literally impossible to implement it wrong.
In practice you just implement it right for the case where you get a correct iterator and the rest doesn't matter.
 
hmmm ok
up to the user then whether or not he's screwing things up
 
nwp
Sometimes you can be nice and do a check, but in this case the overhead of checking every iterator by comparing it to every element in the list every time is just so ridiculously high that your users probably will not appreciate it.
 
 
8 hours later…
8:27 PM
@faceless that's why people start out with simpler algorithms, like block-chain from scratch
 
buahahahahhahahaha
 
 
2 hours later…
10:00 PM
Hey, can anyone help? Stumpled across this code:

class DebugReportCallbackEXT
{
public:
operator VkDebugReportCallbackEXT() const
{
return m_debugReportCallbackEXT;
}
private:
VkDebugReportCallbackEXT m_debugReportCallbackEXT;
};
How would I invoke the "operator VkDebugReportCallbackEXT() const" or what is it? I thought one cannot define new operators in c++
 
thanks man...I've been going crazy over this for like the last hour
 

« first day (342 days earlier)      last day (2517 days later) »