Skip to content

Instantly share code, notes, and snippets.

View efruchter's full-sized avatar
🏠
Working from home

Eric Fruchter efruchter

🏠
Working from home
  • Epic Games
  • Los Angeles, CA
View GitHub Profile
@efruchter
efruchter / bigsort.cpp
Last active October 7, 2019 00:27
dumb stuff
// 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;
: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
@efruchter
efruchter / BirthdayParadox.cpp
Created November 17, 2021 01:18
calculate the probabilities that a group of n people will have at least two people within that share the same birthday.
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;
}