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
#pragma once | |
#include <utility> | |
// varidic max, min, and minmax implementation (named maximum, minimum and min_max to avoid confusion) | |
// no support for custom comparators (mainly because i'm not sure how they should be specified) | |
namespace detail { | |
// max base case | |
template <class T> |
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 <lua.h> | |
#include <lauxlib.h> | |
#include <lualib.h> | |
#include <stdlib.h> | |
int map_create(lua_State *lua); | |
int map_slice(lua_State *lua); | |
int main(int argc, char **argv){ | |
lua_State *lua = lua_open(); |
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
// lib /def:user32.def | |
// cl /O2 test.cpp /link user32.lib | |
#include <Windows.h> | |
#include <stdio.h> | |
struct PrecisionTouchPadConfig { | |
BYTE LegacyParams[3]; | |
BOOL LoadedSettings; | |
// 0: No delay (always on) |
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
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
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
/*============================================================================ | |
NVIDIA FXAA 3.11 by TIMOTHY LOTTES | |
------------------------------------------------------------------------------ | |
COPYRIGHT (C) 2010, 2011 NVIDIA CORPORATION. ALL RIGHTS RESERVED. | |
------------------------------------------------------------------------------ | |
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED |
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
// Modified version of a tilt shift shader from Martin Jonasson (http://grapefrukt.com/) | |
// Read http://notes.underscorediscovery.com/ for context on shaders and this file | |
// License : MIT | |
uniform sampler2D tex0; | |
varying vec2 tcoord; | |
varying vec4 color; | |
/* | |
Take note that blurring in a single pass (the two for loops below) is more expensive than separating |
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
------------------------------------------------------------------------ | |
Memory Allocator perfomance benchmark | |
------------------------------------------------------------------------ | |
local_n = n threads allocating and deallocating random blocks of max | |
size. Deallocations always happening in the same thread that | |
the corresponding allocation. | |
share_n = n threads allocating and deallocating random blocks of max | |
size from a shared list. Deallocation may happen in different | |
thread that the allocation one |
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
/* | |
Check SSE/AVX support. | |
This application can detect the instruction support of | |
SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4a, SSE5, and AVX. | |
*/ | |
#include <iostream> | |
#ifdef _MSC_VER | |
#include <intrin.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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <netinet/tcp.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <netinet/in.h> |