text:
/*
 Copyright (C) 2016 Quaternion Risk Management Ltd
 All rights reserved.

 This file is part of ORE, a free-software/open-source library
 for transparent pricing and risk analysis - http://opensourcerisk.org

 ORE is free software: you can redistribute it and/or modify it
 under the terms of the Modified BSD License.  You should have received a
 copy of the license along with this program.
 The license is also available online at <http://opensourcerisk.org>

 This program is distributed on the basis that it will form a useful
 contribution to risk analytics and model standardisation, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
*/

#include <boost/test/unit_test.hpp>
#include <orea/scenario/aggregationscenariodata.hpp>
#include <oret/toplevelfixture.hpp>
#include <test/oreatoplevelfixture.hpp>

using namespace ore::analytics;
using namespace boost::unit_test_framework;

BOOST_FIXTURE_TEST_SUITE(OREAnalyticsTestSuite, ore::test::OreaTopLevelFixture)

BOOST_AUTO_TEST_SUITE(AggregationScenarioDataTest)

BOOST_AUTO_TEST_CASE(testInMemoryAggregationScenarioData) {
    InMemoryAggregationScenarioData data(3, 5);

    // write data
    BOOST_CHECK_THROW(data.set(3, 0, 0.0, AggregationScenarioDataType::Generic, "blabla"), std::exception);
    BOOST_CHECK_THROW(data.set(0, 5, 0.0, AggregationScenarioDataType::Generic, "blabla"), std::exception);

    for (Size i = 0; i < 3; ++i) {
        for (Size j = 0; j < 5; ++j) {
            data.set(i, j, 0.0001 * i + 0.01 * j, AggregationScenarioDataType::IndexFixing, "OIS_EUR");
            data.set(i, j, 0.1 + 0.0001 * i + 0.01 * j, AggregationScenarioDataType::IndexFixing, "OIS_USD");
            data.set(i, j, 0.2 + 0.0001 * i + 0.01 * j, AggregationScenarioDataType::IndexFixing, "OIS_GBP");
            data.set(i, j, i + 0.1 * j, AggregationScenarioDataType::FXSpot, "EURUSD");
            data.set(i, j, 2.0 + i + 0.1 * j, AggregationScenarioDataType::FXSpot, "EURGBP");
        }
    }

    // read data
    BOOST_CHECK_THROW(data.get(3, 0, AggregationScenarioDataType::Generic, "blabla"), std::exception);
    BOOST_CHECK_THROW(data.get(0, 5, AggregationScenarioDataType::Generic, "blabla"), std::exception);

    Real tol = 1.0E-12;

    for (Size i = 0; i < 3; ++i) {
        for (Size j = 0; j < 5; ++j) {
            BOOST_CHECK_CLOSE(data.get(i, j, AggregationScenarioDataType::IndexFixing, "OIS_EUR"),
                              0.0001 * i + 0.01 * j, tol);
            BOOST_CHECK_CLOSE(data.get(i, j, AggregationScenarioDataType::IndexFixing, "OIS_USD"),
                              0.1 + 0.0001 * i + 0.01 * j, tol);
            BOOST_CHECK_CLOSE(data.get(i, j, AggregationScenarioDataType::IndexFixing, "OIS_GBP"),
                              0.2 + 0.0001 * i + 0.01 * j, tol);
            BOOST_CHECK_CLOSE(data.get(i, j, AggregationScenarioDataType::FXSpot, "EURUSD"), i + 0.1 * j, tol);
            BOOST_CHECK_CLOSE(data.get(i, j, AggregationScenarioDataType::FXSpot, "EURGBP"), 2.0 + i + 0.1 * j, tol);
        }
    }
}

BOOST_AUTO_TEST_SUITE_END()

BOOST_AUTO_TEST_SUITE_END()

ext: cpp

max_stars_repo_name: mrslezak/Engine

max_issues_repo_name: mrslezak/Engine

max_forks_repo_name: mrslezak/Engine


text:
//****************************************************************************
// (c) 2008, 2009 by the openOR Team
//****************************************************************************
// The contents of this file are available under the GPL v2.0 license
// or under the openOR comercial license. see
//   /Doc/openOR_free_license.txt or
//   /Doc/openOR_comercial_license.txt
// for Details.
//****************************************************************************
//! OPENOR_INTERFACE_FILE(Basic)
//****************************************************************************
/**
 * @file
 * @author Christian Winne
 * @ingroup Basic
 */
#ifndef openOR_PropertyAccess_hpp
#define openOR_PropertyAccess_hpp

#include <openOR/Plugin/CreateInterface.hpp>
#include <boost/property_tree/ptree.hpp>

namespace openOR {

   /**
    * \brief interface for loading and saving of the property data
    * @ingroup Basic
    */
   struct Configurable
   {
      virtual void load(const boost::property_tree::ptree& properties) = 0;

      virtual void save(boost::property_tree::ptree& properties) const = 0;
   };

   /**
    * \brief interface for access of the property data of a plugin
    * @ingroup Basic
    */
   struct PropertyAccess : public Configurable
   {

      template<class Type>
      Type get(const std::string& name, const Type& defaultValue) const
      {
         try {
            return get<Type>(name);
         } catch(...) {
            return defaultValue;
         }
      }

      template<class Type>
      Type get(const std::string& name) const
      {
         Type val;
         boost::any any = boost::any(val);
         getProperty(name, any);
         return boost::any_cast<Type>(any);
      }

      template<class Type>
      bool set(const std::string& name, const Type& propertydata)
      {
         try {
            setProperty(name, propertydata);
         } catch(...) {
            return false;
         }
         return true;
      }

   private:

      virtual void setProperty(const std::string& name, const boost::any& propertydata) = 0;
      virtual void getProperty(const std::string& name, boost::any& propertydata) const = 0;
   };

}

OPENOR_CREATE_INTERFACE(openOR::Configurable)
void load(const boost::property_tree::ptree& properties) { adaptee()->load(properties); }
void save(boost::property_tree::ptree& properties) const  { adaptee()->save(properties); }
OPENOR_CREATE_INTERFACE_END

OPENOR_CREATE_INTERFACE(openOR::PropertyAccess)
   void setProperty(const std::string& name, const boost::any& propertydata) { adaptee()->setProperty(name, propertydata); }
   void getProperty(const std::string& name, boost::any& propertydata) const { adaptee()->getProperty(name, propertydata); }
   void load(const boost::property_tree::ptree& properties) { adaptee()->load(properties); }
   void save(boost::property_tree::ptree& properties) const  { adaptee()->save(properties); }
OPENOR_CREATE_INTERFACE_END

#define OPENOR_PROPERTYACCESS_SET_BEGIN                                                         \
virtual void setProperty(const std::string& name, const boost::any& propertydata)               \
{                                                                                \

#define OPENOR_PROPERTYACCESS_SET_ENTRY_EX(namestring, Type, command)                           \
   if (name == namestring)                                                                      \
   {                                                                                \
      const Type* p = boost::any_cast<Type>(&propertydata);                                     \
      const Type& r = *p;                                                                       \
      command;                                                                                \
      return;                                                                                \
   }                                                                                \

#define OPENOR_PROPERTYACCESS_SET_ENTRY(namestring, Type, var) OPENOR_PROPERTYACCESS_SET_ENTRY_EX(namestring, Type, var=r)

#define OPENOR_PROPERTYACCESS_SET_END                                                           \
   throw std::runtime_error(std::string("Could not find property with name") + name);           \
}

#define OPENOR_PROPERTYACCESS_GET_BEGIN                                                         \
virtual void getProperty(const std::string& name, boost::any& propertydata) const               \
{                                                                                \

#define OPENOR_PROPERTYACCESS_GET_ENTRY(namestring, Type, var)                                  \
   if (name == namestring)                                                                      \
   {                                                                                \
      Type* p = boost::any_cast<Type>(&propertydata);                                           \
      *p = var;                                                                                \
      return;                                                                                \
   }                                                                                \

#define OPENOR_PROPERTYACCESS_GET_END                                                           \
   throw std::runtime_error(std::string("Could not find property with name") + name);           \
}

#endif

ext: hpp

max_stars_repo_name: avinfinity/UnmanagedCodeSnippets

max_issues_repo_name: avinfinity/UnmanagedCodeSnippets

max_forks_repo_name: avinfinity/UnmanagedCodeSnippets


text:
//
// Copyright (c) 2018-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Official repository: https://github.com/vinniefalco/BeastLounge
//

#include "listener.hpp"
#include "logger.hpp"
#include "server_certificate.hpp"
#include "service.hpp"
#include "utility.hpp"
#include <boost/beast/core/detect_ssl.hpp>
#include <boost/asio/coroutine.hpp>
#include <boost/container/flat_set.hpp>
#include <boost/make_unique.hpp>
#include <boost/smart_ptr/weak_ptr.hpp>
#include <iostream>
#include <mutex>
#include <vector>

extern
void
run_http_session(
    server& srv,
    listener& lst,
    stream_type stream,
    endpoint_type ep,
    flat_storage storage);

extern
void
run_https_session(
    server& srv,
    listener& lst,
    asio::ssl::context& ctx,
    stream_type stream,
    endpoint_type ep,
    flat_storage storage);

