48 karma · joined Jan 10, 2015 (11y ago) · 32 submissions
comment 3y ago · link · parent
[1]: https://github.com/eliben/static-server/blob/main/internal/s...
comment 9y ago · link · parent
comment 9y ago · link · parent
http://flask.pocoo.org/docs/0.12/patterns/caching/
I'm not sure how this works with multiple threads though, I imagine you would have to synchronize it yourself.
comment 9y ago · link · parent
All jokes aside I agree with you to some extent: C++ can be frustrating to work with, and there are a lot of quirks that make it really easy to blow your foot off.
These quirks are not without benefit though. Being able to control how memory is allocated is hugely important in performance sensitive applications where pointer chasing is not tolerable. The same can be said about r values/move semantics.
comment 9y ago · link · parent
The code listed as "C++" is essentially C with ostreams. If I were interviewing someone and they claimed to know C++, and then used "sizeof(A) / sizeof(A[0])" to get the size of an array, I'd question how much C++ they actually knew. I understand that the focus here is mainly on problem solving and not language specific patterns, but when you advertise the site as a coding interview helper I think that the solution code should reflect that which should be written in an actual interview.
comment 9y ago · link · parent
comment 9y ago · link · parent
On top of this, Google does not use Cloudflare and as far as I know there have been no reports of accounts actually being comprised, only logged out. I would wager whatever maintenance routine they were carrying out accidentally invalided some user sessions.
comment 9y ago · link · parent
comment 9y ago · link · parent
comment 9y ago · link · parent
Is it really nessecary to allocate all of the hash buckets up front? Why not initialize them to null and then allocate them as you need?
Why not use some kind of managed container like std vector to store the hash buckets? This removes the need to do explicit memory management.
Why not use std forward_list instead of rolling your own linked list? Again, this will reduce the amount of code and save you from having to do manual memory management
comment 10y ago · link · parent
https://gist.github.com/Quinny/09e34afb1d187e43dea2f3c3b0c04...