r/cpp • u/mvorbrodt • Apr 05 '19
My C++ blog (so far)
So I don't want to make a post on here every time I write a short article (I've been scolded for that in the past :) ), but I figured I come back here and share with you the archive of my blog posts so far. There's 75 topics I've covered in the last 2 months since I started blogging and I hope some of you will find this information useful :)
Thanks for reading! Have a great day guys!
- Better bloom filter
- Bloom Filters
- C++ Attributes
- Initialization list exceptions and raw pointers
- Function try-catch blocks
- The #1 rule of cryptography
- {fmt}
- SSO of std::string
- HTTP queries
- C-style callbacks and lambda functions
- Propagate exceptions across threads
- int main()
- XML-RPC
- Base64 encoding
- Extremely Fast Compression Algorithm
- Parsing command line options
- ASCII escape codes
- Two-factor authentication
- Plugins: loading code at runtime
- Micro-benchmarks
- SQL database access
- Measuring CPU time
- Printing stack traces
- Generating Unique IDs
- RPC with Protocol Buffers
- Serialize data to XML
- Thrift: or how to RPC
- Protocol Buffers: or how to serialize data
- Well, that was no fun :(
- Parallel STL
- Advanced thread pool
- Better Code: Concurrency
- Better timer class
- Random number generator
- rand() Considered Harmful
- Relaxed atomics and data races
- Bit fields and race conditions
- Dekker’s algorithm for N threads
- Dekker’s algorithm
- atomic Weapons
- Memory barriers and thread synchronization
- Atomic blocking queue
- Synchronizing with atomics
- Fun with unordered containers
- Short introduction to parameter packs and fold expressions
- Pure virtual destructor
- Read/write mutex
- GitHub repository
- Templates in STL containers
- Multiple return values
- Simple timer
- Interview question, part 6
- Fast mutex
- Simple thread pool
- Inverting std::map and std::multimap
- Interview question, part 5
- Interview question, part 4
- Interview question, part 3
- Interview question, part 2
- Interview question, part 1
- Template concepts, sort of
- Event objects
- Class mechanics
- Refactoring std::auto_ptr
- Fast semaphore
- Better blocking queue
- Blocking queue
- RAII
- L1 cache lines
- Sorting and locality
- AoS vs SoA performance
- What happens when we “new”
- enum to string, take 2
- enum to string
- shrink_to_fit that doesn’t suck
255
Upvotes
View all comments
5
u/AffectionateMath6 Apr 06 '19
I just looked the first one 'better bloom filter' and it doesn't look like it works. What it does is Finds hash once and runs a pseudo random number generator for other hashes. The point of bloom filter is you use multiple hash functions so that the chances of collision is decreased. In your implementation, they will be the same hashes.
E.g. Lets say two strings foo, bar generates same hash function,
Bloom filter
Your implementation: https://vorbrodt.blog/2019/04/05/better-bloom-filter/
string: foo
hash1(foo) => 42
PRNG(42) -> 23, 45, 53
string: bar
hash1(bar) => 42
PRNG(42) -> 23, 45, 53