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
NSString* file = [[NSString alloc] initWithUTF8String:pth.c_str()]; | |
CGImageRef image = [UIImage imageWithContentsOfFile:file].CGImage; | |
[file release]; | |
m_width = CGImageGetWidth(image); | |
m_height = CGImageGetHeight(image); | |
m_poww = std::max<int>(math::high_pow2(m_width), 16); | |
m_powh = std::max<int>(math::high_pow2(m_height), 16); | |
int pitch = m_poww * 4; |
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
#!/bin/bash | |
# apply | |
codesign -f -s "iPhone Developer" -v MyApp.app | |
# check it | |
codesign -d --entitlements - MyApp.app |
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 <future> | |
class wait_event | |
{ | |
std::condition_variable cond; | |
std::mutex m; | |
public: | |
void signal() | |
{ | |
std::lock_guard<std::mutex> lock(m); |
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
// Dr. Dobb's | |
// Generalizing Observer By Herb Sutter | |
// http://www.drdobbs.com/cpp/generalizing-observer/184403873 | |
// | |
#pragma once | |
#include <list> | |
#include <functional> |
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
std::string string_format(const char* s, ...) | |
{ | |
va_list args; | |
va_start(args, s); | |
std::string result; | |
int len = vsnprintf(nullptr, 0, s, args); | |
if (len > 0) | |
{ |
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
git config --global push.default tracking |
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
git config --global merge.tool p4merge | |
git config --global mergetool.p4merge.trustExitCode false | |
git config --global diff.tool p4merge |
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
<Reference Include="MonoMac" Condition="'$(Configuration)'=='DebugMono'" /> | |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Mono|AnyCPU' "> | |
<DefineConstants>PLATFORM_MONO</DefineConstants> | |
<PropertyGroup /> |
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
#!/bin/bash | |
if [-z "$1" ]; then | |
BASE_PATH=. | |
else | |
BASE_PATH=$1 | |
fi | |
if [-z "$2" ]; then | |
FILTER_EXT=* |
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
class AsyncProcess(object): | |
def __init__(self, arg_list, env, listener, | |
# .... (removed) code | |
# Hide the console window on Windows | |
startupinfo = None | |
if os.name == "nt": | |
startupinfo = subprocess.STARTUPINFO() | |
# comment line below to enable GUI processes |
OlderNewer