Skip to content

Instantly share code, notes, and snippets.

@floli
floli / importer.py
Created May 6, 2019 12:46
Beancount Importer for 1822direkt files
__license__ = "GNU GPLv3"
import argparse, csv, datetime, hashlib, re, tempfile
from os import path
import beancount as bc
import beancount.loader, beancount.parser
from beancount.core.number import D
from beancount.core import data
#define BOOST_ALL_DYN_LINK
#include <string>
#include <functional>
#include <iostream>
#include <boost/uuid/name_generator.hpp>
#include <boost/uuid/string_generator.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <boost/filesystem.hpp>
florian@horus ~/software/borgmatic (git)-[master] % pytest -k "test_check_archives_calls_borg_with_parameters"
============================================================================================================================ test session starts =============================================================================================================================
platform linux -- Python 3.6.5, pytest-3.6.2, py-1.5.4, pluggy-0.6.0
rootdir: /home/florian/software/borgmatic, inifile:
plugins: cov-2.5.1
collected 170 items / 166 deselected
borgmatic/tests/unit/borg/test_check.py FFFF
void requestConnection(std::string const &nameAcceptor,
std::string const &nameRequester,
std::set<int> const &acceptorRanks,
int requesterRank)
{
boost::asio::ip::tcp::resolver resolver(*_ioService);
for (auto const & acceptorRank : acceptorRanks) {
try {
@floli
floli / mpitest.cpp
Created February 19, 2018 09:09
Invalid read problem
// Compile and test with: mpicxx -std=c++11 -g -O0 mpitest.cpp && LD_PRELOAD=/usr/lib/valgrind/libmpiwrap-amd64-linux.so mpirun -n 1 valgrind --read-var-info=yes --leak-check=full ./a.out
#include <vector>
#include <iostream>
#include <mpi.h>
using namespace std;
struct MPI_EventData
@floli
floli / gist:5f2a00c38686e379ef7a99c5d79cf72d
Created February 19, 2018 09:08
Invalid read problem
// Compile and test with: mpicxx -std=c++11 -g -O0 mpitest.cpp && LD_PRELOAD=/usr/lib/valgrind/libmpiwrap-amd64-linux.so mpirun -n 1 valgrind --read-var-info=yes --leak-check=full ./a.out
#include <vector>
#include <iostream>
#include <mpi.h>
using namespace std;
struct MPI_EventData
@floli
floli / mpitest.cpp
Created February 14, 2018 13:08
MPI_ERR_TRUNCATE in MPI_Unpack
#include <vector>
#include <mpi.h>
int main(int argc, char *argv[])
{
MPI_Init(&argc, &argv);
{
MPI_Request req1, req2;
std::vector<int> vec = {1, 2, 3};
int packSize = sizeof(int) * vec.size();