namespace {

// Detects the SSL opening handshake and launches either
// a plain HTTP session or a Secure HTTP session.

class detector
    : public boost::asio::coroutine
    , public session
{
    server& srv_;
    listener& lst_;
    section& log_;
    asio::ssl::context& ctx_;
    stream_type stream_;
    endpoint_type ep_;
    flat_storage storage_;

public:
    detector(
        server& srv,
        listener& lst,
        section& log,
        asio::ssl::context& ctx,
        socket_type sock,
        endpoint_type ep)
        : srv_(srv)
        , lst_(lst)
        , log_(log)
        , ctx_(ctx)
        , stream_(std::move(sock))
        , ep_(ep)
    {
        lst_.insert(this);
    }

    ~detector()
    {
        lst_.erase(this);
    }

    void
    run()
    {
        // Use post to get on to our strand.
        net::post(
            stream_.get_executor(),
            bind_front(this));
    }

    void
    on_stop() override
    {
        net::post(
            stream_.get_executor(),
            bind_front(this, &detector::do_stop));
    }

    void
    do_stop()
    {
        // Cancel pending I/O, this causes an immediate
        // completion with error::operation_aborted.
        stream_.cancel();
    }

#include <boost/asio/yield.hpp>
    void
    operator()(
        beast::error_code ec = {},
        bool is_tls = false)
    {
        reenter(*this)
        {
            // Set the expiration
            stream_.expires_after(
                std::chrono::seconds(30));

            // See if a TLS handshake is requested
            yield beast::async_detect_ssl(
                stream_,
                storage_,
                bind_front(this));

            // Report any error
            if(ec)
                return fail(ec, "async_detect_ssl");

            if(is_tls)
            {
                // launch the HTTPS session
                return run_https_session(
                    srv_, lst_, ctx_,
                    std::move(stream_),
                    ep_,
                    std::move(storage_));
            }
            else
            {
                // launch the plain HTTP session
                return run_http_session(
                    srv_, lst_,
                    std::move(stream_),
                    ep_,
                    std::move(storage_));
            }
        }
    }
#include <boost/asio/unyield.hpp>

    void
    fail(beast::error_code ec, char const* what)
    {
        if(ec == net::error::operation_aborted)
            LOG_TRC(log_, what, '\t', ec.message());
        else
            LOG_INF(log_, what, '\t', ec.message());
    }
};

//------------------------------------------------------------------------------

// Accepts incoming connections and launches the sessions
class listener_impl
    : public boost::asio::coroutine
    , public service
    , public listener
{
    // This hack works around a bug in basic_socket_acceptor
    // which uses the wrong socket type here:
    // https://github.com/boostorg/asio/blob/c7bbd30491c377ebe12f6e33a0992a3280d71fa4/include/boost/asio/detail/reactive_socket_accept_op.hpp#L198

    struct tcp_ex : net::ip::tcp
    {
        tcp_ex(tcp const& t)
            : tcp(t)
        {
        }

        using socket =
            net::basic_stream_socket<
                tcp, executor_type>;
    };

    server& srv_;
    section& log_;
    std::mutex mutex_;
    listener_config cfg_;
    asio::ssl::context ctx_;
    net::basic_socket_acceptor<
        tcp_ex, executor_type> acceptor_;
    boost::container::flat_set<
        session*> sessions_;
    endpoint_type ep_;

public:
    listener_impl(
        server& srv,
        listener_config cfg)
        : srv_(srv)
        , cfg_(std::move(cfg))
        , log_(srv_.log().get_section("listener"))
        , ctx_(asio::ssl::context::tlsv12)
        , acceptor_(srv_.make_executor())
    {
        cfg_.kind = listener_config::allow_tls;

        // This holds the self-signed certificate used by the server
        load_server_certificate(ctx_);
    }

    ~listener_impl()
    {
        BOOST_ASSERT(sessions_.empty());
    }

    bool
    open()
    {
        beast::error_code ec;
        endpoint_type ep(cfg_.address, cfg_.port_num);

        // Open the acceptor
        acceptor_.open(ep.protocol(), ec);
        if(ec)
        {
            srv_.log().cerr() <<
                "acceptor_.open: " << ec.message() << "\n";
            return false;
        }

        // Allow address reuse
        acceptor_.set_option(
            net::socket_base::reuse_address(true));
        if(ec)
        {
            srv_.log().cerr() <<
                "acceptor_.set_option: " << ec.message() << "\n";
            return false;
        }

        // Bind to the server address
        acceptor_.bind(ep, ec);
        if(ec)
        {
            srv_.log().cerr() <<
                "acceptor_.bind: " << ec.message() << "\n";
            return false;
        }

        // Start listening for connections
        acceptor_.listen(
            net::socket_base::max_listen_connections, ec);
        if(ec)
        {
            srv_.log().cerr() <<
                "acceptor_.listen: " << ec.message() << "\n";
            return false;
        }

        return true;
    }

    void
    do_stop()
    {
        LOG_TRC(log_, "listener::do_stop");

        // Close the acceptor
        beast::error_code ec;
        acceptor_.close();

        // Stop all the sessions
        std::vector<
            boost::weak_ptr<session>> v;
        {
            std::lock_guard<std::mutex> lock(mutex_);
            v.reserve(sessions_.size());
            for(auto p : sessions_)
                v.emplace_back(weak_from(p));
            sessions_.clear();
            sessions_.shrink_to_fit();
        }
        for(auto& e : v)
            if(auto sp = e.lock())
                sp->on_stop();
    }

#include <boost/asio/yield.hpp>
    void
    operator()(
        beast::error_code ec,
        socket_type sock)
    {
        reenter(*this)
        {
            for(;;)
            {
                // Report the error, if any
                if(ec)
                    return fail(ec, "listener::acceptor_.async_accept");

                // If the acceptor is closed it means we stopped
                if(! acceptor_.is_open())
                    return;

                // Launch a new session for this connection
                if(cfg_.kind == listener_config::no_tls)
                {
                    run_http_session(
                        srv_,
                        *this,
                        stream_type(std::move(sock)),
                        ep_,
                        {});
                }
                else if(cfg_.kind == listener_config::allow_tls)
                {
                    auto sp = boost::make_shared<detector>(
                        srv_,
                        *this,
                        log_,
                        ctx_,
                        std::move(sock),
                        ep_);
                    sp->run();
                }
                else
                {
                    run_https_session(
                        srv_,
                        *this,
                        ctx_,
                        stream_type(std::move(sock)),
                        ep_,
                        {});
                }

                // Accept the next connection
                yield acceptor_.async_accept(
                    srv_.make_executor(),
                    ep_,
                    bind_front(this));
            }
        }
    }
#include <boost/asio/unyield.hpp>

    // Report a failure
    void
    fail(beast::error_code ec, char const* what)
    {
        if(ec == net::error::operation_aborted)
            LOG_TRC(log_, what, '\t', ec.message());
        else
            LOG_INF(log_, what, '\t', ec.message());
    }

    //--------------------------------------------------------------------------
    //
    // listener
    //
    //--------------------------------------------------------------------------

    void
    insert(session* p) override
    {
        std::lock_guard<std::mutex> lock(mutex_);
        sessions_.insert(p);
    }

    void
    erase(session* p) override
    {
        std::lock_guard<std::mutex> lock(mutex_);
        sessions_.erase(p);
    }

    //--------------------------------------------------------------------------
    //
    // service
    //
    //--------------------------------------------------------------------------

    /// Called when the server starts
    void
    on_start() override
    {
        // Accept the first connection
        acceptor_.async_accept(
            srv_.make_executor(),
            ep_,
            bind_front(this));
    }

    /// Called when the server stops
    void
    on_stop() override
    {
        // Call do_stop from within the strand
        net::post(
            acceptor_.get_executor(),
            beast::bind_front_handler(
                &listener_impl::do_stop,
                this));
    }
};

} // (anon)

//------------------------------------------------------------------------------

bool
run_listener(
    server& srv,
    listener_config cfg)
{
    auto sp = boost::make_unique<listener_impl>(
            srv, std::move(cfg));
    bool open = sp->open();
    srv.insert(std::move(sp));
    return open;
}

max_stars_repo_name: djarek/BeastLounge

max_issues_repo_name: djarek/BeastLounge

max_forks_repo_name: djarek/BeastLounge


text:
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_TRAITS_RESOLVER_20091214
#define BOOST_NETWORK_PROTOCOL_HTTP_TRAITS_RESOLVER_20091214

//          Copyright Dean Michael Berris 2009.
// Distributed under the Boost Software License, Version 1.0.
//    (See accompanying file LICENSE_1_0.txt or copy at
//          http://www.boost.org/LICENSE_1_0.txt)

#include <boost/network/protocol/http/tags.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/ip/udp.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/not.hpp>
#include <boost/network/support/is_tcp.hpp>
#include <boost/network/support/is_udp.hpp>
#include <boost/network/protocol/http/support/is_http.hpp>
#include <boost/static_assert.hpp>

