Skip to content

Instantly share code, notes, and snippets.

View brycelelbach's full-sized avatar

Bryce Adelstein Lelbach aka wash brycelelbach

  • Sunnyvale, CA
View GitHub Profile
brycelelbach /
Last active August 7, 2023 01:29
C++ Conference Student Programs

C++ Conference Student & Volunteer Programs

Conference Location Time of Year Financial Support
[C++Now][cppnow] US, Colorado May Pays for registration, transit, & lodging
[CppCon (Student)][cppconS] US, Colorado Sep/Oct Discounted registration
[CppCon (Volunteer)][cppconV] US, Colorado Sep/Oct Pays for registration, transit, & lodging
[C++ On Sea (Student)][cpponseaS] UK Jun/Jul Pays for registration, local transit, & lodging
[C++ On Sea (Volunteer)][cpponseaV] UK Jun/Jul Pays for registration, local transit, & lodging
[Meeting C++ (Student)][meetingcppS] Germany November Pays for registration
std::vector v = ...;
auto min = std::ranges::min_element(v);
std::ranges::for_each(v, [&] (auto& e) { e /= min; });
std::vector v = ...;
auto min = std::ranges::min_element(v);
std::ranges::transform(v, v.begin(), [&] (auto e) { return e / min; });
std::vector v = ...;
auto min = std::ranges::min_element(v);
brycelelbach /
Created May 21, 2021 19:39
`vcpkg install --head inja` fails to get the tarball from GitHub
$ ../vcpkg/vcpkg install --triplet x64-linux --head inja
Computing installation plan...
The following packages will be built and installed:
    inja[core]:x64-linux -> 3.2.0 (+HEAD)
Starting package 1/1: inja:x64-linux
Building package inja[core]:x64-linux from HEAD...
-- Downloading -> pantor-inja-master.tar.gz.version...
-- Downloading Failed. Status: 22;"HTTP response code said error"
CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:184 (message):
brycelelbach /
Last active March 5, 2021 21:59
Principles for Open Projects

Principles for Open Projects

Reply-To: Bryce Adelstein Lelbach

Why Open?

For some kinds of software projects to be successful, it is vital that they get developers to adopt the project and build an ecosystem around the project.

One of the best ways to attract developers to a project is to make it open. In an open project, anyone can participate and contribute to the project.

brycelelbach /
Last active December 21, 2020 21:34
`/opt/intel/oneapi/tbb/latest/env/` doesn't set the proper CMake variables

/opt/intel/oneapi/tbb/latest/env/ doesn't setup CMake variables in a way that will lead to TBB being successfully detected.

In the latest OneAPI Debian packages (as of today 2020-12-21), the TBB shared libraries are located in /opt/intel/oneapi/tbb/2021.1.1/lib/intel64/gcc4.8/*.

/opt/intel/oneapi/tbb/latest/env/ sets CMAKE_PREFIX_PATH to ${TBBROOT}, aka /opt/intel/oneapi/tbb/2021.1.1. That's not helpful - here's how CMake's find_library uses CMAKE_PREFIX_PATH:

[...] 2. Search paths specified in cmake-specific environment variables. These are intended to be set in the user’s shell configuration, and therefore use the host’s native path separator (; on Windows and : on UNIX). This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed or by setting the CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PAT to FALSE.

  • <prefix>/lib/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and <prefix>/lib for each <prefix> in
brycelelbach /
Last active October 11, 2022 17:45
`/opt/intel/oneapi/` overrides bash arguments when sourced

When /opt/intel/oneapi/ is sourced, it overrides ${@} (the bash variable that stores command line arguments). This is very problematic when when you are sourcing the script inside of another script that needs to process command line arguments.

To reproduce:

docker run -i ubuntu:20.04 /bin/bash -s <<EOF
echo "Bash Arguments: \${@}"
apt-get -y update
apt-get -y install gnupg curl
brycelelbach /
Last active June 3, 2020 02:02
Form email to regarding the treatment of gender as binary in the ISO Gender Action Plan and survey


Subject: Please don't treat gender as a binary in the ISO Gender Action Plan and survey

Dear ISO Council,


I am glad to hear that ISO is taking steps to address gender equality in ISO technical work.

// Every thread must wait for every other thread to read its
// neighbors and finish its computation before it can start storing.
__host__ __device__
void solve(double* u, size_t n, size_t steps) {
for (size_t t = 0; t < steps; ++t) {
double un = stencil(u[n - 1], u[n], u[n + 1]);
u[n] = un;
brycelelbach / amber_spyglass_chapter_21_euthanasia.txt
Last active December 22, 2019 02:30
Excerpt on Euthanasia from The Amber Spyglass Chapter 21
Before long they had reached the edge of the settlement and made their way
beside a sluggish stream through bare-twigged scrubby bushes. Occasionally
they would hear a harsh croak or a splash as some amphibian was disturbed, but
the only creature they saw was a toad as big as Will’s foot, which could only
flop in a pain-filled sideways heave as if it were horribly injured. It lay
across the path, trying to move out of the way and looking at them as if it
knew they meant to hurt it.
“It would be merciful to kill it,” said Tialys.
“How do you know?” said Lyra. “It might still like being alive, in spite of