This file contains hidden or 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
| use std::convert::TryInto; | |
| trait Serialize { | |
| fn to_bytes(&self) -> ObjectData; | |
| } | |
| trait Deserialize { | |
| fn from_bytes(data: ObjectData) -> Self | |
| where | |
| Self: Sized; |
This file contains hidden or 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 keras.layers as L | |
| import keras.models as M | |
| import numpy as np | |
| import sklearn.metrics as sk | |
| import matplotlib.pyplot as plt | |
| def create_model(): | |
| input_a = L.Input(shape=(1,)) | |
| input_b = L.Input(shape=(1,)) |
This file contains hidden or 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 uuid import uuid4 | |
| import pickle | |
| class IdiotProof: | |
| def __init__(self, local): | |
| self.vars = [] | |
| self.local = local | |
| def track(self, variable): |
This file contains hidden or 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
| CXX := g++ | |
| FLAGS := -O3 | |
| all: | |
| $(CXX) $(FLAGS) find_a_cat_v1.cpp -o find_a_cat_v1 | |
| $(CXX) $(FLAGS) find_a_cat_v2.cpp -o find_a_cat_v2 | |
| $(CXX) $(FLAGS) prove_xorshift.cpp -o prove_xorshift | |
| clean: | |
| $(RM) find_a_cat_v1 find_a_cat_v2 prove_xorshift |
This file contains hidden or 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
| module Main where | |
| import Data.Maybe (fromJust) | |
| import Data.List (elemIndex) | |
| import Data.Char (ord, chr) | |
| import Text.Printf (printf) | |
| alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#@" | |
| -- добавление паддинга до размера size |
This file contains hidden or 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 copy import deepcopy | |
| from pathlib import Path | |
| import subprocess as sp | |
| import argparse | |
| import json | |
| import math | |
| from PIL import Image, ImageDraw | |
This file contains hidden or 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 datetime import datetime as dt | |
| from hashlib import sha1 | |
| import zlib | |
| from flask import Flask, Response | |
| app = Flask(__name__) | |
This file contains hidden or 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
| all: build_rust build_cpp build_nim build_haskell build_zig | |
| build_rust: | |
| @echo "> build rust code" | |
| @rustc -C opt-level=3 cellmachine.rs -o cellmachine_rs | |
| build_cpp: | |
| @echo "> build c++ code" | |
| @g++ -O3 -std=c++20 cellmachine.cpp -o cellmachine_cpp | |
| build_nim: | |
| @echo "> build nim" | |
| @nim compile -d:release -o:cellmachine_nim cellmachine.nim > /dev/null 2>&1 |
This file contains hidden or 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
| // [dependencies] | |
| // num-bigint = "*" | |
| extern crate num_bigint; | |
| // num-traits = "*" | |
| extern crate num_traits; | |
| use num_bigint::BigUint; | |
| use num_traits::{One, Zero}; | |
| use std::env; | |
| use std::mem::replace; |
This file contains hidden or 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
| #[cfg(windows)] | |
| extern crate winres; | |
| extern crate chrono; | |
| use std::collections::HashMap; | |
| use std::process::Command; | |
| use std::{fs::read_to_string, fs::File, io::Write}; | |
| use chrono::Utc; | |
| fn execute(cmd: &str) -> String { | |
| match Command::new(cmd).arg("-vV").output() { |
NewerOlder