I hereby claim:
- I am oxalica on github.
- I am oxalica (https://keybase.io/oxalica) on keybase.
- I have a public key whose fingerprint is F90F FD6D 585C 2BA1 F13D E8A9 7571 654C F88E 31C2
To claim this, I am signing this object:
// statx-sys = "0.3.0" | |
// libc = "0.2.62" | |
// criterion = "0.3.0" | |
// | |
// Bench with file `a` but no file `b` in working dir. | |
#![feature(const_cstr_unchecked)] | |
use libc; | |
use statx_sys; | |
use std::{ffi::CStr, fs, mem}; | |
use criterion::*; |
time: 0.979; rss: 176MB parse_crate | |
time: 0.000; rss: 176MB attributes_injection | |
time: 0.000; rss: 176MB incr_comp_prepare_session_directory | |
time: 0.000; rss: 176MB incr_comp_garbage_collect_session_directories | |
time: 0.000; rss: 176MB recursion_limit | |
time: 0.000; rss: 176MB plugin_loading | |
time: 0.000; rss: 176MB plugin_registration | |
time: 0.028; rss: 178MB pre_AST_expansion_lint_checks | |
time: 0.000; rss: 178MB crate_injection | |
time: 0.991; rss: 373MB expand_crate |
-- https://www.json.org/json-en.html | |
{-# LANGUAGE OverloadedStrings #-} | |
import Data.Map.Strict (Map, fromList) | |
import qualified Data.Text as T | |
import Data.Char (isDigit, chr, isHexDigit) | |
import Control.Monad (ap) | |
import Control.Applicative (Alternative(..), optional) | |
newtype Parser a = Parser { runParser :: T.Text -> Either String (T.Text, a) } |
module Main | |
import Printf | |
%default total | |
||| Define the "like" relationship on two `Format`. | |
||| | |
||| One format is "like" the other one iff the former with all non-format-specifier removed is | |
||| the same as the later. |
use brainfuck::{program::Program, tape}; // brainfuck = "0.2.1" | |
fn gen_printer(s: &str) -> String { | |
assert!(!s.is_empty()); | |
let s = s.as_bytes(); | |
let mut buf = "+".repeat(s[0] as usize) + "."; | |
for (&prev, &cur) in s.iter().zip(&s[1..]) { | |
if prev < cur { | |
buf += &"+".repeat((cur - prev) as usize); | |
} else if cur < prev { |
{ | |
inputs = { | |
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable; | |
flake-utils.url = github:numtide/flake-utils; | |
rust-overlay.url = github:oxalica/rust-overlay; | |
}; | |
outputs = { nixpkgs, flake-utils, rust-overlay, ... }: | |
flake-utils.lib.eachSystem ["x86_64-linux"] (system: let | |
pkgs = import nixpkgs { |
retain_std u64 almost_kept | |
time: [123.44 us 127.97 us 134.19 us] | |
Found 14 outliers among 100 measurements (14.00%) | |
2 (2.00%) low mild | |
5 (5.00%) high mild | |
7 (7.00%) high severe | |
retain_early_drop u64 almost_kept | |
time: [98.345 us 100.49 us 103.22 us] | |
Found 15 outliers among 100 measurements (15.00%) |
// https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=440c65898633c8dba89e0a036f049e95 | |
use std::ops::Deref; | |
use std::marker::PhantomData; | |
#[repr(transparent)] | |
struct Getter<A, T>(T, PhantomData<A>); | |
impl<A, T, U> Deref for Getter<A, (T, U)> { | |
type Target = Getter<A, U>; | |
fn deref(&self) -> &Self::Target { |
module Main where | |
import qualified Data.Map as M | |
import Text.Printf (printf) | |
import Control.Monad (ap) | |
data Script a = Script { genScript :: Int -> (Int, [Operation], a) } | |
instance Functor Script where | |
fmap f (Script gen) = Script $ fmap f . gen |
I hereby claim:
To claim this, I am signing this object: