- About
- Applicable
- Approximate
- Automatic
- Bad
- Best
- Best Practice
- Between
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
void hexdump(const void* data, size_t size) { | |
size_t j; | |
size_t i; | |
#define nexti (i + 1) | |
const uint8_t wrap = 16; | |
char ascii[wrap + 1]; | |
memset(ascii, 0, sizeof(ascii)); | |
for (i = 0; i < size; ++i) { |
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
template<typename T> | |
T exponentialAverageFilter(const T& value, T& pastValue, const float& filterWeight = 0.8) { | |
return static_cast<T>((1.0 - filterWeight) * pastValue + (filterWeight * value)); | |
} |
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
With the OS X firewall enabled, you can remove the "Do you want the application "python" to accept incoming network connections?" message. | |
Create a self-signed certificate. | |
Open Keychain Access. Applications > Utilities > Keychain Access. | |
Keychain Access menu > Certificate Assistant > Create a Certificate... | |
Enter a Name like "My Certificate". | |
Select Identity Type: Self Signed Root | |
Select Certificate Type: Code Signing | |
Check the Let me override defaults box |
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
/* | |
* Copyright (c) 2009-2017, Farooq Mela | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* | |
* 1. Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* 2. Redistributions in binary form must reproduce the above copyright |
-
No prototypes. Just make the game. polish as you go. Don't depend on polish happening later. Always maintain constantly shippable code.
-
It is incredibly important that your game can always be run by your team. Bulletproof your engine by providing defaults upon load failure.
-
Keep your code absolutely simple. Keep looking at your functions and figure out how you can simplify further.
-
Great tools help make great games. Spend as much time on tools as possible.
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
typedef struct __attribute__((packed)) { | |
double kP; | |
double kI; | |
double kD; | |
uint8_t checksum; | |
} PID_t; | |
PID_t pidParam = { 16.0, 0.10, 1.0, 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
#include <stdio.h> | |
typedef struct bits_packed { | |
unsigned int b0:1; | |
unsigned int b1:1; | |
unsigned int b2:1; | |
unsigned int b3:1; | |
unsigned int b4:1; | |
unsigned int b5:1; | |
unsigned int b6:1; |
NewerOlder