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
#![feature(try_trait_v2)] | |
use std::{io::{Write, BufRead}, ops::{Try, ControlFlow}}; | |
fn main() -> Result<(), Box<dyn std::error::Error>> { | |
let test_file_path = std::env::args_os().nth(1).expect("No input file specified!"); | |
let test_file = std::fs::File::open(test_file_path)?; | |
let stdout = std::io::stdout(); | |
// Lock the stdout once so we don't have to acquire the lock for every line written, which is slow | |
let stdout = stdout.lock(); |
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/sh | |
set -e | |
input="$1" | |
output1="$(mktemp --tmpdir result_XXXXXXXXXXXXX.ppm)" | |
output2="$(mktemp --tmpdir result_XXXXXXXXXXXXX.ppm)" | |
trap "rm -f "$output1" "$output2"" EXIT | |
if ! yes | /home/shnatsel/Code/zune-image/target/release/zune --safe --input "$input" --out "$output1" >/dev/null 2>&1; then |
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
parsec-service-0.1.2/build.rs: const_err, | |
sta-0.2.5/src/lib.rs: pub fn const_error(errormessage: String, exitcode: i32) -> Error { | |
sta-0.2.5/src/lib.rs: pub fn const_error_noexit(errormessage: String) -> Error { | |
sta-0.2.5/src/lib.rs: let error = error::const_error_noexit("This is a sample error, beep beep.".to_string()); | |
core_extensions-0.1.16/src_core_extensions/marker_traits.rs: #[allow(const_err)] | |
core_extensions-0.1.16/src_core_extensions/marker_traits.rs: #[allow(const_err)] | |
oaidl-0.2.1/src/lib.rs:#![deny(const_err)] | |
x509-signature-0.3.0/src/lib.rs: const_err, | |
betrusted-pac-0.0.1/src/lib.rs:#![deny(const_err)] | |
gd32vf103-pac-0.2.0/src/lib.rs:#![deny(const_err)] |
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 | |
# Usage: | |
# ./compare.sh folder1 folder2 | grep -v '^[0-9]\.[0-9]\+e-' | grep -v '^0 ' | sort --numeric-sort --reverse | |
# filters out images with significant differences and sorts them by mean squared error | |
cd "$1" | |
for file in $(find * -type f); do | |
# http://www.imagemagick.org/Usage/compare/ | |
NORMALIZED_DIFFERENCE=$(compare -metric MSE "$file" ../"$2"/"$file" null: 2>&1 | cut -d '(' -f 2 | cut -d ')' -f 1) |
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
--- libdislocator.so.c.pristine 2018-08-22 04:43:10.970904951 +0300 | |
+++ libdislocator.so.c 2018-08-22 04:46:06.028396381 +0300 | |
@@ -64,7 +64,7 @@ | |
/* Canary & clobber bytes: */ | |
#define ALLOC_CANARY 0xAACCAACC | |
-#define ALLOC_CLOBBER 0xCC | |
+int alloc_clobber_counter = 0; | |
#define PTR_C(_p) (((u32*)(_p))[-1]) |
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
use std::vec; | |
// Use the system allocator so we can substitute it with a custom one via LD_PRELOAD | |
use std::alloc::System; | |
#[global_allocator] | |
static GLOBAL: System = System; | |
/// Returns the sum of all values in a vector of uninitialized memory | |
fn sum_uninitialized() -> u64 { | |
let mut my_vec: Vec<u64> = Vec::with_capacity(2048); |
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
# Generalized binary search that lets you supply a custom comparator. | |
# Works both in Python 2 and Python 3. | |
# Based on Python's built-in bisect.bisect() function. | |
# Copyright 2016, Sergey "Shnatsel" Davidoff <shnatsel@gmail.com> | |
class BisectRetVal(): | |
LOWER, HIGHER, STOP = range(3) |