text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using ConvenienceSystemDataModel;

namespace WebAdminClient
{
    public partial class DirectAccounting : Page
    {
        public string StateMessage { get; set; }

        //public List<ProductProperties> ReasonList;
        public List<ListItem> ReasonListItems;
        public List<ListItem> UserList;

        protected async void Page_Load(object sender, EventArgs e)
        {
            string ReasonSelected = "";
            string UserSelected = "";
            if (IsPostBack)
            {
                ReasonSelected = ReasonSelectServer.Value;
                UserSelected = UserSelect.Value;
            }

            Title = StringsLocal.Accounting;
            inputCustomReason.Attributes.Add("placeholder", StringsLocal.Reason);
            // Get Data needed from backend
            var products = await Backend.GetAllProductsAsync();
            var users = await Backend.GetAllUsersAsync();
            /*ReasonList = new List<ProductProperties>();
            ProductProperties CustomProduct = new ProductProperties();
            CustomProduct.product = "Custom";
            CustomProduct.price = "Use text field";
            ReasonList.Add(CustomProduct);

            this.repProducts.DataSource = ReasonList;
            this.repProducts.DataBind();*/

            // create List of products
            ReasonListItems = new List<ListItem>();
            ReasonListItems.AddRange(products.dataSet.ConvertAll<ListItem>((x) =>
            {
                ListItem pp = new ListItem();
                pp.Text = x.product + " - " + x.price.ToString();
                pp.Value = x.product;
                return pp;
            }));

            ListItem item = new ListItem();
            item.Text = StringsLocal.CustomUseInputField;
            item.Value = "Custom";
            item.Selected = true;

            ReasonSelectServer.Items.Clear();
            ReasonSelectServer.Items.Add(item);
            ReasonSelectServer.Items.AddRange(ReasonListItems.ToArray());

            // create list of users
            UserList = users.dataSet.ConvertAll<ListItem>((x) =>
            {
                ListItem pp = new ListItem();
                pp.Text = x.username;
                pp.Value = x.username;
                return pp;
            });
            UserSelect.Items.Clear();
            UserSelect.Items.AddRange(UserList.ToArray());

            if (IsPostBack)
            {
                double price;
                string val = ReasonSelected;
                if (val == "Custom")
                {
                    // Convert from input field
                    try
                    {
                        price = Global.String2Double(inputCustomPrice.Value);
                        if (!String.IsNullOrEmpty(inputCustomReason.Value))
                            val = inputCustomReason.Value;
                    }
                    catch
                    {
                        StateMessage = "Error: invalid number";
                        return;
                    }
                }
                else
                {
                    // Take product price
                    price = products.dataSet.First((x) => x.product == val).price;
                }
                // price is set - give data to backend
                var request = new BuyDirectlyRequest();
                request.comment = val;
                request.price = price;
                request.username = UserSelected;
                var succ = await Backend.BuyDirectlyAsync(request);
                if (succ)
                {
                    StateMessage = "Success";
                }
                else
                {
                    StateMessage = "Error: No Data updated";
                }
            }

        }

        public bool ShowAggregated;
    }
}


text:
body {
    font-family: Lora, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    position: relative;
    width: 100%;
    height: 100%;
    color: #fff;
    background-color: #000
}

html {
    width: 100%;
    height: 100%
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: Cabin, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    margin: 0 0 35px;
    letter-spacing: 1px;
    text-transform: uppercase
}

p {
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 25px
}

@media (min-width:768px) {
    p {
        font-size: 18px;
        line-height: 1.6;
        margin: 0 0 35px
    }
}

a {
    -webkit-transition: all .2s ease-in-out;
    -moz-transition: all .2s ease-in-out;
    transition: all .2s ease-in-out;
    color: #42dca3
}

a:focus,
a:hover {
    text-decoration: none;
    color: #1d9b6c
}

#mainNav {
    font-family: Cabin, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin-bottom: 0;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, .3);
    background-color: #000
}

#mainNav .navbar-toggler {
    font-size: 14px;
    padding: 11px;
    color: #fff;
    border: 1px solid #fff
}

#mainNav .navbar-brand {
    font-weight: 700
}

#mainNav a {
    color: #fff
}

#mainNav .navbar-nav .nav-item {
    -webkit-transition: background .3s ease-in-out;
    -moz-transition: background .3s ease-in-out;
    transition: background .3s ease-in-out
}

#mainNav .navbar-nav .nav-item:hover {
    color: fade(white, 80%);
    outline: 0;
    background-color: transparent
}

#mainNav .navbar-nav .nav-item:active,
#mainNav .navbar-nav .nav-item:focus {
    outline: 0;
    background-color: transparent
}

@media (min-width:992px) {
    #mainNav {
        padding-top: 20px;
        padding-bottom: 20px;
        -webkit-transition: background .3s ease-in-out, padding-top .3s ease-in-out, padding-bottom .3s;
        -moz-transition: background .3s ease-in-out, padding-top .3s ease-in-out, padding-bottom .3s;
        transition: background .3s ease-in-out, padding-top .3s ease-in-out, padding-bottom .3s;
        letter-spacing: 1px;
        border-bottom: none;
        background: 0 0
    }
    #mainNav.navbar-shrink {
        padding-top: 10px;
        padding-bottom: 10px;
        border-bottom: 1px solid rgba(255, 255, 255, .3);
        background: #000
    }
    #mainNav .nav-link.active {
        outline: 0;
        background-color: rgba(255, 255, 255, .3)
    }
    #mainNav .nav-link.active:hover {
        color: #fff
    }
}

.masthead {
    display: table;
    width: 100%;
    height: auto;
    padding: 200px 0;
    text-align: center;
    color: #fff;
    background: url(../img/intro-bg.jpg) no-repeat bottom center scroll;
    background-color: #000;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover
}

.masthead .intro-body {
    display: table-cell;
    vertical-align: middle
}

.masthead .intro-body .brand-heading {
    font-size: 50px;
    border-style: solid;
    border-width: 5px;
    border-color: white;
}

.masthead .intro-body .intro-text {
    font-size: 18px
}

@media (min-width:768px) {
    .masthead {
        height: 100%;
        padding: 0
    }
    .masthead .intro-body .brand-heading {
        font-size: 100px;
        border-style: solid;
        border-width: 5px;
        border-color: white;
    }
    .masthead .intro-body .intro-text {
        font-size: 22px
    }
}

.btn-circle {
    font-size: 26px;
    width: 55px;
    height: 55px;
    margin-top: 15px;
    line-height: 45px;
    -webkit-transition: background .3s ease-in-out;
    -moz-transition: background .3s ease-in-out;
    transition: background .3s ease-in-out;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 100% !important;
    background: 0 0
}

.btn-circle:focus,
.btn-circle:hover {
    color: #fff;
    outline: 0;
    background: rgba(255, 255, 255, .1)
}

.content-section {
    padding-top: 150px;
    padding-bottom: 150px
}

.download-section {
    color: #fff;
    background: url(../img/downloads-bg.jpg) no-repeat center center scroll;
    background-color: #000;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover
}

#map {
    width: 100%;
    height: 300px
}

@media (min-width:992px) {
    .content-section {
        padding-top: 200px;
        padding-bottom: 200px
    }
    #map {
        height: 350px
    }
}

.btn {
    font-family: Cabin, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 400;
    -webkit-transition: all .3s ease-in-out;
    -moz-transition: all .3s ease-in-out;
    transition: all .3s ease-in-out;
    text-transform: uppercase;
    border-radius: 0
}

.btn-default {
    color: #42dca3;
    border: 1px solid #42dca3;
    background-color: transparent
}

.btn-default:focus,
.btn-default:hover {
    color: #000;
    border: 1px solid #42dca3;
    outline: 0;
    background-color: #42dca3
}

ul.banner-social-buttons {
    margin-top: 0
}

@media (max-width:1199px) {
    ul.banner-social-buttons {
        margin-top: 15px
    }
}

@media (max-width:767px) {
    ul.banner-social-buttons li {
        display: block;
        margin-bottom: 20px;
        padding: 0
    }
    ul.banner-social-buttons li:last-child {
        margin-bottom: 0
    }
}

footer {
    padding: 50px 0
}

footer p {
    font-size: 14px;
    margin: 0
}

::-moz-selection {
    background: #fcfcfc;
    background: rgba(255, 255, 255, .2);
    text-shadow: none
}

::selection {
    background: #fcfcfc;
    background: rgba(255, 255, 255, .2);
    text-shadow: none
}

img::selection {
    background: 0 0
}

img::-moz-selection {
    background: 0 0
}

redpajama_set_name: RedPajamaGithub


text:
// saeeditor.cpp
//

#include "../sae.h"
#include "saeeditor.h"
#include "engine/controller.h"
#include "engine/coposition.h"
#include "ui/uimanager.h"
#include "gfx/rendercontext.h"
#include "gfx/drawutils.h"
#include "system/file.h"
#include "../engine/attractormanager.h"
#include "../engine/coattractor.h"
#include "../engine/cohandle.h"
#include "../engine/saecamera.h"
#include "../engine/dfmanager.h"

SAEEditor* SAEEditor::ms_editor = nullptr;

SAEEditor::SAEEditor() :
    m_current_attractor_type(INDEX_NONE),
    m_seed_offset(0),
    m_seed_copy(0.f)
{
    ms_editor = this;
	//m_current_file_name.resize(512);
	//m_current_file_name = "";
}

SAEEditor::~SAEEditor()
{
    ms_editor = nullptr;
}

static void UIOnToggleEditorCB( bool bshow_editor )
{

}

static void UIDrawEditorCB( bool* show_editor, bigball::RenderContext& render_ctxt )
{
    SAEEditor::Get()->UIDrawEditor( show_editor, render_ctxt );
}
static void UIDrawEditorMenusCB(bigball::RenderContext& render_ctxt)
{
	SAEEditor::Get()->UIDrawEditorMenus(render_ctxt);
}

bool SAEEditor::GetItemStringArray( void* data, int idx, const char** out_text )
{
	Array<String>* str_array = (Array<String>*)data;
	if( idx >= 0 && idx < str_array->size() )
	{
		*out_text = (*str_array)[idx].c_str();
		return true;
	}

	return false;
}

void SAEEditor::UIDrawEditor( bool* show_editor, RenderContext& render_ctxt )
{
    ImGui::Begin("Editor", show_editor, ImVec2(200,400), -1.f, 0/*ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar*/ );

	ImGui::ShowTestWindow();

    ImGui::End();
}

