Reputation
5,206
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
11 24
Newest
 Custodian
Impact
~176k people reached

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
17
comment Feeling like all my code is very poor quality and slowly built
I'd say this underestimates the time to "achieve the same" by at least a full order of magnitude, at least unless you're just re-typing from memory. Consider this elderly classic - it took the author two subsequent revisions to get right, but the final code could easily be described in a 10 minute tutorial.
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
10
comment Using the readahead syscall in C in the linux environment
readahead is for pre-fetching - it doesn't seem to help here at all. Why are you certain you want to use it?
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?
Jul
24
awarded  Custodian
Jul
24
reviewed Approve Maintaining separation of concerns
Jul
24
comment Can I listen on a port without interrupting traffic?
The alternative is to code a forwarding proxy, which is essentially a man-in-the-middle, but that hardly counts as not interfering.
Jul
24
comment Can I listen on a port without interrupting traffic?
It's possible, but not by using regular sockets. You need a packet capture tool for your platform (you haven't said what it is, but look at wireshark).