I now this is very naive, but after watching a few soccer games I was vary curious to see if minimal spanning trees between soccer players could somehow model soccer tactics.
The file above can be opened in a browser, with no dependencies.
I now this is very naive, but after watching a few soccer games I was vary curious to see if minimal spanning trees between soccer players could somehow model soccer tactics.
The file above can be opened in a browser, with no dependencies.
| let state : (int * int) list ref = ref [] | |
| let rec fibonacci (n : int) : int = | |
| if n <= 1 then 1 | |
| else | |
| match List.assoc_opt n !state with | |
| | Some v -> begin | |
| print_string "Cache hit :)"; | |
| print_newline (); | |
| v |
| def reduce_mem_usage(df, verbose=True): | |
| numerics = ['int16', 'int32', 'int64', 'float16', 'float32', 'float64'] | |
| start_mem = df.memory_usage().sum() / 1024**2 | |
| for col in df.columns: | |
| col_type = df[col].dtypes | |
| if col_type in numerics: | |
| c_min = df[col].min() | |
| c_max = df[col].max() | |
| if str(col_type)[:3] == 'int': | |
| if c_min > np.iinfo(np.int8).min and c_max < np.iinfo(np.int8).max: |
| import random | |
| import ast | |
| def generate_code(scope): | |
| stmts = [] | |
| for _ in range(5): | |
| stmts.append(generate_statement(scope)) | |
| stmts.append(random.choice(scope)) | |
| return "\n".join(stmts) |
| module Main | |
| data Direction = North | South | West | East | |
| turn : Direction -> Direction | |
| turn North = East | |
| turn South = West | |
| turn West = North | |
| turn East = South |
| defmodule Functional do | |
| def run() do | |
| source = """ | |
| def f(xs, f) do | |
| Enum.map(xs, f) |> Enum.join(",") | |
| Enum.map(xs, f) |> Enum.into(",") | |
| end | |
| """ | |
| ast = Code.string_to_quoted!(source) |
| defmodule CredoBugOnABC do | |
| """ | |
| This is an interactive bug report :) | |
| Load it on IEx. | |
| """ | |
| def test() do |
| # just try ASM.example on IEx | |
| # assembly-ish code parses alright | |
| defmodule ASM do | |
| def example() do | |
| quote do | |
| section data | |
| msg db "hello, world" | |
| len equ - msg |
| def eval(num) when is_number(num) do | |
| num | |
| end |
I hereby claim:
To claim this, I am signing this object: