text:
using namespace foundation;
using namespace renderer;
using namespace std;

namespace appleseed {
namespace studio {

namespace
{
    //
    // Helper functions to build the user interface.
    //

    QHBoxLayout* create_horizontal_layout()
    {
        QHBoxLayout* layout = new QHBoxLayout();
        layout->setSpacing(20);
        return layout;
    }

    QVBoxLayout* create_vertical_layout()
    {
        QVBoxLayout* layout = new QVBoxLayout();
        layout->setAlignment(Qt::AlignLeft | Qt::AlignTop);
        return layout;
    }

    QFormLayout* create_form_layout()
    {
        QFormLayout* layout = new QFormLayout();
        layout->setLabelAlignment(Qt::AlignRight);
        layout->setSpacing(10);
        return layout;
    }

    QFormLayout* create_form_layout(const QString& label, QWidget* widget)
    {
        QFormLayout* layout = create_form_layout();
        layout->addRow(label, widget);
        return layout;
    }

    QWidget* create_horizontal_group(QWidget* widget1, QWidget* widget2 = 0, QWidget* widget3 = 0)
    {
        QWidget* group = new QWidget();

        QHBoxLayout* layout = new QHBoxLayout();
        group->setLayout(layout);

        layout->setMargin(0);
        layout->setSpacing(10);
        layout->setSizeConstraint(QLayout::SetFixedSize);

        layout->addWidget(widget1);

        if (widget2)
            layout->addWidget(widget2);

        if (widget3)
            layout->addWidget(widget3);

        return group;
    }

    void set_widget_width_for_text(
        QWidget*            widget,
        const QString&      text,
        const int           margin = 0,
        const int           min_width = 0)
    {
        const QFontMetrics metrics(widget->font());
        const int text_width = metrics.boundingRect(text).width();
        const int final_width = max(text_width + margin, min_width);

        widget->setMinimumWidth(final_width);
        widget->setMaximumWidth(final_width);
    }

    void set_widget_width_for_value(
        QWidget*            widget,
        const int           value,
        const int           margin = 0,
        const int           min_width = 0)
    {
        set_widget_width_for_text(widget, QString::number(value), margin, min_width);
    }

    const int SpinBoxMargin = 28;
    const int SpinBoxMinWidth = 40;
}

//
// RenderSettingsPanel base class.
//

class RenderSettingsPanel
  : public FoldablePanelWidget
{
  public:
    RenderSettingsPanel(const QString& title, QWidget* parent = 0)
      : FoldablePanelWidget(title, parent)
    {
    }

    virtual void save_config(Configuration& config) const = 0;

    map<string, string> get_widget_values() const
    {
        map<string, string> values;

        for (const_each<WidgetProxyCollection> i = m_widget_proxies; i; ++i)
            values[i->first] = i->second->get();

        return values;
    }

  protected:
    typedef map<string, IInputWidgetProxy*> WidgetProxyCollection;

    struct DirectLink
    {
        string  m_widget_key;
        string  m_param_path;
        string  m_default_value;
    };

    typedef vector<DirectLink> DirectLinkCollection;

    WidgetProxyCollection       m_widget_proxies;
    DirectLinkCollection        m_direct_links;

    QSpinBox* create_integer_input(
        const string&           widget_key,
        const int               min,
        const int               max,
        const int               step)
    {
        QSpinBox* spinbox = new QSpinBox();
        m_widget_proxies[widget_key] = new SpinBoxProxy(spinbox);

        spinbox->setRange(min, max);
        spinbox->setSingleStep(step);
        set_widget_width_for_value(spinbox, max, SpinBoxMargin, SpinBoxMinWidth);

        new MouseWheelFocusEventFilter(spinbox);

        return spinbox;
    }

    QSpinBox* create_integer_input(
        const string&           widget_key,
        const int               min,
        const int               max,
        const int               step,
        const QString&          label)
    {
        QSpinBox* spinbox = create_integer_input(widget_key, min, max, step);

        const QString suffix = " " + label;
        spinbox->setSuffix(suffix);

        QString text;
        text.setNum(max);
        text.append(suffix);
        set_widget_width_for_text(spinbox, text, SpinBoxMargin, SpinBoxMinWidth);

        return spinbox;
    }

    QDoubleSpinBox* create_double_input(
        const string&           widget_key,
        const double            min,
        const double            max,
        const int               decimals,
        const double            step)
    {
        QDoubleSpinBox* spinbox = new QDoubleSpinBox();
        m_widget_proxies[widget_key] = new DoubleSpinBoxProxy(spinbox);

        spinbox->setMaximumWidth(60);
        spinbox->setRange(min, max);
        spinbox->setDecimals(decimals);
        spinbox->setSingleStep(step);

        new MouseWheelFocusEventFilter(spinbox);

        return spinbox;
    }

    QDoubleSpinBox* create_double_input(
        const string&           widget_key,
        const double            min,
        const double            max,
        const int               decimals,
        const double            step,
        const QString&          label)
    {
        QDoubleSpinBox* spinbox =
            create_double_input(
                widget_key,
                min,
                max,
                decimals,
                step);

        const QString suffix = " " + label;
        spinbox->setSuffix(suffix);

        QString text;
        text.setNum(max, 'f', decimals);
        text.append(suffix);
        set_widget_width_for_text(spinbox, text, SpinBoxMargin, SpinBoxMinWidth);

        return spinbox;
    }

    QCheckBox* create_checkbox(
        const string&           widget_key,
        const QString&          label)
    {
        QCheckBox* checkbox = new QCheckBox(label);
        m_widget_proxies[widget_key] = new CheckBoxProxy(checkbox);

        return checkbox;
    }

    QGroupBox* create_checkable_groupbox(
        const string&           widget_key,
        const QString&          label)
    {
        QGroupBox* groupbox = new QGroupBox(label);
        m_widget_proxies[widget_key] = new GroupBoxProxy(groupbox);

        groupbox->setCheckable(true);

        return groupbox;
    }

    QRadioButton* create_radio_button(
        const string&           widget_key,
        const QString&          label)
    {
        QRadioButton* radio_button = new QRadioButton(label);
        m_widget_proxies[widget_key] = new RadioButtonProxy(radio_button);

        return radio_button;
    }

    QComboBox* create_combobox(
        const string&           widget_key)
    {
        QComboBox* combobox = new QComboBox();
        m_widget_proxies[widget_key] = new ComboBoxProxy(combobox);

        new MouseWheelFocusEventFilter(combobox);

        return combobox;
    }

    template <typename T>
    void create_direct_link(
        const string&           widget_key,
        const string&           param_path,
        const T&                default_value)
    {
        DirectLink direct_link;
        direct_link.m_widget_key = widget_key;
        direct_link.m_param_path = param_path;
        direct_link.m_default_value = to_string(default_value);
        m_direct_links.push_back(direct_link);
    }

    void load_directly_linked_values(const Configuration& config)
    {
        for (const_each<DirectLinkCollection> i = m_direct_links; i; ++i)
            set_widget(i->m_widget_key, get_config<string>(config, i->m_param_path, i->m_default_value));
    }

    void save_directly_linked_values(Configuration& config) const
    {
        for (const_each<DirectLinkCollection> i = m_direct_links; i; ++i)
            set_config(config, i->m_param_path, get_widget<string>(i->m_widget_key));
    }

    template <typename T>
    T get_widget(const string& widget_key) const
    {
        const WidgetProxyCollection::const_iterator i = m_widget_proxies.find(widget_key);
        assert(i != m_widget_proxies.end());
        return from_string<T>(i->second->get());
    }

    template <typename T>
    void set_widget(
        const string&           widget_key,
        const T&                value)
    {
        assert(m_widget_proxies.find(widget_key) != m_widget_proxies.end());
        m_widget_proxies[widget_key]->set(to_string(value));
    }

    template <typename T>
    static T get_config(
        const Configuration&    configuration,
        const string&           param_path,
        const T&                default_value)
    {
        return configuration.get_inherited_parameters().
            template get_path_optional<T>(param_path.c_str(), default_value);
    }

    template <typename T>
    static void set_config(
        Configuration&          configuration,
        const string&           param_path,
        const T&                value)
    {
        configuration.get_parameters().insert_path(param_path, value);
    }
};

namespace
{
    //
    // Image Plane Sampling panel.
    //

    class ImagePlaneSamplingPanel
      : public RenderSettingsPanel
    {
        Q_OBJECT

      public:
        ImagePlaneSamplingPanel(const Configuration& config, QWidget* parent = 0)
          : RenderSettingsPanel("Image Plane Sampling", parent)
        {
            QVBoxLayout* layout = new QVBoxLayout();
            container()->setLayout(layout);

            create_image_plane_sampling_general_settings(layout);
            create_image_plane_sampling_sampler_settings(layout);

            create_direct_link("general.sampler", "pixel_renderer", "uniform");
            create_direct_link("general.passes", "generic_frame_renderer.passes", 1);
            create_direct_link("uniform_sampler.samples", "uniform_pixel_renderer.samples", 64);
            create_direct_link("uniform_sampler.force_antialiasing", "uniform_pixel_renderer.force_antialiasing", false);
            create_direct_link("uniform_sampler.decorrelate_pixels", "uniform_pixel_renderer.decorrelate_pixels", true);
            create_direct_link("adaptive_sampler.min_samples", "adaptive_pixel_renderer.min_samples", 16);
            create_direct_link("adaptive_sampler.max_samples", "adaptive_pixel_renderer.max_samples", 64);
            create_direct_link("adaptive_sampler.quality", "adaptive_pixel_renderer.quality", 2.0);
            create_direct_link("adaptive_sampler.enable_diagnostics", "adaptive_pixel_renderer.enable_diagnostics", false);

            load_directly_linked_values(config);
        }

        virtual void save_config(Configuration& config) const APPLESEED_OVERRIDE
        {
            save_directly_linked_values(config);

            set_config(
                config,
                "shading_result_framebuffer",
                get_widget<size_t>("general.passes") > 1 ? "permanent" : "ephemeral");
        }

      private:
        QComboBox*  m_image_plane_sampler_combo;
        QSpinBox*   m_image_plane_sampler_passes;
        QGroupBox*  m_uniform_image_plane_sampler;
        QGroupBox*  m_adaptive_image_plane_sampler;
        QCheckBox*  m_uniform_sampler_decorrelate_pixels;
        QCheckBox*  m_uniform_sampler_force_aa;

        void create_image_plane_sampling_general_settings(QVBoxLayout* parent)
        {
            QGroupBox* groupbox = new QGroupBox("General");
            parent->addWidget(groupbox);

            QVBoxLayout* layout = new QVBoxLayout();
            groupbox->setLayout(layout);

            QFormLayout* sublayout = create_form_layout();
            layout->addLayout(sublayout);

            m_image_plane_sampler_combo = create_combobox("general.sampler");
            m_image_plane_sampler_combo->addItem("Uniform", "uniform");
            m_image_plane_sampler_combo->addItem("Adaptive", "adaptive");
            m_image_plane_sampler_combo->setCurrentIndex(-1);
            sublayout->addRow("Sampler:", m_image_plane_sampler_combo);

            connect(
                m_image_plane_sampler_combo, SIGNAL(currentIndexChanged(int)),
                SLOT(slot_changed_image_plane_sampler(const int)));

            m_image_plane_sampler_passes = create_integer_input("general.passes", 1, 1000000, 1);
            sublayout->addRow("Passes:", m_image_plane_sampler_passes);
        }

        void create_image_plane_sampling_sampler_settings(QVBoxLayout* parent)
        {
            QHBoxLayout* layout = create_horizontal_layout();
            parent->addLayout(layout);

            create_image_plane_sampling_uniform_sampler_settings(layout);
            create_image_plane_sampling_adaptive_sampler_settings(layout);
        }

        void create_image_plane_sampling_uniform_sampler_settings(QHBoxLayout* parent)
        {
            m_uniform_image_plane_sampler = new QGroupBox("Uniform Sampler");
            parent->addWidget(m_uniform_image_plane_sampler);

            QVBoxLayout* layout = create_vertical_layout();
            m_uniform_image_plane_sampler->setLayout(layout);

            QSpinBox* samples_spinbox = create_integer_input("uniform_sampler.samples", 1, 1000000, 1);
            layout->addLayout(create_form_layout("Samples:", samples_spinbox));

            m_uniform_sampler_force_aa = create_checkbox("uniform_sampler.force_antialiasing", "Force Antialiasing");
            layout->addWidget(m_uniform_sampler_force_aa);

            connect(
                samples_spinbox, SIGNAL(valueChanged(const int)),
                SLOT(slot_changed_uniform_sampler_samples(const int)));

            m_uniform_sampler_decorrelate_pixels =
                create_checkbox("uniform_sampler.decorrelate_pixels", "Decorrelate Pixels");
            layout->addWidget(m_uniform_sampler_decorrelate_pixels);

            connect(
                m_image_plane_sampler_passes, SIGNAL(valueChanged(const int)),
                SLOT(slot_changed_image_plane_sampler_passes(const int)));
        }

        void create_image_plane_sampling_adaptive_sampler_settings(QHBoxLayout* parent)
        {
            m_adaptive_image_plane_sampler = new QGroupBox("Adaptive Sampler");
            parent->addWidget(m_adaptive_image_plane_sampler);

            QVBoxLayout* layout = create_vertical_layout();
            m_adaptive_image_plane_sampler->setLayout(layout);

            QFormLayout* sublayout = create_form_layout();
            layout->addLayout(sublayout);

            sublayout->addRow("Min Samples:", create_integer_input("adaptive_sampler.min_samples", 1, 1000000, 1));
            sublayout->addRow("Max Samples:", create_integer_input("adaptive_sampler.max_samples", 1, 1000000, 1));
            sublayout->addRow("Quality:", create_double_input("adaptive_sampler.quality", -20.0, +20.0, 2, 0.5));

            layout->addWidget(create_checkbox("adaptive_sampler.enable_diagnostics", "Enable Diagnostic AOVs"));
        }

      private slots:
        void slot_changed_image_plane_sampler(const int index)
        {
            const QString sampler = m_image_plane_sampler_combo->itemData(index).value<QString>();

            m_uniform_image_plane_sampler->setEnabled(sampler == "uniform");
            m_adaptive_image_plane_sampler->setEnabled(sampler == "adaptive");
        }

        void slot_changed_image_plane_sampler_passes(const int passes)
        {
            if (passes > 1)
            {
                m_uniform_sampler_decorrelate_pixels->setChecked(true);
                m_uniform_sampler_decorrelate_pixels->setDisabled(true);
            }
            else
            {
                m_uniform_sampler_decorrelate_pixels->setDisabled(false);
            }
        }

        void slot_changed_uniform_sampler_samples(const int samples)
        {
            m_uniform_sampler_force_aa->setDisabled(samples > 1);
        }
    };

    //
    // Lighting panels.
    //

    class LightingPanel
      : public RenderSettingsPanel
    {
      public:
        LightingPanel(const Configuration& config, QWidget* parent = 0)
          : RenderSettingsPanel("Lighting", parent)
        {
        }

        virtual void save_config(Configuration& config) const APPLESEED_OVERRIDE
        {
            save_directly_linked_values(config);
        }

      protected:
        void construct(const Configuration& config, QComboBox* engine_combobox)
        {
            QFormLayout* layout = create_form_layout();
            container()->setLayout(layout);
            layout->addRow("Engine:", engine_combobox);

            create_direct_link("engine", "lighting_engine", "pt");

            load_directly_linked_values(config);
        }
    };

    class FinalConfigurationLightingPanel
      : public LightingPanel
    {
      public:
        FinalConfigurationLightingPanel(const Configuration& config, QWidget* parent = 0)
          : LightingPanel(config, parent)
        {
            QComboBox* combobox = create_combobox("engine");
            combobox->addItem("Distribution Ray Tracer", "drt");
            combobox->addItem("Unidirectional Path Tracer", "pt");
            combobox->addItem("Stochastic Progressive Photon Mapping", "sppm");
            construct(config, combobox);
        }
    };

    class InteractiveConfigurationLightingPanel
      : public LightingPanel
    {
      public:
        InteractiveConfigurationLightingPanel(const Configuration& config, QWidget* parent = 0)
          : LightingPanel(config, parent)
        {
            QComboBox* combobox = create_combobox("engine");
            combobox->addItem("Distribution Ray Tracer", "drt");
            combobox->addItem("Unidirectional Path Tracer", "pt");
            construct(config, combobox);
        }
    };

    //
    // Lighting Engine panel.
    //

    class LightingEnginePanel
      : public RenderSettingsPanel
    {
      public:
        LightingEnginePanel(const QString& title, QWidget* parent = 0)
          : RenderSettingsPanel(title, parent)
        {
        }

      protected:
        void create_bounce_settings_group(QVBoxLayout* parent, const string& prefix)
        {
            QGroupBox* groupbox = new QGroupBox("Bounces");
            parent->addWidget(groupbox);

            QFormLayout* layout = create_form_layout();
            groupbox->setLayout(layout);

            create_bounce_settings(layout, prefix);
        }

        void create_bounce_settings(QFormLayout* layout, const string& prefix)
        {
            const string widget_base_key = prefix + ".bounces.";

            QSpinBox* max_bounces = create_integer_input(widget_base_key + "max_bounces", 0, 10000, 1);
            QCheckBox* unlimited_bounces = create_checkbox(widget_base_key + "unlimited_bounces", "Unlimited");
            layout->addRow("Max Bounces:", create_horizontal_group(max_bounces, unlimited_bounces));
            connect(unlimited_bounces, SIGNAL(toggled(bool)), max_bounces, SLOT(setDisabled(bool)));

            layout->addRow("Russian Roulette Start Bounce:", create_integer_input(widget_base_key + "rr_start_bounce", 1, 10000, 1));
        }

        void load_bounce_settings(
            const Configuration&    config,
            const string&           widget_key_prefix,
            const string&           param_path)
        {
            const size_t DefaultMaxBounces = 8;

            const size_t max_path_length =
                get_config<size_t>(config, param_path, 0);

            set_widget(widget_key_prefix + ".bounces.unlimited_bounces", max_path_length == 0);
            set_widget(widget_key_prefix + ".bounces.max_bounces", max_path_length == 0 ? DefaultMaxBounces : max_path_length - 1);
        }

        void save_bounce_settings(
            Configuration&          config,
            const string&           widget_key_prefix,
            const string&           param_path) const
        {
            const size_t max_path_length =
                !get_widget<bool>(widget_key_prefix + ".bounces.unlimited_bounces")
                    ? get_widget<size_t>(widget_key_prefix + ".bounces.max_bounces") + 1
                    : 0;

            set_config(config, param_path, max_path_length);
        }
    };

    //
    // Distribution Ray Tracer panel.
    //

    class DistributionRayTracerPanel
      : public LightingEnginePanel
    {
      public:
        DistributionRayTracerPanel(const Configuration& config, QWidget* parent = 0)
          : LightingEnginePanel("Distribution Ray Tracer", parent)
        {
            fold();

            QVBoxLayout* layout = new QVBoxLayout();
            container()->setLayout(layout);

            QGroupBox* groupbox = new QGroupBox("Components");
            layout->addWidget(groupbox);

            QVBoxLayout* sublayout = new QVBoxLayout();
            groupbox->setLayout(sublayout);

            sublayout->addWidget(create_checkbox("lighting_components.ibl", "Image-Based Lighting"));

            create_bounce_settings_group(layout, "drt");
            create_drt_advanced_settings(layout);

            create_direct_link("lighting_components.ibl", "drt.enable_ibl", true);
            create_direct_link("drt.bounces.rr_start_bounce", "drt.rr_min_path_length", 3);
            create_direct_link("advanced.dl.light_samples", "drt.dl_light_samples", 1);
            create_direct_link("advanced.ibl.env_samples", "drt.ibl_env_samples", 1);

            load_directly_linked_values(config);

            load_bounce_settings(config, "drt", "drt.max_path_length");
        }

        virtual void save_config(Configuration& config) const APPLESEED_OVERRIDE
        {
            save_directly_linked_values(config);

            save_bounce_settings(config, "drt", "drt.max_path_length");
        }

      private:
        void create_drt_advanced_settings(QVBoxLayout* parent)
        {
            QGroupBox* groupbox = new QGroupBox("Advanced");
            parent->addWidget(groupbox);

            QVBoxLayout* layout = new QVBoxLayout();
            groupbox->setLayout(layout);

            create_drt_advanced_dl_settings(layout);
            create_drt_advanced_ibl_settings(layout);
        }

        void create_drt_advanced_dl_settings(QVBoxLayout* parent)
        {
            QGroupBox* groupbox = new QGroupBox("Direct Lighting");
            parent->addWidget(groupbox);

            QVBoxLayout* layout = create_vertical_layout();
            groupbox->setLayout(layout);

            QHBoxLayout* sublayout = create_horizontal_layout();
            layout->addLayout(sublayout);

            sublayout->addLayout(create_form_layout("Light Samples:", create_double_input("advanced.dl.light_samples", 0.0, 1000000.0, 3, 1.0)));
        }

        void create_drt_advanced_ibl_settings(QVBoxLayout* parent)
        {
            QGroupBox* groupbox = new QGroupBox("Image-Based Lighting");
            parent->addWidget(groupbox);

            QVBoxLayout* layout = create_vertical_layout();
            groupbox->setLayout(layout);

            QHBoxLayout* sublayout = create_horizontal_layout();
            layout->addLayout(sublayout);

            sublayout->addLayout(create_form_layout("Environment Samples:", create_double_input("advanced.ibl.env_samples", 0.0, 1000000.0, 3, 1.0)));
        }
    };

    //
    // Unidirectional Path Tracer panel.
    //

    class UnidirectionalPathTracerPanel
      : public LightingEnginePanel
    {
      public:
        UnidirectionalPathTracerPanel(const Configuration& config, QWidget* parent = 0)
          : LightingEnginePanel("Unidirectional Path Tracer", parent)
        {
            fold();

            QVBoxLayout* layout = new QVBoxLayout();
            container()->setLayout(layout);

            QGroupBox* groupbox = new QGroupBox("Components");
            layout->addWidget(groupbox);

            QVBoxLayout* sublayout = new QVBoxLayout();
            groupbox->setLayout(sublayout);

            sublayout->addWidget(create_checkbox("lighting_components.dl", "Direct Lighting"));
            sublayout->addWidget(create_checkbox("lighting_components.ibl", "Image-Based Lighting"));
            sublayout->addWidget(create_checkbox("lighting_components.caustics", "Caustics"));

            create_bounce_settings_group(layout, "pt");
            create_pt_advanced_settings(layout);

            create_direct_link("lighting_components.dl", "pt.enable_dl", true);
            create_direct_link("lighting_components.ibl", "pt.enable_ibl", true);
            create_direct_link("lighting_components.caustics", "pt.enable_caustics", false);
            create_direct_link("pt.bounces.rr_start_bounce", "pt.rr_min_path_length", 3);
            create_direct_link("advanced.next_event_estimation", "pt.next_event_estimation", true);
            create_direct_link("advanced.dl.light_samples", "pt.dl_light_samples", 1);
            create_direct_link("advanced.ibl.env_samples", "pt.ibl_env_samples", 1);

            load_directly_linked_values(config);

            load_bounce_settings(config, "pt", "pt.max_path_length");

            set_widget("advanced.unlimited_ray_intensity", !config.get_parameters().exist_path("pt.max_ray_intensity"));
            set_widget("advanced.max_ray_intensity", get_config<double>(config, "pt.max_ray_intensity", 1.0));
        }

        virtual void save_config(Configuration& config) const APPLESEED_OVERRIDE
        {
            save_directly_linked_values(config);

            save_bounce_settings(config, "pt", "pt.max_path_length");

            if (get_widget<bool>("advanced.unlimited_ray_intensity"))
                config.get_parameters().remove_path("pt.max_ray_intensity");
            else set_config(config, "pt.max_ray_intensity", get_widget<double>("advanced.max_ray_intensity"));
        }

      private:
        void create_pt_advanced_settings(QVBoxLayout* parent)
        {
            QGroupBox* groupbox = new QGroupBox("Advanced");
            parent->addWidget(groupbox);

            QVBoxLayout* layout = new QVBoxLayout();
            groupbox->setLayout(layout);

            QGroupBox* nee_groupbox = create_checkable_groupbox("advanced.next_event_estimation", "Next Event Estimation");
            layout->addWidget(nee_groupbox);

            QVBoxLayout* nee_layout = create_vertical_layout();
            nee_groupbox->setLayout(nee_layout);

            create_pt_advanced_dl_settings(nee_layout);
            create_pt_advanced_ibl_settings(nee_layout);
            create_pt_advanced_max_ray_intensity_settings(nee_layout);
        }

        void create_pt_advanced_dl_settings(QVBoxLayout* parent)
        {
            QGroupBox* groupbox = new QGroupBox("Direct Lighting");
            parent->addWidget(groupbox);

            QVBoxLayout* layout = create_vertical_layout();
            groupbox->setLayout(layout);

            QHBoxLayout* sublayout = create_horizontal_layout();
            layout->addLayout(sublayout);

            sublayout->addLayout(create_form_layout("Light Samples:", create_double_input("advanced.dl.light_samples", 0.0, 1000000.0, 3, 1.0)));
        }

        void create_pt_advanced_ibl_settings(QVBoxLayout* parent)
        {
            QGroupBox* groupbox = new QGroupBox("Image-Based Lighting");
            parent->addWidget(groupbox);

            QVBoxLayout* layout = create_vertical_layout();
            groupbox->setLayout(layout);

            QHBoxLayout* sublayout = create_horizontal_layout();
            layout->addLayout(sublayout);

            sublayout->addLayout(create_form_layout("Environment Samples:", create_double_input("advanced.ibl.env_samples", 0.0, 1000000.0, 3, 1.0)));
        }

        void create_pt_advanced_max_ray_intensity_settings(QVBoxLayout* parent)
        {
            QDoubleSpinBox* max_ray_intensity = create_double_input("advanced.max_ray_intensity", 0.0, 1.0e9, 3, 0.1);
            QCheckBox* unlimited_ray_intensity = create_checkbox("advanced.unlimited_ray_intensity", "Unlimited");
            parent->addLayout(create_form_layout("Max Ray Intensity:", create_horizontal_group(max_ray_intensity, unlimited_ray_intensity)));
            connect(unlimited_ray_intensity, SIGNAL(toggled(bool)), max_ray_intensity, SLOT(setDisabled(bool)));
        }
    };

    //
    // Stochastic Progressive Photon Mapping panel.
    //

    class SPPMPanel
      : public LightingEnginePanel
    {
      public:
        SPPMPanel(const Configuration& config, QWidget* parent = 0)
          : LightingEnginePanel("Stochastic Progressive Photon Mapping", parent)
        {
            fold();

            QVBoxLayout* layout = new QVBoxLayout();
            container()->setLayout(layout);

            create_photon_type_settings(layout);
            create_components_settings(layout);
            create_photon_tracing_settings(layout);
            create_radiance_estimation_settings(layout);

            create_direct_link("lighting_components.ibl", "sppm.enable_ibl", true);
            create_direct_link("lighting_components.caustics", "sppm.enable_caustics", true);
            create_direct_link("photon_tracing.bounces.rr_start_bounce", "sppm.photon_tracing_rr_min_path_length", 3);
            create_direct_link("photon_tracing.light_photons", "sppm.light_photons_per_pass", 1000000);
            create_direct_link("photon_tracing.env_photons", "sppm.env_photons_per_pass", 1000000);
            create_direct_link("radiance_estimation.bounces.rr_start_bounce", "sppm.path_tracing_rr_min_path_length", 3);
            create_direct_link("radiance_estimation.initial_radius", "sppm.initial_radius", 1.0);
            create_direct_link("radiance_estimation.max_photons", "sppm.max_photons_per_estimate", 100);
            create_direct_link("radiance_estimation.alpha", "sppm.alpha", 0.7);

            load_directly_linked_values(config);

            load_bounce_settings(config, "photon_tracing", "sppm.photon_tracing_max_path_length");
            load_bounce_settings(config, "radiance_estimation", "sppm.path_tracing_max_path_length");

            const string dl_mode = get_config<string>(config, "sppm.dl_mode", "rt");
            if (dl_mode == "rt")
                set_widget("lighting_components.dl.rt", true);
            else if (dl_mode == "sppm")
                set_widget("lighting_components.dl.sppm", true);
            else set_widget("lighting_components.dl.off", true);

            const string photon_type = get_config<string>(config, "sppm.photon_type", "mono");
            if (photon_type == "mono")
                set_widget("photon_type.mono", true);
            else set_widget("photon_type.poly", true);
        }

        virtual void save_config(Configuration& config) const APPLESEED_OVERRIDE
        {
            save_directly_linked_values(config);

            save_bounce_settings(config, "photon_tracing", "sppm.photon_tracing_max_path_length");
            save_bounce_settings(config, "radiance_estimation", "sppm.path_tracing_max_path_length");

            set_config(config, "sppm.dl_mode",
                get_widget<bool>("lighting_components.dl.rt") ? "rt" :
                get_widget<bool>("lighting_components.dl.sppm") ? "sppm" : "off");

            set_config(config, "sppm.photon_type",
                get_widget<bool>("photon_type.mono") ? "mono" : "poly");
        }

      private:
        void create_photon_type_settings(QVBoxLayout* parent)
        {
            QGroupBox* groupbox = new QGroupBox("Photon Type");
            parent->addWidget(groupbox);

            QButtonGroup* buttons = new QButtonGroup(groupbox);
            QRadioButton* buttons_mono = create_radio_button("photon_type.mono", "Monochromatic Photons");
            QRadioButton* buttons_poly = create_radio_button("photon_type.poly", "Polychromatic Photons");
            buttons->addButton(buttons_mono);
            buttons->addButton(buttons_poly);

            QHBoxLayout* photontype_buttons_layout = new QHBoxLayout();
            photontype_buttons_layout->addWidget(buttons_mono);
            photontype_buttons_layout->addWidget(buttons_poly);
            groupbox->setLayout(photontype_buttons_layout);
        }

        void create_components_settings(QVBoxLayout* parent)
        {
            QGroupBox* groupbox = new QGroupBox("Components");
            parent->addWidget(groupbox);

            QVBoxLayout* layout = new QVBoxLayout();
            groupbox->setLayout(layout);

            QButtonGroup* buttons = new QButtonGroup(groupbox);
            QRadioButton* buttons_rt = create_radio_button("lighting_components.dl.rt", "RT Direct Lighting");
            QRadioButton* buttons_sppm = create_radio_button("lighting_components.dl.sppm", "SPPM Direct Lighting");
            QRadioButton* buttons_off = create_radio_button("lighting_components.dl.off", "No Direct Lighting");
            buttons->addButton(buttons_rt);
            buttons->addButton(buttons_sppm);
            buttons->addButton(buttons_off);

            QHBoxLayout* dl_buttons_layout = new QHBoxLayout();
            dl_buttons_layout->addWidget(buttons_rt);
            dl_buttons_layout->addWidget(buttons_sppm);
            dl_buttons_layout->addWidget(buttons_off);
            layout->addLayout(dl_buttons_layout);

            layout->addWidget(create_checkbox("lighting_components.ibl", "Image-Based Lighting"));
            layout->addWidget(create_checkbox("lighting_components.caustics", "Caustics"));
        }

        void create_photon_tracing_settings(QVBoxLayout* parent)
        {
            QGroupBox* groupbox = new QGroupBox("Photon Tracing");
            parent->addWidget(groupbox);

            QVBoxLayout* layout = new QVBoxLayout();
            groupbox->setLayout(layout);

            QFormLayout* sublayout = create_form_layout();
            layout->addLayout(sublayout);

            create_bounce_settings(sublayout, "photon_tracing");
            sublayout->addRow("Light Photons:", create_integer_input("photon_tracing.light_photons", 0, 1000000000, 100000));
            sublayout->addRow("Environment Photons:", create_integer_input("photon_tracing.env_photons", 0, 1000000000, 100000));
        }

        void create_radiance_estimation_settings(QVBoxLayout* parent)
        {
            QGroupBox* groupbox = new QGroupBox("Radiance Estimation");
            parent->addWidget(groupbox);

            QVBoxLayout* layout = new QVBoxLayout();
            groupbox->setLayout(layout);

            QFormLayout* sublayout = create_form_layout();
            layout->addLayout(sublayout);

            create_bounce_settings(sublayout, "radiance_estimation");
            sublayout->addRow("Initial Radius:", create_double_input("radiance_estimation.initial_radius", 0.001, 100.0, 3, 0.1, "%"));
            sublayout->addRow("Max Photons:", create_integer_input("radiance_estimation.max_photons", 8, 1000000000, 50));
            sublayout->addRow("Alpha:", create_double_input("radiance_estimation.alpha", 0.0, 1.0, 2, 0.1));
        }
    };

    //
    // System panel.
    //

