text:
using System;
using System.Data;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SageFrame.Framework;
using SageFrame.Web;
using SageFrame.Message;
using System.Text;
using SageFrame.Web.Utilities;

namespace SageFrame.Modules.Admin.MessageManagement
{
    public partial class ctl_MessageTemplateManagement : BaseAdministrationUserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    BindMessageTemplateType();
                    ClearForm();
                    BindData();
                    pnlMessageTemplateList.Style.Add("display", "block");
                    BindMessageToken();
                    lnkAddSubjectMessageToken.Attributes.Add("onclick",
                                                             "showMessageToken('" + txtSubject.ClientID + "','" +
                                                             mpeAddMessageTokenModalPopup.ClientID + "',false);");
                    lnkAddBodyMessageToken.Attributes.Add("onclick",
                                                          "showMessageToken('" + txtBody.ClientID + "','" +
                                                          mpeAddMessageTokenModalPopup.ClientID + "',true);");
                    lblAddSubjectMessageToken.Attributes.Add("onclick",
                                                             "showMessageToken('" + txtSubject.ClientID + "','" +
                                                             mpeAddMessageTokenModalPopup.ClientID + "',false);");
                    lblAddBodyMessageToken.Attributes.Add("onclick",
                                                          "showMessageToken('" + txtBody.ClientID + "','" +
                                                          mpeAddMessageTokenModalPopup.ClientID + "',true);");
                    btnAddMessageTokenOk.Attributes.Add("onclick",
                                                        "AddMessageToken('" + lstMessageToken.ClientID + "','" +
                                                        mpeAddMessageTokenModalPopup.ClientID + "' )");
                    btnAddMessageTokenCancel.Attributes.Add("onclick",
                                                            "hideModalPopup('" + mpeAddMessageTokenModalPopup.ClientID +
                                                            "');");
                    btnCancelMessageTemplateType.Attributes.Add("onclick",
                                                                "ClearTemplateText('" + txtMessageTemplateType.ClientID +
                                                                "', '" + lblErrorMessageTemplateType.ClientID +
                                                                "'); hideModalPopup('" + mpeMessageTemplateType.ClientID + "');");
                    btnCancelMessageTemplateToken.Attributes.Add("onclick",
                                                                 "ClearTemplateText('" +
                                                                 txtMessageTemplateToken.ClientID + "', '" +
                                                                 lblErrorMessageTemplateToken.ClientID +
                                                                 "'); hideModalPopup('" + mpeMessageTemplateToken.ClientID + "');");
                    lstMessageToken.Attributes.Add("onchange", "setMessageToken(this.value);");
                    hypAddMessageTemplateType.Attributes.Add("onclick",
                                                             "ClearTemplateText('" + txtMessageTemplateType.ClientID +
                                                             "', '" + lblErrorMessageTemplateType.ClientID +
                                                             "'); showModalPopup('" + mpeMessageTemplateType.ClientID +
                                                             "');");
                    hypAddMessageTemplateToken.Attributes.Add("onclick",
                                                              "ClearTemplateText('" + txtMessageTemplateToken.ClientID +
                                                              "', '" + lblErrorMessageTemplateToken.ClientID +
                                                              "'); showModalPopup('" + mpeMessageTemplateToken.ClientID +
                                                              "');");
                    lblAddMessageTemplateType.Attributes.Add("onclick",
                                                             "ClearTemplateText('" + txtMessageTemplateType.ClientID +
                                                             "', '" + lblErrorMessageTemplateType.ClientID +
                                                             "'); showModalPopup('" + mpeMessageTemplateType.ClientID +
                                                             "');");
                    lblAddMessageTemplateToken.Attributes.Add("onclick",
                                                              "ClearTemplateText('" + txtMessageTemplateToken.ClientID +
                                                              "', '" + lblErrorMessageTemplateToken.ClientID +
                                                              "'); showModalPopup('" + mpeMessageTemplateToken.ClientID +
                                                              "');");
                }
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ckEditorUserModuleID", " var ckEditorUserModuleID='" + SageUserModuleID + "';", true);
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }

        private void BindMessageToken()
        {
            try
            {
                lstMessageToken.Items.Clear();
                if (ddlMessageTemplateType.SelectedIndex != -1)
                {
                    if (Int32.Parse(ddlMessageTemplateType.SelectedValue) > 0)
                    {
                        MessageManagementController objMsgController = new MessageManagementController();
                        List<MessageManagementInfo> messageTokens = objMsgController.GetMessageTemplateTypeTokenListByMessageTemplateType(Int32.Parse(ddlMessageTemplateType.SelectedValue), GetPortalID);
                        foreach (MessageManagementInfo messageToken in messageTokens)
                        {
                            ListItem li = new ListItem(messageToken.MessageTokenKey, messageToken.MessageTokenKey);
                            lstMessageToken.Items.Add(li);
                        }
                    }
                }
                if (lstMessageToken.Items.Count > 0)
                {
                    lstMessageToken.SelectedIndex = 0;
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "InitializedMessageToken", "setMessageToken('" + lstMessageToken.SelectedValue + "');", true);
                }
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }

        private void BindMessageTemplateType()
        {
            try
            {
                CommonFunction comm = new CommonFunction();
                MessageManagementController objMsgController = new MessageManagementController();
                var LINQ = objMsgController.GetMessageTemplateTypeList(true, false, GetPortalID, GetUsername, GetCurrentCultureName);
                DataTable dtTemplateType = comm.LINQToDataTable(LINQ);
                ddlMessageTemplateType.DataSource = dtTemplateType;
                ddlMessageTemplateType.DataTextField = "CultureName";
                ddlMessageTemplateType.DataValueField = "MessageTemplateTypeID";
                ddlMessageTemplateType.DataBind();
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }

        protected void imbAddNew_Click(object sender, EventArgs e)
        {
            try
            {
                ClearForm();
                hdnMessageTemplateID.Value = "0";
                pnlMessageTemplate.Style.Add("display", "block");
                pnlMessageTemplateList.Style.Add("display", "none");
                //hypAddMessageTemplateType.Style.Add("display", "inline");
                //hypAddMessageTemplateToken.Style.Add("display", "inline");
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }

        }

        protected void imbSave_Click(object sender, EventArgs e)
        {
            Save();
        }

        private void Save()
        {
            try
            {
                StringBuilder strMessage = new StringBuilder();
                if (Validate(strMessage))
                {
                    MessageManagementController objMsgController = new MessageManagementController();
                    if (Int32.Parse(hdnMessageTemplateID.Value) > 0)
                    {
                        try
                        {
                            Int32 MessageTemplateID = Int32.Parse(Session["MessageTemplateID"].ToString());
                            objMsgController.UpdateMessageTemplate(MessageTemplateID, Int32.Parse(ddlMessageTemplateType.SelectedValue), txtSubject.Text,
                                txtBody.Value, txtMailFrom.Text, chkIsActive.Checked, DateTime.Now, GetPortalID, GetUsername, GetCurrentCultureName);
                            ShowMessage(SageMessageTitle.Information.ToString(), GetSageMessage("MessageManagement", "MessageTemplateIsUpdatedSuccessfully"), "", SageMessageType.Success);
                            BindData();
                            ClearForm();
                        }
                        catch
                        {
                            ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("MessageManagement", "MessageTemplateCouldnotBeUpdated"), "", SageMessageType.Error);
                        }
                    }
                    else
                    {
                        int newMessageTemplateID = objMsgController.AddMessageTemplate(int.Parse(ddlMessageTemplateType.SelectedValue), txtSubject.Text, txtBody.Value, txtMailFrom.Text, chkIsActive.Checked, DateTime.Now, GetPortalID, GetUsername, GetCurrentCultureName);
                        if (newMessageTemplateID > 0)
                        {
                            BindData();
                            ShowMessage(SageMessageTitle.Information.ToString(), GetSageMessage("MessageManagement", "MessageTemplateIsAddedSuccessfully"), "", SageMessageType.Success);
                            ClearForm();
                        }
                        else
                        {

                            ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("MessageManagement", "MessageTemplateCouldnotBeAdded"), "", SageMessageType.Error);
                        }
                    }
                }
                else
                {
                    ShowMessage(SageMessageTitle.Information.ToString(), strMessage.ToString(), "", SageMessageType.Success);

                }
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }

        private bool Validate(StringBuilder strMessage)
        {
            bool IsValid = true;

            strMessage.AppendLine(GetSageMessage("MessageManagement", "PleaseFill") + Environment.NewLine);
            if (txtSubject.Text.Trim() == string.Empty)
            {
                IsValid = false;

                strMessage.AppendLine(GetSageMessage("MessageManagement", "MessageTemplateSubject") + Environment.NewLine);
            }
            if (txtBody.Value.Trim() == string.Empty)
            {
                IsValid = false;

                strMessage.AppendLine(GetSageMessage("MessageManagement", "MessageTemplateBody") + Environment.NewLine);
            }
            if (txtMailFrom.Text.Trim() == string.Empty)
            {
                IsValid = false;

                strMessage.AppendLine(GetSageMessage("MessageManagement", "FromEmailAddressIsRequired") + Environment.NewLine);
            }
            return IsValid;
        }

        protected void imbCancel_Click(object sender, EventArgs e)
        {
            try
            {
                ClearForm();
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }

        private void ClearForm()
        {
            try
            {
                chkIsActive.Checked = false;
                txtSubject.Text = "";
                txtBody.Value = "";
                txtMailFrom.Text = "";
                Session["MessageTemplateID"] = null;
                HideAll();
                pnlMessageTemplateList.Style.Add("display", "block");
                pnlMessageTemplate.Style.Add("display", "none");
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }

        private void HideAll()
        {
            try
            {
                pnlMessageTemplate.Style.Add("display", "none");
                pnlMessageTemplateList.Style.Add("display", "none");
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }

        private void BindData()
        {
            try
            {
                MessageManagementController objMsgController = new MessageManagementController();
                var LINQ = objMsgController.GetMessageTemplateList(true, false, GetPortalID, GetUsername, GetCurrentCultureName);
                grdList.DataSource = LINQ;
                grdList.DataBind();
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }

        protected void grdList_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            try
            {
                grdList.PageIndex = e.NewPageIndex;
                BindData();
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }

        protected void grdList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                Int32 MessageTemplateID = Int32.Parse(e.CommandArgument.ToString());
                switch (e.CommandName.ToString())
                {
                    case "Edit":
                        EditMessageTemplate(MessageTemplateID);
                        BindMessageToken();
                        break;
                    case "Delete":
                        DeleteMessageTemplate(MessageTemplateID);

                        break;
                }
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }

        private void EditMessageTemplate(Int32 MessageTemplateID)
        {
            try
            {
                MessageManagementController objMsgController = new MessageManagementController();
                var LINQ = objMsgController.GetMessageTemplate(MessageTemplateID, GetPortalID);
                if (LINQ.MessageTemplateTypeID > 0)
                {
                    hdnMessageTemplateID.Value = MessageTemplateID.ToString();
                    txtSubject.Text = LINQ.Subject;
                    txtBody.Value = LINQ.Body;
                    txtMailFrom.Text = LINQ.MailFrom;
                    chkIsActive.Checked = (LINQ.IsActive == true ? true : false);
                    ddlMessageTemplateType.SelectedValue = LINQ.MessageTemplateTypeID == 0 ? MessageTemplateID.ToString() : LINQ.MessageTemplateTypeID.ToString();
                    Session["MessageTemplateID"] = MessageTemplateID;
                    HideAll();
                    pnlMessageTemplate.Style.Add("display", "block");
                    //hypAddMessageTemplateType.Style.Add("display", "none");
                    //hypAddMessageTemplateToken.Style.Add("display", "none");

                }
                else
                {
                    ClearNewForm();
                }
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }

        private void DeleteMessageTemplate(Int32 MessageTemplateID)
        {
            try
            {
                MessageManagementController objMsgController = new MessageManagementController();
                objMsgController.DeleteMessageTemplate(MessageTemplateID, GetPortalID, DateTime.Now, GetUsername);
                ShowMessage(SageMessageTitle.Information.ToString(), GetSageMessage("MessageManagement", "MessageTemplateIsDeletedSuccessfully"), "", SageMessageType.Success);
                BindData();
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }

        protected void grdList_RowDataBound(object sender, GridViewRowEventArgs e)
        {

        }

        protected void grdList_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {

        }

        protected void grdList_RowEditing(object sender, GridViewEditEventArgs e)
        {

        }

        protected void grdList_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {

        }

        protected void btnOkMessageTemplateType_Click(object sender, EventArgs e)
        {
            try
            {
                MessageManagementController objMsgController = new MessageManagementController();
                if (objMsgController.CheckMessgeTemplateUnique(txtMessageTemplateType.Text.TrimStart(','), GetPortalID))
                {

                    if (txtMessageTemplateType.Text.Trim() != "")
                    {
                        string messageTemplateTypeName = txtMessageTemplateType.Text.TrimStart(',');
                        int MessageTemplateTypeID = 0;
                        MessageTemplateTypeID = objMsgController.AddMessageTemplateType(messageTemplateTypeName, true, DateTime.Now, GetPortalID, GetUsername);
                        if (MessageTemplateTypeID > 0)
                        {
                            ShowMessage(SageMessageTitle.Information.ToString(), GetSageMessage("MessageManagement", "MessageTemplateIsAddedSuccessfully"), "", SageMessageType.Success);
                            BindMessageTemplateType();
                            txtMessageTemplateType.Text = "";
                            ClearNewForm();
                        }
                        else
                        {
                            ShowMessage(SageMessageTitle.Information.ToString(), GetSageMessage("MessageManagement", "PleaseSaveMessageTemplateTypeAgain"), "", SageMessageType.Error);
                        }
                    }
                    else
                    {

                        ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("MessageManagement", "MessageTemplateTypeIsRequiredField"), "", SageMessageType.Alert);
                    }
                }
                else
                {
                    mpeMessageTemplateType.Show();
                    lblErrorMessageTemplateType.Text = GetSageMessage("MessageManagement",
                                                                       "UniqueMessageTemplateTypeIsRequired");
                    lblErrorMessageTemplateType.Visible = true;
                    // ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("MessageManagement", "UniqueMessageTemplateTypeIsRequired"), "", SageMessageType.Alert);
                }
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }

        protected void ddlMessageTemplateType_SelectedIndexChanged(object sender, EventArgs e)
        {
            EditMessageTemplate(Int32.Parse(ddlMessageTemplateType.SelectedValue));
            BindMessageToken();
        }

        protected void btnCustomizeEditor_Click(object sender, EventArgs e)
        {
            txtBody.ToolbarSet = "Default";
            btnCustomizeEditor.Visible = false;
            lblCustomizeEditor.Visible = false;
            btnDefault.Visible = true;
            lblDefault.Visible = true;
            txtBody.Visible = true;
        }

        protected void btnDefault_Click(object sender, EventArgs e)
        {
            txtBody.ToolbarSet = "SageFrameLimited";
            btnCustomizeEditor.Visible = true;
            lblCustomizeEditor.Visible = true;
            btnDefault.Visible = false;
            lblDefault.Visible = false;
            txtBody.Visible = true;
        }
        protected void btnOkMessageTemplateToken_Click(object sender, EventArgs e)
        {
            try
            {
                MessageManagementController objMsgController = new MessageManagementController();
                if (objMsgController.CheckMessgeTokenUnique(txtMessageTemplateToken.Text.TrimStart(','), Int32.Parse(ddlMessageTemplateType.SelectedValue), GetPortalID))
                {
                    if (ddlMessageTemplateType.SelectedIndex != -1)
                    {
                        if (Int32.Parse(ddlMessageTemplateType.SelectedValue) > 0)
                        {
                            if (txtMessageTemplateToken.Text.Trim() != "")
                            {
                                string messageTemplateTokenName = txtMessageTemplateToken.Text.TrimStart(',');
                                int MessageTokenID = 0;
                                MessageTokenID = objMsgController.MessageTemplateTokenAdd(MessageTokenID, Int32.Parse(ddlMessageTemplateType.SelectedValue), messageTemplateTokenName, true, DateTime.Now, GetPortalID, GetUsername);
                                if (MessageTokenID > 0)
                                {

                                    ShowMessage(SageMessageTitle.Information.ToString(), GetSageMessage("MessageManagement", "MessageTemplateTokenIsAddedSuccessfully"), "", SageMessageType.Success);
                                    BindMessageToken();
                                    //BindMessageTemplateType();
                                    txtMessageTemplateToken.Text = "";
                                }
                                else
                                {

                                    ShowMessage(SageMessageTitle.Information.ToString(), GetSageMessage("MessageManagement", "PleaseSaveMessageTemplateTokenAgain"), "", SageMessageType.Error);
                                }
                            }
                            else
                            {

                                ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("MessageManagement", "MessageTemplateTokenIsRequiredField"), "", SageMessageType.Alert);
                            }
                        }
                    }
                }
                else
                {
                    mpeMessageTemplateToken.Show();
                    lblErrorMessageTemplateToken.Text = GetSageMessage("MessageManagement",
                                                                       "UniqueMessageTemplateTokenIsRequired");
                    lblErrorMessageTemplateToken.Visible = true;
                    //ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("MessageManagement", "UniqueMessageTemplateTokenIsRequired"), "", SageMessageType.Alert);
                }
            }
            catch (Exception ex)
            {
                ProcessException(ex);
            }
        }

        private void ClearNewForm()
        {
            chkIsActive.Checked = false;
            txtSubject.Text = "";
            txtBody.Value = "";
            txtMailFrom.Text = "";
        }
    }
}


text:
package org.apache.activemq.artemis.core.remoting;

/**
 * CloseListeners can be registered with a {@link org.apache.activemq.artemis.spi.core.protocol.RemotingConnection} to get notified when the connection is closed.
 * <p>
 * {@link org.apache.activemq.artemis.spi.core.protocol.RemotingConnection#addCloseListener(CloseListener)}
 */
public interface CloseListener
{
   /**
    * called when the connection is closed
    */
   void connectionClosed();
}

redpajama_set_name: RedPajamaGithub


text:
package org.dromelvan.modell.persistence;

import java.util.List;

import org.dromelvan.modell.Anvandare;
import org.dromelvan.modell.Sasong;
import org.dromelvan.modell.Spelare;
import org.jukito.JukitoModule;
import org.jukito.JukitoRunner;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(JukitoRunner.class)
public class AnvandareDeltagareTest {

    public static class Module extends JukitoModule {
        @Override
        protected void configureTest() {

        }
    }

    @Test
    public void test() {
        System.out.println("Hello World!");
        SessionManager.getInstance().beginTransaction();
        AnvandareDAO anvandareDAO = DAOFactory.getInstance().getAnvandareDAO();
        Anvandare anvandare = anvandareDAO.findById(2);
        Sasong sasong = DAOFactory.getInstance().getSasongDAO().findById(11);

        List<Spelare> spelareLista = DAOFactory.getInstance().getSpelareDAO().findTransferlistningsbaraSpelareByAnvandareOchSasong(anvandare, sasong);

        Spelare kek = DAOFactory.getInstance().getSpelareDAO().findById(2130);
        System.out.println(kek.getNamn());

        for(Spelare spelare : spelareLista) {
            System.out.println(spelare.getNamn());
        }
        System.out.println(spelareLista.contains(kek));
    }
}


text:
\<HtmlLabel />
=====================
{{{html-label.description}}}

{{{html-label.props}}}


text:
set -uo pipefail

echo -e "Python: mypy static analysis..."
mypy --config-file=./misc/scripts/mypy.ini .


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
    android:id="@+id/root_layout"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/biz_news_local_weather_bg_big">

    <LinearLayout
        android:id="@+id/weather_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:orientation="vertical"
            android:padding="12dp">

            <TextView
                android:id="@+id/city"
                style="@style/weather_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>

            <TextView
                android:id="@+id/today"
                style="@style/weather_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="24dp"/>

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:orientation="horizontal"
            android:padding="12dp">

            <ImageView
                android:id="@+id/weatherImage"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="8dp"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/weatherTemp"
                    style="@style/weather_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="4dp"/>

                <TextView
                    android:id="@+id/wind"
                    style="@style/weather_temp"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="4dp"/>

                <TextView
                    android:id="@+id/weather"
                    style="@style/weather_weather"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="4dp"/>

            </LinearLayout>

        </LinearLayout>

        <HorizontalScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scrollbars="none">

            <LinearLayout
                android:id="@+id/weather_content"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:gravity="center"
                android:orientation="horizontal">

            </LinearLayout>
        </HorizontalScrollView>
    </LinearLayout>

    <ProgressBar
        android:id="@+id/progress"
        style="?android:attr/progressBarStyle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:visibility="gone"/>

</FrameLayout>


text:
/*
 * myprintf.h
 *
 * CODE GENERATED BY MATLAB CODER (THE HUMAN READABILITY IS THEREFORE LIMITED)
 *
 */

#ifndef __MYPRINTF_H__
#define __MYPRINTF_H__
/* Include files */
#include <math.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "rt_nonfinite.h"

#include "rtwtypes.h"
#include "fimreg_types.h"

/* Type Definitions */

/* Named Constants */

/* Variable Declarations */

/* Variable Definitions */

/* Function Declarations */
extern void b_myprintf(real32_T flt);
extern void c_myprintf(real32_T flt);
extern void h_myprintf(real32_T flt);
extern void myprintf(const emxArray_char_T *strL, real32_T flt, const emxArray_char_T *strR);
#endif
/* End of code generation (myprintf.h) */


text:
require 'spec_helper'

describe Ci::Build do
  let(:project) { FactoryGirl.create :ci_project }
  let(:gl_project) { FactoryGirl.create :empty_project, gitlab_ci_project: project }
  let(:commit) { FactoryGirl.create :ci_commit, gl_project: gl_project }
  let(:build) { FactoryGirl.create :ci_build, commit: commit }
  subject { build }

  it { is_expected.to belong_to(:commit) }
  it { is_expected.to belong_to(:user) }
  it { is_expected.to validate_presence_of :status }
  it { is_expected.to validate_presence_of :ref }

  it { is_expected.to respond_to :success? }
  it { is_expected.to respond_to :failed? }
  it { is_expected.to respond_to :running? }
  it { is_expected.to respond_to :pending? }
  it { is_expected.to respond_to :trace_html }

  describe :first_pending do
    let(:first) { FactoryGirl.create :ci_build, commit: commit, status: 'pending', created_at: Date.yesterday }
    let(:second) { FactoryGirl.create :ci_build, commit: commit, status: 'pending' }
    before { first; second }
    subject { Ci::Build.first_pending }

    it { is_expected.to be_a(Ci::Build) }
    it('returns with the first pending build') { is_expected.to eq(first) }
  end

  describe :create_from do
    before do
      build.status = 'success'
      build.save
    end
    let(:create_from_build) { Ci::Build.create_from build }

    it 'there should be a pending task' do
      expect(Ci::Build.pending.count(:all)).to eq 0
      create_from_build
      expect(Ci::Build.pending.count(:all)).to be > 0
    end
  end

  describe :started? do
    subject { build.started? }

    context 'without started_at' do
      before { build.started_at = nil }

      it { is_expected.to be_falsey }
    end

    %w(running success failed).each do |status|
      context "if build status is #{status}" do
        before { build.status = status }

        it { is_expected.to be_truthy }
      end
    end

    %w(pending canceled).each do |status|
      context "if build status is #{status}" do
        before { build.status = status }

        it { is_expected.to be_falsey }
      end
    end
  end

  describe :active? do
    subject { build.active? }

    %w(pending running).each do |state|
      context "if build.status is #{state}" do
        before { build.status = state }

        it { is_expected.to be_truthy }
      end
    end

    %w(success failed canceled).each do |state|
      context "if build.status is #{state}" do
        before { build.status = state }

        it { is_expected.to be_falsey }
      end
    end
  end

  describe :complete? do
    subject { build.complete? }

    %w(success failed canceled).each do |state|
      context "if build.status is #{state}" do
        before { build.status = state }

        it { is_expected.to be_truthy }
      end
    end

    %w(pending running).each do |state|
      context "if build.status is #{state}" do
        before { build.status = state }

        it { is_expected.to be_falsey }
      end
    end
  end

  describe :ignored? do
    subject { build.ignored? }

    context 'if build is not allowed to fail' do
      before { build.allow_failure = false }

      context 'and build.status is success' do
        before { build.status = 'success' }

        it { is_expected.to be_falsey }
      end

      context 'and build.status is failed' do
        before { build.status = 'failed' }

        it { is_expected.to be_falsey }
      end
    end

    context 'if build is allowed to fail' do
      before { build.allow_failure = true }

      context 'and build.status is success' do
        before { build.status = 'success' }

        it { is_expected.to be_falsey }
      end

      context 'and build.status is failed' do
        before { build.status = 'failed' }

        it { is_expected.to be_truthy }
      end
    end
  end

  describe :trace do
    subject { build.trace_html }

    it { is_expected.to be_empty }

    context 'if build.trace contains text' do
      let(:text) { 'example output' }
      before { build.trace = text }

      it { is_expected.to include(text) }
      it { expect(subject.length).to be >= text.length }
    end

    context 'if build.trace hides token' do
      let(:token) { 'my_secret_token' }

      before do
        build.project.update_attributes(token: token)
        build.update_attributes(trace: token)
      end

      it { is_expected.to_not include(token) }
    end
  end

  describe :timeout do
    subject { build.timeout }

    it { is_expected.to eq(commit.project.timeout) }
  end

  describe :duration do
    subject { build.duration }

    it { is_expected.to eq(120.0) }

    context 'if the building process has not started yet' do
      before do
        build.started_at = nil
        build.finished_at = nil
      end

      it { is_expected.to be_nil }
    end

    context 'if the building process has started' do
      before do
        build.started_at = Time.now - 1.minute
        build.finished_at = nil
      end

      it { is_expected.to be_a(Float) }
      it { is_expected.to be > 0.0 }
    end
  end

  describe :options do
    let(:options) do
      {
        image: "ruby:2.1",
        services: [
          "postgres"
        ]
      }
    end

    subject { build.options }
    it { is_expected.to eq(options) }
  end

  describe :sha do
    subject { build.sha }

    it { is_expected.to eq(commit.sha) }
  end

  describe :short_sha do
    subject { build.short_sha }

    it { is_expected.to eq(commit.short_sha) }
  end

  describe :allow_git_fetch do
    subject { build.allow_git_fetch }

    it { is_expected.to eq(project.allow_git_fetch) }
  end

  describe :project do
    subject { build.project }

    it { is_expected.to eq(commit.project) }
  end

  describe :project_id do
    subject { build.project_id }

    it { is_expected.to eq(commit.project_id) }
  end

  describe :project_name do
    subject { build.project_name }

    it { is_expected.to eq(project.name) }
  end

  describe :repo_url do
    subject { build.repo_url }

    it { is_expected.to eq(project.repo_url_with_auth) }
  end

  describe :extract_coverage do
    context 'valid content & regex' do
      subject { build.extract_coverage('Coverage 1033 / 1051 LOC (98.29%) covered', '\(\d+.\d+\%\) covered') }

      it { is_expected.to eq(98.29) }
    end

    context 'valid content & bad regex' do
      subject { build.extract_coverage('Coverage 1033 / 1051 LOC (98.29%) covered', 'very covered') }

      it { is_expected.to be_nil }
    end

    context 'no coverage content & regex' do
      subject { build.extract_coverage('No coverage for today :sad:', '\(\d+.\d+\%\) covered') }

      it { is_expected.to be_nil }
    end

    context 'multiple results in content & regex' do
      subject { build.extract_coverage(' (98.39%) covered. (98.29%) covered', '\(\d+.\d+\%\) covered') }

      it { is_expected.to eq(98.29) }
    end
  end

  describe :variables do
    context 'returns variables' do
      subject { build.variables }

      let(:variables) do
        [
          { key: :DB_NAME, value: 'postgres', public: true }
        ]
      end

      it { is_expected.to eq(variables) }

      context 'and secure variables' do
        let(:secure_variables) do
          [
            { key: 'SECRET_KEY', value: 'secret_value', public: false }
          ]
        end

        before do
          build.project.variables << Ci::Variable.new(key: 'SECRET_KEY', value: 'secret_value')
        end

        it { is_expected.to eq(variables + secure_variables) }

        context 'and trigger variables' do
          let(:trigger) { FactoryGirl.create :ci_trigger, project: project }
          let(:trigger_request) { FactoryGirl.create :ci_trigger_request_with_variables, commit: commit, trigger: trigger }
          let(:trigger_variables) do
            [
              { key: :TRIGGER_KEY, value: 'TRIGGER_VALUE', public: false }
            ]
          end

          before do
            build.trigger_request = trigger_request
          end

          it { is_expected.to eq(variables + secure_variables + trigger_variables) }
        end
      end
    end
  end

  describe :project_recipients do
    let(:pusher_email) { 'pusher@gitlab.test' }
    let(:user) { User.new(notification_email: pusher_email) }
    subject { build.project_recipients }

    before do
      build.update_attributes(user: user)
    end

    it 'should return pusher_email as only recipient when no additional recipients are given' do
      project.update_attributes(email_add_pusher: true,
                                email_recipients: '')
      is_expected.to eq([pusher_email])
    end

    it 'should return pusher_email and additional recipients' do
      project.update_attributes(email_add_pusher: true,
                                email_recipients: 'rec1 rec2')
      is_expected.to eq(['rec1', 'rec2', pusher_email])
    end

    it 'should return recipients' do
      project.update_attributes(email_add_pusher: false,
                                email_recipients: 'rec1 rec2')
      is_expected.to eq(['rec1', 'rec2'])
    end

    it 'should return unique recipients only' do
      project.update_attributes(email_add_pusher: true,
                                email_recipients: "rec1 rec1 #{pusher_email}")
      is_expected.to eq(['rec1', pusher_email])
    end
  end
end


text:
#include <compressor.h>
#include <datatype.h>
#include <cfloat>
#include <climits>
#include <cstddef>
#include <cstdint>

#include "constants.h"

namespace tiledb {

namespace constants {

/** The array metadata file name. */
const char* array_metadata_filename = "__array_metadata.tdb";

/** The fragment metadata file name. */
const char* fragment_metadata_filename = "__fragment_metadata.tdb";

/** The default tile capacity. */
const uint64_t capacity = 10000;

/** The size of a variable cell offset. */
const uint64_t cell_var_offset_size = sizeof(uint64_t);

/** The type of a variable cell offset. */
const Datatype cell_var_offset_type = Datatype::UINT64;

/** A special value indicating varibale size. */
const uint64_t var_size = UINT64_MAX;

/** The default compressor for the offsets of variable-sized cells. */
Compressor cell_var_offsets_compression = Compressor::DOUBLE_DELTA;

/** The default compression level for the offsets of variable-sized cells. */
int cell_var_offsets_compression_level = -1;

/** The default compressor for the coordinates. */
Compressor coords_compression = Compressor::DOUBLE_DELTA;

/** The default compressor for real coordinates. */
Compressor real_coords_compression = Compressor::BLOSC_ZSTD;

/** The default compression level for the coordinates. */
int coords_compression_level = -1;

/** Special name reserved for the coordinates attribute. */
const char* coords = "__coords";

/** The array filelock name. */
const char* array_filelock_name = "__array_lock.tdb";

/** The special value for an empty int32. */
const int empty_int32 = INT_MAX;

/** The special value for an empty int64. */
const int64_t empty_int64 = INT64_MAX;

/** The special value for an empty float32. */
const float empty_float32 = FLT_MAX;

/** The special value for an empty float64. */
const double empty_float64 = DBL_MAX;

/** The special value for an empty char. */
const char empty_char = CHAR_MAX;

/** The special value for an empty int8. */
const int8_t empty_int8 = INT8_MAX;

/** The special value for an empty uint8. */
const uint8_t empty_uint8 = UINT8_MAX;

/** The special value for an empty int16. */
const int16_t empty_int16 = INT16_MAX;

/** The special value for an empty uint16. */
const uint16_t empty_uint16 = UINT16_MAX;

/** The special value for an empty uint32. */
const uint32_t empty_uint32 = UINT32_MAX;

/** The special value for an empty uint64. */
const uint64_t empty_uint64 = UINT64_MAX;

/** The file suffix used in TileDB. */
const char* file_suffix = ".tdb";

/** Default datatype for a generic tile. */
const Datatype generic_tile_datatype = Datatype::CHAR;

/** Default compressor for a generic tile. */
Compressor generic_tile_compressor = Compressor::BLOSC_ZSTD;

/** Default compression level for a generic tile. */
int generic_tile_compression_level = -1;

/** Default cell size for a generic tile. */
uint64_t generic_tile_cell_size = sizeof(char);

/** The group file name. */
const char* group_filename = "__tiledb_group.tdb";

/** The initial internal buffer size for the case of sparse arrays. */
const uint64_t internal_buffer_size = 10000000;

/** The buffer size for each attribute used in consolidation. */
const uint64_t consolidation_buffer_size = 10000000;

/** The maximum number of bytes written in a single I/O. */
const uint64_t max_write_bytes = INT_MAX;

/** The maximum name length. */
const unsigned name_max_len = 256;

/** The size of the buffer that holds the sorted cells. */
const uint64_t sorted_buffer_size = 10000000;

/** The size of the buffer that holds the sorted variable cells. */
const uint64_t sorted_buffer_var_size = 10000000;

/** Special value indicating a variable number of elements. */
const unsigned int var_num = UINT_MAX;

/** String describing no compression. */
const char* no_compression_str = "NO_COMPRESSION";

/** String describing GZIP. */
const char* gzip_str = "GZIP";

/** String describing ZSTD. */
const char* zstd_str = "ZSTD";

/** String describing LZ4. */
const char* lz4_str = "LZ4";

/** String describing BLOSC. */
const char* blosc_str = "BLOSC_LZ";

/** String describing BLOSC_LZ4. */
const char* blosc_lz4_str = "BLOSC_LZ4";

/** String describing BLOSC_LZ4HC. */
const char* blosc_lz4hc_str = "BLOSC_LZ4HC";

/** String describing BLOSC_SNAPPY. */
const char* blosc_snappy_str = "BLOSC_SNAPPY";

/** String describing BLOSC_ZLIB. */
const char* blosc_zlib_str = "BLOSC_ZLIB";

/** String describing BLOSC_ZSTD. */
const char* blosc_zstd_str = "BLOSC_ZSTD";

/** String describing RLE. */
const char* rle_str = "RLE";

/** String describing BZIP2. */
const char* bzip2_str = "BZIP2";

/** String describing DOUBLE_DELTA. */
const char* double_delta_str = "DOUBLE_DELTA";

/** The string representation for type int32. */
const char* int32_str = "INT32";

/** The string representation for type int64. */
const char* int64_str = "INT64";

/** The string representation for type float32. */
const char* float32_str = "FLOAT32";

/** The string representation for type float64. */
const char* float64_str = "FLOAT64";

/** The string representation for type char. */
const char* char_str = "CHAR";

/** The string representation for type int8. */
const char* int8_str = "INT8";

/** The string representation for type uint8. */
const char* uint8_str = "UINT8";

/** The string representation for type int16. */
const char* int16_str = "INT16";

/** The string representation for type uint16. */
const char* uint16_str = "UINT16";

/** The string representation for type uint32. */
const char* uint32_str = "UINT32";

/** The string representation for type uint64. */
const char* uint64_str = "UINT64";

/** The string representation for the dense array type. */
const char* dense_str = "dense";

/** The string representation for the sparse array type. */
const char* sparse_str = "sparse";

/** The string representation for the column-major layout. */
const char* col_major_str = "col-major";

/** The string representation for the row-major layout. */
const char* row_major_str = "row-major";

/** The string representation for the global order layout. */
const char* global_order_str = "global-order";

/** The string representation for the unordered layout. */
const char* unordered_str = "unordered";

/** The string representation of null. */
const char* null_str = "null";

/** The version in format { major, minor, revision }. */
const int version[3] = {1, 2, 0};

/** The size of a tile chunk. */
const uint64_t tile_chunk_size = INT_MAX;

}  // namespace constants

}  // namespace tiledb


text:
import argparse
import os
import sys
import termios
import tty
import yaml
from tempfile import mkdtemp
from rosdistro import get_index, get_index_url, get_distribution_file
import subprocess

from catkin_pkg.package import parse_package_string
import rosdistro

import subprocess
from subprocess import Popen, CalledProcessError

def parse_options():
    import argparse
    parser = argparse.ArgumentParser(
        description='re-release to an existing STRANDS bloom repo.'
    )
    parser.add_argument(
        'repo_name',
        help='A read-only git buildpackage repo uri.',
    )
    parser.add_argument('rosdistro', help='Which rosdistro to operate on')
    parser.add_argument('--track', help='Also run bloom after preparing upstream with this track', default=None)
    parser.add_argument('--bump',
                        help='Version number to bump. Default: %(default)s',
                        default='patch')

    args = parser.parse_args()

    return args

class Releaser:

    def __init__(self, repo, distro_name, track, bump):
        self.repo_name = repo
        self.track = track
        self.distro_name = distro_name
        self.bump = bump
        self.pretend = False

        try:
            self.index = get_index(get_index_url())
            self.distribution = get_distribution_file(
                self.index,
                self.distro_name
            )
            self.repo = self.distribution.repositories[self.repo_name]
        except:
            print "failed to get data about repo %s in distribution %s" % (self.repo_name, self.distro_name)
            raise

    def get_release_upstream_repo(self):
        repo = self.repo
        distro = self.distro_name
        if not repo.release_repository:
            raise  RuntimeError('no release repo exists')

        release_repo = repo.release_repository
        if release_repo.version is None:
            raise  RuntimeError('no release version exists')

        url = release_repo.url

        prefix = 'https://github.com/'
        if not url.startswith(prefix):
            raise RuntimeError('wrong prefix')
        suffix = '.git'
        if not url.endswith(suffix):
            raise RuntimeError('wrong suffix')

        tracks_url = 'https://raw.githubusercontent.com/' + url[len(prefix):]
        tracks_url = tracks_url[:-len(suffix)] + '/master/tracks.yaml'

        tracks_yaml = rosdistro.loader.load_url(tracks_url)

        tracks_data = yaml.load(tracks_yaml)
        upstream_url = tracks_data['tracks'][distro]['vcs_uri']
        # ignore local upstream path

        last_version=tracks_data['tracks'][distro]['last_version']
        release_tag=tracks_data['tracks'][distro]['release_tag'].replace(':{version}', last_version)

        release_branch = tracks_data['tracks'][distro]['devel_branch']
        if release_branch is None:
            remotes = subprocess.check_output(['git', 'ls-remote', upstream_url])
            lines = remotes.splitlines()
            lines = [l.split('\t') for l in lines]
            head_hash = [l[0] for l in lines if l[1] == 'HEAD'][0]
            default_ref = [l[1] for l in lines if l[0] == head_hash and l[1] != 'HEAD'][0]
            release_branch = default_ref.split('/')[-1]

        self.upstream_url = upstream_url
        self.release_branch = release_branch
        return upstream_url, release_branch
        #print release_branch, repo_name, tracks_data['tracks'][distro]
        #tag_hash = [l[0] for l in lines if l[1] == 'refs/tags/'+release_tag][0]
        #release_branch_hash = [l[0] for l in lines if l[1] == 'refs/heads/'+release_branch][0]

    def call(self, working_dir, command, pipe=None):
        print('+ cd %s && ' % working_dir + ' '.join(command))
        if not self.pretend:
            process = Popen(command, stdout=pipe, stderr=pipe, cwd=working_dir)
            output, unused_err = process.communicate()
            retcode = process.poll()
            if retcode:
                raise CalledProcessError(retcode, command)
            if pipe:
                return output
        else:
            return ''

    def bloom_release(self):
        self.call('/',
            [
                'bloom-release',
                '-t', self.track, '-r', self.distro_name, '--noweb',  '-y', '-s'
            ])

    def prepare_upstream(self):
        upstream_dir = mkdtemp()
        upstream_url = self.upstream_url
        try:
            self.call(upstream_dir, ['git', 'clone', '-b', self.release_branch, upstream_url, upstream_dir])

            try:
                self.call(upstream_dir, ['catkin_generate_changelog', '-y',  '-a'])
            except:
                pass
            self.call(upstream_dir, ['catkin_generate_changelog', '-y'])

            for root, dirs, files in os.walk(upstream_dir):
                if 'CHANGELOG.rst' in files:
                    cl_path = '%s/CHANGELOG.rst' % root
                    self.call(upstream_dir, ['git', 'add', cl_path])
            self.call(upstream_dir, ['git', 'commit' ,'-a', '-m', 'updated changelogs'])

            self.call(upstream_dir, ['catkin_prepare_release', '-y', '--bump', self.bump])
            self.call('/', ['rm', '-rf', upstream_dir])
        except:
            print 'error in preparing upstream at %s' % upstream_dir
            raise

if __name__ == "__main__":
    args = parse_options()
    r = Releaser(args.repo_name, args.rosdistro, args.track, args.bump)

    r.get_release_upstream_repo()

    r.prepare_upstream()
    if args.track is not None:
        r.bloom_release()


text:
import java.util.Scanner;

public class tip_calculator {
	public static void main(String[] args) {
		//directions and user input
		Scanner s = new Scanner(System.in);
		System.out.println("What is your total?");
		int total = s.nextInt();
		s.close();

		//calculate
		double ten_percent = total + (total * 0.1);
		double fifteen_percent = total + (total * 0.15);
		double twenty_percent = total + (total * 0.2);

		//print result
		System.out.println(" 10% tip = " + ten_percent +
				  " 15% tip = " + fifteen_percent +
				  " 20% tip = " + twenty_percent);
	}
}


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

    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="format-detection" content="date=no" />
    <meta name="format-detection" content="address=no" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="x-apple-disable-message-reformatting" />

    <title>@yield('title')</title>

        <link href="https://fonts.googleapis.com/css2?family=Annie+Use+Your+Telescope&family=Kreon&display=swap" rel="stylesheet">

            embed(public_path('images/email/bg1.png')) }} ); background-repeat: repeat-x; background-position: 0 0;">

                            embed(public_path('images/logo.png')) }}" width="86" height="86" border="0" alt="" />

                                                                @yield('title')

                                                                @section('wrapper')

Ceci est un message automatique, merci de ne pas y répondre.

                                                                    @yield('content')

Secrètement votre,

{{ config('app.name') }}

                                                                @show

    @yield('body')


text:
var c = require('../../../constants')
    , config = require('../../../config/index')
    , BASE_URL = 'http://' + config.get('HOST') + ':' + config.get('PORT');

module.exports = {

    "Load index page": function (browser) {
        browser
            .url(BASE_URL)
            .waitForElementVisible('//h1[contains(text(), "nodejs-mvc-skeleton")]', 1000)
    },

    "Error page": function (browser) {
        browser
            .url(BASE_URL + '/route_with_error')
            .waitForElementVisible('//h1[contains(text(), "Error: Oops, error occurred!")]', 1000)
    },

    "End of test": function (browser) {
        browser.end()
    }
};


text:
<?php

// @codingStandardsIgnoreFile

namespace Magento\Payment\Model\Method;

use Magento\Framework\DataObject;
use Magento\Payment\Model\InfoInterface;
use Magento\Payment\Model\MethodInterface;
use Magento\Payment\Observer\AbstractDataAssignObserver;
use Magento\Sales\Model\Order\Invoice;
use Magento\Sales\Model\Order\Payment;
use Magento\Quote\Api\Data\PaymentMethodInterface;

