Skip to content

Instantly share code, notes, and snippets.

View hadronized's full-sized avatar
🐺
Oublie qu’t’as aucune chance, va-y, fonce.

Dimitri Sabadie hadronized

🐺
Oublie qu’t’as aucune chance, va-y, fonce.
View GitHub Profile
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)
@hadronized
hadronized / Camera.hs
Last active August 29, 2015 14:17
Netwire camera example
{-# 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 )
struct Widget {
virtual ~Widget();
virtual void foo() = 0;
};
class Label : public Widget {
std::string _value;
public:
# 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
#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>
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);
}
}
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;
}
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) :
aiString str;
std::for_each(_pScene->mMaterials, _pScene->mMaterials+_pScene->mNumMaterials, [&](aiMaterial *pMat) {
pMat->Get(AI_MATKEY_NAME, str);
cout << str.data << endl;
});
#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;