from typing import List
import requests
def ident(x):
return x
def add_1(x):
This file contains 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
$ python multinom_test.py | |
H0: the observed frequeicies follows the expected ones | |
H1: the observed frequeicies does not follow the expected ones | |
observed_frequencies = [0, 10, 6, 4, 5, 5] | |
alpha = 0.05 | |
chisquare: p = 0.064663, H0 is NOT rejected | |
multinom_test: p = 0.030745, H0 is rejected (# of possible events = 324632) |
This file contains 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
$ python goodness_of_fit.py | |
H0: the observed frequeicies follows the expected ones | |
H1: the observed frequeicies does not follow the expected ones | |
observed_frequencies = [0, 10, 6, 4, 5, 5] | |
alpha = 0.05 | |
pearson: p = 0.064663, H0 is NOT rejected | |
log-likelihood: p = 0.014007, H0 is rejected | |
freeman-tukey: p = 0.000233, H0 is rejected |
This file contains 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 itertools | |
from dataclasses import dataclass | |
from typing import Any, Callable | |
Handler = Callable[[Any], Any] | |
@dataclass(frozen=True, match_args=True) | |
class Effect: | |
expr: tuple |
This file contains 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
$ lsb_release -a | |
No LSB modules are available. | |
Distributor ID: Ubuntu | |
Description: Ubuntu 22.04.3 LTS | |
Release: 22.04 | |
Codename: jammy | |
$ grep "processor\|model name" /proc/cpuinfo | |
processor : 0 | |
model name : Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz |
This file contains 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 System.Environment | |
import Text.Printf | |
-- single-line comments | |
{- | |
multi-line comments | |
-} | |
pollardRho n = |
This file contains 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
$ go version | |
go version go1.21.0 linux/amd64 | |
$ go build -ldflags="-s -w" -trimpath pollardRho.go | |
$ time ./pollardRho 12814570762777948741 | |
12814570762777948741 = 3861801803 * 3318288047 | |
real 0m0.160s | |
user 0m0.060s |
This file contains 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
[package] | |
name = "pollard_rho" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
rug = "1.20.1" |
This file contains 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
interface T<V> { valueOf(): V } | |
type HECK<V> = V extends T<infer R> ? T<R> : never | |
type P = string | number | boolean | null | undefined | |
type FXCK = { [k: string]: U } | |
type SXIT = (...args: U[]) => U | void | |
type U = U[] | FXCK | SXIT | P | HECK<any> | |
let fxck: U | |
fxck = {}; console.log(fxck) // FXCK | T<unknown> | |
fxck = []; console.log(fxck) // U[] | T<unknown> |
This file contains 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
$ time python3 squfof.py 60766145992321225002169406923 | |
60766145992321225002169406923 = 242950340194949 * 250117558771727 | |
real 0m23.864s | |
user 0m23.850s | |
sys 0m0.008s |
NewerOlder