Skip to content

Instantly share code, notes, and snippets.

View haleyjd's full-sized avatar

James Haley (Nightdive Studios) haleyjd

View GitHub Profile
enum class YourKeys
{
A,
B,
Subtract
};
using keymap_t = std::unordered_map<std::string, YourKeys>;
const keymap_t g_theKeysDukeTheKeys =
{
/*
CALICO
OpenGL Renderer Primitives
The MIT License (MIT)
Copyright (C) 2007-2014 Samuel Villarreal
Copyright (C) 2016 James Haley
(function (mw, $) {
var imgMap = [];
var displayModal = function (magLink, imgInfo) {
// display the modal
$('.dw-img-modal').css('display', 'block');
// set image properties
var modalImg = $('.dw-img-modal-img');
modalImg.attr('src', imgInfo['thumburl' ]);
#include <iostream>
#include <initializer_list>
#include <type_traits>
using namespace std;
template<typename EnumType>
class FlagSet
{
public:
/** assumes q1 is a normalised quaternion */
public void set(Quat4d q1) {
double test = q1.x*q1.y + q1.z*q1.w;
if (test > 0.499) { // singularity at north pole
heading = 2 * atan2(q1.x,q1.w);
attitude = Math.PI/2;
bank = 0;
return;
}
(function () {
var db = new PrometheusDB();
if(!db.connect("live")) {
Console.println("Error: could not connect to database");
return;
}
var peopleIDs = LazyVecMap.FromCSV("namefixids.csv");
@haleyjd
haleyjd / geometry.cpp
Created November 5, 2017 01:10
node build geometry file
//
// CS 4143
// Final Project
// James Haley
//
// Geometric primitives for BSPGEN
//
#include "math.h"
#include "geometry.h"
//
// CS 4143
// Final Project
// James Haley
//
// BSP Generation code
//
#include <stdlib.h>
#include <iostream.h>
with ins_coverage_type as (
select IP.id,
case
when exists (
select *
from insurance_coverage IC
inner join insurance_policies IIP on IC.INSURANCE_POLICY_ID = IIP.id
inner join TAX_ENTITIES ITE on IIP.TAX_ENTITY_ID = ITE.ID
where IC.person_id = IP.id and
IIP.TAX_ENTITY_ID not in (3300, 3804, 5459, 5717, 3345, 4469, 3592, 135, 2590,
wchar_t *print_as_wide(const char* mbstr)
{
mbstate_t state = mbstate_t();
size_t len = 1 + mbsrtowcs(NULL, &mbstr, 0, &state);
wchar_t *wstr = new wchar_t [len];
mbsrtowcs(&wstr[0], &mbstr, len, &state);
wstr[len-1] = 0;
return wstr;
}