Skip to content

Instantly share code, notes, and snippets.

View fulmicoton's full-sized avatar
🤪

Paul Masurel fulmicoton

🤪
View GitHub Profile
use std::collections::HashMap;
use tokio::sync::Mutex;
use tonic::transport::Server;
use tracing::info;
tonic::include_proto!("bank");
#[derive(Default)]
pub struct MyBank {
accounts: Mutex<HashMap<String, u64>>,
```
If an app invokes 1000 RPC calls to proceed,
and the 99th percentile delay for all of those
calls is 100ms, what is the likelihood that your
app will need to wait <=100ms to proceed?
```
Let's assume that the app needs all RPC to
return before displaying something. (which is
not necessarily the case)
WITH
poss AS (
SELECT x, y, x*y AS p, x+y as s
FROM
GENERATE_SERIES(2,100) as x,
GENERATE_SERIES(2,100) as y
WHERE x + y <= 100 AND y > x
),
poss_after_sue_2 AS (
SELECT *
from collections import Counter, defaultdict
import heapq
import pickle
import os
FIRST_GUESS = "aloes"
NUM_GUESS = 5
CACHE_FILE = "wordle.pickle"
def dictionary():
First of all I am not very familiar with Elasticsearch settings,
but fairly familiar with what stock Lucene does.
I haven't any experience of NRTDirectory...
Lucene simply writes immutable segments files.
The NRTDirectory does not sync, in order to minimize the cost of commit.
The OS will eventually flush these pages to disk.
On the read side, the file is mapped into memory.
On first access, the OS will experience a page fault.
@fulmicoton
fulmicoton / leader_election_scuttlebutt.txt
Last active September 29, 2022 00:44
Leader election on top of scuttlebutt.
Leader election on top of Scuttlebutt.
-----------------------------------------------
The following makes it possible to cheaply get a leader election
on top of a Cassandra-like membership using scuttlebutt + phi accrual detection.
# TDLR about Scuttlebutt and phi accrual detection
Scuttlebutt is a anti-entropy gossip algorithm.
It makes it possible for every node in a cluster to
# Quickwit Individual Contributor License Agreement
Thank you for your interest in contributing to Quickwit ("We" or "Us").
This contributor agreement ("Agreement") documents the rights granted by contributors to Us. To make this document effective, please sign it and send it to Us by electronic submission, following the instructions at https://cla-assistant.io/quickwit-inc/quickwit. This is a legally binding document, so please read it carefully before agreeing to it. The Agreement may cover more than one software project managed by Us.
## 1. Definitions
"*You*" means the individual who Submits a Contribution to Us.
@fulmicoton
fulmicoton / Quickwit_Individual_Contributor_License_Agreement.txt
Last active May 10, 2021 02:36
Quickwit's Individual Contributor License Agreement (CLA)
# Quickwit Individual Contributor License Agreement
Thank you for your interest in contributing to Quickwit ("We" or "Us").
This contributor agreement ("Agreement") documents the rights granted by contributors to Us. To make this document effective, please sign it and send it to Us by electronic submission, following the instructions at https://cla-assistant.io/quickwit-inc/quickwit. This is a legally binding document, so please read it carefully before agreeing to it. The Agreement may cover more than one software project managed by Us.
## 1. Definitions
"*You*" means the individual who Submits a Contribution to Us.
# The point of this program is to demonstrate why
# supporting negative indices can be error-prone.
#
# The example was voluntarily made simple.
# Of course this is not the most optimized algorithm to answer
# the question...
#
# Real life example are typically more intricate
# and may occur sporadically.
def longest_stay(hotel_rates, budget):
class Tree:
def __init__(self, base, left, right):
self.base = base
self.left = left
self.right = right