    class SystemPanel
      : public LightingEnginePanel
    {
      public:
        SystemPanel(const Configuration& config, QWidget* parent = 0)
          : LightingEnginePanel("System", parent)
        {
            fold();

            QVBoxLayout* layout = new QVBoxLayout();
            container()->setLayout(layout);

            create_system_override_rendering_threads_settings(layout);
            create_system_override_texture_store_max_size_settings(layout);
            create_system_override_tile_ordering_settings(layout);

            load_directly_linked_values(config);

            set_widget("rendering_threads.override", config.get_parameters().strings().exist("rendering_threads"));

            const string default_rendering_threads = to_string(System::get_logical_cpu_core_count());
            const string rendering_threads = get_config<string>(config, "rendering_threads", "auto");
            set_widget("rendering_threads.value", rendering_threads == "auto" ? default_rendering_threads : rendering_threads);
            set_widget("rendering_threads.auto", rendering_threads == "auto");

            const size_t MB = 1024 * 1024;
            const size_t DefaultTextureStoreSizeMB = 1024 * MB;
            set_widget("texture_store_max_size.override", config.get_inherited_parameters().exist_path("texture_store.max_size"));
            set_widget("texture_store_max_size.value", get_config<size_t>(config, "texture_store.max_size", DefaultTextureStoreSizeMB) / MB);

            set_widget("tile_ordering.override", config.get_parameters().exist_path("generic_frame_renderer.tile_ordering"));
            set_widget("tile_ordering.value", get_config<string>(config, "generic_frame_renderer.tile_ordering", "hilbert"));
        }

        virtual void save_config(Configuration& config) const APPLESEED_OVERRIDE
        {
            save_directly_linked_values(config);

            if (get_widget<bool>("rendering_threads.override"))
            {
                set_config(config, "rendering_threads",
                    get_widget<bool>("rendering_threads.auto") ? "auto" : get_widget<string>("rendering_threads.value"));
            }
            else config.get_parameters().strings().remove("rendering_threads");

            if (get_widget<bool>("texture_store_max_size.override"))
                set_config(config, "texture_store.max_size", get_widget<size_t>("texture_store_max_size.value") * 1024 * 1024);
            else config.get_parameters().remove_path("texture_store.max_size");

            if (get_widget<bool>("tile_ordering.override"))
            {
                set_config(config, "generic_frame_renderer.tile_ordering", get_widget<string>("tile_ordering.value"));
            }
            else config.get_parameters().remove_path("generic_frame_renderer.tile_ordering");
        }

      private:
        void create_system_override_rendering_threads_settings(QVBoxLayout* parent)
        {
            QGroupBox* groupbox = create_checkable_groupbox("rendering_threads.override", "Override");
            parent->addWidget(groupbox);

            QSpinBox* rendering_threads = create_integer_input("rendering_threads.value", -65535, 65536, 1);
            QCheckBox* auto_rendering_threads = create_checkbox("rendering_threads.auto", "Auto");
            groupbox->setLayout(create_form_layout("Rendering Threads:", create_horizontal_group(rendering_threads, auto_rendering_threads)));
            connect(auto_rendering_threads, SIGNAL(toggled(bool)), rendering_threads, SLOT(setDisabled(bool)));
        }

        void create_system_override_texture_store_max_size_settings(QVBoxLayout* parent)
        {
            QGroupBox* groupbox = create_checkable_groupbox("texture_store_max_size.override", "Override");
            parent->addWidget(groupbox);

            groupbox->setLayout(
                create_form_layout(
                    "Texture Store Size:",
                    create_integer_input("texture_store_max_size.value", 1, 1024 * 1024, 256, "MB")));
        }

        void create_system_override_tile_ordering_settings(QVBoxLayout* parent)
        {
            QGroupBox* groupbox = create_checkable_groupbox("tile_ordering.override", "Override");
            parent->addWidget(groupbox);

            QComboBox* tile_ordering = create_combobox("tile_ordering.value");
            tile_ordering->addItem("Linear", "linear");
            tile_ordering->addItem("Spiral", "spiral");
            tile_ordering->addItem("Hilbert", "hilbert");
            tile_ordering->addItem("Random", "random");
            groupbox->setLayout(create_form_layout("Tile Ordering:", tile_ordering));
        }
    };
}

//
// RenderingSettingsWindow class implementation.
//

RenderingSettingsWindow::RenderingSettingsWindow(ProjectManager& project_manager, QWidget* parent)
  : QWidget(parent)
  , m_ui(new Ui::RenderingSettingsWindow())
  , m_project_manager(project_manager)
{
    m_ui->setupUi(this);

    setWindowFlags(Qt::Window);

    m_ui->scrollarea->setProperty("hasFrame", true);
    m_ui->scrollareawidget->hide();

    create_connections();

    reload();
}

RenderingSettingsWindow::~RenderingSettingsWindow()
{
    delete m_ui;
}

void RenderingSettingsWindow::reload()
{
    vector<QString> configs;

    for (const_each<ConfigurationContainer> i = m_project_manager.get_project()->configurations(); i; ++i)
    {
        if (!BaseConfigurationFactory::is_base_configuration(i->get_name()))
            configs.push_back(i->get_name());
    }

    sort(configs.begin(), configs.end());

    // This will load an empty configuration.
    m_current_configuration_name.clear();

    // This will load the first configuration.
    m_ui->combobox_configurations->clear();
    for (size_t i = 0; i < configs.size(); ++i)
        m_ui->combobox_configurations->addItem(configs[i]);
}

void RenderingSettingsWindow::create_connections()
{
    connect(m_ui->pushbutton_manage, SIGNAL(clicked()), SLOT(slot_open_configuration_manager_window()));

    connect(
        m_ui->combobox_configurations, SIGNAL(currentIndexChanged(const QString&)),
        SLOT(slot_change_active_configuration(const QString&)));

    connect(m_ui->buttonbox, SIGNAL(accepted()), SLOT(slot_save_configuration_and_close()));
    connect(m_ui->buttonbox, SIGNAL(rejected()), SLOT(slot_restore_configuration_and_close()));

    connect(
        create_window_local_shortcut(this, Qt::Key_Return), SIGNAL(activated()),
        SLOT(slot_save_configuration_and_close()));

    connect(
        create_window_local_shortcut(this, Qt::Key_Enter), SIGNAL(activated()),
        SLOT(slot_save_configuration_and_close()));

    connect(
        create_window_local_shortcut(this, Qt::Key_Escape), SIGNAL(activated()),
        SLOT(slot_restore_configuration_and_close()));
}

namespace
{
    bool is_interactive_configuration(const Configuration& config)
    {
        if (BaseConfigurationFactory::is_base_interactive_configuration(config.get_name()))
            return true;

        const Configuration* base_config = config.get_base();

        if (base_config == 0)
            return false;

        return is_interactive_configuration(*base_config);
    }
}

void RenderingSettingsWindow::create_panels(const Configuration& config)
{
    const bool interactive = is_interactive_configuration(config);

    m_panels.clear();

    if (!interactive)
        m_panels.push_back(new ImagePlaneSamplingPanel(config));

    if (interactive)
        m_panels.push_back(new InteractiveConfigurationLightingPanel(config));
    else m_panels.push_back(new FinalConfigurationLightingPanel(config));

    m_panels.push_back(new DistributionRayTracerPanel(config));
    m_panels.push_back(new UnidirectionalPathTracerPanel(config));

    if (!interactive)
        m_panels.push_back(new SPPMPanel(config));

    m_panels.push_back(new SystemPanel(config));
}

void RenderingSettingsWindow::create_layout()
{
    QLayout* root_layout = m_ui->scrollareawidget->layout();
    assert(root_layout);

    clear_layout(root_layout);

    root_layout->addItem(new QSpacerItem(470, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));

    for (const_each<PanelCollection> i = m_panels; i; ++i)
        root_layout->addWidget(*i);
}

void RenderingSettingsWindow::set_panels_enabled(const bool enabled)
{
    for (const_each<PanelCollection> i = m_panels; i; ++i)
        (*i)->container()->setEnabled(enabled);
}

void RenderingSettingsWindow::load_configuration(const QString& name)
{
    assert(!name.isEmpty());

    const Configuration& config = get_configuration(name);

    create_panels(config);
    create_layout();

    set_panels_enabled(
        !BaseConfigurationFactory::is_base_configuration(
            name.toAscii().constData()));

    m_current_configuration_name = name;
    m_initial_values = get_widget_values();
}

void RenderingSettingsWindow::save_current_configuration()
{
    if (m_current_configuration_name.isEmpty())
        return;

    if (BaseConfigurationFactory::is_base_configuration(m_current_configuration_name.toAscii().constData()))
        return;

    Configuration& config = get_configuration(m_current_configuration_name);

    for (const_each<PanelCollection> i = m_panels; i; ++i)
        (*i)->save_config(config);

    m_initial_values = get_widget_values();

    emit signal_settings_modified();
}

Configuration& RenderingSettingsWindow::get_configuration(const QString& name) const
{
    Configuration* configuration =
        m_project_manager.get_project()->configurations().get_by_name(name.toAscii().constData());

    assert(configuration);

    return *configuration;
}

map<string, string> RenderingSettingsWindow::get_widget_values() const
{
    map<string, string> values;

    for (const_each<PanelCollection> i = m_panels; i; ++i)
    {
        const map<string, string> panel_values = (*i)->get_widget_values();
        values.insert(panel_values.begin(), panel_values.end());
    }

    return values;
}

void RenderingSettingsWindow::slot_open_configuration_manager_window()
{
    ConfigurationManagerWindow* config_manager_window = new ConfigurationManagerWindow(this);

    config_manager_window->showNormal();
    config_manager_window->activateWindow();
}

namespace
{
    int show_modified_configuration_message_box(QWidget* parent)
    {
        QMessageBox msgbox(parent);
        msgbox.setWindowTitle("Save Changes?");
        msgbox.setIcon(QMessageBox::Question);
        msgbox.setText("This configuration has been modified.");
        msgbox.setInformativeText("Do you want to save your changes?");
        msgbox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard);
        msgbox.setDefaultButton(QMessageBox::Save);
        return msgbox.exec();
    }
}

void RenderingSettingsWindow::slot_change_active_configuration(const QString& configuration_name)
{
    if (!m_current_configuration_name.isEmpty())
    {
        if (get_widget_values() != m_initial_values)
        {
            switch (show_modified_configuration_message_box(this))
            {
              case QMessageBox::Save:
                save_current_configuration();
                break;

              case QMessageBox::Discard:
                break;
            }
        }
    }

    if (!configuration_name.isEmpty())
        load_configuration(configuration_name);

    m_ui->scrollareawidget->show();
}

void RenderingSettingsWindow::slot_save_configuration_and_close()
{
    save_current_configuration();
    close();
}

void RenderingSettingsWindow::slot_restore_configuration_and_close()
{
    load_configuration(m_current_configuration_name);
    close();
}

}   // namespace studio
}   // namespace appleseed

#include "mainwindow/moc_cpp_renderingsettingswindow.cxx"


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- From: file:/Users/applelike/Desktop/Camera2Video/Application/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.0/res/values-v18/values-v18.xml -->
    <eat-comment/>
    <dimen name="abc_switch_padding">0px</dimen>
</resources>

redpajama_set_name: RedPajamaGithub


