Skip to content

Instantly share code, notes, and snippets.

View perillo's full-sized avatar

Manlio Perillo perillo

  • Avellino, Italy
View GitHub Profile
#!/bin/sh
set -euo pipefail
# Build kcov
scripts/make.sh
printf "\n\n"
# Build tests
mkdir -p build-tests
cd build-tests
@perillo
perillo / distribution_specification.py
Last active December 8, 2023 17:21
Detect the Python distribution specification/format
def _get_dist_spec(dist):
"""Returns the specification used by the distribution.
The result is "dist-info", "egg-info", "egg" or "distutils-legacy".
"""
def is_dir():
return dist.path is not None and os.path.isdir(dist.path)
def is_file():
#!/usr/bin/env python
from math import nan
import sys
from garmin_fit_sdk import Decoder, Stream
import numpy as np
from numpy.lib.stride_tricks import sliding_window_view
def load(path):
def read_fit_header(path):
"""read_fit_header returns the FIT file header.
The FIT SDK has the `Decoder.read_file_header` method, but it cannot be
used because a local object can not be pickled and only the major version
is used, for both protocol_version and profile_version.
"""
stream = Stream.from_file(path)
header = {}
#!/bin/sh
if [ ! -d exercises ]; then
echo "Must be run from the project root directory."
exit 1
fi
build() {
zig build -Dhealed -Dhealed-path=patches/tmp -Dn="$1"
zig_ret=$?
const std = @import("std");
const root = @import("../build.zig");
const debug = std.debug;
const fmt = std.fmt;
const fs = std.fs;
const mem = std.mem;
const Allocator = std.mem.Allocator;
const Build = std.build;

Build file

const std = @import("std");
const tests = @import("tests-tmp.zig");

pub fn build(b: *std.Build) void {
    const test_step = b.step("test", "Run unit tests");
    test_step.dependOn(tests.addCliTests(b));
}
Semantic Analysis [1232] max3... thread 14793 panic: Segmentation fault at address 0x0
???:?:?: 0x2935580 in ??? (/home/manlio/src/contrib/zig/github.com/ziglang/zig/src/zig_llvm.cpp)
/home/manlio/src/contrib/zig/github.com/ziglang/zig/lib/std/mem/Allocator.zig:302:5: 0x9a06d7 in free__anon_3497 (zig)
@memset(non_const_ptr, undefined, bytes_len);
^
/home/manlio/src/contrib/zig/github.com/ziglang/zig/lib/std/array_list.zig:550:47: 0xbc286b in deinit (zig)
allocator.free(self.allocatedSlice());
^
/home/manlio/src/contrib/zig/github.com/ziglang/zig/src/Module.zig:3396:36: 0xa72503 in destroyDecl (zig)
decl_emit_h.fwd_decl.deinit(gpa);
#!/usr/bin/env python
# Validate the code_begin lines in the Zig Language Reference.
import argparse
import sys
CODE_INDENT = 6
def validate(file, verbose=False):

exe

exe|addWithOverflow_builtin
exe|assign_undefined
exe|cImport_builtin
exe|change_active_union_field
exe|cli_allocation
exe|comments
exe|float_mode_exe