void SAEEditor::UIDrawEditorMenus(RenderContext& render_ctxt)
{
	eMenuCommandType menu_cmd_type = eMenuCommandType::None;
	if (ImGui::BeginMainMenuBar())
	{
		if (ImGui::BeginMenu("File"))
		{
			if (ImGui::MenuItem("New attractor"))
			{
				menu_cmd_type = eMenuCommandType::NewAttractor;
			}
			if (ImGui::MenuItem("Save attractor"))
			{
				menu_cmd_type = eMenuCommandType::SaveAttractor;
			}
			if (ImGui::MenuItem("Load attractor"))
			{
				menu_cmd_type = eMenuCommandType::LoadAttractor;
			}
			if (ImGui::MenuItem("Load attractor (OLD)"))
			{
				menu_cmd_type = eMenuCommandType::LoadAttractorOld;
			}
			if (ImGui::MenuItem("Export Obj"))
			{
				menu_cmd_type = eMenuCommandType::ExportObj;
			}
			if (ImGui::MenuItem("Export Ply"))
			{
				menu_cmd_type = eMenuCommandType::ExportPly;
			}
			if (ImGui::MenuItem("Export Pbrt scene file"))
			{
				menu_cmd_type = eMenuCommandType::ExportPbrt;
			}
			ImGui::EndMenu();
		}

		ImGui::EndMainMenuBar();
	}

	if (menu_cmd_type != eMenuCommandType::None)
	{
		m_current_menu_cmd_type = menu_cmd_type;
		ImGui::OpenPopup("File dialog");
	}

	if (ImGui::BeginPopupModal("File dialog"))
	{
		DrawFileDialog(m_current_menu_cmd_type);

		const char* button_labels[(int)eMenuCommandType::Count] = { "", "Save attractor (.sae)", "Load attractor (.sae)", "Load attractor (.sae)", "Export obj", "Export ply", "Export pbrt scene (.pbrt)" };
		if (ImGui::Button(button_labels[(int)m_current_menu_cmd_type]))
		{
			// Execute command here
			switch (m_current_menu_cmd_type)
			{
				case eMenuCommandType::SaveAttractor:
				case eMenuCommandType::LoadAttractor:
				case eMenuCommandType::LoadAttractorOld:
				{
					String filename = m_current_file_path + m_current_file_name;
					File file;
					if (file.Open(filename.c_str(), m_current_menu_cmd_type == eMenuCommandType::SaveAttractor ? true : false))
					{
						bool old_format = (m_current_menu_cmd_type == eMenuCommandType::LoadAttractorOld ? true : false);
						AttractorManager::GetStaticInstance()->SerializeAttractor(file, old_format);
					}
					break;
				}
                case eMenuCommandType::ExportObj:
                {
                    String filename = m_current_file_path + m_current_file_name;
                    File file;
                    if (file.Open(filename.c_str(), true))
                    {
                        AttractorManager::GetStaticInstance()->ExportAttractorAsObj(file);
                    }
                    break;
                }
				case eMenuCommandType::ExportPly:
				{
					String filename = m_current_file_path + m_current_file_name;
					File file;
					if (file.Open(filename.c_str(), true))
					{
						AttractorManager::GetStaticInstance()->ExportAttractorAsPly(file);
					}
					break;
				}
				case eMenuCommandType::ExportPbrt:
				{
					AttractorManager::GetStaticInstance()->ExportAttractorAsPbrtScene(m_current_file_path, m_current_file_name);
					break;
				}
                default: break;
			}

			m_current_menu_cmd_type = eMenuCommandType::None;
			ImGui::CloseCurrentPopup();

            RefreshListFiles();
		}
		ImGui::SameLine();
		if (ImGui::Button("Cancel"))
		{
			m_current_menu_cmd_type = eMenuCommandType::None;
			ImGui::CloseCurrentPopup();
		}
		ImGui::EndPopup();
	}

    DrawRightPanel(render_ctxt);
}

void SAEEditor::DrawFileDialog(eMenuCommandType cmd_type)
{
	if (m_current_file_path.Len() == 0)
	{
		CommandLine const& cmd_line = g_pEngine->GetCommandLine();

		int slash_idx = cmd_line.cmd_exec.LastIndexOf('\\');
		if (slash_idx == INDEX_NONE)
			slash_idx = cmd_line.cmd_exec.LastIndexOf('/');
		if (slash_idx != INDEX_NONE)
			m_current_file_path = cmd_line.cmd_exec.Sub(0, slash_idx + 1);
		else
			m_current_file_path = cmd_line.cmd_exec;

		RefreshListFiles();
	}

	ImGui::Text(m_current_file_path.c_str());

	ImGui::PushItemWidth(350);
    int old_sel = m_current_file_selection;
	if (ImGui::ListBox("", &m_current_file_selection, GetItemStringArray, &m_current_file_array, m_current_file_array.size(), 20))
    {
		if (m_current_file_selection >= 0 && m_current_file_selection < m_current_file_array.size())
		{
#if _WIN32 || _WIN64
			String sep = "\\";
#else
			String sep = "/";
#endif
			if (m_current_file_array[m_current_file_selection].EndsWith(sep))
			{
				if (old_sel == m_current_file_selection)
				{
					// directory
					m_current_file_path += m_current_file_array[m_current_file_selection];
					RefreshListFiles();
					m_current_file_selection = INDEX_NONE;
				}
			}
			else
			{
				// file
				m_current_file_name = m_current_file_array[m_current_file_selection];
			}
		}
    }
	ImGui::PopItemWidth();

	char buffer[512];
	strcpy(buffer, m_current_file_name.c_str());
	if (ImGui::InputText("file", buffer, sizeof(buffer)))
	{
		m_current_file_name = String::Printf("%s", buffer);
	}
}

void SAEEditor::RefreshListFiles()
{
	FileUtils::NormalizePath(m_current_file_path);

	m_current_file_array.clear();

#if _WIN32 || _WIN64
	String file_filter = "*.*";
	String sep = "\\";
#else
	String file_filter = "";
	String sep = "/";
#endif

	FileUtils::ListFiles((m_current_file_path + file_filter).c_str(), m_current_file_array);

	m_current_file_array.remove(".");
	String tmp_str;
	for (int file_idx = 0; file_idx < m_current_file_array.size(); file_idx++)
	{
		tmp_str = m_current_file_path + m_current_file_array[file_idx];
		if (FileUtils::IsDirectory(tmp_str.c_str()))
			m_current_file_array[file_idx] += sep;
	}
}