text:
[![Travis](https://img.shields.io/travis/i18next/i18next-xhr-backend/master.svg?style=flat-square)](https://travis-ci.org/i18next/i18next-xhr-backend)
[![Coveralls](https://img.shields.io/coveralls/i18next/i18next-xhr-backend/master.svg?style=flat-square)](https://coveralls.io/github/i18next/i18next-xhr-backend)
[![npm version](https://img.shields.io/npm/v/i18next-xhr-backend.svg?style=flat-square)](https://www.npmjs.com/package/i18next-xhr-backend)
[![Bower](https://img.shields.io/bower/v/i18next-xhr-backend.svg)]()
[![David](https://img.shields.io/david/i18next/i18next-xhr-backend.svg?style=flat-square)](https://david-dm.org/i18next/i18next-xhr-backend)

This is a simple i18next backend to be used in the browser. It will load resources from a backend server using xhr.

# Getting started

Source can be loaded via [npm](https://www.npmjs.com/package/i18next-xhr-backend), bower or [downloaded](https://github.com/i18next/i18next-xhr-backend/blob/master/i18nextXHRBackend.min.js) from this repo.

```
# npm package
$ npm install i18next-xhr-backend

# bower
$ bower install i18next-xhr-backend
```

Wiring up:

```js
import i18next from 'i18next';
import XHR from 'i18next-xhr-backend';

i18next
  .use(XHR)
  .init(i18nextOptions);
```

- As with all modules you can either pass the constructor function (class) to the i18next.use or a concrete instance.
- If you don't use a module loader it will be added to `window.i18nextXHRBackend`

## Backend Options

```js
{
  // path where resources get loaded from, or a function
  // returning a path:
  // function(lngs, namespaces) { return customPath; }
  // the returned path will interpolate lng, ns if provided like giving a static path
  loadPath: '/locales/{{lng}}/{{ns}}.json',

  // path to post missing resources
  addPath: 'locales/add/{{lng}}/{{ns}}',

  // your backend server supports multiloading
  // /locales/resources.json?lng=de+en&ns=ns1+ns2
  allowMultiLoading: false, // set loadPath: '/locales/resources.json?lng={{lng}}&ns={{ns}}' to adapt to multiLoading

  // parse data after it has been fetched
  // in example use https://www.npmjs.com/package/json5
  // here it removes the letter a from the json (bad idea)
  parse: function(data) { return data.replace(/a/g, ''); },

  // allow cross domain requests
  crossDomain: false,

  // allow credentials on cross domain requests
  withCredentials: false,

  // define a custom xhr function
  // can be used to support XDomainRequest in IE 8 and 9
  ajax: function (url, options, callback, data) {},

  // adds parameters to resource URL. 'example.com' -> 'example.com?v=1.3.5'
  queryStringParams: { v: '1.3.5' }
}
```

Options can be passed in:

**preferred** - by setting options.backend in i18next.init:

```js
import i18next from 'i18next';
import XHR from 'i18next-xhr-backend';

i18next
  .use(XHR)
  .init({
    backend: options
  });
```

on construction:

```js
  import XHR from 'i18next-xhr-backend';
  const xhr = new XHR(null, options);
```

via calling init:

```js
  import XHR from 'i18next-xhr-backend';
  const xhr = new XHR();
  xhr.init(options);
```

### Usage with webpack

To use with webpack, install [bundle-loader](https://github.com/webpack/bundle-loader) and [json-loader](https://github.com/webpack/json-loader).

Define a custom xhr function, webpack's bundle loader will load the translations for you.

```js
function loadLocales(url, options, callback, data) {
  try {
    let waitForLocale = require('bundle!./locales/'+url+'.json');
    waitForLocale((locale) => {
      callback(locale, {status: '200'});
    })
  } catch (e) {
    callback(null, {status: '404'});
  }
}

i18next
  .use(XHR)
  .init({
    backend: {
      loadPath: '{{lng}}',
      parse: (data) => data,
      ajax: loadLocales
    }
  }, (err, t) => {
    // ...
  });
```

## TypeScript definitions

- Install from `@types` (for TypeScript v2 and later):

        npm install --save-dev @types/i18next-xhr-backend

- Install from `typings`:

        typings install --save --global dt~i18next-xhr-backend


text:
import wx

class JointPanel(wx.Panel):
    def __init__(self, parent, joint_name="joint", min_position=-3.14159, max_position=3.14159, max_velocity=100.0, max_effort=100.0, input_mode=True):

        # Create Joint Properties and initialize to None
        self.joint_name = joint_name
        self.min_position = min_position
        self.max_position = max_position
        self.max_velocity = max_velocity
        self.max_effort = max_effort
        self.position = (max_position - min_position)/2 + min_position
        self.velocity = max_velocity/2
        self.effort = max_effort
        self.input_mode = input_mode

        # Set some control properties
        self.slider_increments = 100

        # Create Control Panel
        wx.Panel.__init__(self, parent, wx.ID_ANY, style=wx.BORDER_SUNKEN)

        # Create slider: min_label - slider - max_label
        self.min_position_label = wx.StaticText(self, wx.ID_ANY, str(self.min_position))
        self.position_slider = wx.Slider(self, wx.ID_ANY, minValue=0, maxValue=self.slider_increments, style=wx.SL_AUTOTICKS | wx.SL_HORIZONTAL)
        self.position_slider.Enable(self.input_mode)
        self.max_position_label = wx.StaticText(self, wx.ID_ANY, str(self.max_position))

        sizer_slider = wx.BoxSizer(wx.HORIZONTAL)
        sizer_slider.Add(self.min_position_label, 0, wx.CENTER | wx.ALL, 5)
        sizer_slider.Add(self.position_slider, 1, wx.CENTER)
        sizer_slider.Add(self.max_position_label, 0, wx.CENTER | wx.ALL, 5)

        # Create Joint Properties display boxes
        self.position_label = wx.StaticText(self, wx.ID_ANY, "Position")
        self.position_text = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PROCESS_ENTER)
        self.velocity_label = wx.StaticText(self, wx.ID_ANY, "Velocity")
        self.velocity_text = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PROCESS_ENTER)
        self.effort_label = wx.StaticText(self, wx.ID_ANY, "Effort")
        self.effort_text = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PROCESS_ENTER)

        sizer_properties = wx.BoxSizer(wx.HORIZONTAL)
        sizer_properties.Add(self.position_label, 0, wx.CENTER | wx.ALL, 5)
        sizer_properties.Add(self.position_text, 0, wx.CENTER | wx.TOP | wx.BOTTOM | wx.LEFT, 5)
        sizer_properties.Add((1,1), 1, wx.CENTER)
        sizer_properties.Add(self.velocity_label, 0, wx.CENTER | wx.ALL, 5)
        sizer_properties.Add(self.velocity_text, 0, wx.CENTER | wx.TOP | wx.BOTTOM, 5)
        sizer_properties.Add((1,1), 1, wx.CENTER)
        sizer_properties.Add(self.effort_label, 0, wx.CENTER | wx.ALL, 5)
        sizer_properties.Add(self.effort_text, 0, wx.CENTER | wx.TOP | wx.BOTTOM | wx.RIGHT, 5)

        # Stack the Slider and the Properties vertically
        sizer_panel = wx.BoxSizer(wx.VERTICAL)
        sizer_panel.Add(sizer_slider, 0, wx.EXPAND)
        sizer_panel.Add(sizer_properties, 0, wx.EXPAND)

        self.SetSizer(sizer_panel)

        # Register Callbacks
        if self.input_mode:
            self.position_slider.Bind(wx.EVT_SCROLL, self._on_slider_update)
            self.position_text.Bind(wx.EVT_TEXT_ENTER, self._on_position_update)
            self.position_text.Bind(wx.EVT_KILL_FOCUS, self._on_position_update)
            self.velocity_text.Bind(wx.EVT_TEXT_ENTER, self._on_velocity_update)
            self.velocity_text.Bind(wx.EVT_KILL_FOCUS, self._on_velocity_update)
            self.effort_text.Bind(wx.EVT_TEXT_ENTER, self._on_effort_update)
            self.effort_text.Bind(wx.EVT_KILL_FOCUS, self._on_effort_update)

        # Perform an initial update/redraw of the panel
        self.update_panel()

    def update_panel(self):
        if (self.position is not None):
            self.position_slider.SetValue(self.position2slider(self.position))
            self.position_text.SetValue('%.5f' % self.position)
        else:
            self.position_slider.SetValue(self.position2slider(self.min_position))
            self.position_text.SetValue('')
        if (self.velocity is not None):
            self.velocity_text.SetValue('%.5f' % self.velocity)
        else:
            self.velocity_text.SetValue('')
        if (self.effort is not None):
            self.effort_text.SetValue('%.5f' % self.effort)
        else:
            self.effort_text.SetValue('')

    def position2slider(self, position):
        # Convert a process value into a slider increment
        return int(round(self.slider_increments * (position - self.min_position) / (self.max_position - self.min_position)))

    def slider2position(self, slider):
        # Convert a process value into a slider increment
        return (float(slider) / self.slider_increments * (self.max_position - self.min_position) + self.min_position)

    def _on_slider_update(self, event):
        self.position = self.slider2position(self.position_slider.GetValue())
        self.update_panel()

    def _on_position_update(self, event):
        try:
            self.position = float(self.position_text.GetValue())
            self.position = min(max(self.position, self.min_position), self.max_position)
        except:
            self.position = None
        self.update_panel()

    def _on_velocity_update(self, event):
        try:
            self.velocity = float(self.velocity_text.GetValue())
            if self.velocity > self.max_velocity:
                self.velocity = self.max_velocity
            elif self.velocity < -self.max_velocity:
                self.velocity = -self.max_velocity
        except:
            self.velocity = None
        self.update_panel()

    def _on_effort_update(self, event):
        try:
            self.effort = float(self.effort_text.GetValue())
            if self.effort > self.max_effort:
                self.effort = self.max_effort
        except:
            self.effort = None
        self.update_panel()


text:
// This file has been prepared for Doxygen automatic documentation generation.

#ifndef CMD_IF_3290P_H
#define CMD_IF_3290P_H

/*============================     INCLUDES       ============================*/
#include <stdbool.h>

//! \addtogroup applCmdAVRRAVEN3290p
//! @{
/*============================     MACROS         ============================*/

/*============================     TYPEDEFS       ============================*/

/*============================     VARIABLES      ============================*/

/*============================     FUNCTIONS      ============================*/

/*! \brief  Initialization of the command interface.
 *
 *          The initalization function uses a static data buffer and
 *          initializes the sipc communction interface with a pointer to this
 *          buffer.
 *
 *  \retval true Command interface initialized successfully.
 *  \retval false Command interface failed to initialize.
 */
extern bool cmd_if_init(void);

/*! \brief  De-initialization of the command interface.
 *
 *          The de-initalization function also de-initializes the sipc
 *          communction interface.
 *
 */
extern void cmd_if_deinit(void);
//! @}
#endif
/*EOF*/


text:
package com.github.amlcurran.showcaseview;

import android.graphics.Rect;
import android.util.Log;

/**
 * Class responsible for calculating where the Showcase should position itself
 */
class ShowcaseAreaCalculator {

    private final Rect mShowcaseRect = new Rect();

    /**
     * Creates a {@link android.graphics.Rect} which represents the area the showcase covers. Used
     * to calculate where best to place the text
     *
     * @return true if voidedArea has changed, false otherwise.
     */
    public boolean calculateShowcaseRect(float x, float y, ShowcaseDrawer showcaseDrawer) {

        int cx = (int) x, cy = (int) y;
        int dw = showcaseDrawer.getShowcaseWidth();
        int dh = showcaseDrawer.getShowcaseHeight();

        if (mShowcaseRect.left == cx - dw / 2 && mShowcaseRect.top == cy - dh / 2) {
            return false;
        }

        Log.d("ShowcaseView", "Recalculated");

        mShowcaseRect.left = cx - dw / 2;
        mShowcaseRect.top = cy - dh / 2;
        mShowcaseRect.right = cx + dw / 2;
        mShowcaseRect.bottom = cy + dh / 2;

        return true;

    }

    public Rect getShowcaseRect() {
        return mShowcaseRect;
    }

}


text:
namespace deepmind {
namespace multidim_image_augmentation {
namespace {

using ::tensorflow::shape_inference::DimensionHandle;
using ::tensorflow::shape_inference::InferenceContext;

uint64 RandomSeed() {
  std::random_device device("/dev/urandom");
  std::mt19937_64 seed_rng(device());
  return seed_rng();
}

REGISTER_OP("RandomLUTControlPoints")
    .SetIsStateful()
    .Output("output: float")
    .Attr("new_black_range: list(float)")
    .Attr("new_white_range: list(float)")
    .Attr("slope_min: float = 0.8")
    .Attr("slope_max: float = 1.2")
    .Attr("num_control_point_insertions: int = 2")
    .SetShapeFn([](InferenceContext* c) {
      int32 num_control_points;
      TF_RETURN_IF_ERROR(
          c->GetAttr("num_control_point_insertions", &num_control_points));

      DimensionHandle out_shape = c->MakeDim((1 << num_control_points) + 1);
      c->set_output(0, c->MakeShape({out_shape}));
      return tensorflow::Status::OK();
    })
    .Doc(R"doc(
Creates controlpoints for a random monotonic increasing tabulated function.

Iteratively creates controlpoints for a random monotonic increasing
function.  It starts with a uniform random value for black and a
uniform random value for white. Then iteratively inserts random
controlpoints between the existing ones, conforming to the slope_min
and slope_max constraints.

new_black_range: 2-element float list specifying the range for the
  new "black" value, i.e. the start value of the
  tabulated function. Default: [-0.1, 0.1]
new_white_range: 2-element float list specifying the range for the
  new "white" value, i.e. the end value of the
  tabulated function. Default: [0.9, 1.1]
slope_min: minimum slope for the resulting function
slope_max: maximum slope for the resulting function
num_control_point_insertions: number of splits. i.e.
    no split: 2 points
     1 split: 3 points
    2 splits: 5 points
    3 splits: 9 points,

output: 1-D Tensor containing the control points
)doc");

}  // namespace
}  // namespace multidim_image_augmentation
}  // namespace deepmind


text:
@*
* Copyright 2016 LinkedIn Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*@

@(title: String, page: String)(content: Html)
@import java.lang.Boolean; var analytics = false
@(analytics=play.Play.application().configuration().getBoolean("enable.analytics", false))

@*
* The base layout of Dr. Elephant
*
* This includes the nav bar at the top and other supporting stylesheets
*@

<!DOCTYPE html>

    <title>@title</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="shortcut icon" type="image/png" href='@routes.Assets.at("images/favicon.png")'>

    <link rel='stylesheet' href='@routes.Assets.at("assets/bootstrap/css/bootstrap.min.css")'>
    <link rel='stylesheet' href='@routes.Assets.at("css/main.css")'>
    <link rel='stylesheet' href='@routes.Assets.at("assets/bootstrap-datepicker/css/datepicker.css")'>

          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            Toggle navigation

          </button>
          Dr. Elephant

Dashboard

Search

Compare

Flow History

Job History

Help

    @content

    @if(analytics) {

    }


text:
using namespace ndnrtc;
using namespace std;
using namespace webrtc;

::testing::Environment* const env = ::testing::AddGlobalTestEnvironment(new NdnRtcTestEnvironment(ENV_NAME));

class NdnAudioChannelTester : public NdnRtcObjectTestHelper,
public UnitTestHelperNdnNetwork,
public webrtc::Transport,
public IAudioPacketConsumer
{
public:
    void SetUp()
    {
        setupWebRTCLogging();

        params_ = DefaultParamsAudio;
        params_.streamName = "audio0";
        params_.streamThread = "pcmu2";
        params_.freshness = 5;

        NdnRtcObjectTestHelper::SetUp();

        std::string streamAccessPrefix, userPrefix;
        ASSERT_EQ(RESULT_OK, MediaSender::getStreamKeyPrefix(params_,
                                                             streamAccessPrefix));
        ASSERT_EQ(RESULT_OK, MediaSender::getUserPrefix(params_, userPrefix));

        UnitTestHelperNdnNetwork::NdnSetUp(streamAccessPrefix, userPrefix);

        config_.Set<AudioCodingModuleFactory>(new NewAudioCodingModuleFactory());
        voiceEngine_ = VoiceEngine::Create(config_);

        ASSERT_TRUE(voiceEngine_ != NULL);

        VoEAudioProcessing *voe_proc = VoEAudioProcessing::GetInterface(voiceEngine_);

        voe_proc->SetEcStatus(true, kEcConference);
        voe_proc->Release();

        voe_base_ = VoEBase::GetInterface(voiceEngine_);
        voe_base_->Init();

        sendCS_ = webrtc::CriticalSectionWrapper::CreateCriticalSection();
    }

    void TearDown()
    {
        NdnRtcObjectTestHelper::TearDown();
        UnitTestHelperNdnNetwork::NdnTearDown();

        if (voiceEngine_ != NULL)
        {
            voe_base_->Release();
            VoiceEngine::Delete(voiceEngine_);
        }

        delete sendCS_;
    }

    void onTimeout(const shared_ptr<const Interest>& interest)
    {
        UnitTestHelperNdnNetwork::onTimeout(interest);

        LOG_INFO("got timeout for %s", interest->getName().toUri().c_str());
    }

    void onData(const shared_ptr<const Interest>& interest,
                const shared_ptr<Data>& data)
    {
        UnitTestHelperNdnNetwork::onData(interest, data);

        unsigned char *rawAudioData = (unsigned char*)data->getContent().buf();

        NdnAudioData::AudioPacket packet;

        EXPECT_EQ(RESULT_OK, NdnAudioData::unpackAudio(data->getContent().size(),
                                                       rawAudioData, packet));

        if (packet.isRTCP_)
            rtcpDataFetched_++;
        else
            rtpDataFetched_++;
    }

    int SendPacket(int channel, const void *data, int len)
    {
        string rtpPrefix;
        NdnAudioData::AudioPacket p = {false, NdnRtcUtils::millisecondTimestamp(),
            (unsigned int)len, (unsigned char*)data};
        NdnAudioData adata(p);
        NdnAudioSender::getStreamFramePrefix(params_, rtpPrefix);

        sendCS_->Enter();
        publishMediaPacket(adata.getLength(), adata.getData(),
                           currentRTPFrame_++, params_.segmentSize,
                           rtpPrefix, params_.freshness);
        sendCS_->Leave();

        nRTPSent_++;
        return len;
    }

    int SendRTCPPacket(int channel, const void *data, int len)
    {
        string rtcpPrefix;
        NdnAudioData::AudioPacket p = {true, NdnRtcUtils::millisecondTimestamp(),
            (unsigned int)len, (unsigned char*)data};
        NdnAudioData adata(p);

        NdnAudioSender::getStreamControlPrefix(params_, rtcpPrefix);

        // using RTP frames counter!!!
        sendCS_->Enter();
#if 0
        NdnAudioSender::getStreamControlPrefix(params_, rtcpPrefix);
        publishMediaPacket(adata.getLength(), adata.getData(),
                           currentRTCPFrame_++, params_.segmentSize,
                           rtcpPrefix, params_.freshness);
#else
        publishMediaPacket(adata.getLength(), adata.getData(),
                           currentRTPFrame_++, params_.segmentSize,
                           rtcpPrefix, params_.freshness);
#endif
        sendCS_->Leave();

        nRTCPSent_++;

        return len;
    }

    void onRTPPacketReceived(unsigned int len, unsigned char *data)
    {
        rtpDataFetched_++;
    }

    void onRTCPPacketReceived(unsigned int len, unsigned char *data)
    {
        rtcpDataFetched_++;
    }

    void onErrorOccurred(const char *errorMessage)
    {
        NdnRtcObjectTestHelper::onErrorOccurred(errorMessage);

        LOG_INFO("ERROR occurred: %s", errorMessage);
    }

protected:
    unsigned int nRTPSent_ = 0, nRTCPSent_ = 0,
                    currentRTPFrame_ = 0, currentRTCPFrame_ = 0;
    unsigned int rtpDataFetched_ = 0, rtcpDataFetched_ = 0;

    VoiceEngine *voiceEngine_ = NULL;
    VoEBase *voe_base_ = NULL;
    Config config_;
    webrtc::CriticalSectionWrapper *sendCS_;
};

TEST_F(NdnAudioChannelTester, TestSendChannelCreateDelete)
{
    ASSERT_NO_THROW(
                    NdnAudioSendChannel *ch = new NdnAudioSendChannel(DefaultParamsAudio, voiceEngine_);
                    delete ch;
    );
}

TEST_F(NdnAudioChannelTester, TestSendChannel)
{
    // based on the observations: 50 packets ~ 1 second of recording
    int nPackets = 100;
    int overhead = 500;
    int64_t publishTime = nPackets*20+overhead;

    // make sure packets will not be dropped
    params_.freshness = (publishTime*2/1000 < 1.)? 1 : publishTime*2/1000;

    NdnAudioSendChannel sendChannel(params_, voiceEngine_);
    sendChannel.setObserver(this);

    EXPECT_EQ(0, sendChannel.init(ndnReceiverTransport_));

    UnitTestHelperNdnNetwork::startProcessingNdn();

    int64_t startTime = millisecondTimestamp();
    EXPECT_EQ(RESULT_OK,sendChannel.start());
    EXPECT_FALSE(obtainedError_);

    // now check what we have on the network
    string rtpPrefix, rtcpPrefix;
    EXPECT_EQ(RESULT_OK, NdnAudioSender::getStreamFramePrefix(params_,
                                                              rtpPrefix));
    EXPECT_EQ(RESULT_OK, NdnAudioSender::getStreamControlPrefix(params_,
                                                           rtcpPrefix));
    Name rtpPacketPrefix(rtpPrefix);
    Name rtcpPacketPrefix(rtcpPrefix);

    for (int i = 0; i < nPackets; i++)
    {
        Name prefix = rtpPacketPrefix;

        char frameNoStr[3];
        memset(&frameNoStr[0], 0, 3);
        sprintf(&frameNoStr[0], "%d", i);

        prefix.addComponent((const unsigned char*)&frameNoStr[0], strlen(frameNoStr));

        LOG_INFO("expressing %s", prefix.toUri().c_str());
        ndnFace_->expressInterest(prefix, bind(&NdnAudioChannelTester::onData, this, _1, _2),
                                  bind(&NdnAudioChannelTester::onTimeout, this, _1));
        WAIT(10);
        publishTime -= 10;

        if (publishTime <= 0)
        {
            publishTime = 0;
            EXPECT_EQ(0,sendChannel.stop());
        }
    }

    if (publishTime > 0)
    {
        WAIT(publishTime);
        EXPECT_EQ(RESULT_OK,sendChannel.stop());
    }

    // make some overhead for waiting data to be fetched
    int fetchTime = publishTime;

    EXPECT_TRUE_WAIT(((rtpDataFetched_ + rtcpDataFetched_) == nPackets),
                     fetchTime);

    UnitTestHelperNdnNetwork::stopProcessingNdn();

    EXPECT_EQ(0,nReceivedTimeout_);

    // expect at least 80% RTP and 1% RTCP
    cout << "RTP fetched: " << rtpDataFetched_ << endl;
    cout << "RTCP fetched: " << rtcpDataFetched_ << endl;

    EXPECT_LE(0.80*nPackets, rtpDataFetched_);
    EXPECT_LE(0.01*nPackets, rtcpDataFetched_);
    EXPECT_LE(nPackets, rtpDataFetched_+rtcpDataFetched_);

    // wait unless data will become stale
    WAIT(params_.freshness*1000);
}

class AudioReceiverChannelTester : public NdnAudioReceiveChannel
{
public:
    AudioReceiverChannelTester(ParamsStruct &params, webrtc::VoiceEngine *ve):
        NdnAudioReceiveChannel(params, ve){}

    unsigned int nRTPReceived_ = 0, nRTCPReceived_ = 0;

    void onRTPPacketReceived(unsigned int len, unsigned char *data)
    {
        NdnAudioReceiveChannel::onRTPPacketReceived(len, data);
        nRTPReceived_++;
    }
    void onRTCPPacketReceived(unsigned int len, unsigned char *data)
    {
        NdnAudioReceiveChannel::onRTCPPacketReceived(len, data);
        nRTCPReceived_++;
    }
};

TEST_F(NdnAudioChannelTester, TestReceiveChannel)
{
    params_.bufferSize = 33;
    params_.slotSize = 1500;

    AudioReceiverChannelTester receiverTester(params_, voiceEngine_);

    receiverTester.setObserver(this);
    EXPECT_EQ(RESULT_OK, receiverTester.init(ndnReceiverFace_));

    int channel = voe_base_->CreateChannel();

    ASSERT_LE(0,channel);

    VoENetwork *voe_network = VoENetwork::GetInterface(voiceEngine_);
    EXPECT_EQ(0, voe_network->RegisterExternalTransport(channel, *this));

    EXPECT_EQ(RESULT_OK, receiverTester.start());
    EXPECT_EQ(0, voe_base_->StartSend(channel));

    uint64_t overhead = 200;
    unsigned int publishPacketsNum = 700;
    // we are expecting to receive less than we've published
    unsigned int expectedFetchedPacketsNum = 0.7*publishPacketsNum;

    EXPECT_TRUE_WAIT((nRTPSent_+nRTCPSent_) >= publishPacketsNum,
                     publishPacketsNum*20+overhead);

    cout << "Published RTP: " << nRTPSent_ << ", RTCP: " << nRTCPSent_ << endl;

    sendCS_->Enter();
    { // stop publishing
        int res = voe_base_->StopSend(channel);

        EXPECT_EQ(0, res);

        if (res < 0)
            LOG_INFO("error while stopping voe_base: %d", voe_base_->LastError());

        EXPECT_EQ(0, voe_network->DeRegisterExternalTransport(channel));
        voe_network->Release();
    }
    sendCS_->Leave();

    EXPECT_TRUE_WAIT((receiverTester.nRTPReceived_+receiverTester.nRTCPReceived_) >= expectedFetchedPacketsNum, publishPacketsNum*20+overhead);

    cout << "Fetched RTP: " << receiverTester.nRTPReceived_ << ", RTCP: " << receiverTester.nRTCPReceived_ << endl;

    { // stop fetching
        EXPECT_EQ(RESULT_OK, receiverTester.stop());
        EXPECT_GE(nRTPSent_, receiverTester.nRTPReceived_);
        EXPECT_GE(nRTCPSent_, receiverTester.nRTCPReceived_);
    }
    WAIT(params_.freshness*1000);
}

TEST_F(NdnAudioChannelTester, TestSendReceive)
{
    int nPackets = 500;
    int overhead = 500;
    int recordingTime = nPackets*20+overhead;

    params_.freshness = (recordingTime/1000.)<1.?1.:recordingTime/1000.;

    { // send datda
        NdnAudioReceiveChannel recevier(params_, voiceEngine_);
        NdnAudioSendChannel sender(params_, voiceEngine_);

        EXPECT_EQ(RESULT_OK, recevier.init(ndnReceiverFace_));
        EXPECT_EQ(RESULT_OK, sender.init(ndnTransport_));

        EXPECT_EQ(RESULT_OK, recevier.start());
        EXPECT_EQ(RESULT_OK, sender.start());

        WAIT(recordingTime);

        EXPECT_EQ(RESULT_OK, recevier.stop());
        EXPECT_EQ(RESULT_OK, sender.stop());
    }
    WAIT(params_.freshness*1000);
}


text:
@protocol TOSCommands;

// Extends the base delegate protocol to handle taps on the "Accept and
// continue" button.
@protocol WelcomeScreenViewControllerDelegate <PromoStyleViewControllerDelegate>

// Returns whether the metrics reporting consent checkbox should be selected or
// not by default.
- (BOOL)isCheckboxSelectedByDefault;

// Called when the user taps on "Manage" related to metric reporting.
- (void)showUMADialog;

// Logs scrollability metric on view appears.
- (void)logScrollButtonVisible:(BOOL)scrollButtonVisible
        withUMACheckboxVisible:(BOOL)umaCheckboxVisible;

@end

// View controller of welcome screen.
@interface WelcomeScreenViewController
    : PromoStyleViewController <WelcomeScreenConsumer>

@property(nonatomic, weak) id<WelcomeScreenViewControllerDelegate> delegate;

// Whether the metrics reporting checkbox is selected.
@property(nonatomic, readonly, assign) BOOL checkBoxSelected;

// Init with the handler used to manage the display of TOS.
- (instancetype)initWithTOSHandler:(id<TOSCommands>)TOSHandler
    NS_DESIGNATED_INITIALIZER;

- (instancetype)init NS_UNAVAILABLE;

- (instancetype)initWithNibName:(NSString*)nibNameOrNil
                         bundle:(NSBundle*)nibBundleOrNil NS_UNAVAILABLE;

- (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE;

@end

#endif  // IOS_CHROME_BROWSER_UI_FIRST_RUN_WELCOME_WELCOME_SCREEN_VIEW_CONTROLLER_H_


text:
+++
Title = "Speakers"
Type = "speakers"
Description = "Speakers for devopsdays Minneapolis 2019"
+++


text:
'use strict';

angular.module('app.dashboard', ['ui.router'])

.config(['$urlRouterProvider','$stateProvider', function($urlRouterProvider,$stateProvider) {

  $stateProvider
        .state('dashboard', {
          url: '/dashboard',
          views: {
            '' : {templateUrl: 'components/dashboard/dashboard.html'},
            'nav@dashboard': {templateUrl: 'components/nav/nav.html'},
            'body@dashboard': {
              templateUrl: 'components/partials/index/index.html',
              controller: 'HomeController',
              controllerAs: 'ic'
            },
            // 'footer@dashboard': {templateUrl: 'components/dashboard/dashboard.html'},
          },
          controller: 'DashboardController',
          controllerAs: 'vc'
        })

}])

.controller('DashboardController', ['$http', function($http) {
  var v2 = this;

}]);