Skip to content

Instantly share code, notes, and snippets.

View nbougalis's full-sized avatar

Nik Bougalis nbougalis

View GitHub Profile
@nbougalis
nbougalis / with_lock.cpp
Created September 23, 2024 14:34
Given a lock and a callable, invokes the callable under a lock in an exception-safe manner and returns its result (if any).
// I wrote this little helper function while working on a disaster of a
// codebase with little to no locking. One of my main goals was to make
// it thread safe.
//
// I needed an easy to grab a lock, do some work (which could sometimes
// throw an exception) and then release the lock, but I did not want to
// have lock_guard objects littered in every part of the code.
#include <utility>
#include <type_traits>
@nbougalis
nbougalis / ratio.cpp
Last active June 6, 2020 20:15
std::ratio for amendments
// Example for comment in PR 3428: https://github.com/ripple/rippled/pull/3428
#include <iostream>
#include <ratio>
constexpr int oldN = 204;
constexpr int oldD = 256;
constexpr int newN = 80;
constexpr int newD = 100;
@nbougalis
nbougalis / keybase.md
Created November 4, 2019 23:51
keybase.md

Keybase proof

I hereby claim:

  • I am nbougalis on github.
  • I am nbougalis (https://keybase.io/nbougalis) on keybase.
  • I have a public key ASABGbvTm-VP1imIWqp7P5uF-zjz6f00r5MZOKsb7fY-Ygo

To claim this, I am signing this object:

A new release of rippled - version 0.31.2 - is now available. This release:
* Corrects a defect in the fee escalation algorithm that would cause network fees to
escalate more rapidly than intended; additionally, the minimum local fee, as reported
by validators, will no longer be adjusted upwards.
* Gracefully handles ledger validations which do not include the optional LedgerSequence
field. Earlier versions of rippled incorrectly assumed that the field would always be
included.
To better understand fee escalation and the recently introducted load and open ledger