Skip to content

Instantly share code, notes, and snippets.

grabougrabou
#include <boost/spirit/include/classic_core.hpp>
#include <boost/spirit/include/classic_file_iterator.hpp>
#include <boost/spirit/include/classic_push_back_actor.hpp>
#include <iostream>
using namespace BOOST_SPIRIT_CLASSIC_NS;
int main(int, char**)
{
@Tristramg
Tristramg / main.cc
Created November 10, 2010 10:27 — forked from anonymous/main.cc
/*
* main.cc
*
* Created on: Nov 9, 2010
* Author: julien
*/
#include <iostream>
#include "memory/trail_impl.hh"
#include "memory/restorable_impl.hh"
#include <vector>
class Foo {
template<class Type> std::vector<Type> get(){ throw "vtff";}
template<> std::vector<int> get(){std::vector<int> val; val.push_back(42); return val;}
}
void main(int, char**) {
Foo f;
std::cout << f.get<int>()[0] << std::endl;
#pragma once
/** Allows to relationalish queries on any datastructure stored in std::vector
*
* We use vocabulary form relationnal databases, however the querying and indexing possibilities
* are rather poor compared to a real DB
*
* The user must define the datastructures he want to use: struct City {std::string name; int population;}
* and store them in std::vectors
*
for i in range(6, len(l) - 1):
current_node = nodes_map[l[0]][l[i]]
self.session.add(PT_Edge(prev_stop, current_node, 0, departure, departure + tps_moyen, 0, 'Metro', str(lines_count)))
prev_stop = current_node
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/phoenix_operator.hpp>
#include <iostream>
using namespace boost::spirit::qi;
using namespace boost::phoenix;
typedef std::string::iterator Iterator;
int main(int, char**){
int year, month, day;
rule<Iterator> date = int_[ref(day) = _1] >> '/'
>> int_[ref(month) = _1] >> '/'
#pragma once
#include <string>
/** Classe permettant la reflexion des données */
/// Énumération des attributs que l'on souhaite pouvoir accéder
enum member_e {
id,
idx,
max = 99
nb = 64
str = ""
sum = 0
(nb-1).times do
i = (rand * max).floor
sum += i
str += i.to_s + " "
end
to_reach = (sum.to_f/(nb-1)).ceil * nb
function GetEasterDateByYear(pi_year : Integer) : TDateTime;
var
Y,G,C,X,Z,D,E,N,P,J,M : Integer;
begin
{Algorithme valable pour les dates comprises entre 1583 et 4099}
Y := pi_year;
G := (Y mod 19) + 1;
C := Trunc((Y/100)) + 1;
X := Trunc(3 * C / 4) - 12;
Z := Trunc(((8 * C) + 5) / 25) - 5;