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 <vector> | |
struct Node | |
{ | |
bool accessible; | |
int x; | |
int y; | |
int dx; | |
int dy; | |
std::vector<size_t> out_nodes; |
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 <unordered_set> | |
#include <iostream> | |
struct moo{int i;}; | |
int main(int,char**){ | |
moo * m = new moo(); | |
m->i = 8; | |
std::unordered_set<moo*> my_set; | |
my_set.insert(m); | |
std::cout << "Avant " << m->i; | |
std::unordered_set<moo*>::const_iterator it = my_set.find(m); |
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 <geos_c.h> | |
#include <cstdarg> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <cstring> | |
static void notice(const char *fmt, ...) | |
{ | |
std::fprintf( stdout, "NOTICE: "); | |
va_list ap; |
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
for(const StopArea & sa : this->stop_areas){ | |
for(idx_t sp1_idx : sa.stop_point_list){ | |
for(idx_t sp2_idx : sa.stop_point_list){ | |
for(idx_t rp1_idx : stop_points[sp1_idx].route_point_list){ | |
for(idx_t rp2_idx : stop_points[sp2_idx].route_point_list){ | |
if(rp1_idx < rp2_idx){ | |
boost::tie(e, inserted) = boost::add_edge(rp1_idx, rp2_idx, g); | |
if(inserted){ | |
weightmap[e] = (sp1_idx == sp2_idx ? Edge(120, eStopPoint) : Edge(180, eStopArea)); | |
} |
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> | |
int main() | |
{ | |
auto f = [](){ | |
int a = 1; | |
return [a](int x){return a + x;}; | |
}; | |
auto test = f(); |
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 <memory> | |
#include <iostream> | |
int main(int, char**){ | |
std::unique_ptr<int> x(new int(42)); | |
auto y = std::move(x); | |
auto y = x; // compile pas : use of deleted function ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = int, _Dp = std::default_delete<int>, std::unique_ptr<_Tp, _Dp> = std::unique_ptr<int>]’ | |
std::cout << *x << std::endl; | |
} |
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
extern mod core; | |
use core::hashmap::HashMap; | |
use core::hashmap::linear_map_with_capacity; | |
// #[crate_type = "lib"]; | |
trait Graph<Node, Edge> { | |
fn children(&self, Node, &fn(&(Edge, Node)) -> bool); // iterate on outgoing edges | |
} |
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
extern mod core; | |
use core::hash::Hash; | |
use core::hashmap::HashMap; | |
use core::hashmap::linear_map_with_capacity; | |
// #[crate_type = "lib"]; | |
trait Graph<Node, Edge> { | |
fn children(&self, &Node, &fn(&(Node, Edge)) -> bool); // iterate on outgoing edges |
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
extern mod core; | |
use core::hash::Hash; | |
use core::hashmap::HashMap; | |
// #[crate_type = "lib"]; | |
trait Graph<Node, Edge> { | |
fn children(&self, &Node, &fn(&Node, &Edge) -> bool); // iterate on outgoing edges | |
fn add_node(&mut self, Node); |
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
Traceback (most recent call last): | |
File "/home/tristram/workspace/siel/top_block.py", line 178, in <module> | |
tb = top_block() | |
File "/home/tristram/workspace/siel/top_block.py", line 138, in __init__ | |
self.connect((self.band_pass_filter_1, 0), (self.gr_rds_freq_divider_0, 0)) | |
File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/top_block.py", line 130, in connect | |
self._connect(points[i-1], points[i]) | |
File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/top_block.py", line 142, in _connect | |
dst_block.to_basic_block(), dst_port) | |
File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/runtime_swig.py", line 4238, in primitive_connect |