namespace boost {
namespace network {
namespace http {

template <class Tag>
struct unsupported_tag;

template <class Tag>
struct resolver
    : mpl::if_<mpl::and_<is_tcp<Tag>, is_http<Tag> >,
               boost::asio::ip::tcp::resolver,
               typename mpl::if_<mpl::and_<is_udp<Tag>, is_http<Tag> >,
                                 boost::asio::ip::udp::resolver,
                                 unsupported_tag<Tag> >::type> {
  BOOST_STATIC_ASSERT(
      (mpl::not_<mpl::and_<is_udp<Tag>, is_tcp<Tag> > >::value));
};

}  // namespace http

}  // namespace network

}  // namespace boost

#endif  // BOOST_NETWORK_PROTOCOL_HTTP_TRAITS_RESOLVER_20091214

max_stars_repo_name: ChadSki/Phasor


text:
// Copyright 2019 ETH Zürich, Thomas Schöps
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
//    this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors
//    may be used to endorse or promote products derived from this software
//    without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

#include <Eigen/Geometry>
#include <gtest/gtest.h>
#include <libvis/eigen.h>
#include <libvis/image_display.h>
#include <libvis/libvis.h>
#include <libvis/logging.h>

#include "badslam/direct_ba.h"
#include "badslam/kernels.h"
#include "badslam/util.cuh"
#include "badslam/render_window.h"
#include "badslam/cuda_depth_processing.cuh"

using namespace vis;

// This checks that the geometric residual in bundle adjustment works correctly.
// It sets up a keyframe and a scene with surfels that match its depth image.
// Then it perturbs the keyframe's pose and tests whether optimizing the frame's
// pose yields its original pose again.
TEST(Optimization, PoseOptimizationWithGeometricResidual) {
  srand(0);

  // Initialize camera
  constexpr int width = 640;
  constexpr int height = 480;
  const float camera_parameters[4] = {0.5f * height, 0.5f * height, 0.5f * width - 0.5f, 0.5f * height - 0.5f};
  PinholeCamera4f camera(width, height, camera_parameters);

  // Set ground truth keyframe pose
  SE3f global_tr_frame = SE3f();

  // Initialize CUDA stream
  cudaStream_t stream;
  cudaStreamCreate(&stream);

  // Initialize DirectBA
  constexpr float raw_to_float_depth = 1.f / 1000;
  DirectBA direct_ba(
      /*max_surfel_count*/ 1000 * 1000,
      raw_to_float_depth,
      /*baseline_fx*/ 40,
      /*sparse_surfel_cell_size*/ 1.f,
      /*surfel_merge_dist_factor*/ 0.8f,
      /*min_observation_count_while_bootstrapping_1*/ 2,
      /*min_observation_count_while_bootstrapping_2*/ 2,
      /*min_observation_count*/ 2,
      /*color_camera_initial_estimate*/ camera,
      /*depth_camera_initial_estimate*/ camera,
      /*pyramid_level_for_color*/ 0,
      /*use_depth_residuals*/ true,
      /*use_descriptor_residuals*/ false,
      nullptr,
      /*global_T_anchor_frame*/ SE3f());

  // Create a known depth map with 3 planes that (hopefully) have different normals.
  Image<u16> depth_image(width, height);
  depth_image.SetTo(numeric_limits<u16>::max());

  // Insert 3 planes
  for (int plane_index = 0; plane_index < 3; ++ plane_index) {
    Vec3f plane_normal = Vec3f::Random();
    plane_normal.z() = -1.f;
    plane_normal.normalize();
    Hyperplane<float, 3> plane(plane_normal, 2.5f);

    int max_x = width - 10 - 1;
    int min_x = 10;
    int left = min_x + (max_x - min_x) * ((2 * plane_index) / (2.0f * 3 - 1));
    int right = min_x + (max_x - min_x) * ((2 * plane_index + 1) / (2.0f * 3 - 1));

    for (int y = 10; y < height - 10; ++ y) {
      for (int x = left; x < right; ++ x) {
        Vec3f frame_direction = camera.UnprojectFromPixelCenterConv(Vec2f(x, y));
        ASSERT_EQ(frame_direction.z(), 1.0f);
        ParametrizedLine<float, 3> ray(global_tr_frame.translation(), global_tr_frame.rotationMatrix() * frame_direction);
        float z = ray.intersectionParameter(plane);
        depth_image(x, y) = z / raw_to_float_depth + 0.5f;
      }
    }
  }

//   ImageDisplay debug_display;
//   debug_display.Update(inv_depth_image, "debug: inv depth map", 0.f, 0.5f);
//   std::getchar();

  // Create a homogeneous color image.
  Image<Vec3u8> color_image(width, height);
  memset(color_image.data(), 0, color_image.stride() * color_image.height());

  shared_ptr<Keyframe> new_keyframe(new Keyframe(
      stream,
      /*frame_index*/ 0,
      direct_ba.depth_params(),
      direct_ba.depth_camera(),
      depth_image,
      color_image,
      global_tr_frame));
  direct_ba.AddKeyframe(new_keyframe);

  // Create surfels from the depth map.
  direct_ba.CreateSurfelsForKeyframe(stream, /*filter_new_surfels*/ false, new_keyframe);

  // Attempt to estimate the frame's pose, starting from different offsets.
  constexpr float kTranslationOffset = 0.005f;
  constexpr float kRotationOffset = 0.001f;
  SE3f offsets[] = {
      // Identity
      SE3f(),
      // Positive offsets
      SE3f::exp((Matrix<float, 6, 1>() << kTranslationOffset, 0, 0, 0, 0, 0).finished()),
      SE3f::exp((Matrix<float, 6, 1>() << 0, kTranslationOffset, 0, 0, 0, 0).finished()),
      SE3f::exp((Matrix<float, 6, 1>() << 0, 0, kTranslationOffset, 0, 0, 0).finished()),
      SE3f::exp((Matrix<float, 6, 1>() << 0, 0, 0, kRotationOffset, 0, 0).finished()),
      SE3f::exp((Matrix<float, 6, 1>() << 0, 0, 0, 0, kRotationOffset, 0).finished()),
      SE3f::exp((Matrix<float, 6, 1>() << 0, 0, 0, 0, 0, kRotationOffset).finished()),
      // Negative offsets
      SE3f::exp((Matrix<float, 6, 1>() << -kTranslationOffset, 0, 0, 0, 0, 0).finished()),
      SE3f::exp((Matrix<float, 6, 1>() << 0, -kTranslationOffset, 0, 0, 0, 0).finished()),
      SE3f::exp((Matrix<float, 6, 1>() << 0, 0, -kTranslationOffset, 0, 0, 0).finished()),
      SE3f::exp((Matrix<float, 6, 1>() << 0, 0, 0, -kRotationOffset, 0, 0).finished()),
      SE3f::exp((Matrix<float, 6, 1>() << 0, 0, 0, 0, -kRotationOffset, 0).finished()),
      SE3f::exp((Matrix<float, 6, 1>() << 0, 0, 0, 0, 0, -kRotationOffset).finished())};

  for (int offset_index = 0; offset_index < static_cast<int>(sizeof(offsets) / sizeof(offsets[0])); ++ offset_index) {
    SE3f global_tr_frame_estimate;
    direct_ba.EstimateFramePose(
        stream,
        offsets[offset_index] * global_tr_frame.inverse(),
        new_keyframe->depth_buffer(),
        new_keyframe->normals_buffer(),
        new_keyframe->color_texture(),
        &global_tr_frame_estimate,
        /*called_within_ba*/ false);

    Matrix<float, 6, 1> error = (global_tr_frame_estimate.inverse() * global_tr_frame).log();
//     LOG(INFO) << "Case " << offset_index << " error: " << error.transpose();
    for (int i = 0; i < 6; ++ i) {
      constexpr float kTolerance = 1e-6f;
      EXPECT_NEAR(0.f, error(i), kTolerance) << "Error in test case " << offset_index;
    }
  }

  cudaStreamDestroy(stream);
}

ext: cc

max_stars_repo_name: Rmargin/badslam

max_issues_repo_name: Rmargin/badslam

max_forks_repo_name: Rmargin/badslam


text:
#include <dlib/pixel.h>
#include <dlib/array2d.h>
#include <dlib/image_loader/image_loader.h>
#include <dlib/image_keypoint.h>
using namespace std;
using namespace dlib;

// [[Rcpp::export]]
List dlib_surf_points(const std::string file_name,
                      long max_points = 10000,
                      double detection_threshold = 30.0) {
  array2d<rgb_pixel> img;
  load_bmp(img, file_name.c_str());
  std::vector<surf_point> sp = get_surf_points(img, max_points, detection_threshold);
  NumericVector ip_center_x(sp.size());
  NumericVector ip_center_y(sp.size());
  NumericVector ip_angle(sp.size());
  NumericVector ip_scale(sp.size());
  NumericVector ip_score(sp.size());
  NumericVector ip_laplacian(sp.size());
  NumericMatrix ip_surf(sp.size(), 64);

  int points_nr;
  points_nr = sp.size();
  for(int i=0; i<points_nr; i++){
    ip_center_x[i] = sp[i].p.center(0);
    ip_center_y[i] = sp[i].p.center(1);
    ip_angle[i] = sp[i].angle;
    ip_scale[i] = sp[i].p.scale;
    ip_score[i] = sp[i].p.score;
    ip_laplacian[i] = sp[i].p.laplacian;
    for(int j=0; j<64; j++){
      ip_surf(i, j) = sp[i].des(j, 1);
    }

  }
  return List::create(_["points"] = sp.size(),
                      _["x"] = ip_center_x,
                      _["y"] = ip_center_y,
                      _["angle"] = ip_angle,
                      _["pyramid_scale"] = ip_scale,
                      _["score"] = ip_score,
                      _["laplacian"] = ip_laplacian,
                      _["surf"] = ip_surf);
}

max_stars_repo_name: ParoRahul/ImageDetection

max_issues_repo_name: ParoRahul/ImageDetection

max_forks_repo_name: ParoRahul/ImageDetection


text:
#include <memory>
#include <unordered_set>
#include <limits>
#include <boost/multiprecision/cpp_dec_float.hpp>

namespace spdlog {
class logger;
}

namespace AsioCalc {
enum class TokenType {
    number,
    operation,
    final
};

template<class InputInteger, class ResultType>
class Evaluator {
    std::shared_ptr<spdlog::logger> logger;

    class Token {
        Token() = default;
    public:
        TokenType tokenType;
        InputInteger num{0};
        char operation{0};
        bool isFinal() const {return tokenType == TokenType::final; }

        static Token BuildFromInteger(InputInteger &&num) {
            Token t;
            t.tokenType = TokenType::number;
            t.num = std::move(num);
            return t;
        }

        static Token BuildFromOperation(char &operation) {
            Token t;
            t.tokenType = TokenType::operation;
            t.operation = std::move(operation);
            return t;
        }

        static Token FinalToken() {
            static Token final_token;
            final_token.tokenType = TokenType::final;
            return final_token;
        }
    };
    Token lastToken{Token::FinalToken()};
    std::unordered_set<char> mask;
public:
    std::string input;
    std::string::iterator it;
    std::string::iterator prev;
    Evaluator(std::string &&input_);

    Token getNextToken();
    void unread();
    ResultType prim();
    ResultType handleAddition();
    ResultType handleMultiplication();
    std::string Run();
};
}

max_stars_repo_name: vadikrobot/asio-calc

max_issues_repo_name: vadikrobot/asio-calc

max_forks_repo_name: vadikrobot/asio-calc


text:
#include "logic/ui/SlideStackDataUiMapper.h"

#include "common/CoordinateFrame.h"
#include "common/HZeeException.hpp"
#include "common/UID.h"

#include "logic/managers/ActionManager.h"
#include "logic/managers/AssemblyManager.h"
#include "logic/managers/DataManager.h"
#include "logic/managers/InteractionManager.h"
#include "logic/data/DataLoading.h"

#include "slideio/SlideHelper.h"

#include <boost/range/algorithm.hpp>

#include <iostream>
#include <limits>
#include <list>
#include <sstream>

struct SlideStackDataUiMapper::Impl
{
    Impl( ActionManager&, AssemblyManager&, DataManager&, InteractionManager&,
          AllViewsUpdaterType );

    ~Impl() = default;

    void updateAppFromUi( const gui::SlideStackPartial_msgFromUi& );
    void updateAppFromUi( const gui::SlideStackOrder_msgFromUi& );
    void updateAppFromUi( const gui::ActiveSlide_msgFromUi& );
    void updateAppFromUi( const gui::SlideCommonPropertiesPartial_msgFromUi& );
    void updateAppFromUi( const gui::SlideHeaderPartial_msgFromUi& );
    void updateAppFromUi( const gui::SlideViewDataPartial_msgFromUi& );
    void updateAppFromUi( const gui::SlideTxDataPartial_msgFromUi& );
    void updateAppFromUi( const gui::MoveToSlide_msgFromUi& );

    gui::SlideStackComplete_msgToUi getSlideStack() const;
    gui::SlideStackPartial_msgToUi getSlideStackTransformation() const;
    gui::SlidePreview getSlide( const UID& slideUid ) const;
    gui::ActiveSlide_msgToUi getActiveSlide() const;
    gui::SlideCommonPropertiesComplete_msgToUi getSlideCommonProperties() const;

    gui::SlideHeaderComplete_msgToUi getSlideHeader( const UID& slideUid ) const;
    gui::SlideViewDataComplete_msgToUi getSlideViewData( const UID& slideUid ) const;
    gui::SlideTxDataComplete_msgToUi getSlideTxData( const UID& slideUid ) const;

    /// Update the UI due to change of a single slide's data
    void updateUiFromSlideDataChange( const UID& slideUid );

    /// Update the UI due to change of the composition of the slide stack
    void updateUiFromSlideStackChange();

    /// Update the UI due to change of the slide stack transformation
    void updateUiFromSlideStackTransformationChange();

    /// Update the UI due to change of the active slide selection
    void updateUiFromActiveSlideSelectionChange( const UID& activeSlideUid );

    /// Update the UI due to a slide stack assembly rendering properties change
    void updateUiFromSlideStackAssemblyRenderingPropertiesChange(
            const SlideStackAssemblyRenderingProperties& );

    /// Update the UI due to slide transformation changes
    void updateUiFromSlideTransformationChanges( const std::list<UID>& slideUids );

    ActionManager& m_actionManager;
    AssemblyManager& m_assemblyManager;
    DataManager& m_dataManager;
    InteractionManager& m_interactionManager;

    /// Function that updates all rendered views
    AllViewsUpdaterType m_allViewsUpdater;

    /// Slide stack frame provider
    GetterType<CoordinateFrame> m_stackFrameProvider;

    /// Slide stack frame broadcaster
    SetterType<const CoordinateFrame&> m_stackFrameBroadcaster;

    /// Move crosshairs to slide center
    CrosshairsToSlideCenterMover m_centerCrosshairsOnSlide;

    /// Functional that updates the UI with all slide stack changes from the app
    gui::SlideStackComplete_msgToUi_PublisherType m_slideStackCompletePublisher;

    /// Functional that updates the UI with some slide stack changes from the app
    gui::SlideStackPartial_msgToUi_PublisherType m_slideStackPartialPublisher;

    /// Functional that updates the UI with the active slide from the app
    gui::ActiveSlide_msgToUi_PublisherType m_activeSlidePublisher;

    /// Functional that updates the UI with some slide stack rendering properties from the app
    gui::SlideCommonPropertiesPartial_msgToUi_PublisherType m_slideStackRenderingPartialPublisher;

    /// Functional that updates the UI with all slide stack rendering properties from the app
    gui::SlideCommonPropertiesComplete_msgToUi_PublisherType m_slideStackRenderingCompletePublisher;

    gui::SlideHeaderComplete_msgToUi_PublisherType m_slideHeaderCompletePublisher;
    gui::SlideViewDataComplete_msgToUi_PublisherType m_slideViewDataCompletePublisher;
    gui::SlideViewDataPartial_msgToUi_PublisherType m_slideViewDataPartialPublisher;
    gui::SlideTxDataComplete_msgToUi_PublisherType m_slideTxDataCompletePublisher;
    gui::SlideTxDataPartial_msgToUi_PublisherType m_slideTxDataPartialPublisher;
};

SlideStackDataUiMapper::SlideStackDataUiMapper(
        ActionManager& actionManager,
        AssemblyManager& assemblyManager,
        DataManager& dataManager,
        InteractionManager& interactionManager,
        AllViewsUpdaterType viewsUpdater )
    :
      m_impl( std::make_unique<Impl>(
                  actionManager, assemblyManager, dataManager, interactionManager,
                  viewsUpdater ) )
{}

SlideStackDataUiMapper::~SlideStackDataUiMapper() = default;

void SlideStackDataUiMapper::setSlideStackFrameProvider( GetterType<CoordinateFrame> provider )
{
    if ( m_impl ) m_impl->m_stackFrameProvider = provider;
}

void SlideStackDataUiMapper::setSlideStackFrameChangeDoneBroadcaster(
        SetterType<const CoordinateFrame&> broadcaster )
{
    if ( m_impl ) m_impl->m_stackFrameBroadcaster = broadcaster;
}

void SlideStackDataUiMapper::setCrosshairsToSlideCenterMover( CrosshairsToSlideCenterMover mover )
{
    if ( m_impl ) m_impl->m_centerCrosshairsOnSlide = mover;
}

void SlideStackDataUiMapper::setSlideStackPartial_fromUi( const gui::SlideStackPartial_msgFromUi& msg )
{
    if ( m_impl ) m_impl->updateAppFromUi( msg );
}

void SlideStackDataUiMapper::setSlideStackOrder_fromUi( const gui::SlideStackOrder_msgFromUi& msg )
{
    if ( m_impl ) m_impl->updateAppFromUi( msg );
}

void SlideStackDataUiMapper::setActiveSlide_fromUi( const gui::ActiveSlide_msgFromUi& msg )
{
    if ( m_impl ) m_impl->updateAppFromUi( msg );
}

void SlideStackDataUiMapper::setSlideCommonPropertiesPartial_fromUi( const gui::SlideCommonPropertiesPartial_msgFromUi& msg )
{
    if ( m_impl ) m_impl->updateAppFromUi( msg );
}

void SlideStackDataUiMapper::setSlideHeaderPartial_fromUi( const gui::SlideHeaderPartial_msgFromUi& msg )
{
    if ( m_impl ) m_impl->updateAppFromUi( msg );
}

void SlideStackDataUiMapper::setSlideViewDataPartial_fromUi( const gui::SlideViewDataPartial_msgFromUi& msg )
{
    if ( m_impl ) m_impl->updateAppFromUi( msg );
}

void SlideStackDataUiMapper::setSlideTxDataPartial_fromUi( const gui::SlideTxDataPartial_msgFromUi& msg )
{
    if ( m_impl ) m_impl->updateAppFromUi( msg );
}

void SlideStackDataUiMapper::setMoveToSlide_fromUi( const gui::MoveToSlide_msgFromUi& msg )
{
    if ( m_impl ) m_impl->updateAppFromUi( msg );
}

void SlideStackDataUiMapper::setSlideStackCompletePublisher_msgToUi(
        gui::SlideStackComplete_msgToUi_PublisherType publisher )
{
    if ( m_impl ) m_impl->m_slideStackCompletePublisher = publisher;
}

void SlideStackDataUiMapper::setSlideStackPartialPublisher_msgToUi(
        gui::SlideStackPartial_msgToUi_PublisherType publisher )
{
    if ( m_impl ) m_impl->m_slideStackPartialPublisher = publisher;
}

void SlideStackDataUiMapper::setActiveSlidePublisher_msgToUi(
        gui::ActiveSlide_msgToUi_PublisherType publisher )
{
    if ( m_impl ) m_impl->m_activeSlidePublisher = publisher;
}

void SlideStackDataUiMapper::setSlideCommonPropertiesPartialPublisher_msgToUi(
        gui::SlideCommonPropertiesPartial_msgToUi_PublisherType publisher )
{
    if ( m_impl ) m_impl->m_slideStackRenderingPartialPublisher = publisher;
}

void SlideStackDataUiMapper::setSlideCommonPropertiesCompletePublisher_msgToUi(
        gui::SlideCommonPropertiesComplete_msgToUi_PublisherType publisher )
{
    if ( m_impl ) m_impl->m_slideStackRenderingCompletePublisher = publisher;
}

void SlideStackDataUiMapper::setSlideHeaderCompletePublisher_msgToUi(
        gui::SlideHeaderComplete_msgToUi_PublisherType publisher )
{
    if ( m_impl ) m_impl->m_slideHeaderCompletePublisher = publisher;
}

void SlideStackDataUiMapper::setSlideViewDataCompletePublisher_msgToUi(
        gui::SlideViewDataComplete_msgToUi_PublisherType publisher )
{
    if ( m_impl ) m_impl->m_slideViewDataCompletePublisher = publisher;
}

void SlideStackDataUiMapper::setSlideViewDataPartialPublisher_msgToUi(
        gui::SlideViewDataPartial_msgToUi_PublisherType publisher )
{
    if ( m_impl ) m_impl->m_slideViewDataPartialPublisher = publisher;
}

void SlideStackDataUiMapper::setSlideTxDataCompletePublisher_msgToUi(
        gui::SlideTxDataComplete_msgToUi_PublisherType publisher )
{
    if ( m_impl ) m_impl->m_slideTxDataCompletePublisher = publisher;
}

void SlideStackDataUiMapper::setSlideTxDataPartialPublisher_msgToUi(
        gui::SlideTxDataPartial_msgToUi_PublisherType publisher )
{
    if ( m_impl ) m_impl->m_slideTxDataPartialPublisher = publisher;
}

gui::SlideStackComplete_msgToUi SlideStackDataUiMapper::getSlideStackComplete_msgToUi() const
{
    return m_impl->getSlideStack();
}

gui::ActiveSlide_msgToUi SlideStackDataUiMapper::getActiveSlide_msgToUi() const
{
    return m_impl->getActiveSlide();
}

gui::SlideCommonPropertiesComplete_msgToUi
SlideStackDataUiMapper::getSlideCommonPropertiesComplete_msgToUi() const
{
    return m_impl->getSlideCommonProperties();
}

std::optional< gui::SlideHeaderComplete_msgToUi >
SlideStackDataUiMapper::getSlideHeaderComplete_msgToUi( const UID& slideUid ) const
{
    auto slideRecord = m_impl->m_dataManager.slideRecord( slideUid ).lock();
    if ( ! slideRecord || ! slideRecord->cpuData() )
    {
        std::cerr << "Requested header data for invalid slide " << slideUid << std::endl;
        return std::nullopt;
    }

    return m_impl->getSlideHeader( slideUid );
}

std::optional< gui::SlideViewDataComplete_msgToUi >
SlideStackDataUiMapper::getSlideViewDataComplete_msgToUi( const UID& slideUid ) const
{
    auto slideRecord = m_impl->m_dataManager.slideRecord( slideUid ).lock();
    if ( ! slideRecord || ! slideRecord->cpuData() )
    {
        std::cerr << "Requested view data for invalid slide " << slideUid << std::endl;
        return std::nullopt;
    }

    return m_impl->getSlideViewData( slideUid );
}

std::optional< gui::SlideTxDataComplete_msgToUi >
SlideStackDataUiMapper::getSlideTxDataComplete_msgToUi( const UID& slideUid ) const
{
    auto slideRecord = m_impl->m_dataManager.slideRecord( slideUid ).lock();
    if ( ! slideRecord || ! slideRecord->cpuData() )
    {
        std::cerr << "Requested transformation data for invalid slide " << slideUid << std::endl;
        return std::nullopt;
    }

    return m_impl->getSlideTxData( slideUid );
}

void SlideStackDataUiMapper::updateUiFromSlideStackFrameChange()
{
    if ( ! m_impl ) return;
    m_impl->updateUiFromSlideStackTransformationChange();
}

SlideStackDataUiMapper::Impl::Impl(
        ActionManager& actionManager,
        AssemblyManager& assemblyManager,
        DataManager& dataManager,
        InteractionManager& interactionManager,
        AllViewsUpdaterType viewsUpdater )
    :
      m_actionManager( actionManager ),
      m_assemblyManager( assemblyManager ),
      m_dataManager( dataManager ),
      m_interactionManager( interactionManager ),

      m_allViewsUpdater( viewsUpdater ),

      m_stackFrameProvider( nullptr ),
      m_stackFrameBroadcaster( nullptr ),
      m_centerCrosshairsOnSlide( nullptr ),

      m_slideStackCompletePublisher( nullptr ),
      m_slideStackPartialPublisher( nullptr ),
      m_activeSlidePublisher( nullptr ),
      m_slideStackRenderingPartialPublisher( nullptr ),
      m_slideStackRenderingCompletePublisher( nullptr ),

      m_slideHeaderCompletePublisher( nullptr ),
      m_slideViewDataCompletePublisher( nullptr ),
      m_slideViewDataPartialPublisher( nullptr ),
      m_slideTxDataCompletePublisher( nullptr ),
      m_slideTxDataPartialPublisher( nullptr )
{
    using std::placeholders::_1;

    // Connect signal that a single slide's data changed to slot that updates UI
    m_dataManager.connectToSlideDataChangedSignal(
                std::bind( &SlideStackDataUiMapper::Impl::updateUiFromSlideDataChange, this, _1 ) );

    // Connect signal that the slide stack composition has changed to slot that updates UI
    m_dataManager.connectToSlideStackChangedSignal(
                std::bind( &SlideStackDataUiMapper::Impl::updateUiFromSlideStackChange, this ) );

    // Connect signal that the active slide has changed to slot that updates UI
    m_dataManager.connectToActiveSlideChangedSignal(
                std::bind( &SlideStackDataUiMapper::Impl::updateUiFromActiveSlideSelectionChange, this, _1 ) );

    // Connect signal that parcellation label mesh rendering property has changed to slot that updates UI.
    m_assemblyManager.connectToSlideStackAssemblyRenderingPropertiesChangedSignal(
                std::bind( &SlideStackDataUiMapper::Impl::updateUiFromSlideStackAssemblyRenderingPropertiesChange, this, _1 ) );

    // Connect signal that slide transformations have changed to slot that updates UI.
    /// @todo remove assemblymanager dependency!
    m_assemblyManager.connectToSlideTransformationsChangedSignal(
                std::bind( &SlideStackDataUiMapper::Impl::updateUiFromSlideTransformationChanges, this, _1 ) );
}

void SlideStackDataUiMapper::Impl::updateAppFromUi( const gui::SlideStackPartial_msgFromUi& msg )
{
    bool updatedActiveSlide = false;

    const auto activeSlideUid = m_dataManager.activeSlideUid();

    for ( const auto& slide : msg.m_slides )
    {
        auto slideRecord = m_dataManager.slideRecord( slide.m_uid ).lock();
        if ( ! slideRecord || ! slideRecord->cpuData() )
        {
            std::ostringstream ss;
            ss << "Cannot update propeties of slide with invalid UID " << slide.m_uid << std::ends;
            throw_debug( ss.str() )
        }

        if ( ! updatedActiveSlide && activeSlideUid && ( slide.m_uid == *activeSlideUid ) )
        {
            updatedActiveSlide = true;
        }

        // Set slide properties
        auto& props = slideRecord->cpuData()->properties();

        props.setDisplayName( slide.m_name );
        props.setBorderColor( slide.m_borderColor );
        props.setVisible( slide.m_visible );
        props.setAnnotVisible( slide.m_annotVisible );

        if ( 0 <= slide.m_opacity && slide.m_opacity <= 100 )
        {
            props.setOpacity( static_cast<float>( slide.m_opacity ) / 100.0f );
        }

        if ( 0 <= slide.m_annotOpacity && slide.m_annotOpacity <= 100 )
        {
            props.setAnnotOpacity( static_cast<float>( slide.m_annotOpacity ) / 100.0f );
        }
    }

    if ( updatedActiveSlide )
    {
        updateUiFromSlideDataChange( *activeSlideUid );
    }

    bool updatedStackTx = false;

    if ( msg.m_set_world_O_stack_identity && *msg.m_set_world_O_stack_identity )
    {
        if ( m_stackFrameBroadcaster )
        {
            CoordinateFrame newStackFrame;
            newStackFrame.setIdentity();
            m_stackFrameBroadcaster( newStackFrame );
            updatedStackTx = true;
        }
    }

    if ( updatedStackTx )
    {
        // This is done to update the matrix widget:
        updateUiFromSlideStackTransformationChange();
    }

    if ( m_allViewsUpdater ) { m_allViewsUpdater(); }
}

void SlideStackDataUiMapper::Impl::updateAppFromUi( const gui::SlideStackOrder_msgFromUi& msg )
{
    if ( m_dataManager.setSlideOrder( msg.m_orderedSlideUids ) )
    {
        if ( m_allViewsUpdater ) { m_allViewsUpdater(); }
    }
}

void SlideStackDataUiMapper::Impl::updateAppFromUi( const gui::ActiveSlide_msgFromUi& msg )
{
    if ( ! msg.m_activeSlideUid || ! msg.m_activeSlideIndex ||
         ! ( 0 <= *msg.m_activeSlideIndex ) )
    {
        // Invalid message
        return;
    }

    // Check that the message's active slide UID and index match:
    const std::optional<size_t> slideIndex = m_dataManager.slideIndex( *msg.m_activeSlideUid );

    if ( ! slideIndex || ( *slideIndex != static_cast<size_t>( *msg.m_activeSlideIndex ) ) )
    {
        // Invalid active slide index
        return;
    }

    if ( m_dataManager.setActiveSlideUid( *msg.m_activeSlideUid ) )
    {
        if ( m_allViewsUpdater ) { m_allViewsUpdater(); }
    }
}

void SlideStackDataUiMapper::Impl::updateAppFromUi( const gui::SlideCommonPropertiesPartial_msgFromUi& msg )
{
    if ( const auto opacity = msg.m_properties.m_masterOpacityValue )
    {
        if ( 0 <= *opacity && *opacity <= 100 )
        {
            m_assemblyManager.setSlideStackMasterOpacityMultiplier(
                        static_cast<float>( *opacity ) / 100.0f );
        }
    }

    if ( const auto opacity = msg.m_properties.m_image3dOpacityValue )
    {
        if ( 0 <= *opacity && *opacity <= 100 )
        {
            m_assemblyManager.setSlideStackImage3dLayerOpacity(
                        static_cast<float>( *opacity ) / 100.0f );
        }
    }

    if ( const auto visibleIn2d = msg.m_properties.m_stackVisibleIn2dViewsChecked )
    {
        m_assemblyManager.setSlideStackVisibleIn2dViews( *visibleIn2d );
    }

    if ( const auto visibleIn3d = msg.m_properties.m_stackVisibleIn3dViewsChecked )
    {
        m_assemblyManager.setSlideStackVisibleIn3dViews( *visibleIn3d );
    }

    if ( const auto show2dSlides = msg.m_properties.m_activeSlideViewShows2dSlidesChecked )
    {
        m_assemblyManager.setActiveSlideViewShows2dSlides( *show2dSlides );
    }

    if ( const auto viewTopToBottom = msg.m_properties.m_activeSlideViewDirectionTopToBottomChecked )
    {
        m_interactionManager.setActiveSlideViewDirection(
                    ( *viewTopToBottom )
                    ? InteractionManager::ActiveSlideViewDirection::TopToBottomSlide
                    : InteractionManager::ActiveSlideViewDirection::BottomToTopSlide );

        // This also updates all views:
        /// @todo Perhaps redundant call to update views?
        m_actionManager.resetViews(); /// @todo Pass this in as callback instead of using ActionManager?
    }

    if ( m_allViewsUpdater ) { m_allViewsUpdater(); }
}

void SlideStackDataUiMapper::Impl::updateAppFromUi( const gui::SlideHeaderPartial_msgFromUi& msg )
{
    auto slideRecord = m_dataManager.slideRecord( msg.m_uid ).lock();

    if ( ! slideRecord || ! slideRecord->cpuData() )
    {
        std::cerr << "Unable to update header data for slide " << msg.m_uid << std::endl;
        return;
    }

    bool doUpdate = false;

    const auto& MH = msg.m_headerMutable;
    auto& SH = slideRecord->cpuData()->header();

    if ( MH.m_displayName )
    {
        slideRecord->cpuData()->properties().setDisplayName( *MH.m_displayName );
    }

    if ( MH.m_pixelSizeX )
    {
        SH.setPixelSizeX( *MH.m_pixelSizeX );
        doUpdate = true;
    }

    if ( MH.m_pixelSizeY )
    {
        SH.setPixelSizeY( *MH.m_pixelSizeY );
        doUpdate = true;
    }

    if ( MH.m_thickness )
    {
        SH.setThickness( *MH.m_thickness );
        doUpdate = true;
    }

    // Trigger render of views:
    if ( doUpdate && m_allViewsUpdater ) { m_allViewsUpdater(); }
}

void SlideStackDataUiMapper::Impl::updateAppFromUi( const gui::SlideViewDataPartial_msgFromUi& msg )
{
    auto slideRecord = m_dataManager.slideRecord( msg.m_uid ).lock();

    if ( ! slideRecord || ! slideRecord->cpuData() )
    {
        std::cerr << "Unable to update view data for slide " << msg.m_uid << std::endl;
        return;
    }

    bool doUpdate = false;

    const auto& V = msg.m_viewData;
    auto& P = slideRecord->cpuData()->properties();

    if ( V.m_borderColor )
    {
        P.setBorderColor( *V.m_borderColor );
        doUpdate = true;
    }

    if ( V.m_slideVisibleChecked )
    {
        P.setVisible( *V.m_slideVisibleChecked );
        doUpdate = true;
    }

    if ( V.m_opacityValue )
    {
        P.setOpacity( static_cast<float>( *V.m_opacityValue ) / 100.0f );
        doUpdate = true;
    }

    if ( V.m_threshValues )
    {
        const auto threshValues = *V.m_threshValues;

        P.setIntensityThresholds( std::make_pair( static_cast<uint8_t>( threshValues.first ),
                                                  static_cast<uint8_t>( threshValues.second ) ) );
        doUpdate = true;
    }

    if ( V.m_edgesVisibleChecked )
    {
        P.setEdgesVisible( *V.m_edgesVisibleChecked );
        doUpdate = true;
    }

    if ( V.m_edgesMagnitudeValue )
    {
        P.setEdgesMagnitude( static_cast<float>( *V.m_edgesMagnitudeValue ) );
        doUpdate = true;
    }

    if ( V.m_edgesSmoothingValue )
    {
        P.setEdgesSmoothing( static_cast<float>( *V.m_edgesSmoothingValue ) );
        doUpdate = true;
    }

    if ( doUpdate )
    {
        if ( m_allViewsUpdater ) { m_allViewsUpdater(); }

        // Send message to update the Slide Preview rows in the Slide Sorter Table:
        if ( m_slideStackPartialPublisher )
        {
            gui::SlideStackPartial_msgToUi msgToUi;
            msgToUi.m_slides.insert( getSlide( msg.m_uid ) );
            m_slideStackPartialPublisher( msgToUi );
        }
    }
}

