Skip to content

Instantly share code, notes, and snippets.

View BillyONeal's full-sized avatar

Billy O'Neal BillyONeal

View GitHub Profile
@BillyONeal
BillyONeal / gist:04a77c971d87a5b0e3727a42dd9e5dbe
Created October 21, 2022 00:22
Example of how git registries work
Git registry declaration has:
"repository": {
"type": "string",
"description": "The URI or SSH entry to clone from. (as if by `git clone`)"
},
"baseline": {
"description": "The SHA that will be checked out to find default versions for ports from this registry.",
"$ref": "#/definitions/sha1"
},
"reference": {
Thesis: HSR is squeezed on the short end by driving, and on the long end by air travel.
This discussion makes the following assumptions:
• Driving average speed is 83km/hr. (100km/hr speed limit with 10 minutes break each hour)
• HSR average speed is 300km/hr. (ICE Cologne<->Frankfurt’s top speed. There is faster HSR in
the world but I’m also making no allowances for stops. For example, Nozomi Shinkansen Tokyo<->Osaka
is 515km/4 hours or 128km/hr due to 180km/hr top speed but with 17 stops)
• Flight average speed is 700km/hr. (Chicago->Portland is 4.5 hours to do 2823km) Guess that it
takes 3 hours dealing with getting on or off the plane, security theatre, renting a car, etc. B.S.
at either end.
@BillyONeal
BillyONeal / future.cpp
Created March 26, 2021 04:05
future benchmark
#include <stdint.h>
#include <future>
#include <random>
#include <vector>
#include <benchmark/benchmark.h>
static uint_fast32_t long_running_task() {
std::mt19937 gen{std::random_device{}()};
gen.discard(1000);
return gen();
@BillyONeal
BillyONeal / demo.bat
Last active January 13, 2021 01:36
remove FILE_ATTRIBUTE_READONLY demo
:: Run this from a developer command prompt
type removeme.cpp
cl /EHsc /W4 /WX /std:c++17 .\removeme.cpp /Feremoveme
mkdir exampledir
:: owner == BUILTIN\Users
:: group == BUILTIN\Users
:: DACL: (note DACL processed in order)
:: (D;OICI;SD;;;BU) Deny, Object Inherit Container Inherit, DELETE, BUILTIN\Users
:: (D;OICI;0x40;;;WD) Deny, Object Inherit Container Inherit, FILE_DELETE_CHILD, WORLD\Everyone
:: (A;OICI;FA;;;BU) Allow, Object Inherit Container Inherit, FILE_ALL, BUILTIN\Users
@BillyONeal
BillyONeal / id_rsa.pub
Last active December 23, 2020 01:28
SSH Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCfHKdXIqSGCp9xSlpNQ6q/t6pVJF24LMf9EREh9DSOtxTkV93wzem4ylJ1P9ym2faaZXI19woqBoe9685fxNLiesFb2rP7hva5SVkWFaRFsAxLygpYXad5f93qi0nqwXQmbGUgsaxG9+7QxOTq5vrCUDBoTeD20T6E2bDgKyRXtRmumUo1MdzaAQqCgc/kEnk4oaGo90Gr9TIZl7KDmzBox7s7051MClocVmhNaKDLe4hYPBlJEpRu19isordricQSmW+M1fkUVqR19w7J/MKDk5zSMewgNAFULHzJ9fbcDBdFTRYhBbO0GuF7vMSWuB6SXJTEvxMjmObmXDcQrNKz billy@BION-X71
@BillyONeal
BillyONeal / herb_sutter_string.cpp
Created September 15, 2020 00:51
Herb Sutter's basic_string const& vs. && etc. benchmark
#include <assert.h>
#include <stdlib.h>
#include <stddef.h>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <chrono>
#include <random>
using namespace std;
C:\Users\billy\Desktop>cl /EHsc /W4 /WX .\test.cpp && .\test.exe
Microsoft (R) C/C++ Optimizing Compiler Version 19.20.27607.1 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
test.cpp
Microsoft (R) Incremental Linker Version 14.20.27607.1
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.exe
test.obj
@BillyONeal
BillyONeal / after.cod
Created March 9, 2019 18:39
Atomic Asm Output
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.20.27404.0
include listing.inc
INCLUDELIB LIBCMT
INCLUDELIB OLDNAMES
PUBLIC ?i@@3U?$atomic@H@std@@A ; i
_BSS SEGMENT
?i@@3U?$atomic@H@std@@A DD 01H DUP (?) ; i
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview>type C:\Dev\msvc\src\qa\VC\Libs\devcrt\include\std.hpp
#ifndef STD_HPP
#define STD_HPP
#pragma warning(push)
#pragma warning(1 : 4668) // 'MEOW' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
// DevDiv#255593 "All STL headers should protect themselves from macroized new"
#pragma push_macro("new")
#undef new
@BillyONeal
BillyONeal / exclusive_scan.cpp
Created October 19, 2018 23:23
Parallel Type Requirements Test Cases
struct inputType {
inputType() = delete;
/* implicit */ inputType(int) {} // so that the test can make an array
inputType(const inputType&) = delete;
inputType& operator=(const inputType&) = delete;
};
struct bopResult {
bopResult() = delete;
/* implicit */ bopResult(int) {}