Skip to content

Instantly share code, notes, and snippets.

// include your class here
#include <iostream>
#include <sstream>
#include <string>
void unless( const bool condition, const std::string& error )
{
if( !condition )
{
BOOST_AUTO_TEST_CASE( call_and_return_factorial )
{
auto code = create_code_segment(
// stack: [-4: n] (supplied by executor)
opcode::relative_load_stack, std::uint32_t( 4 ), std::int32_t( -4 ),
// stack: [-8: n (return value memory, to be overwritten)] [-4: n]
// result = factorial( n )
opcode::call, label_reference( "factorial" ),
// stack: [factorial( n )]
opcode::exit,
3>P:\Programming\Libraries\boost_1_58_0\boost/variant/variant.hpp(978): error C3066: there are multiple ways that an object of this type can be called with these arguments
3> P:\Programming\Libraries\perseus\code\src\executable\perseus_print.cpp(37): note: could be 'void print_visitor::operator ()(const perseus::detail::ast::void_expression &) const'
3> P:\Programming\Libraries\perseus\code\src\executable\perseus_print.cpp(42): note: or 'void print_visitor::operator ()(const perseus::detail::ast::string_literal &) const'
3> P:\Programming\Libraries\perseus\code\src\executable\perseus_print.cpp(47): note: or 'void print_visitor::operator ()(uint32_t) const'
3> P:\Programming\Libraries\perseus\code\src\executable\perseus_print.cpp(52): note: or 'void print_visitor::operator ()(bool) const'
3> P:\Programming\Libraries\perseus\code\src\executable\perseus_print.cpp(57): note: or 'void print_visitor::operator ()(const perseus::detail::ast::identifier &) const'
3> P:\Programming\Librari
@mrwonko
mrwonko / Jedi Academy and mods.game
Created May 3, 2012 19:32
GTK Radiant Jedi Academy settings
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<game
name="Jedi Knight Jedi Academy"
enginepath_win32="D:/Modding/JKA/GameData"
gametools_win32="D:/Modding/JKA/GameData/ZeroRadiant"
engine_win32="jasp.exe"
mp_engine_win32="jamp.exe"
basegame="base"
shaderpath="shaders"
default_scale="0.25"
@mrwonko
mrwonko / dxdiag.txt
Created May 9, 2012 22:25
Result of DxDiag on my PC
------------------
System Information
------------------
Time of this report: 5/10/2012, 00:20:57
Machine name: WILLI-SEVEN
Operating System: Windows 7 Professional 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.120305-1505)
Language: German (Regional Setting: German)
System Manufacturer: Gigabyte Technology Co., Ltd.
System Model: EP35-DS3
BIOS: Award Modular BIOS v6.00PG
@mrwonko
mrwonko / ScrnSrt.asm
Created May 15, 2012 10:47
Assembler Project 05 - sorting the screen buffer
DOSSEG
.MODEL MEDIUM ; 1x Data, Nx Code
.STACK
; Exportierte Symbole
PUBLIC Sortiere
PUBLIC Save
PUBLIC Restore
@mrwonko
mrwonko / layout_main.lua
Created May 25, 2012 09:22
Draft of my UI definitions
-- main menu layout:
-- title on top, buttons below
local margin = width * 0.05
local titleHeight = 100
local menuWidth = 400
Layout
{
name = "main",
@mrwonko
mrwonko / template.cpp
Created May 25, 2012 19:49
function pointer template
template<const std::vector<std::string> (*function)(const std::string&)> luabind::object StringVectorAsTable(const std::string& argument, lua_State* L)
{
luabind::object result = luabind::newtable(L);
std::vector<std::string> vec = function(argument);
std::vector<std::string>::iterator end = vec.end();
unsigned int index = 0;
for(std::vector<std::string>::iterator it = vec.begin(); it != end; ++it)
{
result[++index] = *it;
}
@mrwonko
mrwonko / wizualize.cpp
Created June 27, 2012 14:44
FH-Wedel Programmierwettbewerb 2012 - creating TGAs based on program output
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
void printUsage()
{
std::cout<<"Usage: echo [data] | yourProgram | wizualize <width (= height)> <output directory>"<<std::endl;
}
#include "astar.hpp"
#include "vector.hpp"
#include <algorithm>
#include <iterator>
#include <vector>
#include <queue>
#include <cassert>
using Index = int;