void SAEEditor::DrawRightPanel(bigball::RenderContext& render_ctxt)
{
    Array<CoAttractor*> const& attractors = AttractorManager::GetStaticInstance()->GetAttractors();
	if (!attractors.size())
		return;

	CoAttractor* attractor = attractors[0];
	CoHandle* cohandle = static_cast<CoHandle*>(attractor->GetEntityComponent("CoHandle"));

    bool show_pane = false;
    SDL_DisplayMode display_mode = g_pEngine->GetDisplayMode();
    const float menu_height = 19.f;
    const float pane_width = 400.f;
    float pane_pos_x = display_mode.w - pane_width;
    float pane_height = display_mode.h - menu_height;
    ImGui::SetNextWindowPos(ImVec2(pane_pos_x, menu_height));
    ImGui::Begin("Editor", &show_pane, ImVec2(pane_width, pane_height), -1.f, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoResize );

	if (ImGui::CollapsingHeader("Attractor"))
	{
        if(m_current_attractor_type == INDEX_NONE)
            m_current_attractor_type = attractor->GetAttractorType();

		Array<String> attractor_names;
        AttractorManager::GetStaticInstance()->GetFactory()->GetAttractorTypeList(attractor_names);

		ImGui::PushItemWidth(120);
        ImGui::Combo("", &m_current_attractor_type, GetItemStringArray, &attractor_names, attractor_names.size());
		ImGui::PopItemWidth();
        if( m_current_attractor_type != attractor->GetAttractorType() )
        {
            ImGui::SameLine();
            if (ImGui::Button("Confirm change"))
            {
                attractor->ChangeAttractorType((eAttractorType)m_current_attractor_type);
                m_current_attractor_type = attractor->GetAttractorType();
            }
        }
	}

    if( ImGui::CollapsingHeader("Params") )
    {
        if (ImGui::Button("Force rebuild"))
        {
            attractor->RebuildAttractorMesh( true );
        }

        AttractorSelection& current_selection = AttractorManager::GetStaticInstance()->GetEditorSelected();
        int32 num_handles = cohandle->m_handles.size();

        if (current_selection.m_handle_idx >= 0 && current_selection.m_handle_idx < num_handles)
        {
            AttractorHandle& handle = cohandle->GetHandle(current_selection.m_handle_idx);
            ImGui::PushItemWidth(125);
            float& seed_range = AttractorManager::GetStaticInstance()->m_attractor_seed_range;
            ImGui::InputFloat("Range", &seed_range);
            ImGui::PushItemWidth(250.f);
            ImGui::InputFloat3("Seed", (float*)&handle.m_seed.seed, 6/*, ImGuiInputTextFlags_ReadOnly*/);
            ImGui::PopItemWidth();
            ImGui::SameLine();
            if (ImGui::Button("Random seed"))
            {
                handle.m_seed.seed.x = seed_range * (bigball::randfloat() * 2.f - 1.f);
                handle.m_seed.seed.y = seed_range * (bigball::randfloat() * 2.f - 1.f);
                handle.m_seed.seed.z = seed_range * (bigball::randfloat() * 2.f - 1.f);
            }
            if (ImGui::Button("Copy seed"))
            {
                m_seed_copy = handle.m_seed.seed;
            }
            ImGui::SameLine();
            if (ImGui::Button("Paste seed"))
            {
                handle.m_seed.seed = m_seed_copy;
            }
            if( ImGui::InputInt("Iteration steps", &handle.m_seed.iter, 1, 100) )
                handle.m_seed.iter = max( handle.m_seed.iter, 3 );
            if( ImGui::InputInt("Reverse iter. steps", &handle.m_seed.rev_iter, 1, 100) )
               handle.m_seed.rev_iter = max( handle.m_seed.rev_iter, 0 );

            ImGui::SliderInt("Slide seed", &m_seed_offset, -10, 10);
            if(m_seed_offset != 0)
            {
                handle.m_seed.seed = attractor->GuessCurvePos(current_selection.m_handle_idx, m_seed_offset);
            }

            float& seed_move = AttractorManager::GetStaticInstance()->m_attractor_seed_move_range;
            ImGui::PushItemWidth(250.f);
            ImGui::SliderFloat("Move speed", &seed_move, 0.f, 2.f, "%.5f", 2.f);
            ImGui::PopItemWidth();

            {

                bool x_0 = ImGui::Button("+x");
                ImGui::SameLine();
                bool x_1 = ImGui::Button("-x");
                ImGui::SameLine();
                bool y_0 = ImGui::Button("+y");
                ImGui::SameLine();
                bool y_1 = ImGui::Button("-y");
                ImGui::SameLine();
                bool z_0 = ImGui::Button("+z");
                ImGui::SameLine();
                bool z_1 = ImGui::Button("-z");
                if( x_0 || x_1 || y_0 || y_1 || z_0 || z_1)
                {
                    vec3 offset(0.f);
                    offset.x += x_0 ? seed_move : (x_1 ? -seed_move : 0.f);
                    offset.y += y_0 ? seed_move : (y_1 ? -seed_move : 0.f);
                    offset.z += z_0 ? seed_move : (z_1 ? -seed_move : 0.f);
                    handle.m_seed.seed += offset;
                }
            }

            ImGui::SliderFloat("Curve alpha", &attractor->m_show_curve_alphas[current_selection.m_handle_idx], 0.f, 1.f, "%.1f");

            if (ImGui::InputInt("Merge span", &handle.m_seed.merge_span, 1, 100))
                handle.m_seed.merge_span = max( handle.m_seed.merge_span, -1 );
        }

        ImGui::PushItemWidth(50);
        Array<String> str_handle_array;
        for (int32 h_idx = 0; h_idx < num_handles; h_idx++)
        {
            str_handle_array.push_back(String::Printf("%d", h_idx));
        }
        ImGui::TextColored(ImVec4(0.5f, 0.5f, 0.5f, 1.f), "Handles");
        if (ImGui::ListBox("", &current_selection.m_handle_idx, GetItemStringArray, &str_handle_array, num_handles, 6))
            current_selection.m_point_idx = INDEX_NONE;
        ImGui::PopItemWidth();

        ImGui::SameLine();
        ImGui::BeginGroup();

        if (current_selection.m_handle_idx >= 0 && current_selection.m_handle_idx < num_handles)
        {
            current_selection.m_attractor = attractor;

            AttractorHandle& handle = cohandle->GetHandle(current_selection.m_handle_idx);

            bool insert_before = (current_selection.m_handle_idx != 0);
            bool insert_after = true;//handle.m_line_idx < attractor->m_line_framed.points.size() - 2; // (current_selection.m_handle_idx != num_handles - 1 );
            if ( (insert_before && ImGui::Button("Insert before", ImVec2(0,20))) ||
                (!insert_before && ImGui::InvisibleButton("", ImVec2(1,20))))
            {
                cohandle->InsertHandle( current_selection.m_handle_idx );
                attractor->InsertCurve( current_selection.m_handle_idx );
            }
            if ( (insert_after && ImGui::Button("Insert after", ImVec2(0,20))) ||
                (!insert_after && ImGui::InvisibleButton("", ImVec2(1,20))))
            {
                cohandle->InsertHandle( current_selection.m_handle_idx + 1 );
                attractor->InsertCurve( current_selection.m_handle_idx + 1 );
            }
            if (num_handles > 1)
                if (ImGui::Button("Delete"))
                {
                    cohandle->DeleteHandle( current_selection.m_handle_idx );
                    attractor->DeleteCurve( current_selection.m_handle_idx );
                }

            attractor->m_preview_idx = current_selection.m_handle_idx;
        }
        ImGui::EndGroup();

        if (current_selection.m_handle_idx != INDEX_NONE && current_selection.m_point_idx != INDEX_NONE)
        {
            ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(255,0,0,100));
            ImGui::SameLine();
            ImGui::BeginChildFrame(234, ImVec2(200,80), ImGuiWindowFlags_ShowBorders);
            //ImGui::LabelText("Point idx", "%d", current_selection.m_point_idx);
            if( ImGui::InputInt("Point idx", &current_selection.m_point_idx, 1, 100) )
            {
                AttractorOrientedCurve const& curve = attractor->m_curves[current_selection.m_handle_idx];
                current_selection.m_point_idx = clamp(current_selection.m_point_idx, 1, curve.points.size() - 1);
            }

            static int cut_length = 0;
            if( ImGui::InputInt("Cut length", &cut_length, 1, 100) )
                cut_length = max( cut_length, 0 );
            if (ImGui::Button("Cut line"))
            {
                AttractorOrientedCurve const& old_curve = attractor->m_curves[current_selection.m_handle_idx];
                AttractorHandle& old_handle = cohandle->m_handles[current_selection.m_handle_idx];
                const int32 num_point = old_curve.points.size();
                const int32 old_iter = old_handle.m_seed.iter;
                const int32 old_rev_iter = old_handle.m_seed.rev_iter;
                const int32 pt_idx = current_selection.m_point_idx;

                if (pt_idx < old_rev_iter)
                {
                    old_handle.m_seed.seed = old_curve.points[pt_idx];
                    old_handle.m_seed.iter = 0;
                    old_handle.m_seed.rev_iter = pt_idx;
                }
                else
                {
                    old_handle.m_seed.iter = pt_idx - old_rev_iter;
                }

                if (cut_length > 0)
                {
                    if (pt_idx + cut_length < num_point)
                    {
                        // cuts at point idx, removes cut_length points after that
                        cohandle->InsertHandle( current_selection.m_handle_idx + 1 );
                        attractor->InsertCurve( current_selection.m_handle_idx + 1 );

                        AttractorOrientedCurve const& prev_curve = attractor->m_curves[current_selection.m_handle_idx];
                        AttractorHandle& new_handle = cohandle->m_handles[current_selection.m_handle_idx + 1];
                        new_handle.m_seed.seed = prev_curve.points[pt_idx + cut_length];
                        new_handle.m_seed.iter = num_point - (pt_idx + cut_length);
                        new_handle.m_seed.rev_iter = 0;
                    }
                }
                // reset
                current_selection.m_point_idx = INDEX_NONE;
            }

            //static bool show_demo = false;
            //if (ImGui::Button("Test Window"))
            //    show_demo = true;
            //ImGui::ShowTestWindow(&show_demo);

            ImGui::EndChildFrame();
            ImGui::PopStyleColor();
        }

        //static float value = 0.5f;
        //if (ImGui::BeginPopupContextItem("item context menu"))
        //{
        //	if (ImGui::Selectable("Set to zero")) value = 0.0f;
        //	if (ImGui::Selectable("Set to PI")) value = 3.1415f;
        //	ImGui::EndPopup();
        //}

        ImGui::Separator();

        //ImGui::InputFloat3("Attractor seed", (float*)&attractor->m_line_params.seed);
        //ImGui::Checkbox("Show seed", &AttractorManager::GetStaticInstance()->m_show_seeds);
        //ImGui::SameLine();

		ImGui::PushItemWidth(125);
		ImGui::InputFloat("Step size", &attractor->m_line_params.step_factor);
		ImGui::InputInt("Simplify step", &attractor->m_shape_params.simplify_level, 1, 10);
		ImGui::InputFloat("Merge dist", &attractor->m_shape_params.merge_dist);
        ImGui::InputInt("Merge span", &attractor->m_shape_params.merge_span, 1, 10000);

		ImGui::Separator();

        ImGui::InputFloat("Line fatness", &attractor->m_shape_params.fatness_scale);
		ImGui::InputInt("Edge count", &attractor->m_shape_params.local_edge_count, 1, 10);
		ImGui::InputFloat("Crease depth", &attractor->m_shape_params.crease_depth);
		ImGui::InputFloat("Crease width", &attractor->m_shape_params.crease_width);
		ImGui::InputFloat("crease bevel", &attractor->m_shape_params.crease_bevel);

		ImGui::Separator();

		//ImGui::Checkbox("Freeze bbox", &attractor->m_shape_params.freeze_bbox);
        //ImGui::Checkbox("Show bary", &attractor->m_shape_params.show_bary);
        //ImGui::InputInt("Max iteration count", &attractor->m_shape_params.max_iter_count, 1, 10);
        ImGui::InputFloat("Target dimension", &attractor->m_line_params.target_dim);
		ImGui::SliderAngle("Shearing angle", &attractor->m_line_params.shearing_angle, -90.f, 90.f);
		ImGui::InputFloat("Shearing scale x", &attractor->m_line_params.shearing_scale_x, 0.01f, 0.05f, 3);
		ImGui::InputFloat("Shearing scale y", &attractor->m_line_params.shearing_scale_y, 0.01f, 0.05f, 3);

		ImGui::PopItemWidth();

		ImGui::Separator();
    }

	if (ImGui::CollapsingHeader("Stats"))
	{
		int32 tri_count = attractor->m_tri_indices.size() / 3;
		ImGui::InputInt("Triangle count", &tri_count, -1, ImGuiInputTextFlags_ReadOnly);
        vec3 dimensions = attractor->m_max_box - attractor->m_min_box;
        ImGui::InputFloat3("Dimensions", (float*)&dimensions, 2, ImGuiInputTextFlags_ReadOnly);
	}

	//bool show_modifications = ImGui::CollapsingHeader("Modifications");
	//AttractorManager::GetStaticInstance()->SetShowHandles(show_modifications);

    if (ImGui::CollapsingHeader("Display"))
    {
        ImGui::Checkbox("show lines", &AttractorManager::GetStaticInstance()->m_show_lines);
        ImGui::Checkbox("show meshes", &AttractorManager::GetStaticInstance()->m_show_meshes);
        ImGui::Checkbox("show handles", &AttractorManager::GetStaticInstance()->m_show_handles);
    }

    ImGui::End();
}

void SAEEditor::Tick( struct TickContext& tick_ctxt )
{
    vec3 scene_center(0.f, 0.f, 0.f);
    Array<CoAttractor*> const& attractors = AttractorManager::GetStaticInstance()->GetAttractors();
    int num_attractor = attractors.size();
    for( int att_idx = 0; att_idx < num_attractor; att_idx++)
    {
        CoPosition* copos = static_cast<CoPosition*>(attractors[att_idx]->GetEntityComponent("CoPosition"));
        scene_center.z = min( scene_center.z, attractors[att_idx]->m_min_box.z * copos->GetScale() );
    }
    DFManager::GetStaticInstance()->SetSceneCenter(scene_center);
}

void SAEEditor::HandleScenePick(ControllerMouseState const& mouse_state)
{
	AttractorManager::GetStaticInstance()->HandleScenePick(mouse_state);
}

bool SAEEditor::Init()
{
	UIManager::GetStaticInstance()->SetDrawEditorFn( nullptr /*&UIDrawEditorCB*/ );
	UIManager::GetStaticInstance()->SetToggleEditorFn( &UIOnToggleEditorCB );
	UIManager::GetStaticInstance()->SetDrawCustomMenuFn(&UIDrawEditorMenusCB);

	// allow mouse - menu interactions
	//SDL_SetRelativeMouseMode(SDL_FALSE);
	//SDL_SetWindowGrab(g_pEngine->GetDisplayWindow(), SDL_FALSE);

	return true;
}

void SAEEditor::Shutdown()
{

}


text:
package fr.openwide.core.jpa.more.junit.difference;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import fr.openwide.core.commons.util.fieldpath.FieldPath;
import fr.openwide.core.jpa.business.generic.model.GenericEntity;
import fr.openwide.core.jpa.business.generic.model.GenericEntityReference;
import fr.openwide.core.jpa.more.business.history.model.AbstractHistoryDifference;
import fr.openwide.core.jpa.more.business.history.model.embeddable.HistoryValue;

public class TestHistoryDifferenceKey {

	private final FieldPath fieldPath;

	private final GenericEntityReference<?, ?> keyAsGenericEntityReference;

	private final String keyAsString;

	@SuppressWarnings("rawtypes")
	public TestHistoryDifferenceKey(FieldPath fieldPath, Object key) {
		super();
		this.fieldPath = fieldPath;
		if (key instanceof GenericEntity) {
			keyAsGenericEntityReference = GenericEntityReference.ofUnknownIdType((GenericEntity)key);
			keyAsString = null;
		} else if (key != null) {
			keyAsGenericEntityReference = null;
			keyAsString = key.toString();
		} else {
			keyAsGenericEntityReference = null;
			keyAsString = null;
		}
	}

	public TestHistoryDifferenceKey(AbstractHistoryDifference<?, ?> input) {
		super();
		this.fieldPath = input.getPath().getPath();
		HistoryValue key = input.getPath().getKey();
		if (key != null && key.getReference() != null) {
			keyAsGenericEntityReference = key.getReference();
			keyAsString = null;
		} else {
			keyAsGenericEntityReference = null;
			keyAsString = key == null ? null : key.getLabel();
		}
	}