/**
 * Payment method abstract model
 * @SuppressWarnings(PHPMD.ExcessivePublicCount)
 * @SuppressWarnings(PHPMD.TooManyFields)
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
 * @deprecated
 */
abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibleModel implements
    MethodInterface,
    PaymentMethodInterface
{
    const ACTION_ORDER = 'order';

    const ACTION_AUTHORIZE = 'authorize';

    const ACTION_AUTHORIZE_CAPTURE = 'authorize_capture';

    const STATUS_UNKNOWN = 'UNKNOWN';

    const STATUS_APPROVED = 'APPROVED';

    const STATUS_ERROR = 'ERROR';

    const STATUS_DECLINED = 'DECLINED';

    const STATUS_VOID = 'VOID';

    const STATUS_SUCCESS = 'SUCCESS';

    /**
     * Different payment method checks.
     */
    const CHECK_USE_FOR_COUNTRY = 'country';

    const CHECK_USE_FOR_CURRENCY = 'currency';

    const CHECK_USE_CHECKOUT = 'checkout';

    const CHECK_USE_INTERNAL = 'internal';

    const CHECK_ORDER_TOTAL_MIN_MAX = 'total';

    const CHECK_ZERO_TOTAL = 'zero_total';

    const GROUP_OFFLINE = 'offline';

    /**
     * @var string
     */
    protected $_code;

    /**
     * @var string
     */
    protected $_formBlockType = 'Magento\Payment\Block\Form';

    /**
     * @var string
     */
    protected $_infoBlockType = 'Magento\Payment\Block\Info';

    /**
     * Payment Method feature
     *
     * @var bool
     */
    protected $_isGateway = false;

    /**
     * Payment Method feature
     *
     * @var bool
     */
    protected $_isOffline = false;

    /**
     * Payment Method feature
     *
     * @var bool
     */
    protected $_canOrder = false;

    /**
     * Payment Method feature
     *
     * @var bool
     */
    protected $_canAuthorize = false;

    /**
     * Payment Method feature
     *
     * @var bool
     */
    protected $_canCapture = false;

    /**
     * Payment Method feature
     *
     * @var bool
     */
    protected $_canCapturePartial = false;

    /**
     * Payment Method feature
     *
     * @var bool
     */
    protected $_canCaptureOnce = false;

    /**
     * Payment Method feature
     *
     * @var bool
     */
    protected $_canRefund = false;

    /**
     * Payment Method feature
     *
     * @var bool
     */
    protected $_canRefundInvoicePartial = false;

    /**
     * Payment Method feature
     *
     * @var bool
     */
    protected $_canVoid = false;

    /**
     * Payment Method feature
     *
     * @var bool
     */
    protected $_canUseInternal = true;

    /**
     * Payment Method feature
     *
     * @var bool
     */
    protected $_canUseCheckout = true;

    /**
     * Payment Method feature
     *
     * @var bool
     */
    protected $_isInitializeNeeded = false;

    /**
     * Payment Method feature
     *
     * @var bool
     */
    protected $_canFetchTransactionInfo = false;

    /**
     * Payment Method feature
     *
     * @var bool
     */
    protected $_canReviewPayment = false;

    /**
     * TODO: whether a captured transaction may be voided by this gateway
     * This may happen when amount is captured, but not settled
     * @var bool
     */
    protected $_canCancelInvoice = false;

    /**
     * Fields that should be replaced in debug with '***'
     *
     * @var array
     */
    protected $_debugReplacePrivateDataKeys = [];

    /**
     * Payment data
     *
     * @var \Magento\Payment\Helper\Data
     */
    protected $_paymentData;

    /**
     * Core store config
     *
     * @var \Magento\Framework\App\Config\ScopeConfigInterface
     */
    protected $_scopeConfig;

    /**
     * @var Logger
     */
    protected $logger;

    /**
     * @param \Magento\Framework\Model\Context $context
     * @param \Magento\Framework\Registry $registry
     * @param \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory
     * @param \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory
     * @param \Magento\Payment\Helper\Data $paymentData
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     * @param Logger $logger
     * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
     * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
     * @param array $data
     * @SuppressWarnings(PHPMD.ExcessiveParameterList)
     */
    public function __construct(
        \Magento\Framework\Model\Context $context,
        \Magento\Framework\Registry $registry,
        \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
        \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory,
        \Magento\Payment\Helper\Data $paymentData,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Payment\Model\Method\Logger $logger,
        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
        array $data = []
    ) {
        parent::__construct(
            $context,
            $registry,
            $extensionFactory,
            $customAttributeFactory,
            $resource,
            $resourceCollection,
            $data
        );
        $this->_paymentData = $paymentData;
        $this->_scopeConfig = $scopeConfig;
        $this->logger = $logger;
        $this->initializeData($data);
    }

    /**
     * Initializes injected data
     *
     * @param array $data
     * @return void
     */
    protected function initializeData($data = [])
    {
        if (!empty($data['formBlockType'])) {
            $this->_formBlockType = $data['formBlockType'];
        }
    }

    /**
     * {inheritdoc}
     */
    public function setStore($storeId)
    {
        $this->setData('store', (int)$storeId);
    }

    /**
     * {inheritdoc}
     */
    public function getStore()
    {
        return $this->getData('store');
    }

    /**
     * Check order availability
     *
     * @return bool
     * @api
     */
    public function canOrder()
    {
        return $this->_canOrder;
    }

    /**
     * Check authorize availability
     *
     * @return bool
     * @api
     */
    public function canAuthorize()
    {
        return $this->_canAuthorize;
    }

    /**
     * Check capture availability
     *
     * @return bool
     * @api
     */
    public function canCapture()
    {
        return $this->_canCapture;
    }

    /**
     * Check partial capture availability
     *
     * @return bool
     * @api
     */
    public function canCapturePartial()
    {
        return $this->_canCapturePartial;
    }

    /**
     * Check whether capture can be performed once and no further capture possible
     *
     * @return bool
     * @api
     */
    public function canCaptureOnce()
    {
        return $this->_canCaptureOnce;
    }

    /**
     * Check refund availability
     *
     * @return bool
     * @api
     */
    public function canRefund()
    {
        return $this->_canRefund;
    }

    /**
     * Check partial refund availability for invoice
     *
     * @return bool
     * @api
     */
    public function canRefundPartialPerInvoice()
    {
        return $this->_canRefundInvoicePartial;
    }

    /**
     * Check void availability
     * @return bool
     * @internal param \Magento\Framework\DataObject $payment
     * @api
     */
    public function canVoid()
    {
        return $this->_canVoid;
    }

    /**
     * Using internal pages for input payment data
     * Can be used in admin
     *
     * @return bool
     */
    public function canUseInternal()
    {
        return $this->_canUseInternal;
    }

    /**
     * Can be used in regular checkout
     *
     * @return bool
     */
    public function canUseCheckout()
    {
        return $this->_canUseCheckout;
    }

    /**
     * Can be edit order (renew order)
     *
     * @return bool
     * @api
     */
    public function canEdit()
    {
        return true;
    }

    /**
     * Check fetch transaction info availability
     *
     * @return bool
     * @api
     */
    public function canFetchTransactionInfo()
    {
        return $this->_canFetchTransactionInfo;
    }

    /**
     * Fetch transaction info
     *
     * @param InfoInterface $payment
     * @param string $transactionId
     * @return array
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     * @api
     */
    public function fetchTransactionInfo(InfoInterface $payment, $transactionId)
    {
        return [];
    }

    /**
     * Retrieve payment system relation flag
     *
     * @return bool
     * @api
     */
    public function isGateway()
    {
        return $this->_isGateway;
    }

    /**
     * Retrieve payment method online/offline flag
     *
     * @return bool
     * @api
     */
    public function isOffline()
    {
        return $this->_isOffline;
    }

    /**
     * Flag if we need to run payment initialize while order place
     *
     * @return bool
     * @api
     */
    public function isInitializeNeeded()
    {
        return $this->_isInitializeNeeded;
    }

    /**
     * To check billing country is allowed for the payment method
     *
     * @param string $country
     * @return bool
     */
    public function canUseForCountry($country)
    {
        /*
        for specific country, the flag will set up as 1
        */
        if ($this->getConfigData('allowspecific') == 1) {
            $availableCountries = explode(',', $this->getConfigData('specificcountry'));
            if (!in_array($country, $availableCountries)) {
                return false;
            }
        }
        return true;
    }

    /**
     * Check method for processing with base currency
     *
     * @param string $currencyCode
     * @return bool
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function canUseForCurrency($currencyCode)
    {
        return true;
    }

    /**
     * Retrieve payment method code
     *
     * @return string
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function getCode()
    {
        if (empty($this->_code)) {
            throw new \Magento\Framework\Exception\LocalizedException(__('We cannot retrieve the payment method code.'));
        }
        return $this->_code;
    }

    /**
     * Retrieve block type for method form generation
     *
     * @return string
     */
    public function getFormBlockType()
    {
        return $this->_formBlockType;
    }

    /**
     * Retrieve block type for display method information
     *
     * @return string
     * @api
     */
    public function getInfoBlockType()
    {
        return $this->_infoBlockType;
    }

    /**
     * Retrieve payment information model object
     *
     * @return InfoInterface
     * @throws \Magento\Framework\Exception\LocalizedException
     * @api
     */
    public function getInfoInstance()
    {
        $instance = $this->getData('info_instance');
        if (!$instance instanceof InfoInterface) {
            throw new \Magento\Framework\Exception\LocalizedException(__('We cannot retrieve the payment information object instance.'));
        }
        return $instance;
    }

    /**
     * Retrieve payment information model object
     *
     * @param InfoInterface $info
     * @return void
     * @api
     */
    public function setInfoInstance(InfoInterface $info)
    {
        $this->setData('info_instance', $info);
    }

    /**
     * Validate payment method information object
     *
     * @return $this
     * @throws \Magento\Framework\Exception\LocalizedException
     * @api
     */
    public function validate()
    {
        /**
         * to validate payment method is allowed for billing country or not
         */
        $paymentInfo = $this->getInfoInstance();
        if ($paymentInfo instanceof Payment) {
            $billingCountry = $paymentInfo->getOrder()->getBillingAddress()->getCountryId();
        } else {
            $billingCountry = $paymentInfo->getQuote()->getBillingAddress()->getCountryId();
        }
        if (!$this->canUseForCountry($billingCountry)) {
            throw new \Magento\Framework\Exception\LocalizedException(
                __('You can\'t use the payment type you selected to make payments to the billing country.')
            );
        }
        return $this;
    }

    /**
     * Order payment abstract method
     *
     * @param \Magento\Framework\DataObject|InfoInterface $payment
     * @param float $amount
     * @return $this
     * @throws \Magento\Framework\Exception\LocalizedException
     * @api
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function order(\Magento\Payment\Model\InfoInterface $payment, $amount)
    {
        if (!$this->canOrder()) {
            throw new \Magento\Framework\Exception\LocalizedException(__('The order action is not available.'));
        }
        return $this;
    }

    /**
     * Authorize payment abstract method
     *
     * @param \Magento\Framework\DataObject|InfoInterface $payment
     * @param float $amount
     * @return $this
     * @throws \Magento\Framework\Exception\LocalizedException
     * @api
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function authorize(\Magento\Payment\Model\InfoInterface $payment, $amount)
    {
        if (!$this->canAuthorize()) {
            throw new \Magento\Framework\Exception\LocalizedException(__('The authorize action is not available.'));
        }
        return $this;
    }

    /**
     * Capture payment abstract method
     *
     * @param \Magento\Framework\DataObject|InfoInterface $payment
     * @param float $amount
     * @return $this
     * @throws \Magento\Framework\Exception\LocalizedException
     * @api
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount)
    {
        if (!$this->canCapture()) {
            throw new \Magento\Framework\Exception\LocalizedException(__('The capture action is not available.'));
        }

        return $this;
    }

    /**
     * Refund specified amount for payment
     *
     * @param \Magento\Framework\DataObject|InfoInterface $payment
     * @param float $amount
     * @return $this
     * @throws \Magento\Framework\Exception\LocalizedException
     * @api
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function refund(\Magento\Payment\Model\InfoInterface $payment, $amount)
    {
        if (!$this->canRefund()) {
            throw new \Magento\Framework\Exception\LocalizedException(__('The refund action is not available.'));
        }
        return $this;
    }

    /**
     * Cancel payment abstract method
     *
     * @param \Magento\Framework\DataObject|InfoInterface $payment
     * @return $this
     * @api
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function cancel(\Magento\Payment\Model\InfoInterface $payment)
    {
        return $this;
    }

    /**
     * Void payment abstract method
     *
     * @param \Magento\Framework\DataObject|InfoInterface $payment
     * @return $this
     * @throws \Magento\Framework\Exception\LocalizedException
     * @api
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function void(\Magento\Payment\Model\InfoInterface $payment)
    {
        if (!$this->canVoid()) {
            throw new \Magento\Framework\Exception\LocalizedException(__('The void action is not available.'));
        }
        return $this;
    }

    /**
     * Whether this method can accept or deny payment
     * @return bool
     * @api
     */
    public function canReviewPayment()
    {
        return $this->_canReviewPayment;
    }

    /**
     * Attempt to accept a payment that us under review
     *
     * @param InfoInterface $payment
     * @return false
     * @throws \Magento\Framework\Exception\LocalizedException
     * @api
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function acceptPayment(InfoInterface $payment)
    {
        if (!$this->canReviewPayment()) {
            throw new \Magento\Framework\Exception\LocalizedException(__('The payment review action is unavailable.'));
        }
        return false;
    }

    /**
     * Attempt to deny a payment that us under review
     *
     * @param InfoInterface $payment
     * @return false
     * @throws \Magento\Framework\Exception\LocalizedException
     * @api
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function denyPayment(InfoInterface $payment)
    {
        if (!$this->canReviewPayment()) {
            throw new \Magento\Framework\Exception\LocalizedException(__('The payment review action is unavailable.'));
        }
        return false;
    }

    /**
     * Retrieve payment method title
     *
     * @return string
     */
    public function getTitle()
    {
        return $this->getConfigData('title');
    }

    /**
     * Retrieve information from payment configuration
     *
     * @param string $field
     * @param int|string|null|\Magento\Store\Model\Store $storeId
     *
     * @return mixed
     */
    public function getConfigData($field, $storeId = null)
    {
        if ('order_place_redirect_url' === $field) {
            return $this->getOrderPlaceRedirectUrl();
        }
        if (null === $storeId) {
            $storeId = $this->getStore();
        }
        $path = 'payment/' . $this->getCode() . '/' . $field;
        return $this->_scopeConfig->getValue($path, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId);
    }

    /**
     * Assign data to info model instance
     *
     * @param array|\Magento\Framework\DataObject $data
     * @return $this
     * @throws \Magento\Framework\Exception\LocalizedException
     * @api
     */
    public function assignData(\Magento\Framework\DataObject $data)
    {
        $this->_eventManager->dispatch(
            'payment_method_assign_data_' . $this->getCode(),
            [
                AbstractDataAssignObserver::METHOD_CODE => $this,
                AbstractDataAssignObserver::MODEL_CODE => $this->getInfoInstance(),
                AbstractDataAssignObserver::DATA_CODE => $data
            ]
        );

        $this->_eventManager->dispatch(
            'payment_method_assign_data',
            [
                AbstractDataAssignObserver::METHOD_CODE => $this,
                AbstractDataAssignObserver::MODEL_CODE => $this->getInfoInstance(),
                AbstractDataAssignObserver::DATA_CODE => $data
            ]
        );

        return $this;
    }

    /**
     * Check whether payment method can be used
     *
     * @param \Magento\Quote\Api\Data\CartInterface|null $quote
     * @return bool
     */
    public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null)
    {
        if (!$this->isActive($quote ? $quote->getStoreId() : null)) {
            return false;
        }

        $checkResult = new DataObject();
        $checkResult->setData('is_available', true);

        // for future use in observers
        $this->_eventManager->dispatch(
            'payment_method_is_active',
            [
                'result' => $checkResult,
                'method_instance' => $this,
                'quote' => $quote
            ]
        );

        return $checkResult->getData('is_available');
    }

    /**
     * Is active
     *
     * @param int|null $storeId
     * @return bool
     */
    public function isActive($storeId = null)
    {
        return (bool)(int)$this->getConfigData('active', $storeId);
    }

    /**
     * Method that will be executed instead of authorize or capture
     * if flag isInitializeNeeded set to true
     *
     * @param string $paymentAction
     * @param object $stateObject
     *
     * @return $this
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     * @api
     */
    public function initialize($paymentAction, $stateObject)
    {
        return $this;
    }

    /**
     * Get config payment action url
     * Used to universalize payment actions when processing payment place
     *
     * @return string
     * @api
     */
    public function getConfigPaymentAction()
    {
        return $this->getConfigData('payment_action');
    }

    /**
     * Log debug data to file
     *
     * @param array $debugData
     * @return void
     */
    protected function _debug($debugData)
    {
        $this->logger->debug(
            $debugData,
            $this->getDebugReplacePrivateDataKeys(),
            $this->getDebugFlag()
        );
    }

    /**
     * Define if debugging is enabled
     *
     * @return bool
     * @SuppressWarnings(PHPMD.BooleanGetMethodName)
     * @api
     */
    public function getDebugFlag()
    {
        return (bool)(int)$this->getConfigData('debug');
    }

    /**
     * Used to call debug method from not Payment Method context
     *
     * @param mixed $debugData
     * @return void
     * @api
     */
    public function debugData($debugData)
    {
        $this->_debug($debugData);
    }

    /**
     * Return replace keys for debug data
     *
     * @return array
     */
    public function getDebugReplacePrivateDataKeys()
    {
        return (array) $this->_debugReplacePrivateDataKeys;
    }
}


