Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#include <cstring> // memcpy | |
#include <type_traits> // is_trivially_copyable | |
// http://src.chromium.org/viewvc/chrome/trunk/src/base/basictypes.h?view=markup | |
// bit_cast<Dest,Source> is a template function that implements the | |
// equivalent of "*reinterpret_cast<Dest*>(&source)". We need this in | |
// very low-level functions like the protobuf library and fast math | |
// support. | |
// |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#include "gtest/gtest.h" | |
using namespace testing; | |
class ConfigurableEventListener : public TestEventListener | |
{ | |
protected: | |
TestEventListener* eventListener; | |
#include <type_traits> | |
#include <tuple> | |
#include <iostream> | |
// Link: https://github.com/aeyakovenko/notes | |
//count arguments | |
//COUNT_ARGS :: ... -> Int | |
#define COUNT_ARGS(...) COUNT_ARGS_(,##__VA_ARGS__,6,5,4,3,2,1,0) | |
#define COUNT_ARGS_(z,a,b,c,d,e,f,cnt,...) cnt |
/* | |
* Random-Number Utilities (randutil) | |
* Addresses common issues with C++11 random number generation. | |
* Makes good seeding easier, and makes using RNGs easy while retaining | |
* all the power. | |
* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2015-2022 Melissa E. O'Neill | |
* |
Memory Optimization (Christer Ericson, GDC 2003)
http://realtimecollisiondetection.net/pubs/GDC03_Ericson_Memory_Optimization.ppt
Cache coherency primer (Fabian Giesen)
https://fgiesen.wordpress.com/2014/07/07/cache-coherency/
Code Clinic 2015: How to Write Code the Compiler Can Actually Optimize (Mike Acton)
http://gdcvault.com/play/1021866/Code-Clinic-2015-How-to
There is sometimes a situation in which one needs to get the relative offset of a structure field, common examples of this include serialization frameworks which aid to serialize objects, vertex attributes for rendering (D3D, GL.), etc.
The most common technique for getting this information is through the offsetof
macro defined in stddef.h
. Unfortunately using the macro in C++ comes with a
new set of restrictions that prevent some (subjectively valid) uses of it.
I'm assuming you are familiar with symbol servers - you might not have one set up yourself for your own projects, but you probably use Microsoft's public symbol server for downloading symbols for system DLLs.
For your own projects it might be useful to set up a symbol server - I won't go into how you do that here since it's well documented elsewhere, but basically you just set up a folder somewhere - say X:\symbols\ or \servername\symbols or even http://servername.foo/symbols/ which has a defined tree structure:
symbols/
symbols/mymodule.pdb/
symbols/mymodule.pdb/123456789012345678901234567890122/
/* | |
* Author: David Robert Nadeau | |
* Site: http://NadeauSoftware.com/ | |
* License: Creative Commons Attribution 3.0 Unported License | |
* http://creativecommons.org/licenses/by/3.0/deed.en_US | |
*/ | |
#if defined(_WIN32) | |
#include <Windows.h> | |
#elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__)) |
These commands are based on a askubuntu answer http://askubuntu.com/a/581497 | |
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below. | |
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING. | |
ABSOLUTELY NO WARRANTY. | |
If you are still reading let's carry on with the code. | |
sudo apt-get update && \ | |
sudo apt-get install build-essential software-properties-common -y && \ | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ |