Skip to content

Instantly share code, notes, and snippets.

View zzxx-husky's full-sized avatar
🤦‍♂️
Ding Ding Ding

zzxx zzxx-husky

🤦‍♂️
Ding Ding Ding
  • CUHK
  • HK
View GitHub Profile
@zzxx-husky
zzxx-husky / SubgraphDAG.dot
Created August 17, 2020 19:32
The Problematic DOT File
digraph plan_v1 {
// rankdir=LR // uncommenting this line may help converting the dot to png but the png may not look nice.
// comment all the `rank=same` in this file will help converting the dot to png.
compound=true
subgraph cluster28 {
color=black // not query
shape=box
penwidth=3
label="id: 28\ndag id: 0\ncardinality: 100"
{
@zzxx-husky
zzxx-husky / application.cpp
Last active December 18, 2018 08:55
Minor Update
#include "statistic_monitor.hpp"
#include "cassert"
#include "caf/all.hpp"
#include "caf/io/all.hpp"
using namespace caf;
using namespace chrono;
using namespace literals;
string self_host;
#include <thread>
#include <chrono>
#include <functional>
#include <iostream>
template<typename I>
class StatisticMonitor {
public:
typedef std::function<I()> Watcher;
@zzxx-husky
zzxx-husky / master.cpp
Created April 19, 2018 12:41
An example to send messages among actors on different actor systems
#include "caf/all.hpp"
#include "caf/io/middleman.hpp"
using namespace caf;
class Master : public caf::event_based_actor {
public:
caf::actor inner;
Master(caf::actor_config &cfg, caf::actor inner) : event_based_actor(cfg) {
@zzxx-husky
zzxx-husky / master.cpp
Last active March 7, 2018 09:49
An example to send an vector from one machine to another in CAF
#include <vector>
#include "caf/all.hpp"
//template<typename Inspect, typename T>
//typename Inspect::type_name inspect(Inspect &ins, std::vector<T> &vec) {
// return ins(caf::meta::type_name("vector"), vec);
//};
#include "caf/io/all.hpp"
class DQN(DQNBase):
def __init__(self):
self.k = HP['frame_skipping']
def initialState(self):
states = []
obs = self.env.reset()
obs = self.model.preprocess(obs)
for _ in range(HP['stacked_frame_size']):
states.append(obs)