	@Override
	public int hashCode() {
		return new HashCodeBuilder().append(fieldPath).append(keyAsGenericEntityReference).append(keyAsString).build();
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof TestHistoryDifferenceKey) {
			TestHistoryDifferenceKey other = (TestHistoryDifferenceKey) obj;
			return new EqualsBuilder()
					.append(fieldPath, other.fieldPath)
					.append(keyAsGenericEntityReference, other.keyAsGenericEntityReference)
					.append(keyAsString, other.keyAsString)
					.build();
		}
		return false;
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
				.append(fieldPath).append(keyAsGenericEntityReference).append(keyAsString)
				.build();
	}

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libfly: Class Members - Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>

libfly
    6.2.2

C++20 utility library for Linux, macOS, and Windows

- g -

generate_random_string()
: fly::BasicString< CharType >

get()
: fly::logger::Logger
, fly::parser::Parser

get_default_logger()
: fly::logger::detail::Registry
, fly::logger::Logger

get_logger()
: fly::logger::detail::Registry

get_process_cpu_usage()
: fly::system::SystemMonitor

get_process_memory_usage()
: fly::system::SystemMonitor

get_system_cpu_count()
: fly::system::SystemMonitor

get_system_cpu_usage()
: fly::system::SystemMonitor

get_system_memory_usage()
: fly::system::SystemMonitor

get_total_system_memory()
: fly::system::SystemMonitor

get_value()
: fly::config::Config

Generated by  1.9.1


text:
const wchar_t* errmsg = (const wchar_t*)sqlite3_errmsg16(CONNECTION); \
auto exceptionMessage = ref new Platform::String(errmsg); \
int errorCode = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SQLITE, RESULT); \
throw Platform::Exception::CreateException(errorCode, exceptionMessage);

namespace SQLiteRuntime
{
	SQLiteConnection::~SQLiteConnection()
	{
		if (m_connection != nullptr)
		{
			sqlite3_close(m_connection);
			m_connection = nullptr;
		}
	}

	SQLiteConnection^ SQLiteConnection::Open(Platform::String^ filepath)
	{
		SQLiteConfig^ config = SQLiteConfig::Default;

		if (!config->IsTempDirectorySet)
		{
			config->SetTempDirectory();
		}

		const wchar_t* filenameData = filepath->Data();
		sqlite3* pDb = nullptr;

		int result = sqlite3_open16(
			filenameData,
			&pDb
			);

		if (SQLITE_OK == result)
		{
			auto connection = ref new SQLiteConnection(pDb);
			return connection;
		}
		else
		{
			// TODO: Log Error
			return nullptr;
		}
	}

	SQLiteConnection::SQLiteConnection(sqlite3* connection)
	{
		m_connection = connection;
	}

	SQLiteStatement ^ SQLiteConnection::Prepare(Platform::String ^ sql)
	{
		const wchar_t* sqlData = sql->Data();

		sqlite3_stmt* stmt = nullptr;
		int result = sqlite3_prepare16_v2(m_connection, sqlData, -1, &stmt, nullptr);

		if (result == SQLITE_OK)
		{
			SQLiteStatement^ statement = ref new SQLiteStatement(stmt, m_connection);
			return statement;
		}

		if (stmt != nullptr)
		{
			sqlite3_finalize(stmt);
		}

		THROW_SQL_EXCEPTION(m_connection, result);

		return nullptr;
	}
}


text:
Macrame provides macro-base replacements for parts of the Scala standard library.

