Reputation
5,467
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
12 24
Newest
 Yearling
Impact
~220k people reached

Feb
3
comment Why is chaining setters unconventional?
@MatthieuM. really? Sounds similar to CRTP for C++ ...
Jan
28
answered TCP - Three Way Handshake, which Port?
Nov
3
awarded  Yearling
Oct
27
answered Am I overusing Inheritance or this is exactly what it is here for?
Oct
25
comment Proper way to interpret this dereference operation?
That's interesting: the author of the question commented more than two months ago, and immediately above your comment, that this answer covered "...exactly the issue I was having." They also accepted the answer. Are you suggested the author misunderstood his own question, or have I missed your point?
Oct
6
comment Data structure to use for time-optimized line-vs-grid check?
A regular orthogonal grid like x % 5 == 0, y % 5 == 0, or an arbitrary grid you have to store somewhere? A straight line segment, or a complete (infinite) straight line, or a curved line or segment?
Aug
26
answered What is a URI Scheme?
Aug
24
comment Const means Thread-safe?
@DanAllen that slide is 16 minutes in, and presented with a lot of context. It's a mnemonic to help remember the presentation, not a headline! If you're going to say "this slide would be misleading out of context and therefore shouldn't be included at all", that precludes the use of any slides, and indeed any non-trivial presentation.
Aug
19
comment Is it okay to return the “wrong” HTTP status code in order to show a more user-friendly error page?
@ChrisCirefice - There's a significant difference between a failed AJAX request (the user performs an action, expects some response), and a failed navigation between pages. I've been assuming this case is more like the latter, but if your "pages" are (trying to be) more like JS-heavy web apps, the answer could change. I don't have a good model for distinguishing between the two, but I can feel the difference between say, navigating between pages on SO (where a 404 might be reasonable), and performing an interactive request (like flagging) where a flash message would be natural.
Aug
19
answered Is it okay to return the “wrong” HTTP status code in order to show a more user-friendly error page?
Aug
12
comment Possible alternatives to copy constructors
I see. Well, since I can't comment on code I can't see, I still don't have any reason to prefer the wrapper over unique_ptr (and typedef is probably sufficient for documentation purposes). My general approach is that writing a custom wrapper is bad practice unless it does something, and I don't know what, if anything, yours does.
Aug
12
comment Possible alternatives to copy constructors
If you think shared_ptr is hard to use and hinders readability ... I strongly suggest you just get more familiar with shared_ptr and use it anyway, tbh. Unless you mean there's a bit more to your wrapper? Either way, I'd recommend shared_ptr as the default, and write your own wrapper only if you have some strong reason.
Aug
12
comment Possible alternatives to copy constructors
Do you need copies of the shader program? These things may be obvious to you, but they aren't to us, and you didn't really discuss your lifetime or sharing requirements in any detail.
Aug
12
answered Possible alternatives to copy constructors
Aug
6
comment Proper way to interpret this dereference operation?
Precedence doesn't tell you everything about the language, it's just for disambiguation and tie-breaking. It's well documented because it can be confusing, and because it's a fairly small table; the grammar by comparison is enormous, hard to read, and usually behaves the way you'd expect anyway.
Aug
6
answered Proper way to interpret this dereference operation?
Aug
6
comment How to share data members between classes in C++ without violating encapsulation too much
The "right design solution" is going to depend very sensitively on the exact details. I appreciate you've generalized the question, but immediately have a list of questions that can't be answered from this simplified example: what are a1,a2? How do they relate to a3? Why are in they in A, and should they be?
Aug
3
comment API to get data, caller may not know how much? How to allocate buffer size
This is C, so the callback you suggested has to be a free function rather than a method. This also means you need to package up any local state needed in the callback into a struct, and (usually) pass it through as a void pointer. For synchronous processing it feels over-complicated (for async code it's worth the complexity, and in C++11 the barrier to use is much lower, since you can just pass a lambda).
Jul
24
answered Memory page - virtual or physical and relation to data types allocation?
Jul
24
answered What does using pointer in Linux kernel imply?