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
/*! | |
**@file tuple.h | |
**@author Matthieu Garrigues <matthieu.garrigues@gmail.com> | |
**@date Thu Sep 15 17:07:34 2011 | |
** | |
**@brief C++ tuple implementation. Maximum number of arguments is 6. | |
** Features: | |
** - tuple<...>::get<N>(); returns the N'th element of the tuple. | |
** - Map tuple members to a function call: | |
** float fun(float a, int b); |
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
auto factory = sqlite_connection_factory("database.db"); | |
auto c = factory.instantiate(); |
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 <iostream> | |
#include <cstring> | |
double get_time() | |
{ | |
timespec ts; | |
clock_gettime(CLOCK_REALTIME, &ts); | |
return double(ts.tv_sec) + double(ts.tv_nsec) / 1000000000.; | |
} |
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 <cassert> | |
// Return R | |
template <typename R, typename A, int (A::*)() const> | |
struct first | |
{ | |
typedef R ret; | |
}; |
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
/*! | |
**\file main.cc | |
**\author Matthieu Garrigues <matthieu.garrigues@googglemail.com> | |
**\date Sat Jun 11 13:53:44 2011 | |
** | |
**\brief Solution of Code of Duty 2011 | |
** | |
** | |
*/ |
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
GET / _set_person / _id[int()] | |
* get_parameter(_name = string()) | |
* post_parameter(_city = string()) = | |
[] (auto p) { | |
cout << " id = " << p.id | |
<< " name = " << p.name | |
<< " city = " << p.city; | |
} |
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 <typename I, typename O> | |
void erode(const I& img, O& out) | |
{ | |
auto win = make_array(vint2{-4, 0}, vint2{-3, 0}, vint2{-2, 0}, vint2{-1, 0}, | |
vint2{ 1, 0}, vint2{ 2, 0}, vint2{ 3, 0}, vint2{ 4, 0}, | |
vint2{0, -7}, vint2{0, -6}, vint2{0, -5}, vint2{0, -4}, vint2{0, -3}, vint2{0, -2}, vint2{0, -1}, | |
vint2{0, 1}, vint2{0, 2}, vint2{0, 3}, vint2{0, 4}, vint2{0, 5}, vint2{0, 6}, vint2{0, 7}); | |
auto nbh = const_box_nbh2d<typename I::value_type, 9, 15>(img); |
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
// The preprocessor transforms this file: | |
#include <iod/symbol.hh> | |
int main() | |
{ | |
@test; | |
} | |
// Into: |
NewerOlder