text:
@interface LTMainTableViewController ()
@property (nonatomic, strong) NSArray *poemCategoryArray;
@end

@implementation LTMainTableViewController
-(NSArray *)poemCategoryArray {
    if (!_poemCategoryArray) {
        _poemCategoryArray = [LTPoemCategory parsePoetryCategory];
    }
    return _poemCategoryArray;
}

- (void)viewDidLoad {
    [super viewDidLoad];
}

#pragma mark - Table view data source

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.poemCategoryArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    LTTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    LTPoemCategory *category = self.poemCategoryArray[indexPath.row];
    cell.poemLabel.text = category.poemCategory;
    cell.poemLabel.font = [UIFont systemFontOfSize:15];
    //button是否显示
    if (category.categoryIntroduction.length == 0) {
        cell.poemButton.hidden = YES;
    }else {
        //显示四次分类的详情控制器
        [cell.poemButton setTag:indexPath.row];
        [cell.poemButton addTarget:self action:@selector(clickButton:) forControlEvents:UIControlEventTouchUpInside];
    }
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    //数据来源
    LTPoemCategory *category = self.poemCategoryArray[indexPath.row];
    //push显示当前分类的所有诗词列表
    LTPeomListTableViewController *peomListTableViewcontroller = [[LTPeomListTableViewController alloc] initWithCategory:category];
    [self.navigationController pushViewController:peomListTableViewcontroller animated:YES];
}
#pragma mark - 点击详情按钮之后触发
-(void)clickButton:(id)sender {
    LTPoemCategory *category = self.poemCategoryArray[[sender tag]];
    LTCategoryIntroductionViewController *introductionViewController = [LTCategoryIntroductionViewController new];
    introductionViewController.poemIntroduction = category.categoryIntroduction;
    [self.navigationController pushViewController:introductionViewController animated:YES];
}
@end


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string-array name="otr_options">
        <item>Force / Require</item>
        <item>Automatically Attempt</item>
        <item>As Requested</item>
        <item>Disabled / Never</item>
    </string-array>
    <string-array name="otr_options_values">
        <item>force</item>
        <item>auto</item>
        <item>requested</item>
        <item>disabled</item>
    </string-array>
    <string-array name="account_domains">
        <item>dukgo.com</item>
        <item>jabber.calyxinstitute.org</item>
        <item>xmpp.jp</item>
        <item>jabberpl.org</item>
        <item>neko.im</item>
        <item>rkquery.de</item>
        <item>bam.yt</item>
    </string-array>

