Skip to main content
Caleth's user avatar
Caleth's user avatar
Caleth's user avatar
Caleth
  • Member for 12 years
  • Last seen this week
comment
comment
How to deal with public vs private version of same resource in a RESTFul API?
I'm just very suspicious of "we check access at the door so don't inside" as a security strategy. I'm also not convinced I understand "cross cutting concern" the way you do, because to me security as a cross cutting concern is a strike against your advice.
comment
How to deal with public vs private version of same resource in a RESTFul API?
@Steve the admin page that wants to display active items can call the endpoint with a query parameter (or whatever)
comment
How to deal with public vs private version of same resource in a RESTFul API?
User identity is very often part of business logic. A customer should only be able to edit their own orders, not anyone elses. A user should see items in their "recommended" feed tailored to them, etc.
comment
How to deal with public vs private version of same resource in a RESTFul API?
404 is not a lie. The server looked in the places the customer is permitted, and did not find the item there
comment
Why Garbage Collection if smart pointers are there
@ToddLehman even more accurately, they are released if the program needs to re-use that memory. For many programs the null garbage collector is valid
comment
Is code written inline faster than using function calls?
@JörgWMittag I thought it was a specific decision not to do any code transformations in Cython, specifically so that stack traces in exceptions were dead simple to match to code, i.e. they are optimising for debuggability, not speed
comment
What are and how do (data-) types work?
@BartvanIngenSchenau there's also complex float etc, which has the same representation as float[2] but permits all the usual arithmetic.
comment
What are and how do (data-) types work?
@Jules I doubt Cython reinterprets data with any type other than void *, which is approximately "pointer to unknown data", and it will store an identifier with what it was alongside that pointer.
comment
What is the C++ equivalent of a logging facade in Java?
A logger interface should have one member, so in C++ it could also be exposed as std::function<void(LogMessage)>
comment
confusion regarding handling of new smart pointers on stack frames?
all the special members of std::unique_ptr have simple implementations. Approximately this
awarded
comment
How does 'everything is a file' not contradict 'do one thing and do it well'?
@sakisk if you were modelling it in Java, you'd have interface File, and there would be a whole lot of extends File. I'd call that "everything is a file"
revised
When to use std::vector reserve
added 10 characters in body
Loading…
comment
When to use std::vector reserve
Oh, I've looked at the code that provided the graph, and it might be that it is mostly timing the prng :(
comment
When to use std::vector reserve
@freakish probably not, by the measurement candied_orange found. remember the as-if rule
comment
When to use std::vector reserve
@candied_orange it isn't, partly because that doesn't that doesn't generalize to all types
comment
When to use std::vector reserve
And it looks like transform is (within the margin of error) the same as reserve: godbolt.org/z/PE3vTYcKG
comment
When to use std::vector reserve
@freakish and by quicksort, you mean the languages standard sort. std::sort in most implementations is a hybrid of quick and insertion sort, that's been measured to be better across a large range of situations.
comment
When to use std::vector reserve
@Tagor The (iterator, iterator) constructor exists in C++11. It has the same performance requirements as this. You don't get a transform in std, but it does exist in boost
1
2 3 4 5
108