Skip to content

Instantly share code, notes, and snippets.

View mendsley's full-sized avatar

Matthew Endsley mendsley

View GitHub Profile
@mendsley
mendsley / inputPadDevice.h
Last active December 12, 2015 04:08
Sketchy NDK controller support for OUYA... using unexported
//------------------------------------------------------------------------------
// Heat Engine - Copyright (c) 2011-2013 by Carbon Games Inc.
//------------------------------------------------------------------------------
#ifndef __INPUTPADDEVICE_H__
#define __INPUTPADDEVICE_H__
struct PadDeviceState
{
PadDeviceState()
#include <iostream>
#include <iomanip>
int main() {
for (int ii = 0; ii < 20; ++ii) {
std::cout << std::setw(4) << ii << std::setw(4) << 2*ii << std::endl;
}
}
goroutine 1 [chan receive]:
testing.RunTests(0x6ee510, 0x807600, 0x24, 0x24, 0x1, ...)
/opt/google/go/src/pkg/testing/testing.go:434 +0x88e
testing.Main(0x6ee510, 0x807600, 0x24, 0x24, 0x80a280, ...)
/opt/google/go/src/pkg/testing/testing.go:365 +0x8a
main.main()
carbon/chat2/_test/_testmain.go:113 +0x9a
goroutine 2 [syscall]:
for (var ii = 0; ii < 5; ++ii) {
console.log(ii);
if (ii == 1) {
break;
}
}
/*
* Copyright 2011 Matthew Endsley. All rights reserved.
* Copyright 2012 Carbon Games, Inv. All rights reserved.
*/
package billing
import (
"carbon/keys"
"errors"
$ strace -cT time premake5 gmake
[Premake MSVC Windows XP support Extension loaded]
Building configurations...
Running action 'gmake'...
Done (20729ms).
PROFILE: interrupts/evictions/bytes = 1253/68/34464
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
52.14 0.769342 20 39177 199 stat
46.99 0.693356 38 18046 120 openat

Keybase proof

I hereby claim:

  • I am mendsley on github.
  • I am mendsley (https://keybase.io/mendsley) on keybase.
  • I have a public key whose fingerprint is 6F26 3479 06EE FB43 BC5D AD6C 2069 9D45 3805 17F9

To claim this, I am signing this object:

@mendsley
mendsley / xaudioDevice.cpp
Created December 14, 2017 23:48
Create IXAudio2MasteringVoice from IMMDevice
IXAudio2MasteringVoice* createVoiceForDevice(IXAudio2* xaudio2, IMMDevice* device)
{
LPWSTR id;
HRESULT hr = device->GetId(&id);
if (FAILED(hr))
{
device->Release();
return nullptr;
}
@mendsley
mendsley / xorshiftstar.cs
Created February 20, 2019 01:32
Public domain xorshift* 64/32 PRNG
// Public domain truncating xorshift* PRNG
// No warrant implied; use at your own risk
//
// LICENSE - see end of file for license details. TL;DR public domain
// or MIT if your lawyers don't like public domain
namespace XorShiftStar
{
// Truncating xorshift* 64/32 PRNG
// https://www.jstatsoft.org/v08/i14/paper