</resources>


text:
namespace gin {

WrapperInfo* WrapperInfo::From(v8::Local<v8::Object> object) {
  if (object->InternalFieldCount() != kNumberOfInternalFields)
    return NULL;
  WrapperInfo* info = static_cast<WrapperInfo*>(
      object->GetAlignedPointerFromInternalField(kWrapperInfoIndex));
  return info->embedder == kEmbedderNativeGin ? info : NULL;
}

}  // namespace gin


text:
"use strict";

const gulp = require("gulp");
const config = require("../config").config;
const assemble = require("assemble");
const helpers = require("handlebars-helpers")();
const extname = require("gulp-extname");
const app = assemble();

// Handlebars関連ファイルを読み込みます。
gulp.task("assemble-load", (done) => {
	app.partials(`${config.handlebarsPartialsDir}*.hbs`);
	app.layouts(`${config.handlebarsLayoutsDir}*.hbs`);
	app.data(`${config.handlebarsDataDir}website.json`);
	app.pages(`${config.sourceDir}*.hbs`);

	// Assembleの古いビルトイン変数にアクセス可能にする
	// https://github.com/assemble/assemble/issues/829
	const get = require("get-value");
	app.engine("hbs", require("engine-handlebars"));
	app.helper("get", function(prop) {
		return get(this.context, prop);
	});

	done();
});

