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
# Wraps ggsave to produce both light and dark themed plot using ggdark. | |
dark_save <- function(filename, plot, sep = "-", ...) { | |
require(tools) | |
require(ggdark) | |
base <- file_path_sans_ext(filename) | |
ext <- file_ext(filename) | |
base_light <- paste(base, "light", sep = "-") | |
base_dark <- paste(base, "dark", sep = "-") | |
filename_light <- paste(base_light, ext, sep = ".") | |
filename_dark <- paste(base_dark, ext, sep = ".") |
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
let blacklists = ["*://www.inoreader.com/*", "*://mail.google.com/*"] |
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
flexbuffers::Builder& build(flexBuffers::Builder& builder, const data& x) { | |
struct converter { | |
converter(flatbuffers::FlatBufferBuilder& builder) : builder_{builder} { | |
} | |
using result_type = flatbuffers::Offset<detail::Data>; | |
result_type operator()(none) { | |
detail::DataBuilder db{builder_}; | |
return db.Finish(); | |
} | |
result_type operator()(boolean x) { |
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
flexbuffers::Builder& build(flexbuffers::Builder& builder, const data& x) { | |
static auto to_uint = [](auto i) { | |
return static_cast<std::underlying_type_t<detail::DataType>>(i); | |
}; | |
struct converter { | |
converter(flexbuffers::Builder& builder) : builder_{builder} { | |
} | |
void operator()(none) { | |
builder_.UInt(to_uint(detail::DataType::NoneType)); | |
} |
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
#ifndef VAST_FLEXBUFFER_PACKER_HPP | |
#define VAST_FLEXBUFFER_PACKER_HPP | |
#include <caf/deserializer.hpp> | |
#include <caf/serializer.hpp> | |
#include <flatbuffers/flexbuffers.h> | |
#include "vast/chunk.hpp" |
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> | |
#include <iostream> | |
#include <vector> | |
#include <caf/all.hpp> | |
using namespace std; | |
using namespace caf; | |
// The same bot from part one. |
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> | |
#include <iostream> | |
#include <vector> | |
#include <caf/all.hpp> | |
using namespace std; | |
using namespace caf; | |
// Predicate to check whether a particular bot is the puzzle solution. |
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
// --- component setup -------------------------------------------------------- | |
// Creates a broker execution context that encapsulates runtime state, such as | |
// a thread pool and message type information. | |
system sys{cfg}; | |
// Create a broker in a given system. A broker is a thin abstraction on top of | |
// a CAF actor for sending and receiving messages. There exist synchronous and | |
// aysnchronous brokers. | |
async_broker a{sys}; |
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
# California data breach analysis | |
# | |
# Author: Matthias Vallentin <vallentin@icir.org> | |
# Copyright (c) 2016 | |
# | |
# To reproduce, please contact me. | |
library(dplyr) | |
library(ggplot2) | |
library(lubridate) |
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
# Plots GOES-13 Proton Flux for particles >= 10 Mev. | |
# | |
# Data source: ftp://ftp.swpc.noaa.gov/pub/lists/particle/ | |
# | |
# Check out http://stuffin.space to see where GOES-13 flies. | |
library(dplyr) | |
library(tidyr) | |
library(lubridate) | |
library(ggplot2) |
NewerOlder