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
var gulp = require('gulp'); | |
var gutil = require('gulp-util'); | |
var through = require('through2'); | |
/* Wrap the content of text files into CommonJS modules exporting that content as JS strings. | |
*/ | |
function textFileToCommonJS(filename, options) { | |
var lines = []; | |
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 <iostream> | |
using namespace std; | |
int | |
main (int argc, char *argv[]) | |
{ | |
cout << "Press ENTER to continue....." << endl << endl; | |
cin.ignore(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
#include <iostream> | |
/*======================================================================= | |
* ASPECT COMPOSITION | |
*======================================================================*/ | |
template<class Parent> | |
struct Nil_aspect: public Parent | |
{ | |
void tell() {} // no-op, and ends the chain |
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 <iostream> | |
/*======================================================================= | |
* ASPECT COMPOSITION | |
*======================================================================*/ | |
/* This is the base class to be specialized via CRTP. | |
* | |
* It must provide all the methods that aspects can override as no-ops. | |
*/ |
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
/* | |
* Find next NAL unit from the specified H.264 bitstream data. | |
*/ | |
static auto find_next_nal_unit(const uint8_t *start, const uint8_t *end) -> const uint8_t * | |
{ | |
const uint8_t *p = start; | |
/* Simply lookup "0x000001" pattern */ | |
while (p <= end - 3 && (p[0] || p[1] || p[2] != 1)) | |
++p; |
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
/* Example class for rendering a rectangle using OpenGL 4, using a vertex buffer and a | |
* vertex array object and the triangle strip primitive. | |
* | |
* Note: GL calls are wrapped into a variadic macro of the form GL(func, arg1, arg2,...). | |
*/ | |
class opengl_rectangle { | |
public: | |
void get_resources() |
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
ifstream ifs; | |
ofstream ofs; | |
istream *is = nullptr; | |
ostream *os = nullptr; | |
if (!input_file.empty()) { | |
ios_base::sync_with_stdio(false); | |
ifs.open(input_file, ios::binary); | |
is = &ifs; | |
} |
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
using namespace std; | |
ifstream fs(filename); | |
string s; | |
fs.seekg(0, ios::end); | |
s.reserve( (size_t) fs.tellg() ); | |
fs.seekg(0, ios::beg); | |
s.assign( istreambuf_iterator<char>(fs), istreambuf_iterator<char>() ); |
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
static const std::string | |
getWindowsErrorString(int err = 0) | |
{ | |
LPSTR s; | |
if (err == 0) err = GetLastError(); | |
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, | |
NULL, | |
err, |
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
{ | |
'targets': [ | |
{ | |
'target_name': 'lsexcel_node', | |
'include_dirs': [ 'support/' ], | |
'sources': [ 'bindings.cc', 'support/utils.cc' ], | |
'configurations': { | |
'Debug': { | |
'msvs_settings': { | |
'VCLinkerTool': { |
OlderNewer