Glasshouse
A dashboard, privacy controls and Home Assistant bridge for rooted LG webOS TVs.
Religion, hobbies and favourite film, game, book and music genres by country, age and sex. C++23, header-only, deterministic.
Translation pending
Developer toolsC++ · PythonGitHub @dasmigOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗Requires C++23 (e.g.,
-std=c++23for GCC/Clang,/std:c++latestfor MSVC).
API Reference · Usage Guide · Data and Method · Releases
Religion, hobbies and favourite media by country, age and sex. A call draws a religion from the shares of a country, a few hobbies, and favourite film, game, book and music genres, shaped by the person's sex, age, country and religion (195 countries in lite, 248 with detail in full).
Country-based Religion. Each country's shares come from the CIA World Factbook, with hand-written rows where it has none (see Data and Method for what is estimated).
Hobbies and Media by Sex, Age and Country. An item's weight is multiplied by factors for the person's sex, age band, country or region, and religion. The sex, age and country differences in activities are measured (Eurostat time-use surveys, Europe), the catalogue and the genre tastes are curated, and each factor row says which.
Request-First Generation. All per-call choices live in interest_request; use get_interest(request) for random generation or get_interest(request, seed) for reproducible results. interest::seed() records the seed for replay.
Deterministic Seeding. get_interest(request, seed) is a pure function of the request, the seed and the data, and interest::seed() replays a previous result.
Batch Generation. Generate thousands of results from one seed, on several threads with the same output for any thread count, optionally unique by a key, and stream them as JSON Lines or CSV (see the usage guide).
Identical Everywhere. A seed gives the same result on every compiler, standard library and CPU (GCC, Clang, MSVC, Emscripten; x86-64 and ARM64), checked by known-answer tests.
Extensible Data. Load your own TSV layers on top of the shipped data to add, change or remove entries (extend()), checked before they are applied.
JSON and Replay. to_json() on every result, and a signature() recording the seed and the data it came from.
Compiled-in Data. Define DASMIG_INTEREST_EMBED to build the lite tier into the program, for WebAssembly and other builds without files.
Multi-Instance Support. Construct independent intg instances with their own data and random engine.
interestgen.hpp is the library released here. Keep core.hpp and the core/ directory (dasmig-core) in the same directory. Add
#include <dasmig/interestgen.hpp>
to the files you want to use it in, and supply the resources folder (or define DASMIG_INTEREST_EMBED).
#include <dasmig/interestgen.hpp>
#include <iostream>
auto& gen = dasmig::intg::instance(); // loads the lite tier
const dasmig::interest_request request{.country = "BR", .age = 34, .person_sex = dasmig::sex::female};
auto v = gen.get_interest(request);
std::cout << v << '\n'; // the religion, e.g. "Christian"
for (const auto& h : v.hobbies) std::cout << h.label << '\n'; // also films, games, books, music
std::cout << v.to_json() << '\n'; // {"country_code":"BR","religion":...,"hobbies":[...],...,"signature":{...}}
// The same seed and request give the same result everywhere.
auto again = gen.get_interest(request, v.seed());
Use get_interest({}) for a random country, unknown age and sex, three hobbies and two genres per medium. Generation has no mutable instance defaults or generator-level seeding controls; data loading and layers remain instance-level. The old country-only, seed-only and no-argument overloads have been removed.
See the usage guide for everything else.
make # example
make test # tests
make bench # benchmarks, results in build/bench.tsv
make test-embed # tests with the lite tier compiled in
make coverage # code coverage
make lint # clang-tidy
make docs # API docs
make embed # regenerate dasmig/interestgen_data.hpp from resources/lite
Tested with:
-std=c++23)-std=c++23)/std:c++latest)| Dependency | Version | Bundled | Purpose |
|---|---|---|---|
| dasmig-core | 1.4 | Yes (core.hpp, core/) | Platform-independent random engine and distributions, data layers, JSON |
| Catch2 | 3.x | Yes (amalgamated) | Unit testing |
| Library | Description |
|---|---|
| address-generator | Postal addresses with real streets by place |
| biodata-generator | Procedural human physical characteristics |
| birth-generator | Demographically plausible birthdays |
| city-generator | Weighted city selection by population |
| country-generator | Weighted country selection by population |
| device-generator | Devices, browsers, user agents and IP addresses that fit together |
| email-generator | Email addresses in each country's style |
| entity-generator | ECS-based entity generation |
| name-generator | Culturally appropriate full names |
| nickname-generator | Gamer-style nicknames |
| occupation-generator | Employment status, education and occupation by country, age and sex |
| persona-generator |
This library is released under the MIT License.
MIT License
Copyright (c) 2026 Diego Dasso Migotto
| Complete characters composed from the other generators |
| phone-generator | Phone numbers valid in each country's numbering plan |
| relationship-generator | Families around a person: parents, siblings, partners and children |
| trait-generator | Personality traits with conflicts, synergies and Big Five axes |
| user-generator | Complete user records: account, username, email, phone and address |