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
#ifndef _DCT_WEAK_H | |
#define _DCT_WEAK_H | |
// Macros for portable support of notionally weak properties with ARC | |
// Forked from https://gist.github.com/1354106 | |
// Updated by Rowan James | |
// Available at https://gist.github.com/1530868 | |
// Defines: | |
// dct_weak to be used as a replacement for the 'weak' keyword: | |
// @property (dct_weak) NSObject* propertyName; |
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
([+-])?(0|[1-9][0-9]*)(?:\.([0-9]+))?(?:[Ee]([+-])?(0|[1-9][0-9]*)(?:\.([0-9]+))?)? |
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
#import <iostream> | |
struct Octree { | |
Octree() : index(created++){} | |
void print_index() | |
{ | |
std::cout << "print_index() " << index << std::endl; | |
} | |
int index; | |
static int created; |
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
// istreamLikeClass is | |
boost::iostreams::filtering_streambuf<boost::iostreams::input> in; | |
boost::iostreams::gzip_decompressor decompressor; | |
in.push(decompressor); | |
in.push(is); | |
stringstream ss (stringstream::in | stringstream::out); |
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
struct Base{virtual ~Base(){}; int x;}; | |
struct Derived : public Base {int y;}; | |
#import <boost/pool/object_pool.hpp> | |
namespace pools | |
{ | |
boost::object_pool<Base> Base; | |
boost::object_pool<Derived> Derived; | |
} |
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
struct Base{virtual ~Base(){}; int x;}; | |
struct Derived : public Base {int y;}; | |
#import <boost/pool/pool_alloc.hpp> | |
template <typename T> | |
T* construct() | |
{ | |
T* result = reinterpret_cast<T*>(boost::pool_allocator<Base>::pool_allocator::allocate(sizeof (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 <iostream> | |
using namespace std; | |
// #include <some header> | |
void foo(int x, int y); | |
// but we always use y = 2 with foo | |
void foo(int x, int y = 2); | |
int main() |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1"> | |
<title></title> | |
<meta name="notebook-annotation-version" content="2"> | |
<style type="text/css">.page { | |
/* PAGE BACKGROUND */ | |
background: white; | |
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
local xcCLANG = [ SHELL "xcrun -sdk iphoneos -f clang" ] ; | |
local CLANG = [ MATCH "([^ | |
]*)" : $(xcCLANG) ] ; | |
ECHO "CLANG = $(CLANG)" ; | |
local xcDEVDIR = [ SHELL "xcode-select --print-path" ] ; | |
local DEVDIR = [ MATCH "([^ | |
]*)" : $(xcDEVDIR) ] ; | |
ECHO "DEVDIR = $(DEVDIR)" ; |
OlderNewer