void SlideStackDataUiMapper::Impl::updateAppFromUi( const gui::SlideTxDataPartial_msgFromUi& msg )
{
    auto slideRecord = m_dataManager.slideRecord( msg.m_uid ).lock();

    if ( ! slideRecord || ! slideRecord->cpuData() )
    {
        std::cerr << "Unable to update transformation data for slide " << msg.m_uid << std::endl;
        return;
    }

    bool doUpdate = false;

    auto& T = slideRecord->cpuData()->transformation();
    const auto& D = msg.m_txData;

    const glm::vec3 physicalDims = slideio::physicalSlideDims( *slideRecord->cpuData() );

    if ( D.m_useScaleRotationParameterization )
    {
        if ( *D.m_useScaleRotationParameterization )
        {
            T.setShearParamMode( slideio::SlideTransformation::ShearParamMode::ScaleRotation );
        }
        else
        {
            T.setShearParamMode( slideio::SlideTransformation::ShearParamMode::ShearAngles );
        }
        doUpdate = true;
    }

    if ( D.m_xTranslationValueInMm )
    {
        T.setNormalizedTranslationX( static_cast<float>( *D.m_xTranslationValueInMm ) /  physicalDims.x );
        doUpdate = true;
    }
    if ( D.m_yTranslationValueInMm )
    {
        T.setNormalizedTranslationY( static_cast<float>( *D.m_yTranslationValueInMm ) / physicalDims.y );
        doUpdate = true;
    }
    if ( D.m_zTranslationValueInMm )
    {
        T.setStackTranslationZ( static_cast<float>( *D.m_zTranslationValueInMm ) );
        doUpdate = true;
    }

    if ( D.m_zRotationValueInDeg )
    {
        T.setRotationAngleZ( static_cast<float>( *D.m_zRotationValueInDeg ) );
        doUpdate = true;
    }

    if ( D.m_xScaleValue )
    {
        T.setScaleFactorsX( static_cast<float>( *D.m_xScaleValue ) );
        doUpdate = true;
    }
    if ( D.m_yScaleValue )
    {
        T.setScaleFactorsY( static_cast<float>( *D.m_yScaleValue ) );
        doUpdate = true;
    }

    if ( D.m_xShearValueInDeg )
    {
        T.setShearAnglesX( static_cast<float>( *D.m_xShearValueInDeg ) );
        doUpdate = true;
    }
    if ( D.m_yShearValueInDeg )
    {
        T.setShearAnglesY( static_cast<float>( *D.m_yShearValueInDeg ) );
        doUpdate = true;
    }
    if ( D.m_zScaleRotationValueInDeg )
    {
        T.setScaleRotationAngle( static_cast<float>( *D.m_zScaleRotationValueInDeg ) );
        doUpdate = true;
    }

    if ( D.m_xOriginValueInMm )
    {
        T.setNormalizedRotationCenterX( static_cast<float>( *D.m_xOriginValueInMm ) / physicalDims.x );
        doUpdate = true;
    }
    if ( D.m_yOriginValueInMm )
    {
        T.setNormalizedRotationCenterY( static_cast<float>( *D.m_yOriginValueInMm ) / physicalDims.y );
        doUpdate = true;
    }

    if ( msg.m_set_stack_O_slide_identity && *msg.m_set_stack_O_slide_identity )
    {
        T.setIdentity();
        doUpdate = true;
    }

    // Trigger render of views:
    if ( doUpdate && m_allViewsUpdater )
    {
        m_allViewsUpdater();

        // Send message to update the slide transformation:
        // (Mainly needed to update the matrix widget)
        gui::SlideTxDataComplete_msgToUi msgToUi = getSlideTxData( msg.m_uid );
        m_slideTxDataCompletePublisher( msgToUi );
    }
}

void SlideStackDataUiMapper::Impl::updateAppFromUi( const gui::MoveToSlide_msgFromUi& msg )
{
    if ( ! m_centerCrosshairsOnSlide )
    {
        return;
    }

    if ( msg.m_slideIndex < 0 )
    {
        std::cerr << "Cannot move to invalid slide index " << msg.m_slideIndex << std::endl;
        return;
    }

    // Check that the message's slide UID and index match:
    const std::optional<size_t> slideIndex = m_dataManager.slideIndex( msg.m_slideUid );
    if ( ! slideIndex || ( *slideIndex != static_cast<size_t>( msg.m_slideIndex ) ) )
    {
        std::cerr << "Cannot move to slide index " << msg.m_slideIndex
                  << " for slide " << msg.m_slideUid << std::endl;
        return;
    }

    m_centerCrosshairsOnSlide( msg.m_slideUid );

    if ( m_allViewsUpdater ) { m_allViewsUpdater(); }
}

void SlideStackDataUiMapper::Impl::updateUiFromSlideStackAssemblyRenderingPropertiesChange(
        const SlideStackAssemblyRenderingProperties& /*props*/ )
{
    if ( m_slideStackRenderingCompletePublisher )
    {
        m_slideStackRenderingCompletePublisher( getSlideCommonProperties() );
    }
}

void SlideStackDataUiMapper::Impl::updateUiFromSlideTransformationChanges(
        const std::list<UID>& slideUids )
{
    if ( m_slideTxDataCompletePublisher )
    {
        for ( const auto& uid : slideUids )
        {
            m_slideTxDataCompletePublisher( getSlideTxData( uid ) );
        }
    }
}

gui::SlideStackComplete_msgToUi SlideStackDataUiMapper::Impl::getSlideStack() const
{
    gui::SlideStackComplete_msgToUi msg;

    for ( const auto& slideUid : m_dataManager.orderedSlideUids() )
    {
        msg.m_slides.emplace_back( getSlide( slideUid ) );
    }

    msg.m_activeSlideUid = m_dataManager.activeSlideUid();
    msg.m_activeSlideIndex = m_dataManager.activeSlideIndex();

    if ( m_stackFrameProvider )
    {
        msg.m_world_O_stack = glm::dmat4{ m_stackFrameProvider().world_O_frame() };
    }
    else
    {
        throw_debug( "Null stack frame provider" )
    }

    return msg;
}

gui::SlideStackPartial_msgToUi SlideStackDataUiMapper::Impl::getSlideStackTransformation() const
{
    gui::SlideStackPartial_msgToUi msg;

    if ( m_stackFrameProvider )
    {
        msg.m_world_O_stack = glm::dmat4{ m_stackFrameProvider().world_O_frame() };
    }
    else
    {
        throw_debug( "Null stack frame provider" )
    }

    return msg;
}

gui::SlidePreview SlideStackDataUiMapper::Impl::getSlide( const UID& slideUid ) const
{
    auto record = m_dataManager.slideRecord( slideUid ).lock();
    if ( ! record || ! record->cpuData() )
    {
        throw_debug( "Null slide record" )
    }

    auto slideIndex = m_dataManager.slideIndex( slideUid );
    if ( ! slideIndex )
    {
        throw_debug( "Invalid slide UID" )
    }

    const auto& header = record->cpuData()->header();
    const auto& props = record->cpuData()->properties();

    gui::SlidePreview slide;

    slide.m_uid = slideUid;
    slide.m_index = *slideIndex;

    slide.m_name = props.displayName();
    slide.m_borderColor = props.borderColor();
    slide.m_visible = props.visible();
    slide.m_annotVisible = props.annotVisible();
    slide.m_opacity = static_cast<int>( props.opacity() * 100.0f );
    slide.m_annotOpacity = static_cast<int>( props.annotOpacity() * 100.0f );

    slide.m_thumbnailBuffer = header.associatedImages().thumbImage().first;
    slide.m_thumbnailDims = header.associatedImages().thumbImage().second;

    return slide;
}

gui::ActiveSlide_msgToUi SlideStackDataUiMapper::Impl::getActiveSlide() const
{
    gui::ActiveSlide_msgToUi msg;
    msg.m_activeSlideUid = m_dataManager.activeSlideUid();
    msg.m_activeSlideIndex = m_dataManager.activeSlideIndex();
    return msg;
}

gui::SlideCommonPropertiesComplete_msgToUi SlideStackDataUiMapper::Impl::getSlideCommonProperties() const
{
    const auto props = m_assemblyManager.getSlideRenderingProperties();
    const auto viewDir = m_interactionManager.getActiveSlideViewDirection();

    gui::SlideCommonPropertiesComplete_msgToUi msg;

    msg.m_properties.m_masterOpacityRange = std::make_pair( 0, 100 );
    msg.m_properties.m_masterOpacitySingleStep = 1;
    msg.m_properties.m_masterOpacitySliderPageStep = 10;
    msg.m_properties.m_masterOpacityValue = static_cast<int>( props.m_masterOpacityMultiplier * 100.0f );

    msg.m_properties.m_image3dOpacityRange = std::make_pair( 0, 100 );
    msg.m_properties.m_image3dOpacitySingleStep = 1;
    msg.m_properties.m_image3dOpacitySliderPageStep = 10;
    msg.m_properties.m_image3dOpacityValue = static_cast<int>( props.m_image3dLayerOpacity * 100.0f );

    msg.m_properties.m_stackVisibleIn2dViewsChecked = props.m_visibleIn2dViews;
    msg.m_properties.m_stackVisibleIn3dViewsChecked = props.m_visibleIn3dViews;

    msg.m_properties.m_activeSlideViewShows2dSlidesChecked = props.m_activeSlideViewShows2dSlides;

    msg.m_properties.m_activeSlideViewDirectionTopToBottomChecked =
            ( InteractionManager::ActiveSlideViewDirection::TopToBottomSlide == viewDir )
            ? true : false;

    return msg;
}