// assembleをコンパイルします。
gulp.task("assemble", ["assemble-load"], () => {
	return app.toStream("pages")
		.pipe(app.renderFile())
		.pipe(extname())
		.pipe(app.dest(config.distDir))
});


text:
(function(Utils, VFS, API) {
  'use strict';

  /**
   * Settings Manager Class
   *
   * @summary Class for maintaining settings
   *
   *

   * YOU CAN ONLY GET AN INSTANCE WITH `Core.getSettingsManager()`
   *

   *
   * @example
   * OSjs.Core.getSettingsManager()
   *
   * @summary Used for managing Settings across all applications and modules.
   *
   * @constructor
   * @memberof OSjs.Core
   * @see OSjs.Helpers.EventHandler
   * @see OSjs.Core.getSettingsManager
   */
  var SettingsManager = {
    storage: {},
    defaults: {},
    watches: []
  };

  /**
   * Initialize SettingsManager.
   * This is run when a user logs in. It will give saved data here
   *
   * @function init
   * @memberof OSjs.Core.SettingsManager#
   *
   * @param {Object}    settings      Entire settings tree
   */
  SettingsManager.init = function(settings) {
    this.storage = settings || {};
  };

  /**
   * Gets either the full tree or tree entry by key
   *
   * @function get
   * @memberof OSjs.Core.SettingsManager#
   *
   * @param  {String}     pool      Name of settings pool
   * @param  {String}     [key]     Key entry of tree
   *
   * @return  {Mixed}
   */
  SettingsManager.get = function(pool, key) {
    try {
      if ( this.storage[pool] && Object.keys(this.storage[pool]).length ) {
        return key ? this.storage[pool][key] : this.storage[pool];
      }

      return key ? this.defaults[pool][key] : this.defaults[pool];
    } catch ( e ) {
      console.warn('SettingsManager::get()', 'exception', e, e.stack);
    }

    return false;
  };

  /**
   * Sets either full tree or a tree entry by key
   *
   * @function set
   * @memberof OSjs.Core.SettingsManager#
   *
   * @param  {String}     pool                  Name of settings pool
   * @param  {String}     [key]                 Key entry of tree
   * @param  {Mixed}      value                 The value (or entire tree if no key given)
   * @param  {Mixed}      [save]                boolean or callback function for saving
   * @param  {Boolean}    [triggerWatch=true]   trigger change event for watchers
   *
   * @return  {Boolean}
   */
  SettingsManager.set = function(pool, key, value, save, triggerWatch) {
    try {
      if ( key ) {
        if ( typeof this.storage[pool] === 'undefined' ) {
          this.storage[pool] = {};
        }
        if ( (['number', 'string']).indexOf(typeof key) >= 0 ) {
          this.storage[pool][key] = value;
        } else {
          console.warn('SettingsManager::set()', 'expects key to be a valid iter, not', key);
        }
      } else {
        this.storage[pool] = value;
      }
    } catch ( e ) {
      console.warn('SettingsManager::set()', 'exception', e, e.stack);
    }

    if ( save ) {
      this.save(pool, save);
    }

    if ( typeof triggerWatch === 'undefined' || triggerWatch === true ) {
      this.changed(pool);
    }

    return true;
  };

  /**
   * Saves the storage to a location
   *
   * @function save
   * @memberof OSjs.Core.SettingsManager#
   *
   * @param  {String}     pool      Name of settings pool
   * @param  {Function}   callback  Callback
   */
  SettingsManager.save = function(pool, callback) {
    if ( typeof callback !== 'function' ) {
      callback = function() {};
    }

    var handler = OSjs.Core.getHandler();
    handler.saveSettings(pool, this.storage, callback);
  };

  /**
   * Sets the defaults for a specific pool
   *
   * @function defaults
   * @memberof OSjs.Core.SettingsManager#
   *
   * @param  {String}     pool      Name of settings pool
   * @param  {Object}     [default] Default settings tree
   */
  SettingsManager.defaults = function(pool, defaults) {
    this.defaults[pool] = defaults;
  };

  /**
   * Creates a new proxy instance
   *
   * @function instance
   * @memberof OSjs.Core.SettingsManager#
   *
   * @param  {String}     pool      Name of settings pool
   * @param  {Object}     [default] Default settings tree
   *
   * @return {Object}
   */
  SettingsManager.instance = function(pool, defaults) {
    if ( !this.storage[pool] || (this.storage[pool] instanceof Array) ) {
      this.storage[pool] = {};
    }

    var instance = new OSjs.Helpers.SettingsFragment(this.storage[pool], pool);
    if ( arguments.length > 1 ) {
      SettingsManager.defaults(pool, defaults);
      instance.mergeDefaults(defaults);
    }

    return instance;
  };

  /**
   * Destroy a watcher
   *
   * @function unwatch
   * @memberof OSjs.Core.SettingsManager#
   *
   * @param  {Number}    index     The index from watch()
   */
  SettingsManager.unwatch = function(index) {
    if ( typeof this.watches[index] !== 'undefined' ) {
      delete this.watches[index];
    }
  };

  /**
   * Receive events when a pool changes.
   *
   * @function watch
   * @memberof OSjs.Core.SettingsManager#
   *
   * @param  {String}     pool      Name of settings pool
   * @param  {Function}   callback  Callback
   *
   * @return {Mixed}                false on error, index for unwatch() otherwise
   */
  SettingsManager.watch = function(pool, callback) {
    if ( !this.storage[pool] ) {
      return false;
    }

    var index = this.watches.push({
      pool: pool,
      callback: callback
    });

    return index - 1;
  };

  /**
   * Notify the SettingsManager that somewhere in a pool's tree it has changed.
   *
   * @function changed
   * @memberof OSjs.Core.SettingsManager#
   *
   * @param  {String}     pool      Name of settings pool that changed
   *
   * @return {OSjs.Core.SettingsManager}      this
   */
  SettingsManager.changed = function(pool) {
    var self = this;
    this.watches.forEach(function(watch) {
      if ( watch && watch.pool === pool ) {
        watch.callback(self.storage[pool]);
      }
    });

    return this;
  };

  /**
   * Clears a pool
   *
   * @function clear
   * @memberof OSjs.Core.SettingsManager#
   *
   * @param  {String}     pool        Name of settings pool
   * @param  {Mixed}      [save=true] Boolean or callback function for saving
   *
   * @return {OSjs.Core.SettingsManager}      this
   */
  SettingsManager.clear = function(pool, save) {
    save = (typeof save === 'undefined') || (save === true);
    this.set(pool, null, {}, save);
  };

  /////////////////////////////////////////////////////////////////////////////
  // EXPORTS
  /////////////////////////////////////////////////////////////////////////////

  Object.seal(SettingsManager);

  /**
   * Get the current SettingsManager  instance
   *
   * @function getSettingsManager
   * @memberof OSjs.Core
   * @return {OSjs.Core.SettingsManager}
   */
  OSjs.Core.getSettingsManager = function() {
    return SettingsManager;
  };

})(OSjs.Utils, OSjs.VFS, OSjs.API);


