- https://www.brianstorti.com/tcp-flow-control/
- https://hicu.be/bridge-vs-macvlan
- https://hicu.be/macvlan-vs-ipvlan
- https://wiki.aalto.fi/download/attachments/69901948/TCP-CongestionControlFinal.pdf
- https://github.com/tass-belgium/picotcp/blob/3c05fc90347beae23f26d7dc60be69280e55bfa2/modules/pico_tcp.c
- https://www.saminiir.com/lets-code-tcp-ip-stack-5-tcp-retransmission/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2006 Michael Brown <[email protected]>. | |
* | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU General Public License as | |
* published by the Free Software Foundation; either version 2 of the | |
* License, or any later version. | |
* | |
* This program is distributed in the hope that it will be useful, but | |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sh-5.0$ alias atroce='func(' | |
sh-5.0$ atroce | |
sh: syntax error near unexpected token `newline' | |
sh-5.0$ atroce ) { | |
> echo vraiment atroce | |
> | |
> } | |
sh-5.0$ if true; then | |
> alias machin='echo hm ok' | |
> machin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <type_traits> | |
#include <iostream> | |
template<class T, class Enable = void> | |
struct A { | |
static void test() { | |
std::cout << "int" << std::endl; | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <type_traits> | |
#include <iostream> | |
template<class T> | |
struct BaseA { | |
static void test() { | |
std::cout << "int" << std::endl; | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
async def merge_iter(iterables): | |
# create async iterators from the iterables | |
iterators = [iterable.__aiter__() for iterable in iterables] | |
# create an next() task per iterator | |
tasks = {asyncio.ensure_future(it.__anext__()): it for it in iterators} | |
try: | |
while tasks: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# parse --my_option into the MY_OPTION variable | |
# also handles positional arguments | |
__args_list=() | |
__required_args_list=() | |
__unexport_args_list=() | |
normalize_argument() { | |
# uppercase | |
local argname="${1^^}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
class PluginSubclassesMixin: | |
def __init_subclass__(cls, register_base=False, **kwargs): | |
super().__init_subclass__(**kwargs) | |
if PluginSubclassesMixin not in cls.__bases__: | |
return | |
cls.subclasses = [] | |
if register_base: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import lru_cache | |
@lru_cache(maxsize=1024) | |
def kn(a, b, order): | |
assert order >= 1 | |
if order == 1: | |
return a ** b | |
sub_order = order - 1 | |
res = a |
- golang has runtime type information. the format of the structure varies between compiler versions
- convT2E converts some value to
interface{}
, and takes a pointer to a type and a value, and returns an interface - golang also always has function names / line info