Skip to content

Instantly share code, notes, and snippets.

View nickhutchinson's full-sized avatar

Nicholas Hutchinson nickhutchinson

  • London
View GitHub Profile
wil::unique_winhttp_hinternet NewMockHandle(function<void(HINTERNET)> onClose) {
using Deleter = function<void(HINTERNET)>;
struct MockHandleCallback {
static __stdcall void mockHandleCallback(HINTERNET hInternet,
DWORD_PTR dwContext,
DWORD dwInternetStatus,
LPVOID lpvStatusInformation,
DWORD dwStatusInformationLength) {
switch (dwInternetStatus) {
#!/bin/bash
set -euo pipefail
print_usage() {
>&2 echo "USAGE: $0 [-2 | -2.x | -3 | -3.x] [script]"
}
PY_PYTHON=${PY_PYTHON:-2}
interpreter=()
#!/usr/bin/env python2
import argparse
import json
import logging
import nt
import os
import re
import subprocess
import sys
from distutils.spawn import find_executable
from __future__ import print_function
import os
import subprocess
import json
from collections import namedtuple
from distutils.version import LooseVersion
try:
from typing import List, Mapping, Sequence
from __future__ import print_function
import os
import subprocess
import json
import six
from collections import namedtuple
from distutils.version import LooseVersion
MacOsSdk = namedtuple("MacOsSdk", ["xcodeVersion", "xcodePath", "sdkRoot"])
# WIP Port of https://github.com/dotnet/coreclr/blob/ef1e2ab328087c61a6878c1e84f4fc5d710aebce/src/vm/hillclimbing.cpp
import math
import random
from collections import deque
from enum34 import Enum, auto
import psutil
WAVE_PERIOD = 4
// https://groups.google.com/forum/#!topic/comp.programming.threads/2rIqF8MsaxM
// Scalable distributed reference counting with lightweight acquire/
// release operations.
//
// It supports:
// - Reference counting with basic-thread safety
// - Reference counting with strong-thread safety
// - Reference counting with cross-thread references
// - Ultra low overhead PDR
// - PDR with long-term cross-thread references
@nickhutchinson
nickhutchinson / starfish.txt
Created October 17, 2012 04:37
Failing Libdispatch Linux unit tests (Ubuntu 12.04 VM - 32-bit)
==================================================
[TEST] Dispatch Starfish
[PID] 8405
==================================================
lap: 10
count: 1000
delta: 3952490202 ns
math: 1974.270830 ns / lap
@nickhutchinson
nickhutchinson / ubuntu-1204-32.txt
Created October 16, 2012 23:50
libdispatch Test Results (Ubuntu 12.04 32bit)
==================================================
[TEST] Dispatch Apply
[PID] 7140
==================================================
[BEGIN] dispatch_get_global_queue
Actual: 0x40091640
Expected: 0x40091640
[PASS] dispatch_get_global_queue
@nickhutchinson
nickhutchinson / Ubuntu 12.04 64bit.txt
Created October 16, 2012 23:27
libdispatch Test Results (Ubuntu 12.04 64 bit)
==================================================
[TEST] Dispatch Apply
[PID] 12506
==================================================
[BEGIN] dispatch_get_global_queue
Actual: 0x2afb81ffa940
Expected: 0x2afb81ffa940
[PASS] dispatch_get_global_queue