Skip to content

Instantly share code, notes, and snippets.

@cartercanedy
cartercanedy / query.py
Last active November 1, 2023 21:58
Pure Python sequence query functions using Python 3.12+ generic type syntax
from typing import (
Sequence,
Iterable,
Callable
)
type Predicate[ T ] = Callable[ [ T ] , bool ]
type Converter[ TIn , TOut ] = Callable[ [ TIn ] , TOut ]
class QueryException( Exception ):
@i-e-b
i-e-b / adler32.cs
Created September 18, 2017 14:30
Adler32 hash in C#
private static uint Adler32(string str)
{
const int mod = 65521;
uint a = 1, b = 0;
foreach (char c in str) {
a = (a + c) % mod;
b = (b + a) % mod;
}
return (b << 16) | a;
}
@yannabraham
yannabraham / doseResponsePython.ipynb
Last active May 14, 2024 05:36
How to do Dose/Response curve fitting in Python for Drug Discovery
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.