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
alias lower_special_2: String = """\ | |
00DF; 00DF; 0053 0073; 0053 0053; # LATIN SMALL LETTER SHARP S | |
FB00; FB00; 0046 0066; 0046 0046; # LATIN SMALL LIGATURE FF | |
FB01; FB01; 0046 0069; 0046 0049; # LATIN SMALL LIGATURE FI | |
FB02; FB02; 0046 006C; 0046 004C; # LATIN SMALL LIGATURE FL | |
FB05; FB05; 0053 0074; 0053 0054; # LATIN SMALL LIGATURE LONG S T | |
FB06; FB06; 0053 0074; 0053 0054; # LATIN SMALL LIGATURE ST | |
0587; 0587; 0535 0582; 0535 0552; # ARMENIAN SMALL LIGATURE ECH YIWN | |
FB13; FB13; 0544 0576; 0544 0546; # ARMENIAN SMALL LIGATURE MEN NOW | |
FB14; FB14; 0544 0565; 0544 0535; # ARMENIAN SMALL LIGATURE MEN ECH |
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 algorithm.functional import vectorize | |
from bit import bit_width, byte_swap, count_leading_zeros | |
from collections._index_normalization import normalize_index | |
from memory import memcpy, memset_zero | |
from sys import is_big_endian, sizeof | |
from utils import StringSlice, Span | |
from utils.string_slice import _utf8_byte_type, _StringSliceIter | |
struct CrazyString[ |
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
# automatically generated by the FlatBuffers compiler, do not modify | |
import flatbuffers | |
@value | |
struct MetadataVersion: | |
var _value: Int16 | |
# 0.1.0 (October 2016). | |
alias V1 = 0 | |
# 0.2.0 (February 2017). Non-backwards compatible with V1. |
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
@value | |
struct JSONValue(CollectionElement): | |
var _text: String | |
fn __init__(inout self, text: String): | |
self._text = text.strip() | |
fn is_object(self) -> Bool: | |
return self._text.startswith("{") and self._text.endswith("}") | |
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
fn compare(s1: DTypePointer[DType.uint8], s2: DTypePointer[DType.uint8], count: Int)->Int: | |
var result = 0 | |
var i = 0 | |
while i < count: | |
var s1i = s1[i] | |
var s2i = s2[i] | |
var smaller = s1i < s2i | |
var bigger = s1i > s2i | |
i += 1 + count * int(smaller or bigger) | |
result = -1 * int(smaller) + 1 * int(bigger) |
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
trait Hashable: | |
fn __hash__[H: Hasher](self, inout hasher: H): | |
... | |
trait Hasher: | |
fn __init__(inout self): | |
... | |
fn update(inout self, bytes: DTypePointer[DType.uint8], n: Int): | |
... | |
fn finish[dt: DType = DType.uint64](owned self) -> Scalar[dt]: |
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 matplotlib.pyplot as plt | |
def _normalized_experience(data: dict[str, list[int | list[int]]]) -> tuple[int, dict[str, list[int]]]: | |
"""Returns a tuple with latest year and an experience dict with normalised years list""" | |
latest_year = 0 | |
result = {} | |
for topic, years in data.items(): | |
normalised_years = [] | |
for entry in years: | |
if isinstance(entry, list): |
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
#!/bin/bash | |
function check_out_remote_module() ( | |
rurl="$1" | |
shift | |
declare -a paths | |
declare -a module_names | |
for var in "$@" | |
do | |
IFS="=" |
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 Bit import bit_length | |
from String import String | |
from Vector import DynamicVector, UnsafeFixedVector | |
from List import VariadicList | |
struct FibyTree[T: AnyType, cmp: fn(T, T)->Int, to_str: fn(T) -> String]: | |
alias Union = 0 | |
alias Intersection = 1 | |
alias Difference = 2 | |
alias SymetricDifference = 3 |
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 DType import DType | |
from Functional import vectorize | |
from Pointer import DTypePointer | |
from String import String, ord | |
from TargetInfo import dtype_simd_width | |
alias simd_width_u8 = dtype_simd_width[DType.ui8]() | |
let dna = "CAAGAACCAAGATAACACTCATCGTTTACTTCTTACCCGTGCCAATTCGTATTACAAACGAAACCGTGTGGGCCATGTTCGTTATCCGAGGCCCCTTCAATTACTCGTCACTAGTGACCGTCGCTACTATGCCGTGTCCATGATATTACATCAAGACAATGAGATACGAAACGACAGCTGTTCCTACGCCTCGCGAGGGGTTCTACCCCTGAGCCGTGGGAACAGGCCGTCCGACGATCTTCAAGTGTTAAAGCTAGAAAACTTGATCAGAGAACAGTGACAATCCGGTGCAATTAGGGCGCTTCTAGCAAAGTCTTGACGGTTGACATGCTATTCTACCGGCGCAGGTTGCTTGAATGCGCGGGAGTTTTAAGCTCCTCTGTCACGCCATGCCCCCTGCAGTAGCTCACCAGCAAGAAGTTGGCTTAATATACCTGGTAGGAACGTTTGGTTAAACTTCTTTCCCTCTTCTTATACCGATGACACCTACCAATTACGGTCGGCCCGCCCGTGATCCAAACAGGCCTTAATCTTCCAATAATTCAATATGTGTGTGGCTTACAGGAGTCGAATATTTATAAGTGCATTCCTGCCTTCGCTGTTGCGATTTATAGCATCTTATGGTGGCGCAGGGCAACACTTAAAAGGGAGCCAACATGAGTTTCTAGCGTCAGGCACTGCCCTGAGGTAAAGGAATACCTGTTCGATACTATGAGGCGAGATCGCCCCACCTTAAAACAGAAAGACGGTAACGGTCCCTAGCCATTTCCTTATTGCGTACGAGATTATGGAACGCTT |
NewerOlder