> This is a fork of the awesome [Macramé](https://github.com/ChrisNeveu/macrame) using the other feature of play.json.extra
> and working for both Scala and ScalaJS

## Getting Macramé
If you're using SBT, add the following to your build file.
```scala
libraryDependencies ++= Seq(
   "com.chrisneveu" %% "macrame" % "1.0.1",
   compilerPlugin("org.scalamacros" % "paradise" % "2.1.0-M5" cross CrossVersion.full))
```

## API Documentation
Full API documentation is available [here](http://chrisneveu.github.io/macrame/doc/1.0.0/#package).

## Enumerations
Macramé provides an `@enum` macro annotation to replace Scala's `Enumeration` class. Unlike `Enumeration`, `@enum` classes are fully type-safe and provide exhaustiveness checks. `@enum` provides a much larger interface than `Enumeration` but it allows the user to select which functions to expose.

### Getting Started
To understand how to use the `@enum` macro, we'll look at a simple `Color` enumeration and see what it expands to.
```scala
@enum class Color {
   Red
   Blue
   Yellow
}
// Expands to:
sealed abstract class Color extends Product with Serializable
object Color extends EnumApi[Color] {
   case object Red
   case object Blue
   case object Yellow
   <EnumApi implementation elided>
}
```

### Using EnumApi
In order to reduce boilerplate, the `@enum` macro defines a number of convenient functions on your enumeration type. Auto-generated functions are great but they often increase your API in undesired ways, exposing conversions to/from `String` that would be better hidden inside more principled conversions.

To resolve this tension, `@enum` provides the *implementations* for automatically generated functions as `protected` members of the companion object, leaving you to expose these functions or use them to implement other functions as you wish. These functions can be found in [EnumApi](http://chrisneveu.github.io/macrame/doc/1.0.0/#macrame.EnumApi) (select "Visibility: All").
```scala
@enum class Color {
   Red
   Blue
   Yellow
}
object Color {
   def asString(color : Color) = asStringImpl(color)
   // Replicating Enumeration's partial String→Enumeration.Value conversion.
   def withName(s : String) = fromStringImpl(s)
      .getOrElse(throw new NoSuchElementException(s"No value found for '$s'"))
}
```

### Providing Custom String Representations
As with `Enumeration`, you can provide custom `String` representations of your enum cases. These can be either a string literal or an identifier pointing to a string. You can mix-and-match the automatically generated representations with manual ones.
```scala
@enum class Color {
   Red("RED")
   Blue("BLUE")
   Yellow("YELLOW")
}
object Color {
   def asString(color : Color) = asStringImpl(color)
   def fromString(s : String) = fromStringImpl(s)
}
```

## Regular Expressions
Via the `r` string interpolator, Macramé provides compile-time checked regular expressions. Interpolated variables are correctly escaped.
```scala
val separator = "-"
val PhoneNumber = r"""\d{3}$separator\d{4}"""
```
## Selecting Members
Often the key to good boilerplate-elimination, Macramé provides two functions to select members of objects: `members` and `memberMap`. When used inside the selected object, be sure to use type ascriptions otherwise these functions will try to contain themselves.
```scala
@enum class Color {
   Red
   Blue
   Yellow
}
object Color {
   val values : List[Color] = members[Color](this)
}
```
## Debugging
The `trace` macro can be very useful when figuring out why a macro won't work. It outputs to the console during compiliation. The format looks like this:
```console
[info] /home/chris/Programming/scala/macrame/README.scala:70: trace output
[info]    immutable.this.List.apply[Color](this.Red, this.Blue, this.Yellow)
[info] for position:
[info]       val values : List[Color] = trace(members[Color](this))
[info]                                        ^
```


text:
(function () {

    var LinearRegressionSummary = require(EclairJS_Globals.NAMESPACE + '/ml/regression/LinearRegressionSummary');
    var Logger = require(EclairJS_Globals.NAMESPACE + '/Logger');
    var Utils = require(EclairJS_Globals.NAMESPACE + '/Utils');

    /**
     * @classdesc
     * Linear regression training results. Currently, the training summary ignores the
     * training coefficients except for the objective trace.
     * @class
     * @memberof module:eclairjs/ml/regression
     * @extends module:eclairjs/ml/regression.LinearRegressionSummary
     */

    var LinearRegressionTrainingSummary = function (jvmObject) {

        this.logger = Logger.getLogger("ml_regression_LinearRegressionTrainingSummary_js");
        LinearRegressionSummary.call(this, jvmObject);

    };

    LinearRegressionTrainingSummary.prototype = Object.create(LinearRegressionSummary.prototype);

    LinearRegressionTrainingSummary.prototype.constructor = LinearRegressionTrainingSummary;

    /**
     *
     * @returns {string}
     */
    LinearRegressionTrainingSummary.prototype.featuresCol = function () {
        return this.getJavaObject().featuresCol();
    };

    /**
     *
     * @returns {float[]}
     */
    LinearRegressionTrainingSummary.prototype.objectiveHistory = function () {
        return Utils.javaToJs(this.getJavaObject().objectiveHistory());
    };

    /**
     *
     * @returns {integer}
     */
    LinearRegressionTrainingSummary.prototype.totalIterations = function () {
        return this.getJavaObject().totalIterations();
    };

    module.exports = LinearRegressionTrainingSummary;
})();


text:
package com.jaamsim.input;

import java.awt.image.BufferedImage;
import java.net.URI;

import javax.imageio.ImageIO;

import com.jaamsim.basicsim.Entity;

public class ImageInput extends Input<BufferedImage> {

	public ImageInput(String key, String cat, BufferedImage def) {
		super(key, cat, def);
	}

	@Override
	public void parse(Entity thisEnt, KeywordIndex kw) throws InputErrorException {
		BufferedImage temp;
		URI uri = Input.parseURI(kw);

		// Confirm that the file exists
		if (!InputAgent.fileExists(uri))
			throw new InputErrorException("The specified file does not exist.\n" +
					"File path = %s", kw.getArg(0));

		try {
			temp = ImageIO.read(uri.toURL());
		}
		catch (Exception ex) {
			throw new InputErrorException("Bad image file");
		}

		value = temp;
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <dimen name="default_padding">5dp</dimen>
</resources>


text:
using Kubeless.Core.Exceptions;
using Kubeless.Core.Interfaces;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Emit;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Kubeless.Core.Models
{
    public class DefaultCompiler : ICompiler
    {
        public IParser Parser { get; }
        public IReferencesManager ReferencesManager { get; }

        public DefaultCompiler(IParser parser, IReferencesManager referenceManager)
        {
            Parser = parser;
            ReferencesManager = referenceManager;
        }

        private CSharpCompilation GetCompilationEngine(string assemblyName, string code)
        {
            var syntaxTree = Parser.ParseText(code);
            var references = ReferencesManager.GetReferences();
            return CreateCompilation(assemblyName, syntaxTree, references);
        }

        private CSharpCompilation CreateCompilation(string assemblyName, SyntaxTree syntaxTree, MetadataReference[] references)
        {
            return CSharpCompilation.Create(
                assemblyName,
                syntaxTrees: new[] { syntaxTree },
                references: references,
                options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
        }

        public void Compile(IFunction function)
        {
            var assemblyName = string.Concat(function.FunctionSettings.ModuleName, ".dll");
            var code = function.FunctionSettings.Code.Content;

            var compilation = GetCompilationEngine(assemblyName, code);
            using (var stream = new MemoryStream())
            {
                EmitResult result = compilation.Emit(stream);
                if (!result.Success)
                    throw new CompilationException(GetCriticalErrors(result));

                stream.Seek(0, SeekOrigin.Begin);
                ((BinaryContent)function.FunctionSettings.Assembly).UpdateBinaryContent(stream.ToArray());
            }
        }

        private IEnumerable<Diagnostic> GetCriticalErrors(EmitResult result)
        {
            return result.Diagnostics.Where(diagnostic =>
                                    diagnostic.IsWarningAsError ||
                                    diagnostic.Severity == DiagnosticSeverity.Error);
        }

    }
}


text:
<link rel="import" href="../../../packages/polymer/polymer.html">
<link rel="import" href="../../../packages/paper_elements/paper_ripple.html">
<link rel="import" href="../../../packages/paper_elements/paper_shadow.html">
<polymer-element name="list-item-element">
  <template>

        <paper-shadow z="1" animated></paper-shadow>
          <paper-ripple fit></paper-ripple>

{{list['name']}}

{{list['description']}}

          {{ bookNumber() }}

    <link type="text/css" rel="stylesheet" href="list-item-element.css">
  </template>

</polymer-element>


text:
/* ** GENEREATED FILE - DO NOT MODIFY ** */
package com.wilutions.mslib.office;
import com.wilutions.com.*;

/**
 * MsoPictureColorType.
 *
 */
@SuppressWarnings("all")
@CoInterface(guid="{00000000-0000-0000-0000-000000000000}")
public class MsoPictureColorType implements ComEnum {
  static boolean __typelib__loaded = __TypeLib.load();

  // Typed constants
  public final static MsoPictureColorType msoPictureMixed = new MsoPictureColorType(-2);
  public final static MsoPictureColorType msoPictureAutomatic = new MsoPictureColorType(1);
  public final static MsoPictureColorType msoPictureGrayscale = new MsoPictureColorType(2);
  public final static MsoPictureColorType msoPictureBlackAndWhite = new MsoPictureColorType(3);
  public final static MsoPictureColorType msoPictureWatermark = new MsoPictureColorType(4);

  // Integer constants for bitsets and switch statements
  public final static int _msoPictureMixed = -2;
  public final static int _msoPictureAutomatic = 1;
  public final static int _msoPictureGrayscale = 2;
  public final static int _msoPictureBlackAndWhite = 3;
  public final static int _msoPictureWatermark = 4;

  // Value, readonly field.
  public final int value;

  // Private constructor, use valueOf to create an instance.
  private MsoPictureColorType(int value) { this.value = value; }

  // Return one of the predefined typed constants for the given value or create a new object.
  public static  MsoPictureColorType valueOf(int value) {
    switch(value) {
    case -2: return msoPictureMixed;
    case 1: return msoPictureAutomatic;
    case 2: return msoPictureGrayscale;
    case 3: return msoPictureBlackAndWhite;
    case 4: return msoPictureWatermark;
    default: return new MsoPictureColorType(value);
    }
  }

  public String toString() {
    switch(value) {
    case -2: return "msoPictureMixed";
    case 1: return "msoPictureAutomatic";
    case 2: return "msoPictureGrayscale";
    case 3: return "msoPictureBlackAndWhite";
    case 4: return "msoPictureWatermark";
    default: {
      StringBuilder sbuf = new StringBuilder();
      sbuf.append("[").append(value).append("=");
      if ((value & -2) != 0) sbuf.append("|msoPictureMixed");
      if ((value & 1) != 0) sbuf.append("|msoPictureAutomatic");
      if ((value & 2) != 0) sbuf.append("|msoPictureGrayscale");
      if ((value & 3) != 0) sbuf.append("|msoPictureBlackAndWhite");
      if ((value & 4) != 0) sbuf.append("|msoPictureWatermark");
      return sbuf.toString();
      }
    }
  }
}


text:
from office365.runtime.client_value import ClientValue
from office365.runtime.client_value_collection import ClientValueCollection
from office365.sharepoint.social.attachment import SocialAttachment
from office365.sharepoint.social.data_overlay import SocialDataOverlay
from office365.sharepoint.social.link import SocialLink
from office365.sharepoint.social.posts.actor_info import SocialPostActorInfo

class SocialPost(ClientValue):
    """The SocialPost specifies a post read from the server."""

    def __init__(self, attachment=SocialAttachment(), overlays=None, source=SocialLink(),
                 liker_info=SocialPostActorInfo()):
        """
        :param SocialAttachment attachment: The Attachment property specifies an image, document preview,
            or video preview attachment.
        :param list[SocialDataOverlay] overlays: The Overlays property is an array of objects in a post, where each
            object represents a user, document, site, tag, or link.
        :param SocialLink source: The Source property specifies the link to a web site (1) associated with the
            application that created the post.
        :param SocialPostActorInfo liker_info: The LikerInfo property specifies information about users who like the
            post.
        """
        self.Attachment = attachment
        self.Overlays = ClientValueCollection(SocialDataOverlay, overlays)
        self.Source = source
        self.LikerInfo = liker_info


text:
function model = multimodelExpandParam(model, params)

% MULTIMODELEXPANDPARAM Create model structure from MULTIMODEL model's parameters.
% FORMAT
% DESC returns a multi-task learning wrapper model structure filled with the
% parameters in the given vector. This is used as a helper function to
% enable parameters to be optimised in, for example, the NETLAB
% optimisation functions.
% ARG model : the model structure in which the parameters are to be
% placed.
% ARG param : vector of parameters which are to be placed in the
% model structure.
% RETURN model : model structure with the given parameters in the
% relevant locations.
%
% SEEALSO : multimodelCreate, multimodelExtractParam, modelExpandParam
%
% COPYRIGHT : Neil D. Lawrence, 2007, 2008
%
% MODIFICATIONS: Mauricio Alvarez, 2008, 2009

% GPMAT

if numel(model.outputDim) == 1
    endVal = model.numParams - model.numModels*model.numSep;
    baseParams = params(1:endVal);
    passParams(model.sharedIndices) = baseParams;
    if ~isempty(model.separateIndices)
        for i = 1:length(model.comp)
            startVal = endVal + 1;
            endVal = endVal + model.numSep;
            passParams(model.separateIndices) = params(startVal:endVal);
            model.comp{i} = modelExpandParam(model.comp{i}, passParams);
        end
    else
        for i = 1:length(model.comp)
            model.comp{i} = modelExpandParam(model.comp{i}, passParams);
        end
    end
else
    startVal = 1;
    endVal = 0;
    for i = 1:length(model.comp)
        endVal = endVal + model.comp{i}.nParams;
        model.comp{i} = modelExpandParam(model.comp{i}, params(startVal:endVal));
        startVal = endVal + 1;
    end
end


text:
package it.cnr.isti.vir.similarity.metric;

import it.cnr.isti.vir.clustering.IMeanEvaluator;
import it.cnr.isti.vir.distance.L2;
import it.cnr.isti.vir.features.AbstractFeaturesCollector;
import it.cnr.isti.vir.features.FeatureClassCollector;
import it.cnr.isti.vir.features.Floats;
import it.cnr.isti.vir.features.localfeatures.FloatsLF;

import java.util.Collection;
import java.util.Properties;

public class FloatsL2Metric  implements IMetric<Floats>, IMeanEvaluator<Floats> {

	private static long distCount = 0;
	private static final FeatureClassCollector reqFeatures = new FeatureClassCollector(Floats.class);

	public final long getDistCount() {
		return distCount;
	}

	public FloatsL2Metric(Properties properties) {

	}

	public FloatsL2Metric() {

	}

	@Override
	public FeatureClassCollector getRequestedFeaturesClasses() {
		return reqFeatures;
	}

	public String toString() {
		return this.getClass().toString();
	}

	@Override
	public final double distance(AbstractFeaturesCollector f1, AbstractFeaturesCollector f2 ) {
		return distance( f1.getFeature(Floats.class), f2.getFeature(Floats.class));
	}

	@Override
	public final double distance(AbstractFeaturesCollector f1, AbstractFeaturesCollector f2, double max ) {
		return distance( f1.getFeature(Floats.class), f2.getFeature(Floats.class), max);
	}

	@Override
	public final double distance(Floats f1, Floats f2) {
		return L2.get(f1.getValues(), f2.getValues());
	}

	@Override
	public final double distance(Floats f1, Floats f2, double max) {
		return L2.get(f1.getValues(), f2.getValues(), max );
	}

	@Override
	public Floats getMean(Collection<Floats> coll) {
		return Floats.getMean(coll);
	}

	public String getStatsString() { return ""; };

}


text:
package so.blacklight.swarm.storage

import java.util.UUID

import akka.actor.Actor
import akka.event.Logging
import so.blacklight.swarm.control.{StartService, StopService}

import scala.collection.mutable

/**
	* ObjectStorage provides a generic way of storing and retrieving objects in an abstract way so that clients don't
	* have to know about storage or implementation details
	*
	* The current, rather trivial implementation does not actually persist the stored objects, they are kept in memory
	* instead. This solution, however fast it may be, is suboptimal and shall be replaced with one that is capable of
	* actual persistence
	*/
class StorageService extends Actor {

	// Objects are kept in a memory backed mutable hash map.
	private val memoryStorage = new mutable.HashMap[StorageId, Any]()

	private val logger = Logging(context.system, this)

	override def receive: Receive = {
		case StartService => startService()
		case StopService => stopService()
		case StoreRequest(target) => sender() ! store(target)
		case RetrieveRequest(request) => sender() ! retrieve(request)
		case ListEntities(_) => sender() ! listEntities()
		case unknownMessage => logger.warning(s"Received unknown message: $unknownMessage")
	}

	private def startService(): Unit = {
		logger.info("Object Storage starting up")
		memoryStorage.clear()
		logger.info("Object Storage started")
	}

	private def stopService(): Unit = {
		logger.info("Object Storage stopping")
		memoryStorage.clear()
		logger.info("Object Storage stopped")
	}

	private def store(target: Any): StorageEvent = {
		val newKey = new StorageId(UUID.randomUUID.toString)
		memoryStorage.put(newKey, target)
		StorageOK(newKey)
	}

	private def retrieve(target: StorageId): Any = {
		LookupResponse(Option(memoryStorage.get(target)))
	}

	private def listEntities(): EntityList = {
		EntityList(memoryStorage.map(pair => (pair._1, pair._2.getClass)).toList)
	}
}


text:
class CreateBudgets < ActiveRecord::Migration
  def change
    create_table :budgets do |t|
      t.string :name
      t.text :text
      t.boolean :published
      t.date :agreed_on
      t.string :agreed_protocol_link

      t.timestamps
    end
  end
end


text:
//
//  Generated by the J2ObjC translator.  DO NOT EDIT!
//  source: android/libcore/luni/src/main/java/java/io/File.java
//

#ifndef _JavaIoFile_H_
#define _JavaIoFile_H_

#include "J2ObjC_header.h"
#include "java/io/Serializable.h"
#include "java/lang/Comparable.h"

@class IOSObjectArray;
@class JavaNetURI;
@class JavaNetURL;
@protocol JavaIoFileFilter;
@protocol JavaIoFilenameFilter;

/*!
 @brief An "abstract" representation of a file system entity identified by a
 pathname.
 The pathname may be absolute (relative to the root directory
 of the file system) or relative to the current directory in which the program
 is running.

The actual file referenced by a File may or may not exist. It may
 also, despite the name File, be a directory or other non-regular
 file.

This class provides limited functionality for getting/setting file
 permissions, file type, and last modified time.

On Android strings are converted to UTF-8 byte sequences when sending filenames to
 the operating system, and byte sequences returned by the operating system (from the
 various list methods) are converted to strings by decoding them as UTF-8
 byte sequences.
 */
@interface JavaIoFile : NSObject < JavaIoSerializable, JavaLangComparable >

#pragma mark Public

/*!
 @brief Constructs a new file using the specified directory and name.
 @param dir
 the directory where the file is stored.
 @param name
 the file's name.
 @throws NullPointerException
 if name is null.
 */
- (instancetype)initWithJavaIoFile:(JavaIoFile *)dir
                      withNSString:(NSString *)name;

/*!
 @brief Constructs a new file using the specified path.
 @param path
 the path to be used for the file.
 */
- (instancetype)initWithNSString:(NSString *)path;

/*!
 @brief Constructs a new File using the specified directory path and file name,
 placing a path separator between the two.
 @param dirPath
 the path to the directory where the file is stored.
 @param name
 the file's name.
 @throws NullPointerException
 if name == null.
 */
- (instancetype)initWithNSString:(NSString *)dirPath
                    withNSString:(NSString *)name;

/*!
 @brief Constructs a new File using the path of the specified URI.
 uri
 needs to be an absolute and hierarchical Unified Resource Identifier with
 file scheme and non-empty path component, but with undefined authority,
 query or fragment components.
 @param uri
 the Unified Resource Identifier that is used to construct this
 file.
 @throws IllegalArgumentException
 if uri does not comply with the conditions above.
 */
- (instancetype)initWithJavaNetURI:(JavaNetURI *)uri;

/*!
 @brief Tests whether or not this process is allowed to execute this file.
 Note that this is a best-effort result; the only way to be certain is
 to actually attempt the operation.
 @return true if this file can be executed, false otherwise.
 @since 1.6
 */
- (jboolean)canExecute;

/*!
 @brief Indicates whether the current context is allowed to read from this file.
 @return true if this file can be read, false otherwise.
 */
- (jboolean)canRead;

/*!
 @brief Indicates whether the current context is allowed to write to this file.
 @return true if this file can be written, false
 otherwise.
 */
- (jboolean)canWrite;

/*!
 @brief Returns the relative sort ordering of the paths for this file and the
 file another.
 The ordering is platform dependent.
 @param another
 a file to compare this file to
 @return an int determined by comparing the two paths. Possible values are
 described in the Comparable interface.
 */
- (jint)compareToWithId:(JavaIoFile *)another;

/*!
 @brief Creates a new, empty file on the file system according to the path
 information stored in this file.
 This method returns true if it creates
 a file, false if the file already existed. Note that it returns false
 even if the file is not a file (because it's a directory, say).

This method is not generally useful. For creating temporary files,
 use createTempFile instead. For reading/writing files, use FileInputStream,
 FileOutputStream, or RandomAccessFile, all of which can create files.

Note that this method does not throw IOException if the file
 already exists, even if it's not a regular file. Callers should always check the
 return value, and may additionally want to call isFile.
 @return true if the file has been created, false if it
 already exists.
 @throws IOException if it's not possible to create the file.
 */
- (jboolean)createNewFile;

/*!
 @brief Creates an empty temporary file using the given prefix and suffix as part
 of the file name.
 If suffix is null, .tmp is used. This
 method is a convenience method that calls
 createTempFile(String,String,File) with the third argument
 being null.
 @param prefix
 the prefix to the temp file name.
 @param suffix
 the suffix to the temp file name.
 @return the temporary file.
 @throws IOException
 if an error occurs when writing the file.
 */
+ (JavaIoFile *)createTempFileWithNSString:(NSString *)prefix
                              withNSString:(NSString *)suffix;

/*!
 @brief Creates an empty temporary file in the given directory using the given
 prefix and suffix as part of the file name.
 If suffix is null, .tmp is used.

Note that this method does not call deleteOnExit, but see the
 documentation for that method before you call it manually.
 @param prefix
 the prefix to the temp file name.
 @param suffix
 the suffix to the temp file name.
 @param directory
 the location to which the temp file is to be written, or
 null for the default location for temporary files,
 which is taken from the "java.io.tmpdir" system property. It
 may be necessary to set this property to an existing, writable
 directory for this method to work properly.
 @return the temporary file.
 @throws IllegalArgumentException
 if the length of prefix is less than 3.
 @throws IOException
 if an error occurs when writing the file.
 */
+ (JavaIoFile *)createTempFileWithNSString:(NSString *)prefix
                              withNSString:(NSString *)suffix
                            withJavaIoFile:(JavaIoFile *)directory;

/*!
 @brief Deletes this file.
 Directories must be empty before they will be deleted.

Note that this method does not throw IOException on failure.
 Callers must check the return value.
 @return true if this file was deleted, false otherwise.
 */
- (jboolean)delete__;

/*!
 @brief Schedules this file to be automatically deleted when the VM terminates normally.

Note that on Android, the application lifecycle does not include VM termination,
 so calling this method will not ensure that files are deleted. Instead, you should
 use the most appropriate out of:

Use a finally clause to manually invoke delete.

Maintain your own set of files to delete, and process it at an appropriate point
 in your application's lifecycle.

Use the Unix trick of deleting the file as soon as all readers and writers have
 opened it. No new readers/writers will be able to access the file, but all existing
 ones will still have access until the last one closes the file.

 */
- (void)deleteOnExit;

/*!
 @brief Compares obj to this file and returns true if they
 represent the same object using a path specific comparison.
 @param obj
 the object to compare this file with.
 @return true if obj is the same as this object,
 false otherwise.
 */
- (jboolean)isEqual:(id)obj;

/*!
 @brief Returns a boolean indicating whether this file can be found on the
 underlying file system.
 @return true if this file exists, false otherwise.
 */
- (jboolean)exists;

/*!
 @brief Returns a new file constructed using the absolute path of this file.
 Equivalent to new File(this.getAbsolutePath()).
 */
- (JavaIoFile *)getAbsoluteFile;

/*!
 @brief Returns the absolute path of this file.
 An absolute path is a path that starts at a root
 of the file system. On Android, there is only one root: /.

A common use for absolute paths is when passing paths to a Process as
 command-line arguments, to remove the requirement implied by relative paths, that the
 child must have the same working directory as its parent.
 */
- (NSString *)getAbsolutePath;

/*!
 @brief Returns a new file created using the canonical path of this file.
 Equivalent to new File(this.getCanonicalPath()).
 @return the new file constructed from this file's canonical path.
 @throws IOException
 if an I/O error occurs.
 */
- (JavaIoFile *)getCanonicalFile;

/*!
 @brief Returns the canonical path of this file.
 An absolute path is one that begins at the root of the file system.
 A canonical path is an absolute path with symbolic links
 and references to "." or ".." resolved. If a path element does not exist (or
 is not searchable), there is a conflict between interpreting canonicalization
 as a textual operation (where "a/../b" is "b" even if "a" does not exist) .

Most callers should use getAbsolutePath instead. A canonical path is
 significantly more expensive to compute, and not generally useful. The primary
 use for canonical paths is determining whether two paths point to the same file by
 comparing the canonicalized paths.

It can be actively harmful to use a canonical path, specifically because
 canonicalization removes symbolic links. It's wise to assume that a symbolic link
 is present for a reason, and that that reason is because the link may need to change.
 Canonicalization removes this layer of indirection. Good code should generally avoid
 caching canonical paths.
 @return the canonical path of this file.
 @throws IOException
 if an I/O error occurs.
 */
- (NSString *)getCanonicalPath;

/*!
 @brief Returns the number of free bytes on the partition containing this path.
 Returns 0 if this path does not exist.

Note that this is likely to be an optimistic over-estimate and should not
 be taken as a guarantee your application can actually write this many bytes.
 @since 1.6
 */
- (jlong)getFreeSpace;

/*!
 @brief Returns the name of the file or directory represented by this file.
 @return this file's name or an empty string if there is no name part in
 the file's path.
 */
- (NSString *)getName;

/*!
 @brief Returns the pathname of the parent of this file.
 This is the path up to
 but not including the last name. null is returned if there is no
 parent.
 @return this file's parent pathname or null.
 */
- (NSString *)getParent;

/*!
 @brief Returns a new file made from the pathname of the parent of this file.
 This is the path up to but not including the last name. null is
 returned when there is no parent.
 @return a new file representing this file's parent or null.
 */
- (JavaIoFile *)getParentFile;

/*!
 @brief Returns the path of this file.
 */
- (NSString *)getPath;

/*!
 @brief Returns the total size in bytes of the partition containing this path.
 Returns 0 if this path does not exist.
 @since 1.6
 */
- (jlong)getTotalSpace;

/*!
 @brief Returns the number of usable free bytes on the partition containing this path.
 Returns 0 if this path does not exist.

Note that this is likely to be an optimistic over-estimate and should not
 be taken as a guarantee your application can actually write this many bytes.
 On Android (and other Unix-based systems), this method returns the number of free bytes
 available to non-root users, regardless of whether you're actually running as root,
 and regardless of any quota or other restrictions that might apply to the user.
 (The getFreeSpace method returns the number of bytes potentially available to root.)
 @since 1.6
 */
- (jlong)getUsableSpace;

/*!
 @brief Returns an integer hash code for the receiver.
 Any two objects for which
 equals returns true must return the same hash code.
 @return this files's hash value.
 */
- (NSUInteger)hash;

/*!
 @brief Indicates if this file's pathname is absolute.
 Whether a pathname is
 absolute is platform specific. On Android, absolute paths start with
 the character '/'.
 @return true if this file's pathname is absolute, false
 otherwise.
 */
- (jboolean)isAbsolute;

/*!
 @brief Indicates if this file represents a directory on the
 underlying file system.
 @return true if this file is a directory, false
 otherwise.
 */
- (jboolean)isDirectory;

/*!
 @brief Indicates if this file represents a file on the underlying
 file system.
 @return true if this file is a file, false otherwise.
 */
- (jboolean)isFile;

/*!
 @brief Returns whether or not this file is a hidden file as defined by the
 operating system.
 The notion of "hidden" is system-dependent. For Unix
 systems a file is considered hidden if its name starts with a ".". For
 Windows systems there is an explicit flag in the file system for this
 purpose.
 @return true if the file is hidden, false otherwise.
 */
- (jboolean)isHidden;

/*!
 @brief Returns the time when this file was last modified, measured in
 milliseconds since January 1st, 1970, midnight.
 Returns 0 if the file does not exist.
 @return the time when this file was last modified.
 */
- (jlong)lastModified;

/*!
 @brief Returns the length of this file in bytes.
 Returns 0 if the file does not exist.
 The result for a directory is not defined.
 @return the number of bytes in this file.
 */
- (jlong)length;

/*!
 @brief Returns an array of strings with the file names in the directory
 represented by this file.
 The result is null if this file is not
 a directory.

 The entries . and .. representing the current and parent
 directory are not returned as part of the list.
 @return an array of strings with file names or null.
 */
- (IOSObjectArray *)list;

/*!
 @brief Gets a list of the files in the directory represented by this file.
 This
 list is then filtered through a FilenameFilter and the names of files
 with matching names are returned as an array of strings. Returns
 null if this file is not a directory. If filter is
 null then all filenames match.

 The entries . and .. representing the current and parent
 directories are not returned as part of the list.
 @param filter
 the filter to match names against, may be null.
 @return an array of files or null.
 */
- (IOSObjectArray *)listWithJavaIoFilenameFilter:(id<JavaIoFilenameFilter>)filter;

/*!
 @brief Returns an array of files contained in the directory represented by this
 file.
 The result is null if this file is not a directory. The
 paths of the files in the array are absolute if the path of this file is
 absolute, they are relative otherwise.
 @return an array of files or null.
 */
- (IOSObjectArray *)listFiles;

/*!
 @brief Gets a list of the files in the directory represented by this file.
 This
 list is then filtered through a FileFilter and matching files are
 returned as an array of files. Returns null if this file is not a
 directory. If filter is null then all files match.

 The entries . and .. representing the current and parent
 directories are not returned as part of the list.
 @param filter
 the filter to match names against, may be null.
 @return an array of files or null.
 */
- (IOSObjectArray *)listFilesWithJavaIoFileFilter:(id<JavaIoFileFilter>)filter;

/*!
 @brief Gets a list of the files in the directory represented by this file.
 This
 list is then filtered through a FilenameFilter and files with matching
 names are returned as an array of files. Returns null if this
 file is not a directory. If filter is null then all
 filenames match.

 The entries . and .. representing the current and parent
 directories are not returned as part of the list.
 @param filter
 the filter to match names against, may be null.
 @return an array of files or null.
 */
- (IOSObjectArray *)listFilesWithJavaIoFilenameFilter:(id<JavaIoFilenameFilter>)filter;

/*!
 @brief Returns the file system roots.
 On Android and other Unix systems, there is
 a single root, /.
 */
+ (IOSObjectArray *)listRoots;

/*!
 @brief Creates the directory named by this file, assuming its parents exist.
 Use mkdirs if you also want to create missing parents.

Note that this method does not throw IOException on failure.
 Callers must check the return value. Note also that this method returns
 false if the directory already existed. If you want to know whether the
 directory exists on return, either use (f.mkdir() || f.isDirectory())
 or simply ignore the return value from this method and simply call isDirectory.
 @return true if the directory was created,
 false on failure or if the directory already existed.
 */
- (jboolean)mkdir;

/*!
 @brief Creates the directory named by this file, creating missing parent
 directories if necessary.
 Use mkdir if you don't want to create missing parents.

Note that this method does not throw IOException on failure.
 Callers must check the return value. Note also that this method returns
 false if the directory already existed. If you want to know whether the
 directory exists on return, either use (f.mkdirs() || f.isDirectory())
 or simply ignore the return value from this method and simply call isDirectory.
 @return true if the directory was created,
 false on failure or if the directory already existed.
 */
- (jboolean)mkdirs;

/*!
 @brief Renames this file to newPath.
 This operation is supported for both
 files and directories.

Many failures are possible. Some of the more likely failures include:

Write permission is required on the directories containing both the source and
 destination paths.

Search permission is required for all parents of both paths.

Both paths be on the same mount point. On Android, applications are most likely to hit
 this restriction when attempting to copy between internal storage and an SD card.

Note that this method does not throw IOException on failure.
 Callers must check the return value.
 @param newPath the new path.
 @return true on success.
 */
- (jboolean)renameToWithJavaIoFile:(JavaIoFile *)newPath;

/*!
 @brief Equivalent to setExecutable(executable, true).
 @since 1.6
 */
- (jboolean)setExecutableWithBoolean:(jboolean)executable;

/*!
 @brief Manipulates the execute permissions for the abstract path designated by
 this file.

Note that this method does not throw IOException on failure.
 Callers must check the return value.
 @param executable
 To allow execute permission if true, otherwise disallow
 @param ownerOnly
 To manipulate execute permission only for owner if true,
 otherwise for everyone. The manipulation will apply to
 everyone regardless of this value if the underlying system
 does not distinguish owner and other users.
 @return true if and only if the operation succeeded. If the user does not
 have permission to change the access permissions of this abstract
 pathname the operation will fail. If the underlying file system
 does not support execute permission and the value of executable
 is false, this operation will fail.
 @since 1.6
 */
- (jboolean)setExecutableWithBoolean:(jboolean)executable
                         withBoolean:(jboolean)ownerOnly;

/*!
 @brief Sets the time this file was last modified, measured in milliseconds since
 January 1st, 1970, midnight.

Note that this method does not throw IOException on failure.
 Callers must check the return value.
 @param time
 the last modification time for this file.
 @return true if the operation is successful, false
 otherwise.
 @throws IllegalArgumentException
 if time < 0.
 */
- (jboolean)setLastModifiedWithLong:(jlong)time;

/*!
 @brief Equivalent to setReadable(readable, true).
 @since 1.6
 */
- (jboolean)setReadableWithBoolean:(jboolean)readable;

/*!
 @brief Manipulates the read permissions for the abstract path designated by this
 file.
 @param readable
 To allow read permission if true, otherwise disallow
 @param ownerOnly
 To manipulate read permission only for owner if true,
 otherwise for everyone. The manipulation will apply to
 everyone regardless of this value if the underlying system
 does not distinguish owner and other users.
 @return true if and only if the operation succeeded. If the user does not
 have permission to change the access permissions of this abstract
 pathname the operation will fail. If the underlying file system
 does not support read permission and the value of readable is
 false, this operation will fail.
 @since 1.6
 */
- (jboolean)setReadableWithBoolean:(jboolean)readable
                       withBoolean:(jboolean)ownerOnly;

/*!
 @brief Equivalent to setWritable(false, false).
 */
- (jboolean)setReadOnly;

/*!
 @brief Equivalent to setWritable(writable, true).
 @since 1.6
 */
- (jboolean)setWritableWithBoolean:(jboolean)writable;

/*!
 @brief Manipulates the write permissions for the abstract path designated by this
 file.
 @param writable
 To allow write permission if true, otherwise disallow
 @param ownerOnly
 To manipulate write permission only for owner if true,
 otherwise for everyone. The manipulation will apply to
 everyone regardless of this value if the underlying system
 does not distinguish owner and other users.
 @return true if and only if the operation succeeded. If the user does not
 have permission to change the access permissions of this abstract
 pathname the operation will fail.
 @since 1.6
 */
- (jboolean)setWritableWithBoolean:(jboolean)writable
                       withBoolean:(jboolean)ownerOnly;

/*!
 @brief Returns a string containing a concise, human-readable description of this
 file.
 @return a printable representation of this file.
 */
- (NSString *)description;

/*!
 @brief Returns a Uniform Resource Identifier for this file.
 The URI is system
 dependent and may not be transferable between different operating / file
 systems.
 @return an URI for this file.
 */
- (JavaNetURI *)toURI;

/*!
 @brief Returns a Uniform Resource Locator for this file.
 The URL is system
 dependent and may not be transferable between different operating / file
 systems.
 @return a URL for this file.
 @throws java.net.MalformedURLException
 if the path cannot be transformed into a URL.
 */
- (JavaNetURL *)toURL;

#pragma mark Package-Private

@end

J2OBJC_STATIC_INIT(JavaIoFile)

FOUNDATION_EXPORT jchar JavaIoFile_separatorChar_;
J2OBJC_STATIC_FIELD_GETTER(JavaIoFile, separatorChar_, jchar)

FOUNDATION_EXPORT NSString *JavaIoFile_separator_;
J2OBJC_STATIC_FIELD_GETTER(JavaIoFile, separator_, NSString *)

FOUNDATION_EXPORT jchar JavaIoFile_pathSeparatorChar_;
J2OBJC_STATIC_FIELD_GETTER(JavaIoFile, pathSeparatorChar_, jchar)

FOUNDATION_EXPORT NSString *JavaIoFile_pathSeparator_;
J2OBJC_STATIC_FIELD_GETTER(JavaIoFile, pathSeparator_, NSString *)

FOUNDATION_EXPORT void JavaIoFile_initWithJavaIoFile_withNSString_(JavaIoFile *self, JavaIoFile *dir, NSString *name);

FOUNDATION_EXPORT JavaIoFile *new_JavaIoFile_initWithJavaIoFile_withNSString_(JavaIoFile *dir, NSString *name) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT void JavaIoFile_initWithNSString_(JavaIoFile *self, NSString *path);

FOUNDATION_EXPORT JavaIoFile *new_JavaIoFile_initWithNSString_(NSString *path) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT void JavaIoFile_initWithNSString_withNSString_(JavaIoFile *self, NSString *dirPath, NSString *name);

FOUNDATION_EXPORT JavaIoFile *new_JavaIoFile_initWithNSString_withNSString_(NSString *dirPath, NSString *name) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT void JavaIoFile_initWithJavaNetURI_(JavaIoFile *self, JavaNetURI *uri);

FOUNDATION_EXPORT JavaIoFile *new_JavaIoFile_initWithJavaNetURI_(JavaNetURI *uri) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT IOSObjectArray *JavaIoFile_listRoots();

FOUNDATION_EXPORT JavaIoFile *JavaIoFile_createTempFileWithNSString_withNSString_(NSString *prefix, NSString *suffix);

FOUNDATION_EXPORT JavaIoFile *JavaIoFile_createTempFileWithNSString_withNSString_withJavaIoFile_(NSString *prefix, NSString *suffix, JavaIoFile *directory);

J2OBJC_TYPE_LITERAL_HEADER(JavaIoFile)

#endif // _JavaIoFile_H_


text: Note Board: A Django RESTful api for managing a note keeping system


text:
function myRobot({place, parcels}, route) {
	if (route.length == 0) {
		let routes = parcels.map(p => {
			if (p.place != place) return {
				pickup: true,
				route: findRoute(roadGraph, place, p.place)
			};

			return {
				pickup: false,
				route: findRoute(roadGraph, place, p.address)
			};
		});

		route = routes.reduce((prev, cur) => {
			if (prev.route.length > cur.route.length) return cur;
			if (prev.route.length < cur.route.length) return prev;
			return cur.pickup ? cur : prev;
		}).route;
	}

	return {direction: route[0], memory: route.slice(1)};
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.07.02 at 01:27:25 PM PDT
//

package org.aries.event;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for event-action.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="event-action">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *     <enumeration value="signed-in"/>
 *     <enumeration value="signed-out"/>
 *     <enumeration value="created"/>
 *     <enumeration value="updated"/>
 *     <enumeration value="deleted"/>
 *     <enumeration value="removed"/>
 *     <enumeration value="restored"/>
 *     <enumeration value="flushed"/>
 *     <enumeration value="reset"/>
 *     <enumeration value="sent"/>
 *     <enumeration value="notsent"/>
 *     <enumeration value="received"/>
 *     <enumeration value="logged"/>
 *     <enumeration value="dropped"/>
 *     <enumeration value="started"/>
 *     <enumeration value="stopped"/>
 *     <enumeration value="deployed"/>
 *     <enumeration value="undeployed"/>
 *     <enumeration value="configured"/>
 *     <enumeration value="accessed"/>
 *     <enumeration value="modified"/>
 *     <enumeration value="committed"/>
 *     <enumeration value="rolledback"/>
 *     <enumeration value="approved"/>
 *     <enumeration value="revoked"/>
 *     <enumeration value="submitted"/>
 *     <enumeration value="completed"/>
 *     <enumeration value="cancelled"/>
 *     <enumeration value="aborted"/>
 *     <enumeration value="failed"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "event-action", namespace = "http://www.aries.org/event/0.0.1")
@XmlEnum
public enum EventAction {

    @XmlEnumValue("signed-in")
    SIGNED_IN("signed-in"),
    @XmlEnumValue("signed-out")
    SIGNED_OUT("signed-out"),
    @XmlEnumValue("created")
    CREATED("created"),
    @XmlEnumValue("updated")
    UPDATED("updated"),
    @XmlEnumValue("deleted")
    DELETED("deleted"),
    @XmlEnumValue("removed")
    REMOVED("removed"),
    @XmlEnumValue("restored")
    RESTORED("restored"),
    @XmlEnumValue("flushed")
    FLUSHED("flushed"),
    @XmlEnumValue("reset")
    RESET("reset"),
    @XmlEnumValue("sent")
    SENT("sent"),
    @XmlEnumValue("notsent")
    NOTSENT("notsent"),
    @XmlEnumValue("received")
    RECEIVED("received"),
    @XmlEnumValue("logged")
    LOGGED("logged"),
    @XmlEnumValue("dropped")
    DROPPED("dropped"),
    @XmlEnumValue("started")
    STARTED("started"),
    @XmlEnumValue("stopped")
    STOPPED("stopped"),
    @XmlEnumValue("deployed")
    DEPLOYED("deployed"),
    @XmlEnumValue("undeployed")
    UNDEPLOYED("undeployed"),
    @XmlEnumValue("configured")
    CONFIGURED("configured"),
    @XmlEnumValue("accessed")
    ACCESSED("accessed"),
    @XmlEnumValue("modified")
    MODIFIED("modified"),
    @XmlEnumValue("committed")
    COMMITTED("committed"),
    @XmlEnumValue("rolledback")
    ROLLEDBACK("rolledback"),
    @XmlEnumValue("approved")
    APPROVED("approved"),
    @XmlEnumValue("revoked")
    REVOKED("revoked"),
    @XmlEnumValue("submitted")
    SUBMITTED("submitted"),
    @XmlEnumValue("completed")
    COMPLETED("completed"),
    @XmlEnumValue("cancelled")
    CANCELLED("cancelled"),
    @XmlEnumValue("aborted")
    ABORTED("aborted"),
    @XmlEnumValue("failed")
    FAILED("failed");
    private final String value;

    EventAction(String v) {
        value = v;
    }

    public String value() {
        return value;
    }

    public static EventAction fromValue(String v) {
        for (EventAction c: EventAction.values()) {
            if (c.value.equals(v)) {
                return c;
            }
        }
        throw new IllegalArgumentException(v);
    }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ND.Controls.Helpers
{
    public class MathHelper
    {
        public static Double Constrain(Double value, Double min, Double max)
        {
            if (min > max)
                throw new ArgumentException("Min value cannot be greater than max value");

            if (value < min)
                value = min;
            else if (value > max)
                value = max;

            return value;
        }
    }
}


text:
import React from 'react';
import { ActionCreators as UndoActionCreators } from 'redux-undo-immutable';
import { connect } from 'react-redux';

let UndoRedo = ({ canUndo, canRedo, onUndo, onRedo }) => <div>
  <button onClick={onUndo} disabled={!canUndo}>
    Undo
  </button>
  <button onClick={onRedo} disabled={!canRedo}>
    Redo
  </button>
</div>;

const mapStateToProps = (dataType, state) => {
  return {
    canUndo: state[dataType].past.size > 0,
    canRedo: state[dataType].future.size > 0
  };
};

const mapDispatchToProps = dispatch => {
  return {
    onUndo: () => dispatch(UndoActionCreators.undo()),
    onRedo: () => dispatch(UndoActionCreators.redo())
  };
};

const UndoRedoCreator = dataType => {
  return connect(
    mapStateToProps.bind(this, dataType),
    mapDispatchToProps
  )(UndoRedo);
};

export default UndoRedoCreator;


text:
namespace CustomMacros.Areas.Infrastructure.Controllers
{
    public interface IWorker
    {
    }
}


text:
<?php

namespace Oro\Bundle\EmailBundle\Migrations\Schema\v1_17;

use Doctrine\DBAL\Schema\Schema;
use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\ParametrizedSqlMigrationQuery;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;

class OroEmailBundle implements Migration
{
    /**
     * {@inheritdoc}
     */
    public function up(Schema $schema, QueryBag $queries)
    {
        if ($schema->hasTable('oro_process_definition')) {
            $queries->addQuery(new ParametrizedSqlMigrationQuery(
                'DELETE FROM oro_process_definition WHERE name = :name',
                ['name' => 'email_auto_response']
            ));
            $queries->addQuery(new ParametrizedSqlMigrationQuery(
                'DELETE FROM oro_process_trigger WHERE definition_name = :name',
                ['name' => 'email_auto_response']
            ));
        }
    }
}


text:
[instagram-private-api](../../README.md) / [responses](../../modules/responses.md) / ListReelMediaViewerFeedResponseFb_user_tags

# Interface: ListReelMediaViewerFeedResponseFb\_user\_tags

[responses](../../modules/responses.md).ListReelMediaViewerFeedResponseFb_user_tags

## Table of contents

### Properties

- [in](ListReelMediaViewerFeedResponseFb_user_tags.md#in)

## Properties

### in

• **in**: `any`[]

#### Defined in

[src/responses/list-reel-media-viewer.feed.response.ts:131](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/list-reel-media-viewer.feed.response.ts#L131)


text:
package org.arakhne.afc.math.geometry.d2.d;

import java.util.AbstractList;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.eclipse.xtext.xbase.lib.Pure;

import org.arakhne.afc.math.geometry.d2.afp.MultiShape2afp;
import org.arakhne.afc.vmutil.asserts.AssertMessages;

/** Container for grouping of shapes.
 *
 *
The coordinates of the shapes inside the multishape are global. They are not relative to the multishape.
 *
 *
Caution: The multishape does not detect the bound change of the stored shapes.
 *
 * @param <T> the type of the shapes inside the multishape.
 * @author $Author: tpiotrow$
 * @author $Author: sgalland$
 * @version $FullVersion$
 * @mavengroupid $GroupId$
 * @mavenartifactid $ArtifactId$
 * @since 13.0
 */
public class MultiShape2d<T extends Shape2d<?>> extends AbstractShape2d<MultiShape2d<T>>
		implements MultiShape2afp<Shape2d<?>, MultiShape2d<T>, T, PathElement2d, Point2d, Vector2d, Rectangle2d> {

	private static final long serialVersionUID = -4727279807601027239L;

	private List<T> elements = new ListResponseModel();

	private Rectangle2d bounds;

	/**
	 * Construct an empty multishape.
	 */
	public MultiShape2d() {
		//
	}

	/** Construct a multishape with shapes inside.
	 *
	 * @param shapes the shapes to add into the multishape.
	 */
	public MultiShape2d(@SuppressWarnings("unchecked") T... shapes) {
		assert shapes != null : AssertMessages.notNullParameter();
		addAll(Arrays.asList(shapes));
	}

	/** Construct a multishape with shapes inside.
	 *
	 * @param shapes the shapes to add into the multishape.
	 */
	public MultiShape2d(Iterable<? extends T> shapes) {
		assert shapes != null : AssertMessages.notNullParameter();
		for (final T element : shapes) {
			add(element);
		}
	}

	@SuppressWarnings("unchecked")
	@Override
	@Pure
	public MultiShape2d<T> clone() {
		final MultiShape2d<T> clone = super.clone();
		final List<T> clonedList = new ArrayList<>();
		for (final T shape : this.elements) {
			clonedList.add((T) shape.clone());
		}
		clone.elements = clonedList;
		if (this.bounds != null) {
			clone.bounds = this.bounds.clone();
		}
		return clone;
	}

	@Override
	@Pure
	public int hashCode() {
		return this.elements.hashCode();
	}

	@Override
	public void onBackendDataChange() {
		this.bounds = null;
		fireGeometryChange();
	}

	/** Invoked when the geometry of the content has changed.
	 */
	protected void onContentGeometryChange() {
		this.bounds = null;
		fireGeometryChange();
	}

	@Pure
	@Override
	public List<T> getBackendDataList() {
		return this.elements;
	}

	@Pure
	@Override
	public Rectangle2d toBoundingBox() {
		if (this.bounds == null) {
			this.bounds = getGeomFactory().newBox();
			MultiShape2afp.super.toBoundingBox(this.bounds);
		}
		return this.bounds;
	}

	@Pure
	@Override
	public void toBoundingBox(Rectangle2d box) {
		assert box != null : AssertMessages.notNullParameter();
		if (this.bounds == null) {
			this.bounds = getGeomFactory().newBox();
			MultiShape2afp.super.toBoundingBox(this.bounds);
		}
		box.set(this.bounds);
	}

	@Override
	public void translate(double dx, double dy) {
		if (dx != 0 || dy != 0) {
			final Rectangle2d box = this.bounds;
			MultiShape2afp.super.translate(dx, dy);
			if (box != null) {
				box.translate(dx, dy);
				this.bounds = box;
			}
			fireGeometryChange();
		}
	}

	/** List responsive model.
	 *
	 * @author $Author: sgalland$
	 * @version $FullVersion$
	 * @mavengroupid $GroupId$
	 * @mavenartifactid $ArtifactId$
	 * @since 13.0
	 */
	private class ListResponseModel extends AbstractList<T> implements ShapeGeometryChangeListener {

		private List<T> delegate = new ArrayList<>();

		/** Construct an empty model.
		 */
		ListResponseModel() {
			//
		}

		@Override
		public void add(int index, T element) {
			assert element != null;
			this.delegate.add(index, element);
			if (element instanceof AbstractShape2d<?>) {
				((AbstractShape2d<?>) element).addShapeGeometryChangeListener(this);
			}
		}

		@Override
		public T remove(int index) {
			final T element = this.delegate.remove(index);
			if (element instanceof AbstractShape2d<?>) {
				((AbstractShape2d<?>) element).removeShapeGeometryChangeListener(this);
			}
			return element;
		}

		@Override
		public T set(int index, T element) {
			assert element != null;
			final T oldElement = this.delegate.set(index, element);
			if (oldElement instanceof AbstractShape2d<?>) {
				((AbstractShape2d<?>) oldElement).removeShapeGeometryChangeListener(this);
			}
			if (element instanceof AbstractShape2d<?>) {
				((AbstractShape2d<?>) element).addShapeGeometryChangeListener(this);
			}
			return oldElement;
		}

		@Override
		public T get(int index) {
			return this.delegate.get(index);
		}

		@Override
		public int size() {
			return this.delegate.size();
		}

		@Override
		public void shapeGeometryChange(Shape2d<?> shape) {
			onContentGeometryChange();
		}

		@Override
		public boolean equals(Object obj) {
			return this.delegate.equals(obj);
		}

        @Override
		public int hashCode() {
			return this.delegate.hashCode();
		}

	}

}