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 your class here | |
#include <iostream> | |
#include <sstream> | |
#include <string> | |
void unless( const bool condition, const std::string& error ) | |
{ | |
if( !condition ) | |
{ |
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
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, |
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
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 |
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 "astar.hpp" | |
#include "vector.hpp" | |
#include <algorithm> | |
#include <iterator> | |
#include <vector> | |
#include <queue> | |
#include <cassert> | |
using Index = int; |
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
-##- -##- -##- -##- -##- -##- -##- -##- -##- | |
-##- -##- -##- -##--##- -##--##- | |
-##- -##- -##- -##- | |
-##- -##--##- -##- -##- -##- -##- | |
-##- -##- -##--##- -##--##- -##- -##- | |
-##- -##- -##- -##- -##- -##- | |
-##- -##--##--##- -##- -##- | |
-##- -##--##--##- -##- -##--##- -##- | |
-##- -##- -##- -##- -##- -##- | |
-##- -##- -##- |
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
#pragma once | |
#include <cstddef> | |
#include <cctype> | |
#include <algorithm> | |
#include <istream> | |
#include <streambuf> | |
#include <utility> | |
#include "gsl.h" |
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
#pragma once | |
#include <array> | |
#include <utility> | |
#include <cassert> | |
#include <cstddef> | |
#include <algorithm> | |
#include "qcommon/q_platform.h" |
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
/* | |
main = interact(decode tail(lines) ctree . head . lines) | |
-- the parens here are misleading, this is really just: | |
main = interact(decode tail lines ctree . head . lines) | |
-- which comes down to this due to operator precedence: | |
main = interact((decode tail lines ctree) . head . lines) | |
*/ | |
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
module Main( main ) where | |
data PolishElement = PolishPlus | PolishNumber Integer deriving (Show) | |
polish :: [PolishElement] -> (Integer, [PolishElement]) | |
polish (PolishNumber x : tail) = (x, tail) | |
polish (PolishPlus : tail) = (x + y, tail'') | |
where | |
(x, tail') = polish tail | |
(y, tail'') = polish tail' |
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
module Main where | |
main :: IO () | |
main = interact $ \ input -> | |
let (serializedTree:encodedMessages) = lines input | |
tree = deserialize serializedTree | |
messages = map (decode tree) encodedMessages in | |
unlines messages | |
data PrefixTree = Leaf Char | Node PrefixTree PrefixTree |