Compiled switch in modern c++

Posted on Tue 31 January 2023 in tech • Tagged with c++, c++20, programming, tutorial

Compiled Switch

This example demonstrates how to incorporate a compiled switch construct in an event driven application such as a market data handler or parser.

Full tutorial on YouTube:


Fibonacci 200M in 2 Minutes

Posted on Fri 16 December 2022 in tech • Tagged with programming, fibonacci, prime, go

Fibonaccis

F(200M) in 2 minutes! Apple arm64 is no joke. You can do it yourself with Go Fib


Order of evaluation for Solidity modifiers

Posted on Thu 13 October 2022 in tech • Tagged with solidity, programming, ethereum, web3, modifier

Solidity modifiers are evaluated from left to right. It makes sense to order modifiers in order of those that are most likely to fail to those that are least likely to fail. It is also a good idea to order them from most primitive to most expensive. And prerequisite conditions …


Continue reading

remove the ./ from find -print

Posted on Wed 28 September 2022 in tech • Tagged with linux, programming, bash

If you want to apply a script to each file in a folder recursively you may not want the full relative path. Here is how to remove it.

$ find . -type f -print | sed -e "s|^\./||g"

For example to combine it with xargs and invoke a script on each name …


Continue reading

Three steps to document Solididty in SPHINX

Posted on Tue 27 September 2022 in tech • Tagged with solidity, programming, ethereum, crypto, sphinx, tutorial

I was able to get solidity docgen working by implementing a series of three different stages all automated in our build process.

  1. Parse the solc output into actual json.
  2. Load the json file into the documentation system
  3. Use a Jinja template to convert the api document

There is shockingly poor …


Continue reading

How to Configure git editor in a codespace

Posted on Fri 23 September 2022 in tech • Tagged with programming, github, codespaces

How to configure git to use vscode as the default editor from your codespace:

git config --global core.editor "code --wait"