<commit_before>Snippets of code resulting of studying specific data structures, algorithms and
general coding techniques.

## Requirements (sort of)
[GCC](https://gcc.gnu.org/) supporting `C++17`. Trying to switch the older
directories to [Buck](https://buck.build/). It uses
[boost](http://www.boost.org/) here and there, and I'll try to add it as a
submodule as well.

## List of snippets

### Disjoint sets
An implementation of `boost::disjoint_sets` with a generic class and a single
`std::vector` as container, with comments explaining how to use it. It is partly
personal study for an implementation I had to do for my job, and partly an
answer to [this
question](http://stackoverflow.com/questions/4134703/understanding-boostdisjoint-sets)
in Stack Overflow.

### Set
A couple of examples showing a problem in how `std::set` is implemented by GNU's
[libstdc++](http://gcc.gnu.org/libstdc++/). I'm not sure whether this merits a
bug report, since I read somewhere that there is a design choice behind it, but
it's certainly worth being aware of it.

The problem is related to iterators for two *different* sets of type
`std::set<T, C1>` and `std::set<T, C2>`, where the compare objects are
different.

### Bit field
An attempt to save as much memory as possible by storing a `bool` as a bit in
some other numeric field, and making ad-hoc *getters* and *setters* so the
change is transparent to the outside. The experiment was actually made with two
`bool`s so the modifications to the code could be appreciated.

### Cache
A little experiment to show the effects of processor cache. Credit to [Igor
Ostrovsky](http://igoro.com/archive/gallery-of-processor-cache-effects/) for his
article on Processor Cache Effects.
<commit_msg>Updates README file.<commit_after>Snippets of code resulting of studying specific data structures, algorithms and
general coding techniques.

## Requirements (sort of)
[GCC](https://gcc.gnu.org/) supporting `C++17`. Trying to switch the older
directories to [Buck](https://buck.build/). It uses
[boost](http://www.boost.org/) here and there, and I'll try to add it as a
submodule as well.

## List of snippets

### Set
A couple of examples showing a problem in how `std::set` is implemented by GNU's
[libstdc++](http://gcc.gnu.org/libstdc++/). I'm not sure whether this merits a
bug report, since I read somewhere that there is a design choice behind it, but
it's certainly worth being aware of it.

The problem is related to iterators for two *different* sets of type
`std::set<T, C1>` and `std::set<T, C2>`, where the compare objects are
different.

### Cache
A little experiment to show the effects of processor cache. Credit to [<NAME>](http://igoro.com/archive/gallery-of-processor-cache-effects/) for his
article on Processor Cache Effects.

{'fraction_non_alphanumeric': 0.09996404171161452, 'fraction_numerical': 0.005393743257820928, 'mean_word_length': 4.631578947368421, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1805901', 'n_tokens_mistral': 822, 'n_tokens_neox': 770, 'n_words': 379}