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
From http://en.wikipedia.org/wiki/Box-drawing_character | |
┘ ┐ ┌ └ ┼ ─ ├ ┤ ┴ ┬ │ • × ⌘ π √ ÷ ² ³ ¼ ½ ¾ | |
A matrix: | |
┌ ┐ | |
│ 1 0 0 │ | |
│ 0 1 0 │ | |
│ 0 0 1 │ | |
└ ┘ |
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
#ifndef CALLBACK_H | |
#define CALLBACK_H | |
#include <functional> | |
using namespace std ; | |
// REQUIRES APPLE LLVM | |
//Under Apple LLVM compiler 4.0 - Language, | |
// - C++ Standard Library: choose libc++ (LLVM C++ standard with C++11 support) | |
// NOT GNU |
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
#ifndef KEYCHAIN_H | |
#define KEYCHAIN_H | |
/* | |
kSecAttrAccessible - A CFTypeRef (opaque) value that indicates when your app | |
needs access to the data in a keychain item. You should choose the | |
most restrictive option that meets your app’s needs so that iOS can protect | |
that item to the greatest extent possible. For a list of possible values, | |
see “Keychain Item Accessibility Constants.” |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <vector> | |
using namespace std ; | |
float randFloat() | |
{ | |
return (float)rand() / RAND_MAX ; | |
} |
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
If you want an event in a game that runs at 60FPS to occur ON AVERAGE (once every 30 seconds), | |
then the probability interval you should use is 0.000555555556. So pick a range, | |
say [0, 0.000555555556]. | |
Call randFloat(0,1) once every frame, and if the random generated is on | |
[0,0.000555555556] then make the event happen. | |
This table is to choose a probability interval (on [0,1]). | |
If you want something to occur on average ONCE per second for a 60 FPS game, | |
then the probability interval for that event should be exactly 1/60 chance |
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 <vector> | |
#include <stdio.h> | |
#include <stdlib.h> | |
using namespace std ; | |
int randInt( int a, int b ) | |
{ | |
return a + rand()%(b-a) ; | |
} |
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
// Extensions for std::string to trim whitespace | |
string& trimR( string& str ) | |
{ | |
if( !str.size() ) return str; | |
// find the last whitespace chr, then delete from there to end. | |
string::iterator iter = --str.end() ; | |
while( isspace( *iter ) ) --iter; | |
str.erase( ++iter, str.end() ) ; | |
return str ; | |
} |
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
bool SecCheck( OSStatus res, const char* msg ) | |
{ | |
if( res==errSecSuccess ) | |
{ | |
printf( "< %s okie dokie >\n", msg ) ; // COMMENT THIS OUT TO SILENCE OK's | |
} | |
else | |
{ | |
printf( "< NOT OK!! >: %s FAILED:\n >> ", msg ) ; | |
switch( res ) |
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 <stdlib.h> // MUST BE BEFORE GLUT ON WINDOWS | |
#ifdef _WIN32 | |
#include <gl/glut.h> | |
#else | |
#include <GLUT/glut.h> | |
#include <OpenGL/gl.h> | |
#include <OpenGL/glu.h> | |
#endif |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Twitter Archive Browser</title> | |
<script src="https://unpkg.com/react@16/umd/react.development.js"></script> | |
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> | |
<script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script> | |
<style> |