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 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
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
import Control.Monad
import Data.Bool
import Data.Functor
import System.Environment
import System.IO
data Token
= Section String
| Attribute String String
| Undefined
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])
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;
}
#include <iostream>
using namespace std;
class Base {
protected :
virtual void foo(void) const {
cout << "in the base class" << endl;
}
class Foo {
double _;
public :
Foo(void) : _(0.) {
}
~Foo(void) = default;
};
#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"
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;
frag = texture2D(offtex, uv)
+ texture2D(offtex, vec2(uv.x-0.1, uv.y))
+ texture2D(offtex, vec2(uv.x+0.1, uv.y));
frag /= 3;