This file contains hidden or 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> | |
//int a = 0; | |
template <typename T, T /*unnamed*/> | |
struct nnb_ForceInit { }; | |
template< | |
class T | |
> |
This file contains hidden or 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> | |
template<typename Owner, typename MemType> | |
struct Attr { | |
typedef int Owner::*MemPtr; | |
MemPtr ptr; | |
Attr() {} | |
void Bind(MemPtr memptr) { |
This file contains hidden or 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
apk update | |
apk add virtualbox-guest-additions virtualbox-guest-modules-virthardened | |
# auto load vboxsf kernel module | |
echo vboxsf > /etc/modules-load.d/vboxsf.conf | |
reboot |
This file contains hidden or 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
struct FCustomUtils | |
{ | |
static void OrthoNormalize(FVector& Normal, FVector& Tangent) | |
{ | |
Normal = Normal.GetUnsafeNormal(); | |
Tangent = Tangent - (Normal * FVector::DotProduct(Tangent, Normal)); | |
Tangent = Tangent.GetUnsafeNormal(); | |
} | |
} |
This file contains hidden or 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
LCtrl & LShift:: | |
Send {RShift down} | |
Send {Home down} | |
Sleep 30 | |
Send {Home up} | |
Send {RShift up} |
This file contains hidden or 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
// view the assembly output in https://goo.gl/VEyRNK or https://gcc.godbolt.org/# | |
#include <iostream> | |
using namespace std; | |
struct Array | |
{ | |
template<typename T, int N> | |
struct Elem | |
{ |
This file contains hidden or 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
def readLocalProp () { | |
Properties properties = new Properties() | |
properties.load(project.rootProject.file('local.properties').newDataInputStream()) | |
return properties | |
} | |
def invokeNDKBuild (debuggable, cleaning) { | |
def properties = readLocalProp() | |
def ndkDir = properties.getProperty('ndk.dir') | |
def osName = System.getProperty('os.name').toLowerCase() |
This file contains hidden or 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
For rooted devices running a custom recovery: | |
- reboot to recovery | |
- find the mount system and check it | |
- open a terminal and type: adb shell | |
- type: chmod 4750 /system/bin/run-as | |
- uncheck the System mount and reboot! |
This file contains hidden or 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
/* | |
Usage example: | |
int a = my_rand(); | |
int b = my_rand(); | |
int c = a + b; | |
doNotOptimizeAway (c); | |
*/ | |
template<class T> | |
inline void doNotOptimizeAway (T&& x) | |
{ |
This file contains hidden or 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
// | |
// extract from http://www.scratchapixel.com/lessons/3d-basic-lessons/lesson-7-intersecting-simple-shapes/ray-box-intersection/ | |
// | |
template<typename T> | |
struct AABB | |
{ | |
Vec3<T> min; | |
Vec3<T> max; | |
bool intersect(const Ray<T> &r) |