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/sh | |
# Credits for the idea: http://linuxcommando.blogspot.com/2008/06/show-progress-during-dd-copy.html | |
# Written by Louis Delacroix | |
dd if=/dev/zero of=/dev/null bs=512 count=3000000 & | |
PID=$! |
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
/// Current plug-ing system, schematically: | |
std::vector<Block*> BlockCB; // Dirt, Stone, Stairs, Torch, ... | |
PacketHandler::player_does_something() | |
{ | |
int16_t block_type = figureOutAffectedBlockType(); | |
for ( each Block* blockcb in BlockCB) | |
{ |
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
/// Current plug-ing system, schematically: | |
std::vector<Block*> BlockCB; // Dirt, Stone, Stairs, Torch, ... | |
PacketHandler::player_does_something() | |
{ | |
int16_t block_type = figureOutAffectedBlockType(); | |
for ( each Block* blockcb in BlockCB) | |
{ |
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
# Set compiler specific build flags | |
IF (CMAKE_COMPILER_IS_GNUCXX) | |
set(CMAKE_CXX_FLAGS "-W -Wall -Wno-unused -pedantic") | |
set(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG -g") | |
set(CMAKE_CXX_FLAGS_PROFILE "-DDEBUG -g -pg") | |
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -s -DNDEBUG") | |
ENDIF() | |
IF (MSVC_IDE) |
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
if (pos < path.length()) | |
{ | |
try | |
{ | |
out += path.substr(pos); | |
} | |
catch (const std::exception & e) | |
{ | |
std::cerr << "Exception: " << e.what() << std::endl; | |
out = "INVALID_STATE"; |
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 H_PRETTY_PRINT | |
#define H_PRETTY_PRINT | |
#define HAVE_VARIADIC_TEMPLATES 0 | |
#define HAVE_TEMPLATE_ALIASES 0 | |
#include <iostream> | |
#include <iterator> | |
#include <utility> | |
#include <tuple> |
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> | |
#include <vector> | |
#include <unordered_map> | |
#include <map> | |
#include <set> | |
#include <array> | |
#include <tuple> | |
#include <utility> | |
#include <string> | |
#include <sstream> |
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 <png.h> | |
#include <stdio.h> | |
#include <errno.h> | |
#define PNG_SUCCESS 0 | |
#define PNG_ERR_INVALID_HEADER 1 | |
#define PNG_ERR_INIT 2 | |
int read_png(FILE * fp) | |
{ |
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 <vector> | |
#include <string> | |
#include <utility> | |
#include <iostream> | |
template<typename T> | |
struct has_const_iterator | |
{ | |
private: | |
typedef char one; |