gui::SlideHeaderComplete_msgToUi SlideStackDataUiMapper::Impl::getSlideHeader( const UID& slideUid ) const
{
    auto slideRecord = m_dataManager.slideRecord( slideUid ).lock();

    if ( ! slideRecord || ! slideRecord->cpuData() )
    {
        std::ostringstream ss;
        ss << "Unable to get header data for slide " << slideUid << std::ends;
        throw_debug( ss.str() )
    }

    auto* R = slideRecord->cpuData();
    const auto& H = R->header();
    const auto& P = R->properties();

    gui::SlideHeaderComplete_msgToUi msg;

    msg.m_uid = slideUid;

    msg.m_headerImmutable.m_filePath = H.fileName();
    msg.m_headerImmutable.m_slideType = H.vendorId();

    for ( size_t i = 0; i < R->numFileLevels(); ++i )
    {
        msg.m_headerImmutable.m_layerDims.push_back( R->fileLevel( i ).m_dims );
    }

    for ( size_t i = 0; i < R->numCreatedLevels(); ++i )
    {
        msg.m_headerImmutable.m_layerDims.push_back( R->createdLevel( i ).m_dims );
    }

    msg.m_headerImmutable.m_labelImageBuffer = H.associatedImages().labelImage().first;
    msg.m_headerImmutable.m_labelImageDims = H.associatedImages().labelImage().second;

    msg.m_headerImmutable.m_macroImageBuffer = H.associatedImages().macroImage().first;
    msg.m_headerImmutable.m_macroImageDims = H.associatedImages().macroImage().second;

    msg.m_headerImmutable.m_pixelSizeRange = std::make_pair( 1.0e-6, 1.0e6 );
    msg.m_headerImmutable.m_thicknessRange = std::make_pair( 1.0e-6, 1.0e6 );

    msg.m_headerMutable.m_displayName = P.displayName();
    msg.m_headerMutable.m_pixelSizeX = H.pixelSize().x;
    msg.m_headerMutable.m_pixelSizeY = H.pixelSize().y;
    msg.m_headerMutable.m_thickness = H.thickness();

    return msg;
}

gui::SlideViewDataComplete_msgToUi SlideStackDataUiMapper::Impl::getSlideViewData( const UID& slideUid ) const
{
    auto slideRecord = m_dataManager.slideRecord( slideUid ).lock();

    if ( ! slideRecord || ! slideRecord->cpuData() )
    {
        std::ostringstream ss;
        ss << "Unable to get view data for slide " << slideUid << std::ends;
        throw_debug( ss.str() )
    }

    const auto& P = slideRecord->cpuData()->properties();

    gui::SlideViewDataComplete_msgToUi msg;

    msg.m_uid = slideUid;

    msg.m_viewData.m_slideVisibleChecked = P.visible();

    msg.m_viewData.m_borderColor = P.borderColor();

    msg.m_viewData.m_opacityRange = std::make_pair( 0, 100 );
    msg.m_viewData.m_opacitySingleStep = 1;
    msg.m_viewData.m_opacitySliderPageStep = 10;
    msg.m_viewData.m_opacityValue = static_cast<int>( P.opacity() * 100.0f );

    const auto& thresh = P.intensityThresholds();
    msg.m_viewData.m_threshRange = std::make_pair( 0, 255 );
    msg.m_viewData.m_threshSingleStep = 1;
    msg.m_viewData.m_threshSliderPageStep = 10;
    msg.m_viewData.m_threshValues = std::make_pair( static_cast<int>( thresh.first ),
                                                    static_cast<int>( thresh.second ) );

    msg.m_viewData.m_edgesVisibleChecked = P.edgesVisible();

    msg.m_viewData.m_edgesMagnitudeRange = std::make_pair( 0.0, 0.2 );
    msg.m_viewData.m_edgesMagnitudeSingleStep = 0.01;
    msg.m_viewData.m_edgesMagnitudePageStep = 0.5;
    msg.m_viewData.m_edgesMagnitudeDecimalPrecision = 2;
    msg.m_viewData.m_edgesMagnitudeValue = static_cast<double>( P.edgesMagnitude() );

    msg.m_viewData.m_edgesSmoothingRange = std::make_pair( 0.0, 2.0 );
    msg.m_viewData.m_edgesSmoothingSingleStep = 0.1;
    msg.m_viewData.m_edgesSmoothingPageStep = 0.5;
    msg.m_viewData.m_edgesSmoothingDecimalPrecision = 1;
    msg.m_viewData.m_edgesSmoothingValue = static_cast<double>( P.edgesSmoothing() );

    return msg;
}

gui::SlideTxDataComplete_msgToUi SlideStackDataUiMapper::Impl::getSlideTxData( const UID& slideUid ) const
{
    auto slideRecord = m_dataManager.slideRecord( slideUid ).lock();

    if ( ! slideRecord || ! slideRecord->cpuData() )
    {
        std::ostringstream ss;
        ss << "Unable to get transformation data for slide " << slideUid << std::ends;
        throw_debug( ss.str() )
    }

    const auto& T = slideRecord->cpuData()->transformation();
    const glm::vec3 physicalDims = slideio::physicalSlideDims( *slideRecord->cpuData() );

    gui::SlideTxDataComplete_msgToUi msg;

    msg.m_uid = slideUid;

    msg.m_txData.m_translationRange = std::make_pair( -1.0e9, 1.0e9 );
    msg.m_txData.m_translationSingleStep = 1.0e-3;
    msg.m_txData.m_translationDecimalPrecision = 6;

    msg.m_txData.m_rotationRange = std::make_pair( -180.0, 180.0 );
    msg.m_txData.m_rotationSingleStep = 1.0e-3;
    msg.m_txData.m_rotationDecimalPrecision = 6;

    msg.m_txData.m_scaleRange = std::make_pair( -1000.0, 1000.0 );
    msg.m_txData.m_scaleSingleStep = 1.0e-3;
    msg.m_txData.m_scaleDecimalPrecision = 6;

    msg.m_txData.m_scaleRotationRange = std::make_pair( -180.0, 180.0 );
    msg.m_txData.m_scaleRotationSingleStep = 1.0e-3;
    msg.m_txData.m_scaleRotationDecimalPrecision = 6;

    msg.m_txData.m_shearRange = std::make_pair( -90.0, 90.0 );
    msg.m_txData.m_shearSingleStep = 1.0e-3;
    msg.m_txData.m_shearDecimalPrecision = 6;

    msg.m_txData.m_originRange = std::make_pair( -1.0e9, 1.0e9 );
    msg.m_txData.m_originSingleStep = 1.0e-3;
    msg.m_txData.m_originDecimalPrecision = 6;

    msg.m_txData.m_xTranslationValueInMm = static_cast<double>( T.normalizedTranslationXY().x * physicalDims.x );
    msg.m_txData.m_yTranslationValueInMm = static_cast<double>( T.normalizedTranslationXY().y * physicalDims.y );
    msg.m_txData.m_zTranslationValueInMm = static_cast<double>( T.stackTranslationZ() );

    msg.m_txData.m_zRotationValueInDeg = static_cast<double>( T.rotationAngleZ() );

    msg.m_txData.m_xScaleValue = static_cast<double>( T.scaleFactorsXY().x );
    msg.m_txData.m_yScaleValue = static_cast<double>( T.scaleFactorsXY().y );

    msg.m_txData.m_xShearValueInDeg = static_cast<double>( T.shearAnglesXY().x );
    msg.m_txData.m_yShearValueInDeg = static_cast<double>( T.shearAnglesXY().y );

    msg.m_txData.m_zScaleRotationValueInDeg = static_cast<double>( T.scaleRotationAngle() );

    msg.m_txData.m_xOriginValueInMm = static_cast<double>( T.normalizedRotationCenterXY().x * physicalDims.x );
    msg.m_txData.m_yOriginValueInMm = static_cast<double>( T.normalizedRotationCenterXY().y * physicalDims.y );

    msg.m_txData.m_useScaleRotationParameterization =
            ( slideio::SlideTransformation::ShearParamMode::ScaleRotation == T.shearParamMode() )
            ? true : false;

    msg.m_txData.m_stack_O_slide_matrix = glm::dmat4x4{ slideio::stack_O_slide( *slideRecord->cpuData() ) };

    return msg;
}

void SlideStackDataUiMapper::Impl::updateUiFromSlideDataChange( const UID& slideUid )
{
    if ( ! m_slideStackPartialPublisher || ! m_slideHeaderCompletePublisher ||
         ! m_slideViewDataCompletePublisher || ! m_slideTxDataCompletePublisher )
    {
        return;
    }

    gui::SlideStackPartial_msgToUi msg;

    msg.m_slides.insert( getSlide( slideUid ) );

    if ( m_stackFrameProvider )
    {
        msg.m_world_O_stack = glm::dmat4{ m_stackFrameProvider().world_O_frame() };
    }

    m_slideStackPartialPublisher( msg );

    const auto activeSlideUid = m_dataManager.activeSlideUid();

    if ( activeSlideUid && *activeSlideUid == slideUid )
    {
        // The active slide was changed, so publish all of its data to the UI
        m_slideHeaderCompletePublisher( getSlideHeader( slideUid ) );
        m_slideViewDataCompletePublisher( getSlideViewData( slideUid ) );
        m_slideTxDataCompletePublisher( getSlideTxData( slideUid ) );
    }
}

void SlideStackDataUiMapper::Impl::updateUiFromSlideStackChange()
{
    if ( m_slideStackCompletePublisher )
    {
        m_slideStackCompletePublisher( getSlideStack() );
    }
}

void SlideStackDataUiMapper::Impl::updateUiFromSlideStackTransformationChange()
{
    if ( m_slideStackPartialPublisher )
    {
        m_slideStackPartialPublisher( getSlideStackTransformation() );
    }
}

void SlideStackDataUiMapper::Impl::updateUiFromActiveSlideSelectionChange( const UID& /*activeSlideUid*/ )
{
    if ( m_activeSlidePublisher )
    {
        m_activeSlidePublisher( getActiveSlide() );
    }
}

max_stars_repo_name: halfmvsq/histolozee

max_issues_repo_name: halfmvsq/histolozee

max_forks_repo_name: halfmvsq/histolozee