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
from collections import UserDict | |
from typing import Any, Dict, Generator, Tuple, Union | |
ElementID = Tuple[str, int] | |
Element = Dict[str, Any] | |
CollectionType = Union[Dict[int, Element], "Collection"] | |
class AllData(UserDict): | |
def __init__(self, initialdata: Dict[str, CollectionType]) -> None: |
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 main | |
import ( | |
"bytes" | |
"encoding/binary" | |
"encoding/json" | |
"fmt" | |
"io" | |
"strconv" | |
"time" |
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
// From https://github.com/dustin/go-humanize | |
func intToByte(s uint64) string { | |
sizes := []string{"B", "kB", "MB", "GB", "TB", "PB", "EB"} | |
base := 1000.0 | |
logn := func(n, b float64) float64 { | |
return math.Log(n) / math.Log(b) | |
} | |
if s < 10 { |
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 main | |
import ( | |
"context" | |
_ "embed" | |
"fmt" | |
"log" | |
"os" | |
"github.com/tetratelabs/wazero" |
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
const std = @import("std"); | |
const CrossTarget = std.zig.CrossTarget; | |
const OptimizeMode = std.builtin.OptimizeMode; | |
const LazyPath = std.Build.LazyPath; | |
const Compile = std.Build.Step.Compile; | |
pub fn build(b: *std.Build) void { | |
const target = b.standardTargetOptions(.{}); | |
const optimize = b.standardOptimizeOption(.{}); |
OlderNewer