This file contains hidden or 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 Test where | |
import Control.Monad.Trans | |
import Control.Monad.Trans.Reader | |
data Env = Env { | |
-- |A very important value. | |
important :: Int | |
-- |A less important value. | |
, notImportant :: Float |
This file contains hidden or 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
cabal info time | |
* time (library) | |
Synopsis: A time library | |
Versions available: 1.1.4, 1.2, 1.2.0.4, 1.2.0.5, 1.3, 1.4, 1.4.0.1, | |
1.4.0.2, 1.4.1 (and 10 others) | |
Versions installed: 1.4.0.1, 1.4.1 | |
Homepage: http://semantic.org/TimeLib/ | |
Bug reports: [ Not specified ] | |
Description: A time library | |
Category: System |
This file contains hidden or 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
import Control.Monad | |
import Data.Bool | |
import Data.Functor | |
import System.Environment | |
import System.IO | |
data Token | |
= Section String | |
| Attribute String String | |
| Undefined |
This file contains hidden or 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
import Prelude | |
import Control.Monad.Writer | |
import System.IO | |
type Foo a = Writer [String] a | |
type Bar = Foo Int | |
logNumber :: Int -> Bar | |
logNumber a = writer (a,["Got " ++ show a]) |
This file contains hidden or 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
vec3 get_co() { | |
vec2 uv = gl_FragCoord.xy*res.zw; | |
/* vec4 p = inverse(proj) * vec4(2. * vec3(uv, texture(depthmap, uv).r) - 1., 1.); */ | |
vec4 p = inverse(view) * inverse(proj) * vec4(2. * vec3(uv, texture(depthmap, uv).r) - 1., 1.); | |
/* OU MIEUX */ | |
vec4 p = inverse(proj * view) * vec4(2. * vec3(uv, texture(depthmap, uv).r) - 1., 1.); | |
return p.xyz/p.w; | |
} |
This file contains hidden or 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> | |
using namespace std; | |
class Base { | |
protected : | |
virtual void foo(void) const { | |
cout << "in the base class" << endl; | |
} |
This file contains hidden or 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
class Foo { | |
double _; | |
public : | |
Foo(void) : _(0.) { | |
} | |
~Foo(void) = default; | |
}; |
This file contains hidden or 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 <sstream> /* pour std::stringstream */ | |
/* dans ta fonction */ | |
std::stringstream sstr; | |
int a = 45; | |
sstr << a << " hello world! " << 674.46f; | |
auto str = sstr.str(); /* chaine qui contient "45 hello worlds 674.46f" |
This file contains hidden or 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 T_> | |
struct foo_trait { | |
typedef T type; | |
typedef T* pointer; | |
typedef T& ref; | |
typedef T&& rvref; | |
}; | |
/* compile */ | |
foo_trait<int>::pointer a = nullptr; |
This file contains hidden or 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
frag = texture2D(offtex, uv) | |
+ texture2D(offtex, vec2(uv.x-0.1, uv.y)) | |
+ texture2D(offtex, vec2(uv.x+0.1, uv.y)); | |
frag /= 3; |