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
double CurProb = 1; | |
std::cout << 1 << ": " << 0.0 << std::endl; | |
for (int i = 1; i < 100; i++) | |
{ | |
double bp = (365.0 - (double)i) / 365.0; | |
CurProb *= bp; | |
std::cout << (i + 1) << ": " << (1.0 - CurProb) << std::endl; | |
} |
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
:nmap ; : | |
" tabstop: Width of tab character | |
" softtabstop: Fine tunes the amount of white space to be added | |
" shiftwidth Determines the amount of whitespace to add in normal mode | |
" expandtab: When on uses space instead of tabs | |
set tabstop =4 | |
set softtabstop =4 | |
set shiftwidth =4 | |
set expandtab | |
set number |
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
// Puts work into a buffer so it can handle larger collections than the naive stack versions | |
template <class T> | |
struct QSWork { | |
T* begins; | |
T* ends; | |
static QSWork Create( T* begins, T* ends ) { | |
QSWork work; | |
work.begins = begins; | |
work.ends = ends; |
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
/usr/bin/setxkbmap -option "caps:swapescape" |
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
#include <iostream> | |
#include <fstream> | |
#include <string> | |
// convert 2D coordinates to 1D array index | |
int flat_idx(const int row, const int col, const int row_length) | |
{ | |
return (row * row_length) + col; | |
} |
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
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' | |
Shader "Vertex Colors Only" { | |
Properties{ | |
} | |
SubShader{ | |
Tags { "RenderType" = "Opaque" } | |
LOD 200 |
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
#pragma once | |
#include <assert.h> | |
namespace oats { | |
template <class T> | |
struct dynamic_array { | |
T * arr; | |
dynamic_array(); | |
dynamic_array(const int initial_capacity); | |
~dynamic_array(); |
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
public static int[] KMeansCluster(int clusterCount, float3[] data, int maxIterations = 1000) | |
{ | |
if (clusterCount <= 0) | |
{ | |
return new int[0]; | |
} | |
int[] countWithinClusters = new int[clusterCount]; | |
countWithinClusters.Fill(0); |
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
namespace Common | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using UnityEngine; | |
public static class ServiceLocator | |
{ |
NewerOlder