text:
 Copyright © 2017 Lombok Utara.

        <?php $this->load->view('template/scripts.php'); ?>


text:
package client

import (
	"time"

	"github.com/kyma-project/kyma/components/central-application-gateway/internal/csrf"

	cache "github.com/patrickmn/go-cache"
)

// Cache for CSRF data items
type TokenCache interface {
	Get(itemID string) (resp *csrf.Response, found bool)
	Add(itemID string, resp *csrf.Response)
	Remove(itemID string)
}

// Creates a new TokenCache instance
func NewTokenCache() TokenCache {
	return &tokenCache{
		cache: cache.New(cache.NoExpiration, cache.NoExpiration),
	}
}

type tokenCache struct {
	cache *cache.Cache
}

func (tc *tokenCache) Get(itemID string) (resp *csrf.Response, found bool) {
	res, found := tc.cache.Get(itemID)
	if !found {
		return nil, false
	}

	return res.(*csrf.Response), found
}

func (tc *tokenCache) Add(itemID string, resp *csrf.Response) {
	tc.cache.Set(itemID, resp, time.Duration(-1)*time.Second)
}

func (tc *tokenCache) Remove(itemID string) {
	tc.cache.Delete(itemID)
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax
{
    internal partial class SyntaxToken
    {
        internal class SyntaxIdentifierWithTrivia : SyntaxIdentifierExtended
        {
            private readonly GreenNode _leading;
            private readonly GreenNode _trailing;

            internal SyntaxIdentifierWithTrivia(
                SyntaxKind contextualKind,
                string text,
                string valueText,
                GreenNode leading,
                GreenNode trailing)
                : base(contextualKind, text, valueText)
            {
                if (leading != null)
                {
                    this.AdjustFlagsAndWidth(leading);
                    _leading = leading;
                }
                if (trailing != null)
                {
                    this.AdjustFlagsAndWidth(trailing);
                    _trailing = trailing;
                }
            }

            internal SyntaxIdentifierWithTrivia(
                SyntaxKind contextualKind,
                string text,
                string valueText,
                GreenNode leading,
                GreenNode trailing,
                DiagnosticInfo[] diagnostics,
                SyntaxAnnotation[] annotations)
                : base(contextualKind, text, valueText, diagnostics, annotations)
            {
                if (leading != null)
                {
                    this.AdjustFlagsAndWidth(leading);
                    _leading = leading;
                }
                if (trailing != null)
                {
                    this.AdjustFlagsAndWidth(trailing);
                    _trailing = trailing;
                }
            }

            internal SyntaxIdentifierWithTrivia(ObjectReader reader)
                : base(reader)
            {
                var leading = (GreenNode)reader.ReadValue();
                if (leading != null)
                {
                    this.AdjustFlagsAndWidth(leading);
                    _leading = leading;
                }
                var trailing = (GreenNode)reader.ReadValue();
                if (trailing != null)
                {
                    _trailing = trailing;
                    this.AdjustFlagsAndWidth(trailing);
                }
            }

            static SyntaxIdentifierWithTrivia()
            {
                ObjectBinder.RegisterTypeReader(typeof(SyntaxIdentifierWithTrivia), r => new SyntaxIdentifierWithTrivia(r));
            }

            internal override void WriteTo(ObjectWriter writer)
            {
                base.WriteTo(writer);
                writer.WriteValue(_leading);
                writer.WriteValue(_trailing);
            }

            public override GreenNode GetLeadingTrivia()
            {
                return _leading;
            }

            public override GreenNode GetTrailingTrivia()
            {
                return _trailing;
            }

            public override SyntaxToken TokenWithLeadingTrivia(GreenNode trivia)
            {
                return new SyntaxIdentifierWithTrivia(this.contextualKind, this.TextField, this.valueText, trivia, _trailing, this.GetDiagnostics(), this.GetAnnotations());
            }

            public override SyntaxToken TokenWithTrailingTrivia(GreenNode trivia)
            {
                return new SyntaxIdentifierWithTrivia(this.contextualKind, this.TextField, this.valueText, _leading, trivia, this.GetDiagnostics(), this.GetAnnotations());
            }

            internal override GreenNode SetDiagnostics(DiagnosticInfo[] diagnostics)
            {
                return new SyntaxIdentifierWithTrivia(this.contextualKind, this.TextField, this.valueText, _leading, _trailing, diagnostics, this.GetAnnotations());
            }

            internal override GreenNode SetAnnotations(SyntaxAnnotation[] annotations)
            {
                return new SyntaxIdentifierWithTrivia(this.contextualKind, this.TextField, this.valueText, _leading, _trailing, this.GetDiagnostics(), annotations);
            }
        }
    }
}


text:
from .ComputeMixin import ComputeMixin
from .ast import (
    n, e_forward, e_reverse, e_undirected
)


text:
Pair your phone with the remote Bluetooth device.

Edit www/js/index.js and set app.macAddress to the MAC address of the remote Bluetooth adapter.

Install the Bluetooth Serial Cordova plugin

    $ cordova plugin add cordova-plugin-bluetooth-serial

Create an Android project

    $ cordova platform add android

Build and deploy the code to your Android device

    $ cordova run

This code also works on iOS if you have one of the limited Bluetooth Low Energy adapters this plugin supports. See [the documentation](https://github.com/don/BluetoothSerial/blob/master/README.md) for more info.

Edit www/js/index.js and set app.macAddress to the **UUID** of your Bluetooth adapter.

    $ cordova platform add ios
    $ open platforms/ios/SimpleSerial.xcodeproj

Deploy to your iPhone with Xcode.


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Container.Relationship (Jetty Server Project 6.1.26 API)
</TITLE>

<META NAME="date" CONTENT="2010-11-11">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../javadoc.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.mortbay.component

Class Container.Relationship

java.lang.Object
  org.mortbay.component.Container.Relationship

Enclosing class:
Container

public static class Container.Relationship
extends java.lang.Object

A Container event.

See Also:
Container.Listener

Method Summary

 boolean
equals(java.lang.Object o)

 java.lang.Object
getChild()

 Container
getContainer()

 java.lang.Object
getParent()

 java.lang.String
getRelationship()

 int
hashCode()

 java.lang.String
toString()

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Method Detail

getContainer

public Container getContainer()

getChild

public java.lang.Object getChild()

getParent

public java.lang.Object getParent()

getRelationship

public java.lang.String getRelationship()

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.


text:
from django.conf.urls import url
from django.views.generic import TemplateView

urlpatterns = [
    url(r'^$', TemplateView.as_view(template_name="frontend/index.html"), name='index'),
]


text:
package apps::protocols::smtp::plugin;

use strict;
use warnings;
use base qw(centreon::plugins::script_simple);

sub new {
    my ($class, %options) = @_;
    my $self = $class->SUPER::new(package => __PACKAGE__, %options);
    bless $self, $class;
    # $options->{options} = options object

    $self->{version} = '0.1';
    %{$self->{modes}} = (
                        'login'            => 'apps::protocols::smtp::mode::login',
                        'message'          => 'apps::protocols::smtp::mode::message',
                        );
    return $self;
}

1;

__END__

=head1 PLUGIN DESCRIPTION

Check a SMTP server.

=cut


text:
This is a port of Jones Forth to the ESP-8266 microcontroller.

The starting point was the work done by Cheng Chang Wu, who
tried to achieve ANS Forth compliance.

See https://github.com/chengchangwu/jonesforth

## Planned features

    * Filesystem (SPIFFS)
    * GPIO
    * PWM
    * ADC
    * Block I/O a la fig-Forth Forth-79/83 onto Flash SPI sectors directly.
    * Debug serial out
    * Timer
    * I2C
    * SPI
    * Actors, similar to Erlang

To keep the higher level libraries reasonably portable, I think some constants
will be required to be defined at Assembler level, or perhaps even in Makefile configuration.

## Future CPUs
Other processors will be considered (or maybe not) in the future if this one is successful.

Obvious candidates are;

   * ARM
      * Texas Instrument CC2538, CC32xx controllers
      * Atmel (now/soon Microchip) range of ARM-based controllers
      * ST Eectronics ARM range of controllers
      * Many Linux/Android capable systems

   * 8051
      * Many Texas Instrument controllers are 8051 based
      * ST Microelectronic range of 8051 based controllers.

   * Atmel (?)

## Note for Mac users
This project requires a cross-compile environment, and Espressif recommends the crosstool-ng
project, and provides instructions on how to build that. However, that doesn't work on Mac OSX
as the "sed" instruction is different in GNU vs the BSD origin of Mac OSX.

Here is what I did (assuming MacPorts is installed)

    sudo port install gsed
    sudo mv /usr/bin/sed /usr/bin/sed.orig
    sudo ln -s `which gsed` /usr/bin/sed

That should do the trick and crosstool-ng building.


text:
using UnityPureMVC.Interfaces;
using UnityPureMVC.Patterns;

namespace lizzard.Examples02
{
    public class StartupProxiesCommand : SimpleCommand
    {
        public override void Execute(INotification notification)
        {
            base.Execute(notification);

            Facade.RegisterProxy(new PlayerProxy("PlayerProxy"));
        }
    }
}