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 AST where | |
data E a | |
= Var a | |
| Add (E a) (E a) | |
| Sub (E a) (E a) | |
| Mul (E a) (E a) | |
| Div (E a) (E a) | |
deriving (Eq,Show) |
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
{-# LANGUAGE FlexibleContexts, ScopedTypeVariables, TupleSections #-} | |
module Test where | |
import Control.Arrow | |
import qualified Control.Monad as M ( unless ) | |
import Control.Wire | |
import Control.Wire.Unsafe.Event | |
import Data.Foldable ( foldMap, for_ ) | |
import Data.Function ( fix ) |
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 Widget { | |
virtual ~Widget(); | |
virtual void foo() = 0; | |
}; | |
class Label : public Widget { | |
std::string _value; | |
public: |
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
# Skyoralis Static Model file | |
# Version 3.2 | |
# Exported by the Blender script written by Dimitri 'Skypers' Sabadie | |
# Exportation date and time : 16/04/11 18:19:43 | |
# Header | |
hm 3 | |
hv 8 | |
hi 0 12 | |
hi 1 12 |
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 <boost/spirit/include/qi.hpp> | |
#include <boost/spirit/include/qi_grammar.hpp> | |
#include <boost/spirit/include/phoenix_core.hpp> | |
#include <boost/spirit/include/phoenix_operator.hpp> | |
#include <boost/fusion/include/adapt_struct.hpp> | |
#include <algorithm> | |
#include <iostream> | |
#include <string> | |
#include <vector> |
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
char c; | |
for (int r = 0; r < row; ++r) { | |
for (int c = 0; c < col; ++c) { | |
char c = (c+(r%2))%2); | |
case[r][c].Color = Color(c, c, c); | |
} | |
} |
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
bool col; | |
for (int r = 0; r < 10; ++r) { | |
for (int c = 0; c < 10; ++c) { | |
col = (r+c)%2; | |
std::cout << col << ' '; | |
} | |
std::cout << std::endl; | |
} |
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
template <class Format, class Dispatch> | |
mesh<Format, Dispatch>::mesh(std::string const &name) : | |
resource< mesh<Format, Dispatch> >(name), | |
_nbIndices(0) { | |
} | |
// after a base_type idiom ... | |
template <class Format, class Dispatch> | |
mesh<Format, Dispatch>::mesh(std::string const &name) : |
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
aiString str; | |
std::for_each(_pScene->mMaterials, _pScene->mMaterials+_pScene->mNumMaterials, [&](aiMaterial *pMat) { | |
pMat->Get(AI_MATKEY_NAME, str); | |
cout << str.data << endl; | |
}); |
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 <algorithm> | |
#include <iostream> // std::cout / std::endl; | |
using namespace std; | |
int main() { | |
int const values[] = {1, 2, 3, 4, 5}; | |
std::for_each(values, values+5, [](int v) { | |
cout << v << endl; |
OlderNewer