text:
using System;
using System.Collections.Generic;

namespace Llvm.NET.Values
{
    /// Interface for values containing an AttributeSet
    /// <remarks>
    /// This is used to allow the <see cref="AttributeSetContainer"/> extension
    /// to act as mutators for the otherwise immutable <see cref="AttributeSet"/>.
    /// Each method of the extension class will read the attribute set from the container
    /// and create a new set based on the parameters (adding or removing attributes from the set)
    /// producing a new attributeSet that is then re-assigned back to the container.
    /// </remarks>
    public interface IAttributeSetContainer
    {
        /// Attributes for this container
        AttributeSet Attributes { get; set; }
    }

    /// Static class to provide mutators for otherwise immutable <see cref="AttributeSet"/>s
    /// <remarks>
    /// The methods of this class provide mutators for an <see cref="AttributeSet"/> contained in a
    /// class implementing <see cref="IAttributeSetContainer"/>. (This includes <see cref="Function"/>
    /// <see cref="Instructions.CallInstruction"/>, and <see cref="Instructions.Invoke"/>. An
    /// <see cref="AttributeSet"/> is immutable, all of the methods that modify an attribute set actually
    /// produce a new attribute set. (This follows the underlying LLVM model and semantics). Thus, to
    /// change the attributes of a <see cref="IAttributeSetContainer"/> you must get the
    /// <see cref="IAttributeSetContainer.Attributes"/> set, produce a modified version and then set the
    /// new value back to the <see cref="IAttributeSetContainer.Attributes"/> property. The methods in
    /// this class will perform the read, modify and write back sequence as a single call for any of the
    /// available <see cref="IAttributeSetContainer"/> implementations.
    /// </remarks>
    public static class AttributeSetContainer
    {
        public static T AddAttribute<T>( this T self, FunctionAttributeIndex index, AttributeKind[] values )
            where T : IAttributeSetContainer
        {
            if(values == null)
                throw new ArgumentNullException( nameof( values ) );

            using( var bldr = new AttributeBuilder( self.Attributes, index ) )
            {
                foreach( var kind in values )
                    bldr.Add( kind );

                self.Attributes = self.Attributes.Add( index, bldr.ToAttributeSet( index ) );
                return self;
            }
        }

        public static T AddAttribute<T>( this T self, FunctionAttributeIndex index, AttributeKind value )
            where T : IAttributeSetContainer
        {
            self.Attributes = self.Attributes.Add( index, new AttributeValue( self.Attributes.Context, value ) );
            return self;
        }

        public static T AddAttribute<T>( this T self, FunctionAttributeIndex index, AttributeValue value )
            where T : IAttributeSetContainer
        {
            self.Attributes = self.Attributes.Add( index, value );
            return self;
        }

        /// Compatibility extension method to handle migrating code from older attribute handling
        /// <param name="self">Function to add attributes to</param>
        /// <param name="attributes">Attributes to add</param>
        /// <returns>The function itself</returns>
        /// <remarks>
        /// Adds attributes to a given function itself (as opposed to the return or one of the function's parameters)
        /// This is equivalent to calling <see cref="AddAttributes{T}(T, FunctionAttributeIndex, AttributeValue[])"/>
        /// with <see cref="FunctionAttributeIndex.Function"/> as the first parameter
        /// </remarks>
        public static Function AddAttributes( this Function self, params AttributeValue[] attributes)
        {
            if(self == null)
                throw new ArgumentNullException( nameof( self ) );

            self.Attributes = self.Attributes.Add( FunctionAttributeIndex.Function, attributes );
            return self;
        }

        /// Compatibility extension method to handle migrating code from older attribute handling
        /// <param name="self">Function to add attributes to</param>
        /// <param name="attributes">Attributes to add</param>
        /// <returns>The function itself</returns>
        /// <remarks>
        /// Adds attributes to a given function itself (as opposed to the return or one of the function's parameters)
        /// This is equivalent to calling <see cref="AddAttributes{T}(T, FunctionAttributeIndex, IEnumerable{AttributeValue})"/>
        /// with <see cref="FunctionAttributeIndex.Function"/> as the first parameter
        /// </remarks>
        public static Function AddAttributes( this Function self, IEnumerable<AttributeValue> attributes)
        {
            if(self == null)
                throw new ArgumentNullException( nameof( self ) );

            self.Attributes = self.Attributes.Add( FunctionAttributeIndex.Function, attributes );
            return self;
        }

        /// Compatibility extension method to handle migrating code from older attribute handling
        /// <param name="self">Function to remove attributes from</param>
        /// <param name="kind">Attribute to remove</param>
        /// <returns>The function itself</returns>
        /// <remarks>
        /// Removes attributes from a given function itself (as opposed to the return or one of the function's parameters)
        /// This is equivalent to calling <see cref="RemoveAttribute{T}(T, FunctionAttributeIndex, AttributeKind)"/>
        /// with <see cref="FunctionAttributeIndex.Function"/> as the first parameter
        /// </remarks>
        public static Function RemoveAttribute( this Function self, AttributeKind kind )
        {
            if(self == null)
                throw new ArgumentNullException( nameof( self ) );

            self.Attributes = self.Attributes.Remove( FunctionAttributeIndex.Function, kind );
            return self;
        }

        /// Compatibility extension method to handle migrating code from older attribute handling
        /// <param name="self">Function to remove attributes from</param>
        /// <param name="name">Attribute to remove</param>
        /// <returns>The function itself</returns>
        /// <remarks>
        /// Removes attributes from a given function itself (as opposed to the return or one of the function's parameters)
        /// This is equivalent to calling <see cref="RemoveAttribute{T}(T, FunctionAttributeIndex, AttributeKind)"/>
        /// with <see cref="FunctionAttributeIndex.Function"/> as the first parameter
        /// </remarks>
        public static Function RemoveAttribute( this Function self, string name )
        {
            if(self == null)
                throw new ArgumentNullException( nameof( self ) );

            self.Attributes = self.Attributes.Remove( FunctionAttributeIndex.Function, name );
            return self;
        }

        public static T AddAttributes<T>( this T self, FunctionAttributeIndex index, params AttributeValue[] attributes )
            where T : IAttributeSetContainer
        {
            self.Attributes = self.Attributes.Add( index, attributes );
            return self;
        }

        public static T AddAttributes<T>( this T self, FunctionAttributeIndex index, AttributeSet attributes )
            where T : IAttributeSetContainer
        {
            self.Attributes = self.Attributes.Add( index, attributes[index] );
            return self;
        }

        public static T AddAttributes<T>( this T self, FunctionAttributeIndex index, IEnumerable<AttributeValue> attributes )
            where T : IAttributeSetContainer
        {
            self.Attributes = self.Attributes.Add( index, attributes );
            return self;
        }

        public static T RemoveAttribute<T>( this T self, FunctionAttributeIndex index, AttributeKind kind )
            where T : IAttributeSetContainer
        {
            self.Attributes = self.Attributes.Remove( index, kind );
            return self;
        }

        public static T RemoveAttribute<T>( this T self, FunctionAttributeIndex index, string name )
            where T : IAttributeSetContainer
        {
            self.Attributes = self.Attributes.Remove( index, name );
            return self;
        }
    }
}


text:
package uk.nhs.careconnect.ri.database.entity.medicationStatement;

import javax.persistence.*;

@Entity
@Table(name="MedicationStatementDerivedFrom", uniqueConstraints= @UniqueConstraint(name="PK_MEDICATION_STATEMENT_DERIVEDFROM", columnNames={"MEDICATION_STATEMENT_DERIVEDFROM_ID"})
		)
public class MedicationStatementDerivedFrom {

	public MedicationStatementDerivedFrom() {

	}

	public MedicationStatementDerivedFrom(MedicationStatementEntity statement) {
		this.statement = statement;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name= "MEDICATION_STATEMENT_DERIVEDFROM_ID")
	private Long identifierId;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn (name = "MEDICATION_STATEMENT_ID",foreignKey= @ForeignKey(name="FK_MEDICATION_STATEMENT_MEDICATION_STATEMENT_DERIVEDFROM"))
	private MedicationStatementEntity statement;

	// TO BE IMPLEMENTED

    public Long getDerivedFromId() { return identifierId; }
	public void setDerivedFromId(Long identifierId) { this.identifierId = identifierId; }

	public MedicationStatementEntity getMedicationStatement() {
	        return this.statement;
	}

	public void setMedicationStatement(MedicationStatementEntity statement) {
	        this.statement = statement;
	}

}

redpajama_set_name: RedPajamaGithub


text:
package com.ruslanlesko.htserver.dao;

public class DaoException extends Exception {
    public DaoException(String message) {
        super(message);
    }

    public DaoException(String message, Throwable cause) {
        super(message, cause);
    }
}


text:
package org.apereo.cas.qr.web.flow;

import org.apereo.cas.qr.BaseQRAuthenticationTokenValidatorServiceTests;

import lombok.val;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockServletContext;
import org.springframework.webflow.context.ExternalContextHolder;
import org.springframework.webflow.context.servlet.ServletExternalContext;
import org.springframework.webflow.execution.Action;
import org.springframework.webflow.execution.RequestContextHolder;
import org.springframework.webflow.test.MockRequestContext;

import static org.junit.jupiter.api.Assertions.*;

/**
 * This is {@link QRAuthenticationGenerateCodeActionTests}.
 *
 * @author Misagh Moayyed
 * @since 6.3.0
 */
@Tag("WebflowActions")
@SpringBootTest(classes = BaseQRAuthenticationTokenValidatorServiceTests.SharedTestConfiguration.class)
public class QRAuthenticationGenerateCodeActionTests {
    @Autowired
    @Qualifier("qrAuthenticationGenerateCodeAction")
    private Action qrAuthenticationGenerateCodeAction;

    @Test
    public void verifyOperation() throws Exception {
        val context = new MockRequestContext();
        val request = new MockHttpServletRequest();
        val response = new MockHttpServletResponse();
        context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, response));
        RequestContextHolder.setRequestContext(context);
        ExternalContextHolder.setExternalContext(context.getExternalContext());

        val result = qrAuthenticationGenerateCodeAction.execute(context);
        assertNull(result);

        assertTrue(context.getFlowScope().contains("qrCode"));
        assertTrue(context.getFlowScope().contains("qrChannel"));
        assertTrue(context.getFlowScope().contains("qrPrefix"));
    }

}


text:
for i in group_pool group host_pool host image_pool image template_pool template user_pool user vm_pool vm vnet_pool vnet
do
    xmllint --noout --schema $i.xsd samples/$i/*
done


text:
package collections;// collections/AddingGroups.java
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// Adding groups of elements to Collection objects
import java.util.*;

public class AddingGroups {
  public static void main(String[] args) {
    Collection<Integer> collection =
      new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5));
    Integer[] moreInts = { 6, 7, 8, 9, 10 };
    collection.addAll(Arrays.asList(moreInts));
    // Runs significantly faster, but you can't
    // construct a Collection this way:
    Collections.addAll(collection, 11, 12, 13, 14, 15);
    Collections.addAll(collection, moreInts);
    // Produces a list "backed by" an array:
    List<Integer> list = Arrays.asList(16,17,18,19,20);
    list.set(1, 99); // OK -- modify an element
    // list.add(21); // Runtime error; the underlying
                     // array cannot be resized.
  }
}


text:
"""
Handles sequence of messages that are used to send OMCI to the ONU
"""
import structlog
from scapy.automaton import ATMT

from voltha.adapters.microsemi_olt.BaseOltAutomaton import BaseOltAutomaton
from voltha.adapters.microsemi_olt.PAS5211 import PAS5211MsgSendFrame, PAS5211MsgGetOltVersionResponse, PAS5211MsgSendFrameResponse, \
    PAS5211EventFrameReceived, PAS5211MsgHeader, PAS5211SetVlanGenConfigResponse

from voltha.extensions.omci.omci_frame import OmciFrame

log = structlog.get_logger()

class APIProxy(BaseOltAutomaton):

    proxy_address = None
    msg = None
    opcode = None

    def parse_args(self, debug=0, store=0, **kwargs):
        self.adaptor_agent = kwargs.pop('adapter_agent')
        self.proxy_address = kwargs.pop('proxy_address')
        self.msg = kwargs.pop('msg')

        BaseOltAutomaton.parse_args(self, debug=debug, store=store, **kwargs)

    def restart(self, *args, **kargs):
        self.msg = kargs.pop('msg')
        super(APIProxy, self).restart()

    def master_filter(self, pkt):

        if not super(APIProxy, self).master_filter(pkt):
            return False

        if not self.proxy_address.channel_id:
            self.proxy_address.channel_id = 0

        if not self.proxy_address.onu_id:
            self.proxy_address.onu_id = 0

        # if OmciFrame in pkt:
        #     # if pkt[OmciFrame].message_type in (16, 17):
        #     return False

        if PAS5211MsgHeader in pkt:
            if PAS5211MsgGetOltVersionResponse not in pkt:
                if pkt[PAS5211MsgHeader].channel_id == self.proxy_address.channel_id:
                    if pkt[PAS5211MsgHeader].onu_id == self.proxy_address.onu_id:
                        if OmciFrame not in pkt:
                            rcv_opcode = pkt[PAS5211MsgHeader].opcode & 0xFF
                            if rcv_opcode == self.opcode:
                                return True

        return False

    """
    States
    """

    @ATMT.state(initial=1)
    def send_msg(self):
        pass

    @ATMT.state()
    def wait_response(self):
        pass

    @ATMT.state(error=1)
    def error(self, msg):
        log.error(msg)
        raise self.end()

    @ATMT.state(final=1)
    def end(self):
        log.debug('api-msg-end')
        # pass

    """
    Utils
    """

    def px(self, pkt):

        if not self.proxy_address.channel_id:
            self.proxy_address.channel_id = 0

        return self.p(pkt, channel_id=self.proxy_address.channel_id,
            onu_id=self.proxy_address.onu_id,
            onu_session_id=self.proxy_address.onu_session_id)

    """
    Transitions
    """

    @ATMT.condition(send_msg)
    def send_api_msg(self):
        log.debug('send-api-msg')
        self.opcode = self.msg.opcode & 0xFF
        self.send(self.px(self.msg))
        raise self.wait_response()

    # Transitions from wait_event
    @ATMT.timeout(wait_response, 10)
    def timeout_wait_response(self):
        log.debug('api-proxy-timeout')
        # Send empty packet...
        self.adaptor_agent.receive_proxied_message(self.proxy_address, dict());
        raise self.error("No API event for {}".format(self.proxy_address))

    @ATMT.receive_condition(wait_response)
    def wait_for_response(self, pkt):
        if PAS5211MsgHeader in pkt: # and not isinstance(pkt, OmciFrame):
            log.debug("adaptor-rcv", adaptor=self.adaptor_agent)
            self.adaptor_agent.receive_proxied_message(self.proxy_address, pkt['PAS5211MsgHeader'])
            raise self.end()

    def __del__(self):
        log.debug("APIProxy deleted")
        super(APIProxy, self).__del__()


text:
import * as assert from 'assert';
import * as ttm from 'vsts-task-lib/mock-test';
import * as path from 'path';

export function KuduServiceTests() {
    it('azure-arm-app-service-kudu Kudu', (done: MochaDone) => {
        let tp = path.join(__dirname, 'azure-arm-app-service-kudu-tests.js');
        let tr : ttm.MockTestRunner = new ttm.MockTestRunner(tp);
        let passed: boolean = true;
        try {
            tr.run();
            assert(tr.succeeded, "azure-arm-app-service-kudu-tests should have passed but failed.");
            console.log("\tvalidating updateDeployment");
            updateDeployment(tr);
            console.log("\tvalidating getContinuousJobs");
            getContinuousJobs(tr);
            console.log("\tvalidating startContinuousWebJob");
            startContinuousWebJob(tr);
            console.log("\tvalidating stopContinuousWebJob");
            stopContinuousWebJob(tr);
            console.log("\tvalidating installSiteExtension");
            installSiteExtension(tr);
            console.log("\tvalidating getSiteExtensions");
            getSiteExtensions(tr);
            console.log("\tvalidating getProcess");
            getProcess(tr);
            console.log("\tvalidating killProcess");
            killProcess(tr);
            console.log("\tvalidating getAppSettings");
            getAppSettings(tr);
            console.log("\tvalidating listDir");
            listDir(tr);
            console.log("\tvalidating getFileContent");
            getFileContent(tr);
            console.log("\tvalidating uploadFile");
            uploadFile(tr);
            console.log("\tvalidating createPath");
            createPath(tr);
            console.log("\tvalidating runCommand");
            runCommand(tr);
            console.log("\tvalidating extractZIP");
            extractZIP(tr);
            console.log("\tvalidating zipDeploy");
            zipDeploy(tr);
            console.log("\tvalidating deleteFile");
            deleteFile(tr);
        }
        catch(error) {
            passed = false;
            console.log(tr.stdout);
            console.log(tr.stderr);
            done(error);
        }

        if(passed) {
            done();
        }
    });
}

function updateDeployment(tr) {
    assert(tr.stdOutContained('Successfullyupdateddeploymenthistory http://MOCK_SCM_WEBSITE/api/deployments/MOCK_DEPLOYMENT_ID'),
        'Should have printed: Successfullyupdateddeploymenthistory http://MOCK_SCM_WEBSITE/api/deployments/MOCK_DEPLOYMENT_ID');

    assert(tr.stdOutContained('FailedToUpdateDeploymentHistory null (CODE: 501)'),
        'Should have printed: FailedToUpdateDeploymentHistory null (CODE: 501)');
}

function getContinuousJobs(tr) {
    assert(tr.stdOutContained('MOCK KUDU CONTINUOUS JOBS COUNT: 2'),
        'Should have printed: MOCK KUDU CONTINUOUS JOBS COUNT: 2');

    assert(tr.stdOutContained('Error: FailedToGetContinuousWebJobs null (CODE: 501)'),
        'Should have printed: Error: FailedToGetContinuousWebJobs null (CODE: 501)');
}

function startContinuousWebJob(tr) {
    assert(tr.stdOutContained('StartedWebJob MOCK_JOB_NAME'),
        'Should have printed: StartedWebJob MOCK_JOB_NAME');

    assert(tr.stdOutContained('FailedToStartContinuousWebJob MOCK_JOB_NAME null (CODE: 501)'),
        'Should have printed: FailedToStartContinuousWebJob MOCK_JOB_NAME null (CODE: 501)');
}

function stopContinuousWebJob(tr) {
    assert(tr.stdOutContained('StoppedWebJob MOCK_JOB_NAME'),
        'StoppedWebJob MOCK_JOB_NAME');

    assert(tr.stdOutContained('FailedToStopContinuousWebJob MOCK_JOB_NAME null (CODE: 501)'),
        'Should have printed: FailedToStopContinuousWebJob MOCK_JOB_NAME null (CODE: 501)');
}

function installSiteExtension(tr) {
    assert(tr.stdOutContained('SiteExtensionInstalled MOCK_EXTENSION'),
    'Should have printed: SiteExtensionInstalled MOCK_EXTENSION');

    assert(tr.stdOutContained('FailedToInstallSiteExtension MOCK_EXTENSION null (CODE: 501)'),
        'Should have printed: FailedToInstallSiteExtension MOCK_EXTENSION null (CODE: 501)');
}

function getSiteExtensions(tr) {
    assert(tr.stdOutContained('MOCK KUDU SITE EXTENSIONS COUNT: 2'),
    'Should have printed: MOCK KUDU SITE EXTENSIONS COUNT: 2');

    assert(tr.stdOutContained('FailedToGetSiteExtensions null (CODE: 501)'),
        'Should have printed: FailedToGetSiteExtensions null (CODE: 501)');
}

function getProcess(tr) {
    assert(tr.stdOutContained('MOCK KUDU PROCESS ID: 1'),
        'Should have printed: MOCK KUDU PROCESS ID: 1');
}

function killProcess(tr) {
    assert(tr.stdOutContained('KILLED PROCESS 0'),
        'Should have printed: KILLED PROCESS 0');
}

function getAppSettings(tr) {
    assert(tr.stdOutContained('KUDU APP SETTINGS {"MSDEPLOY_RENAME_LOCKED_FILES":"1","ScmType":"VSTSRM"}'),
    'Should have printed: KUDU APP SETTINGS {"MSDEPLOY_RENAME_LOCKED_FILES":"1","ScmType":"VSTSRM"}');

    assert(tr.stdOutContained('FailedToFetchKuduAppSettings null (CODE: 501)'),
        'Should have printed: FailedToFetchKuduAppSettings null (CODE: 501)');
}

function listDir(tr) {
    assert(tr.stdOutContained('KUDU LIST DIR [{"name":"web.config"},{"name":"content","size":777}]'),
    'Should have printed: KUDU LIST DIR [{"name":"web.config"},{"name":"content","size":777}]');

    assert(tr.stdOutContained('FailedToListPath site/wwwroot null (CODE: 501)'),
        'Should have printed: FailedToListPath site/wwwroot null (CODE: 501)');
}

function getFileContent(tr) {
    assert(tr.stdOutContained('KUDU FILE CONTENT HELLO.TXT FILE CONTENT'),
    'Should have printed: KUDU FILE CONTENT HELLO.TXT FILE CONTENT');

    assert(tr.stdOutContained('KUDU FILE CONTENT 404 - PASSED'),
        'Should have printed: KUDU FILE CONTENT 404 - PASSED');

    assert(tr.stdOutContained('FailedToGetFileContent site/wwwroot web.config null (CODE: 501)'),
        'Should have printed: FailedToGetFileContent site/wwwroot web.config null (CODE: 501)');
}

function uploadFile(tr) {
    assert(tr.stdOutContained('KUDU FILE UPLOAD HELLO.TXT PASSED'),
    'Should have printed: KUDU FILE UPLOAD HELLO.TXT PASSED');

    assert(tr.stdOutContained('FailedToUploadFile site/wwwroot web.config null (CODE: 501)'),
        'Should have printed: FailedToUploadFile site/wwwroot web.config null (CODE: 501)');
}

function createPath(tr) {
    assert(tr.stdOutContained('KUDU CREATE PATH SITE/WWWROOT PASSED'),
    'Should have printed: KUDU CREATE PATH SITE/WWWROOT PASSED');

    assert(tr.stdOutContained('FailedToCreatePath site/wwwroot null (CODE: 501)'),
        'Should have printed: FailedToCreatePath site/wwwroot null (CODE: 501)');
}

function runCommand(tr) {

    assert(tr.stdOutContained('Executing Script on Kudu. Command: echo hello'),
        'Should have printed: Executing Script on Kudu. Command: echo hello');

    assert(tr.stdOutContained('KUDU RUN COMMAND PASSED'),
        'Should have printed: KUDU RUN COMMAND PASSED');

    assert(tr.stdOutContained('Executing Script on Kudu. Command: exit /b 1'),
        'Should have printed: Executing Script on Kudu. Command: exit /b 1');
}

function extractZIP(tr) {
    assert(tr.stdOutContained('KUDU ZIP API PASSED'),
    'Should have printed: KUDU ZIP API PASSED');

    assert(tr.stdOutContained('Failedtodeploywebapppackageusingkuduservice null (CODE: 501)'),
        'Should have printed: Failedtodeploywebapppackageusingkuduservice null (CODE: 501)');
}

function deleteFile(tr) {
    assert(tr.stdOutContained('KUDU DELETE FILE PASSED'),
        'Should have printed: KUDU DELETE FILE PASSED');

    assert(tr.stdOutContained('FailedToDeleteFile site/wwwroot web.config null (CODE: 501)'),
        'Should have printed: Error: FailedToDeleteFile site/wwwroot web.config null (CODE: 501)');
}

function zipDeploy(tr) {
    assert(tr.stdOutContained('KUDU ZIP DEPLOY PASSED. ID: ZIP_DEPLOY_PASSED_ID. STATUS: 4.'),
    'Should have printed: KUDU ZIP DEPLOY PASSED. ID: ZIP_DEPLOY_PASSED_ID. STATUS: 4.');

    assert(tr.stdOutContained('KUDU ZIP DEPLOY FAILED. ID: ZIP_DEPLOY_FAILED_ID. STATUS: 3.'),
        'Should have printed: KUDU ZIP DEPLOY FAILED. ID: ZIP_DEPLOY_FAILED_ID. STATUS: 3.');
}


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Suzanne Bowen on Asterisk, and other worldly endeavours</title>
    <link>http://blog.leifmadsen.com/tags/suzanne-bowen/index.xml</link>
    <description>Recent content in Suzanne Bowen on Asterisk, and other worldly endeavours</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <atom:link href="/tags/suzanne-bowen/index.xml" rel="self" type="application/rss+xml" />

    <item>
      <title>Jim van Meggelen, Open Source Telephony Renaissance Man</title>
      <link>http://blog.leifmadsen.com/blog/2009/11/21/jim-van-meggelen-open-source-telephony-renaissance-man/</link>
      <pubDate>Sat, 21 Nov 2009 15:04:26 +0000</pubDate>

      <guid>http://blog.leifmadsen.com/blog/2009/11/21/jim-van-meggelen-open-source-telephony-renaissance-man/</guid>
      <description>In case you missed it, Suzanne Bowen of DIDX recently interviewed co-author of Asterisk: The Future of Telephony and good friend of mine, Jim van Meggelen. If you&rsquo;ve never had a chance to see Jim speak at a conference, do yourself a favour and try to attend one of his sessions. He is extremely entertaining and informative, and is always a joy to speak to.
Jim also talks about the much anticipated 3rd edition of Asterisk: The Future of Telephony.</description>
    </item>

  </channel>
</rss>


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _stylelint = require("stylelint");

var _utils = require("./utils");

var _rules = _interopRequireDefault(require("./rules"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var rulesPlugins = Object.keys(_rules["default"]).map(function (ruleName) {
  return (0, _stylelint.createPlugin)((0, _utils.namespace)(ruleName), _rules["default"][ruleName]);
});
var _default = rulesPlugins;
exports["default"] = _default;


text:
package net.ME1312.SubServers.Client.Common.Network.API;

import net.ME1312.Galaxi.Library.Map.ObjectMap;
import net.ME1312.Galaxi.Library.Try;
import net.ME1312.Galaxi.Library.Util;
import net.ME1312.SubData.Client.DataClient;
import net.ME1312.SubServers.Client.Common.ClientAPI;
import net.ME1312.SubServers.Client.Common.Network.Packet.*;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.UUID;
import java.util.function.Consumer;
import java.util.function.IntConsumer;

/**
 * Simplified SubServer Data Class
 */
public class SubServer extends Server {
    private List<SubServer> incompatibilities = null;
    private List<SubServer> currentIncompatibilities = null;
    private Host host = null;

    /**
     * SubServer Stop Action Class
     */
    public enum StopAction {
        NONE,
        RESTART,
        REMOVE_SERVER,
        RECYCLE_SERVER,
        DELETE_SERVER;

        @Override
        public String toString() {
            return super.toString().substring(0, 1).toUpperCase()+super.toString().substring(1).toLowerCase().replace('_', ' ');
        }
    }

    /**
     * Create an API representation of a SubServer
     *
     * @param raw JSON representation of the SubServer
     */
    public SubServer(ObjectMap<String> raw) {
        super(null, raw);
    }

    /**
     * Create an API representation of a SubServer
     *
     * @param client SubData connection
     * @param raw JSON representation of the SubServer
     */
    SubServer(DataClient client, ObjectMap<String> raw) {
        super(client, raw);
    }

    /**
     * Create an API representation of a SubServer
     *
     * @param host Host
     * @param raw JSON representation of the SubServer
     */
    SubServer(Host host, ObjectMap<String> raw) {
        this(host.client, raw);
        this.host = host;
    }

    @Override
    public boolean equals(Object obj) {
        return obj instanceof SubServer && super.equals(obj);
    }

    @Override
    public void refresh() {
        host = null;
        incompatibilities = null;
        currentIncompatibilities = null;
        super.refresh();
    }

    /**
     * Starts the Server
     *
     * @param player Player who Started
     * @param response Response Code
     */
    public void start(UUID player, IntConsumer response) {
        Util.nullpo(response);
        StackTraceElement[] origin = new Throwable().getStackTrace();
        client().sendPacket(new PacketStartServer(player, getName(), data -> {
            try {
                response.accept(data.getInt(0x0001));
            } catch (Throwable e) {
                Throwable ew = new InvocationTargetException(e);
                ew.setStackTrace(origin);
                ew.printStackTrace();
            }
        }));
    }

    /**
     * Starts the Server
     *
     * @param response Response Code
     */
    public void start(IntConsumer response) {
        start(null, response);
    }

    /**
     * Starts the Server
     *
     * @param player Player who Started
     */
    public void start(UUID player) {
        start(player, i -> {});
    }

    /**
     * Starts the Server
     */
    public void start() {
        start(i -> {});
    }

    /**
     * Stops the Server
     *
     * @param player Player who Stopped
     * @param response Response Code
     */
    public void stop(UUID player, IntConsumer response) {
        Util.nullpo(response);
        StackTraceElement[] origin = new Throwable().getStackTrace();
        client().sendPacket(new PacketStopServer(player, getName(), false, data -> {
            try {
                response.accept(data.getInt(0x0001));
            } catch (Throwable e) {
                Throwable ew = new InvocationTargetException(e);
                ew.setStackTrace(origin);
                ew.printStackTrace();
            }
        }));
    }

    /**
     * Stops the Server
     *
     * @param response Response Code
     */
    public void stop(IntConsumer response) {
        stop(null, response);
    }

    /**
     * Stops the Server
     *
     * @param player Player who Stopped
     */
    public void stop(UUID player) {
        stop(player, i -> {});
    }

    /**
     * Stops the Server
     */
    public void stop() {
        stop(i -> {});
    }

    /**
     * Terminates the Server
     *
     * @param player Player who Terminated
     * @param response Response Code
     */
    public void terminate(UUID player, IntConsumer response) {
        Util.nullpo(response);
        StackTraceElement[] origin = new Throwable().getStackTrace();
        client().sendPacket(new PacketStopServer(player, getName(), true, data -> {
            try {
                response.accept(data.getInt(0x0001));
            } catch (Throwable e) {
                Throwable ew = new InvocationTargetException(e);
                ew.setStackTrace(origin);
                ew.printStackTrace();
            }
        }));
    }

    /**
     * Terminates the Server
     *
     * @param response Response Code
     */
    public void terminate(IntConsumer response) {
        terminate(null, response);
    }

    /**
     * Terminates the Server
     *
     * @param player Player who Terminated
     */
    public void terminate(UUID player) {
        terminate(player, i -> {});
    }

    /**
     * Terminates the Server
     */
    public void terminate() {
        terminate(i -> {});
    }

    /**
     * Edits the Server
     *
     * @param player Player Editing
     * @param edit Edits
     * @param response Negative Response Code -or- Positive Success Status
     */
    public void edit(UUID player, ObjectMap<String> edit, IntConsumer response) {
        edit(player, edit, false, response);
    }

    /**
     * Edits the Server
     *
     * @param edit Edits
     * @param response Negative Response Code -or- Positive Success Status
     */
    public void edit(ObjectMap<String> edit, IntConsumer response) {
        edit(null, edit, response);
    }

    /**
     * Edits the Server
     *
     * @param player Player Editing
     * @param edit Edits
     */
    public void edit(UUID player, ObjectMap<String> edit) {
        edit(player, edit, i -> {});
    }

    /**
     * Edits the Server
     *
     * @param edit Edits
     */
    public void edit(ObjectMap<String> edit) {
        edit(null, edit);
    }

    /**
     * Edits the Server (& Saves Changes)
     *
     * @param player Player Editing
     * @param edit Edits
     * @param response Negative Response Code -or- Positive Success Status
     */
    public void permaEdit(UUID player, ObjectMap<String> edit, IntConsumer response) {
        edit(player, edit, true, response);
    }

    /**
     * Edits the Server (& Saves Changes)
     *
     * @param edit Edits
     * @param response Negative Response Code -or- Positive Success Status
     */
    public void permaEdit(ObjectMap<String> edit, IntConsumer response) {
        permaEdit(null, edit, response);
    }

    /**
     * Edits the Server (& Saves Changes)
     *
     * @param player Player Editing
     * @param edit Edits
     */
    public void permaEdit(UUID player, ObjectMap<String> edit) {
        permaEdit(player, edit, i -> {});
    }

    /**
     * Edits the Server (& Saves Changes)
     *
     * @param edit Edits
     */
    public void permaEdit(ObjectMap<String> edit) {
        permaEdit(null, edit);
    }

    private void edit(UUID player, ObjectMap<String> edit, boolean perma, IntConsumer response) {
        Util.nullpo(response);
        StackTraceElement[] origin = new Throwable().getStackTrace();
        client().sendPacket(new PacketEditServer(player, getName(), edit, perma, data -> {
            try {
                if (data.getInt(0x0001) != 0) {
                    response.accept(data.getInt(0x0001) * -1);
                } else {
                    response.accept(data.getInt(0x0002));
                }
            } catch (Throwable e) {
                Throwable ew = new InvocationTargetException(e);
                ew.setStackTrace(origin);
                ew.printStackTrace();
            }
        }));
    }

    /**
     * If the Server is Running
     *
     * @return Running Status
     */
    public boolean isRunning() {
        return raw.getBoolean("running");
    }

    /**
     * If the Server is Online

     * This method can only be true when a SubData connection is made!
     *
     * @return Online Status
     */
    public boolean isOnline() {
        return raw.getBoolean("online");
    }

    /**
     * If the Server is Stopping

     * This method can only be true when the server is stopped through the server manager!
     *
     * @return Stopping Status
     */
    public boolean isStopping() {
        return raw.getBoolean("stopping");
    }

    /**
     * Grabs the Host of the Server
     *
     * @return The Host Name
     */
    public String getHost() {
        return raw.getString("host");
    }

    /**
     * Grabs the Host of the Server
     *
     * @param callback The Host
     */
    public void getHost(Consumer<Host> callback) {
        Util.nullpo(callback);
        StackTraceElement[] origin = new Throwable().getStackTrace();
        Runnable run = () -> {
            try {
                callback.accept(host);
            } catch (Throwable e) {
                Throwable ew = new InvocationTargetException(e);
                ew.setStackTrace(origin);
                ew.printStackTrace();
            }
        };

        if (host == null || !host.getName().equalsIgnoreCase(raw.getString("host"))) {
            ClientAPI.getInstance().getHost(raw.getString("host"), host -> {
                this.host = host;
                run.run();
            });
        } else {
            run.run();
        }
    }

    /**
     * Grabs the Template this Server was created from
     *
     * @return The Template
     */
    public String getTemplate() {
        return raw.getString("template");
    }

    /**
     * Grabs the Template this Server was created from
     *
     * @param callback  The Template
     */
    public void getTemplate(Consumer<SubCreator.ServerTemplate> callback) {
        Util.nullpo(callback);
        String name = getTemplate();
        if (name == null) {
            callback.accept(null);
        } else getHost(host -> {
            callback.accept(host.getCreator().getTemplate(name));
        });
    }

    /**
     * Is this Server Available?
     *
     * @return Availability Status
     */
    public boolean isAvailable() {
        return raw.getBoolean("available");
    }

    /**
     * If the Server is Enabled
     *
     * @return Enabled Status
     */
    public boolean isEnabled() {
        return raw.getBoolean("enabled");
    }

    /**
     * Set if the Server is Enabled
     *
     * @param value Value
     */
    public void setEnabled(boolean value) {
        setEnabled(value, b -> {});
    }

    /**
     * Set if the Server is Enabled
     *
     * @param value Value
     * @param response Success Status
     */
    public void setEnabled(boolean value, Consumer<Boolean> response) {
        Util.nullpo(value, response);
        ObjectMap<String> edit = new ObjectMap<String>();
        edit.set("enabled", value);
        edit(edit, r -> {
            if (r > 0) raw.set("enabled", value);
            response.accept(r > 0);
        });
    }

    /**
     * If the Server is accepting requests to edit()
     *
     * @return Edit Status
     */
    public boolean isEditable() {
        return raw.getBoolean("editable");
    }

    /**
     * If the Server is Logging
     *
     * @return Logging Status
     */
    public boolean isLogging() {
        return raw.getBoolean("log");
    }

    /**
     * Set if the Server is Logging
     *
     * @param value Value
     */
    public void setLogging(boolean value) {
        setLogging(value, b -> {});
    }

    /**
     * Set if the Server is Logging
     *
     * @param value Value
     * @param response Success Status
     */
    public void setLogging(boolean value, Consumer<Boolean> response) {
        Util.nullpo(value, response);
        ObjectMap<String> edit = new ObjectMap<String>();
        edit.set("log", value);
        edit(edit, r -> {
            if (r > 0) raw.set("log", value);
            response.accept(r > 0);
        });
    }

    /**
     * Get the Server Directory Path
     *
     * @return Server Directory Path
     */
    public String getPath() {
        return raw.getString("dir");
    }

    /**
     * Get the Server's Executable String
     *
     * @return Executable String
     */
    public String getExecutable() {
        return raw.getString("exec");
    }

    /**
     * Grab the Command to Stop the Server
     *
     * @return Stop Command
     */
    public String getStopCommand() {
        return raw.getString("stop-cmd");
    }

    /**
     * Set the Command that Stops the Server
     *
     * @param value Value
     */
    public void setStopCommand(String value) {
        setStopCommand(value, b -> {});
    }

    /**
     * Set the Command that Stops the Server
     *
     * @param value Value
     * @param response Success Status
     */
    public void setStopCommand(String value, Consumer<Boolean> response) {
        Util.nullpo(value, response);
        ObjectMap<String> edit = new ObjectMap<String>();
        edit.set("stop-cmd", value);
        edit(edit, r -> {
            if (r > 0) raw.set("stop-cmd", value);
            response.accept(r > 0);
        });
    }

    /**
     * Get the action the Server will take when it stops
     *
     * @return Stop Action
     */
    public StopAction getStopAction() {
        return Try.all.get(() -> StopAction.valueOf(raw.getString("stop-action").toUpperCase().replace('-', '_').replace(' ', '_')), StopAction.NONE);
    }

    /**
     * Set the action the Server will take when it stops
     *
     * @param action Stop Action
     */
    public void setStopAction(StopAction action) {
        setStopAction(action, b -> {});
    }

    /**
     * Set the action the Server will take when it stops
     *
     * @param action Stop Action
     * @param response Success Status
     */
    public void setStopAction(StopAction action, Consumer<Boolean> response) {
        Util.nullpo(action, response);
        ObjectMap<String> edit = new ObjectMap<String>();
        edit.set("stop-action", action.toString());
        edit(edit, r -> {
            if (r > 0) raw.set("stop-action", action.toString());
            response.accept(r > 0);
        });
    }

    /**
     * Toggles compatibility with other Servers
     *
     * @param server SubServer to toggle
     */
    public void toggleCompatibility(String server) {
        toggleCompatibility(server, b -> {});
    }

    /**
     * Toggles compatibility with other Servers
     *
     * @param server SubServer to toggle
     */
    public void toggleCompatibility(String server, Consumer<Boolean> response) {
        Util.nullpo(server, response);
        ArrayList<String> value = new ArrayList<String>();
        value.addAll(getIncompatibilities());
        if (!value.contains(server)) value.add(server);
        else value.remove(server);

        ObjectMap<String> edit = new ObjectMap<String>();
        edit.set("incompatible", value);
        edit(edit, r -> {
            if (r > 0) raw.set("incompatible", value);
            response.accept(r > 0);
        });
    }

    /**
     * Checks if a Server is compatible
     *
     * @param server Server name to check
     * @return Compatible Status
     */
    public boolean isCompatible(String server) {
        LinkedList<String> lowercaseIncompatibilities = new LinkedList<String>();
        for (String key : getIncompatibilities()) {
            lowercaseIncompatibilities.add(key.toLowerCase());
        }
        return lowercaseIncompatibilities.contains(server.toLowerCase());
    }

    /**
     * Get all listed incompatibilities for this Server
     *
     * @return Incompatibility List
     */
    public List<String> getIncompatibilities() {
        return raw.getStringList("incompatible-list");
    }

    /**
     * Get all listed incompatibilities for this Server
     *
     * @param callback Incompatibility List
     */
    public void getIncompatibilities(Consumer<List<SubServer>> callback) {
        Util.nullpo(callback);
        StackTraceElement[] origin = new Throwable().getStackTrace();
        Runnable run = () -> {
            try {
                callback.accept(incompatibilities);
            } catch (Throwable e) {
                Throwable ew = new InvocationTargetException(e);
                ew.setStackTrace(origin);
                ew.printStackTrace();
            }
        };

        if (incompatibilities == null) {
            LinkedList<String> incompatible = new LinkedList<String>();
            for (String subserver : raw.getStringList("incompatible-list")) incompatible.add(subserver.toLowerCase());
            client().sendPacket(new PacketDownloadServerInfo(incompatible, data -> {
                LinkedList<SubServer> incompatibilities = new LinkedList<SubServer>();
                for (String server : data.getKeys()) {
                    if (data.getMap(server).getString("type", "Server").equals("SubServer")) incompatibilities.add(new SubServer(data.getMap(server)));
                }

                this.incompatibilities = incompatibilities;
                run.run();
            }));
        } else {
            run.run();
        }
    }

    /**
     * Get incompatibility issues this server currently has
     *
     * @return Current Incompatibility List
     */
    public List<String> getCurrentIncompatibilities() {
        return raw.getStringList("incompatible");
    }

    /**
     * Get incompatibility issues this server currently has
     *
     * @param callback Current Incompatibility List
     */
    public void getCurrentIncompatibilities(Consumer<List<SubServer>> callback) {
        Util.nullpo(callback);
        StackTraceElement[] origin = new Throwable().getStackTrace();
        Runnable run = () -> {
            try {
                callback.accept(currentIncompatibilities);
            } catch (Throwable e) {
                Throwable ew = new InvocationTargetException(e);
                ew.setStackTrace(origin);
                ew.printStackTrace();
            }
        };

        if (currentIncompatibilities == null) {
            LinkedList<String> incompatible = new LinkedList<String>();
            for (String subserver : raw.getStringList("incompatible")) incompatible.add(subserver.toLowerCase());
            client().sendPacket(new PacketDownloadServerInfo(incompatible, data -> {
                LinkedList<SubServer> incompatibilities = new LinkedList<SubServer>();
                for (String server : data.getKeys()) {
                    if (data.getMap(server).getString("type", "Server").equals("SubServer")) incompatibilities.add(new SubServer(data.getMap(server)));
                }

                this.currentIncompatibilities = incompatibilities;
                run.run();
            }));
        } else {
            run.run();
        }
    }

    /**
     * Sets the Display Name for this Server
     *
     * @param value Value (or null to reset)
     */
    public void setDisplayName(String value) {
        setMotd(value, b -> {});
    }

    /**
     * Sets the Display Name for this Server
     *
     * @param value Value (or null to reset)
     * @param response Success Status
     */
    public void setDisplayName(String value, Consumer<Boolean> response) {
        Util.nullpo(value, response);
        ObjectMap<String> edit = new ObjectMap<String>();
        edit.set("display", (value == null)?"":value);
        edit(edit, r -> {
            if (r > 0) raw.set("display", (value == null)?getName():value);
            response.accept(r > 0);
        });
    }

    /**
     * Add this Server to a Group
     *
     * @param value Group name
     */
    public void addGroup(String value) {
        addGroup(value, b -> {});
    }

    /**
     * Add this Server to a Group
     *
     * @param value Group name
     * @param response Success Status
     */
    public void addGroup(String value, Consumer<Boolean> response) {
        Util.nullpo(value, response);
        ArrayList<String> v = new ArrayList<String>();
        v.addAll(getGroups());
        if (!v.contains(value)) v.add(value);

        ObjectMap<String> edit = new ObjectMap<String>();
        edit.set("group", v);
        edit(edit, r -> {
            if (r > 0) raw.set("group", v);
            response.accept(r > 0);
        });
    }

    /**
     * Remove this Server from a Group
     *
     * @param value value Group name
     */
    public void removeGroup(String value) {
        removeGroup(value, b -> {});
    }

    /**
     * Remove this Server from a Group
     *
     * @param value value Group name
     * @param response Success Status
     */
    public void removeGroup(String value, Consumer<Boolean> response) {
        Util.nullpo(value, response);
        ArrayList<UUID> v = new ArrayList<UUID>();
        v.addAll(getWhitelist());
        v.remove(value);

        ObjectMap<String> edit = new ObjectMap<String>();
        edit.set("group", v);
        edit(edit, r -> {
            if (r > 0) raw.set("group", v);
            response.accept(r > 0);
        });
    }

    /**
     * Set if the server is hidden from players
     *
     * @param value Value
     */
    public void setHidden(boolean value) {
        setHidden(value, b -> {});
    }

    /**
     * Set if the server is hidden from players
     *
     * @param value Value
     * @param response Success Status
     */
    public void setHidden(boolean value, Consumer<Boolean> response) {
        Util.nullpo(value, response);
        ObjectMap<String> edit = new ObjectMap<String>();
        edit.set("restricted", value);
        edit(edit, r -> {
            if (r > 0) raw.set("restricted", value);
            response.accept(r > 0);
        });
    }

    /**
     * Sets the MOTD of the Server
     *
     * @param value Value
     */
    public void setMotd(String value) {
        setMotd(value, b -> {});
    }

    /**
     * Sets the MOTD of the Server
     *
     * @param value Value
     * @param response Success Status
     */
    public void setMotd(String value, Consumer<Boolean> response) {
        Util.nullpo(value, response);
        ObjectMap<String> edit = new ObjectMap<String>();
        edit.set("motd", value);
        edit(edit, r -> {
            if (r > 0) raw.set("motd", value);
            response.accept(r > 0);
        });
    }

    /**
     * Sets if the Server is Restricted
     *
     * @param value Value
     */
    public void setRestricted(boolean value) {
        setRestricted(value, b -> {});
    }

    /**
     * Sets if the Server is Restricted
     *
     * @param value Value
     * @param response Success Status
     */
    public void setRestricted(boolean value, Consumer<Boolean> response) {
        Util.nullpo(value, response);
        ObjectMap<String> edit = new ObjectMap<String>();
        edit.set("restricted", value);
        edit(edit, r -> {
            if (r > 0) raw.set("restricted", value);
            response.accept(r > 0);
        });
    }

    /**
     * Add a player to the whitelist (for use with restricted servers)
     *
     * @param player Player to add
     */
    public void whitelist(UUID player) {
        whitelist(player, b -> {});
    }

    /**
     * Add a player to the whitelist (for use with restricted servers)
     *
     * @param player Player to add
     * @param response Success Status
     */
    public void whitelist(UUID player, Consumer<Boolean> response) {
        Util.nullpo(player, response);
        ArrayList<UUID> value = new ArrayList<UUID>();
        value.addAll(getWhitelist());
        if (!value.contains(player)) value.add(player);

        ObjectMap<String> edit = new ObjectMap<String>();
        edit.set("whitelist", value);
        edit(edit, r -> {
            if (r > 0) raw.set("whitelist", value);
            response.accept(r > 0);
        });
    }

    /**
     * Remove a player to the whitelist
     *
     * @param player Player to remove
     */
    public void unwhitelist(UUID player) {
        unwhitelist(player, b -> {});
    }

    /**
     * Remove a player to the whitelist
     *
     * @param player Player to remove
     * @param response Success Status
     */
    public void unwhitelist(UUID player, Consumer<Boolean> response) {
        Util.nullpo(player, response);
        ArrayList<UUID> value = new ArrayList<UUID>();
        value.addAll(getWhitelist());
        value.remove(player);

        ObjectMap<String> edit = new ObjectMap<String>();
        edit.set("whitelist", value);
        edit(edit, r -> {
            if (r > 0) raw.set("whitelist", value);
            response.accept(r > 0);
        });
    }
}


text:
import { Party } from './party'
import { Address } from 'claims/models/address'
import { PartyType } from 'common/partyType'

export class Individual extends Party {
  title?: string

  constructor (name?: string, address?: Address, title?: string) {
    super(PartyType.INDIVIDUAL.dataStoreValue, name, address)
    this.title = title
  }

  deserialize (input: any): Individual {
    if (input) {
      Object.assign(this, new Party().deserialize(input))
      this.type = PartyType.INDIVIDUAL.dataStoreValue
      this.title = input.title
    }
    return this
  }
}


text:
import React, { Component } from 'react';
import { CATEGORIES } from '../constants/defaults';
import { connect } from 'react-redux';
import { changeCategoryDropdownOpened, changeCurrentCategory} from '../actions';
import onClickOutside from "react-onclickoutside";
import _ from 'lodash';

const Fragment = React.Fragment;

class DropDownCategorySelector extends Component {
  handleCurrentCategory(categoryData, e){

    e.stopPropagation();
    this.props.dispatch(changeCurrentCategory({
      id: categoryData.id,
      type: 'click' // click, scroll
    }));

    this.props.dispatch(changeCategoryDropdownOpened(false));
  }

  handleClickOutside(evt){

    evt.stopPropagation();

    _.delay(() => {
      this.props.dispatch(changeCategoryDropdownOpened(false));
    }, 100);

  }

  render() {
    let { currentCategory, locale } = this.props;
    return (

        {
          _.map(CATEGORIES, categoryData => {
            return (
              <a className={`category-selector${ categoryData.id === currentCategory ? "--selected" : ""}`} onClick={this.handleCurrentCategory.bind(this, categoryData)} key={categoryData.id} href="javascript:void(0);">
                {
                  locale == "ko" ?
                  <Fragment>

                      {
                        categoryData.nameKo
                      }

                      {
                        categoryData.nameEn
                      }

                  </Fragment> :
                  <Fragment>

                      {
                        categoryData.nameEn
                      }

                      {
                        categoryData.nameKo
                      }

                  </Fragment>
                }

            );
          })
        }

    );
  }
}

let mapStateToProps = state => {
  return {
    locale: state.locale,
    currentCategory: state.currentCategory
  }
}
export default connect(mapStateToProps)(onClickOutside(DropDownCategorySelector));


text:
package com.github.scribejava.apis;

import com.github.scribejava.core.builder.api.DefaultApi10a;
import com.github.scribejava.core.builder.api.OAuth1SignatureType;
import com.github.scribejava.core.model.Verb;

public class FreelancerApi extends DefaultApi10a {

    private static final String AUTHORIZATION_URL = "http://www.freelancer.com/users/api-token/auth.php";

    protected FreelancerApi() {
    }

    private static class InstanceHolder {
        private static final FreelancerApi INSTANCE = new FreelancerApi();
    }

    public static FreelancerApi instance() {
        return InstanceHolder.INSTANCE;
    }

    @Override
    public OAuth1SignatureType getSignatureType() {
        return OAuth1SignatureType.QUERY_STRING;
    }

    @Override
    public String getAccessTokenEndpoint() {
        return "http://api.freelancer.com/RequestAccessToken/requestAccessToken.xml?";
    }

    @Override
    public String getRequestTokenEndpoint() {
        return "http://api.freelancer.com/RequestRequestToken/requestRequestToken.xml";
    }

    @Override
    public Verb getAccessTokenVerb() {
        return Verb.GET;
    }

    @Override
    public Verb getRequestTokenVerb() {
        return Verb.GET;
    }

    @Override
    public String getAuthorizationBaseUrl() {
        return AUTHORIZATION_URL;
    }

    public static class Sandbox extends FreelancerApi {

        private static final String SANDBOX_AUTHORIZATION_URL
                = "http://www.sandbox.freelancer.com/users/api-token/auth.php";

        private Sandbox() {
        }

        private static class InstanceHolder {
            private static final Sandbox INSTANCE = new Sandbox();
        }

        public static Sandbox instance() {
            return InstanceHolder.INSTANCE;
        }

        @Override
        public String getRequestTokenEndpoint() {
            return "http://api.sandbox.freelancer.com/RequestRequestToken/requestRequestToken.xml";
        }

        @Override
        public String getAccessTokenEndpoint() {
            return "http://api.sandbox.freelancer.com/RequestAccessToken/requestAccessToken.xml?";
        }

        @Override
        public String getAuthorizationBaseUrl() {
            return SANDBOX_AUTHORIZATION_URL;
        }
    }
}


text:
<?php
namespace frontend\controllers\erp;

use yii\base\Action;
use yii\data\ActiveDataProvider;
use common\models\ResPartner;

class CustomersAction extends Action{
    public function run(){
        $provider = New ActiveDataProvider([
            'query' => ResPartner::find()->where(['customer'=>true]),
        ]);

        return $this->controller->render('customers', [
            'provider' => $provider,
        ]);
    }
}


text:
"""Middleware contains the actual communication logic for talking to wysteria.

Files
-----

abstract_middleware.py
    An abstract class contract that a subclass must implement in order to be used as a viable
    middleware.

impl_nats.py
    A Nats.io implementation of the abstract middleware class.

impl_grpc.py
    A gRPC implementation of the the middleware class

wgrpc/
    Auto generated files for gRPC by protobuf.

Exported
--------

  NatsMiddleware
    A Nats.io implementation of the abstract middleware class

  GRPCMiddleware
    A gRPC implementation of the the middleware class

"""

from wysteria.middleware.impl_nats import NatsMiddleware
from wysteria.middleware.impl_grpc import GRPCMiddleware

__all__ = [
    "NatsMiddleware",
    "GRPCMiddleware",
]


text:
require 'spec_helper'

describe ApiV1::Config::ConfigRepoRepresenter do
  describe :serialize do
    it 'should render config repo with hal representation' do
      config_repo_config = ConfigRepoConfig.new(GitMaterialConfig.new('git://foo', 'master'), 'config-repo-json-plugin', 'repo-1')
      actual_json = ApiV1::Config::ConfigRepoRepresenter.new(config_repo_config).to_hash(url_builder: UrlBuilder.new)

      expect(actual_json).to have_link(:self).with_url('http://test.host/api/admin/config_repos/repo-1')
      actual_json.delete(:_links)
      expect(actual_json).to eq(get_config_repo_json)
    end

    protected

    def get_config_repo_json
      {
        :id => 'repo-1',
        :plugin_id => 'config-repo-json-plugin',
        :material => {
          :type => 'git',
          :attributes => {
            :url => 'git://foo',
            :destination => nil,
            :filter => nil,
            :invert_filter => false,
            :name => nil,
            :auto_update => true,
            :branch => 'master',
            :submodule_folder => nil,
            :shallow_clone => false
          }
        },
        :configuration => []
      }
    end
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<GeocodeResponse>
 <status>OK</status>
 <result>
  <type>locality</type>
  <type>political</type>
  <formatted_address>8431 Gralla, Austria</formatted_address>
  <address_component>
   <long_name>Gralla</long_name>
   <short_name>Gralla</short_name>
   <type>locality</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Gemeinde Gralla</long_name>
   <short_name>Gemeinde Gralla</short_name>
   <type>administrative_area_level_3</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Leibnitz</long_name>
   <short_name>Leibnitz</short_name>
   <type>administrative_area_level_2</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Styria</long_name>
   <short_name>Styria</short_name>
   <type>administrative_area_level_1</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Austria</long_name>
   <short_name>AT</short_name>
   <type>country</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>8431</long_name>
   <short_name>8431</short_name>
   <type>postal_code</type>
  </address_component>
  <geometry>
   <location>
    <lat>46.8148074</lat>
    <lng>15.5548000</lng>
   </location>
   <location_type>APPROXIMATE</location_type>
   <viewport>
    <southwest>
     <lat>46.8071708</lat>
     <lng>15.5387926</lng>
    </southwest>
    <northeast>
     <lat>46.8224429</lat>
     <lng>15.5708074</lng>
    </northeast>
   </viewport>
  </geometry>
  <place_id>ChIJhxa9ZAOlb0cRsHfmLVeXAAQ</place_id>
 </result>
</GeocodeResponse>


text:
#ifndef _ELINA_BOX_INTERNAL_H_
#define _ELINA_BOX_INTERNAL_H_

#include <string.h>
#include <stdio.h>

#include "elina_box.h"

#ifdef __cplusplus
extern "C" {
#endif

struct elina_box_t {
  double * inf;
  double * sup;
  size_t intdim;
  size_t realdim;
};

elina_manager_t* elina_box_manager_alloc(void);

typedef struct elina_box_internal_t {
  elina_interval_t * bound_linexpr_internal_itv;
  elina_interval_t * bound_linexpr_internal_itv2;
  elina_interval_t * bound_linexpr_itv;
  elina_interval_t * meet_lincons_internal_itv;
  elina_interval_t * meet_lincons_internal_itv2;
  elina_interval_t * meet_lincons_internal_itv3;
  elina_scalar_t* meet_lincons_internal_bound;
} elina_box_internal_t;

void elina_box_internal_init(elina_box_internal_t* intern);
void elina_box_internal_clear(elina_box_internal_t* intern);

elina_box_internal_t* elina_box_internal_alloc(void);
void elina_box_internal_free(elina_box_internal_t* intern);

/* Initializes some fields of pk from manager */
static inline elina_box_internal_t* elina_box_init_from_manager(elina_manager_t* man, elina_funid_t funid)
{
  elina_box_internal_t* itv = (elina_box_internal_t*)man->internal;
  return itv;
}

#ifdef __cplusplus
}
#endif

#endif


text:
<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "event_sponsor".
 *
 * @property integer $id
 * @property Events  $event_id
 * @property User    $user_id
 */
class Sponsor extends \yii\db\ActiveRecord {
	/**
	 * @inheritdoc
	 */
	public static function tableName()
	{
		return 'event_sponsor';
	}

	/**
	 * @inheritdoc
	 */
	public function attributeLabels()
	{
		return [
			'id'       => 'ID',
			'event_id' => 'Event ID',
			'user_id'  => 'User ID',
		];
	}

	/**
	 * @return \yii\db\ActiveQuery
	 */
	public function getUser()
	{
		return User::findOne(['id' => $this->user_id]);
	}

	/**
	 * @return \yii\db\ActiveQuery
	 */
	public function getEvent()
	{
		return $this->hasOne(Events::className(), ['id' => 'event_id']);
	}
}


text:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Specify the hostname and port for the NameNode -->

<configuration>
  <property>
    <name>fs.default.name</name>
    <value>hdfs://hadoop-namenode:9000</value>
  </property>
  <property>
    <name>fs.inmemory.size.mb</name>
    <value>200</value>
  </property>
  <property>
    <name>io.sort.factor</name>
    <value>100</value>
  </property>
  <property>
    <name>io.sort.mb</name>
    <value>200</value>
  </property>
  <property>
    <name>io.file.buffer.size</name>
    <value>131072</value>
  </property>
</configuration>


text:
from typing import List, Callable

from adbook.orm.collection_manager import CollectionManager, Collection
from adbook.orm.entities.person import Person

class PersonCollection(Collection):
    """
    Default person collection
    """

    name = "persons"

    def __init__(self, manager: CollectionManager):
        super().__init__(manager)
        Person._manager = manager

    def __iter__(self):
        for item in self.items:
            yield item

    def __len__(self):
        return len(self.items)

    def create(self, **kwargs) -> Person:
        return Person(**kwargs)

    def find_by_name(self, first_name: str = "", last_name: str = "") -> List[Person]:
        return self.manager.persons.find(lambda p: p.first_name == first_name or
                                                   p.last_name == last_name)

    def find_by_email(self, email: str) -> List[Person]:
        return self.manager.persons.find(self._email_compare(email))

    @staticmethod
    def _email_compare(email: str) -> Callable[[Person], bool]:
        def is_exists_email(email: str, emails: List[str]) -> bool:
            for mail in emails:
                if mail.startswith(email):
                    return True

            return False

        return lambda p: is_exists_email(email, p.emails)


text:
layout: post
title: Comment system is added now
categories: [General]
tags: [SilMOON]
fullview: true
---

Just added a comment system using Utterances. Welcome to leave your thoughts about my blogs!<br>


text:
Pattern: Duplicate key

Issue: -

## Description

Prevents defining duplicate keys in object literals and classes.

## Further Reading

* [CoffeeLint - duplicate_key](http://www.coffeelint.org/#options)


text:
'use strict';

const encodings = Symbol('encodings');

class EncodingHelper {

  static get [Symbol.species]() {
    this[encodings] = new Map([['BASE64', 'base64'], ['BINARY', 'binary'], ['HEX', 'hex'], ['UTF8', 'utf8']]);
    return this;
  }

  static isValid(encoding) {
    return this[encodings].has(encoding.toUpperCase());
  }
}

module.exports = EncodingHelper;


text: This is from the HMVC module page.


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

"""This script is used to synthesize generated parts of this library."""

import synthtool as s
import synthtool.gcp as gcp
import logging

logging.basicConfig(level=logging.DEBUG)

client_library_version = "0.1.0"

gapic = gcp.GAPICGenerator()
common = gcp.CommonTemplates()
version = "v1beta1"

# ----------------------------------------------------------------------------
# Generate kms GAPIC layer
# ----------------------------------------------------------------------------
library = gapic.py_library(
    "kms", version, config_path="artman_cloudkms.yaml", artman_output_name="kms-v1"
)

s.move(library, excludes=["README.rst", "setup.py", "nox*.py", "docs/**/*"])

# ----------------------------------------------------------------------------
# Add templated files
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
s.move(templated_files)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)


text:
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/lib/errno.C $                                             */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2017,2021                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
#include <errno.h>
#include <map>

const char * ErrnoToString( int i_errno )
{
    //  Map of errnos to string.
    //  Kept within function for deferred malloc and more error handling
    //      Otherwise the map is malloc'd before memory is initialized
    //  Note: All keys and values are preceded with a '-', this is because the
    //        the errno's will be set to 2's complement when there's an error.
    static const std::map<int, const char*> ErrnoToStringMap =
    {
        { -ENOENT     , "-ENOENT"},
        { -EIO        , "-EIO"},
        { -ENXIO      , "-ENXIO"},
        { -ENOEXEC    , "-ENOEXEC"},
        { -EBADF      , "-EBADF"},
        { -EAGAIN     , "-EAGAIN"},
        { -EACCES     , "-EACCES"},
        { -EFAULT     , "-EFAULT"},
        { -EINVAL     , "-EINVAL"},
        { -ENFILE     , "-ENFILE"},
        { -EDEADLK    , "-EDEADLK"},
        { -ETIME      , "-ETIME"},
        { -EALREADY   , "-EALREADY"},
        { -EWOULDBLOCK, "-EWOULDBLOCK"},
    };

    if (ErrnoToStringMap.count(i_errno) > 0)
    {
        return ErrnoToStringMap.at(i_errno);
    }
    else
    {
        return "UNKNOWN";
    }
}


text: DRILLDOWN_CACHE_PREFIX = "drilldown"


text:
not_found_base = 'Could Not Found'
exist_base = 'Already Exists'

def key_error(key):
    return "KeyError: '{}'".format(key)

def no_body():
    return 'No Body'

def not_found(key, value):
    return '{} {} [{}]'.format(not_found_base, key, value)

def missing(name):
    return '{} Missing'.format(name)

def exist(key, value):
    return '{} [{}] {}'.format(key, value, exist_base)

def bad_format(error):
    return 'Bad Format [{}]'.format(error)

def unauthorized():
    return 'No Authentication Header'

def invalid_token():
    return 'Invalid Token'

def no_update():
    return 'Nothing to update'

def must_int(name):
    return '{} must be int'.format(name)

def no_auth():
    return 'No permission to operate. Please ask Administrator for details.'


text:
from dep import *
from dep.helpers import *

def command_status(args):
    tree = dependency.Tree()
    tree.status_dependency_tree(vars(args))

parser_status = opts.subparsers.add_parser("status",
                                           help="Show dependency status for all source repositories",
                                           description="Show dependency status for all source repositories.")
parser_status.add_argument("-s", "--short", dest="status_short", action="store_true",
                           help="Show short status only (default)")
parser_status.add_argument("--long", dest="status_long", action="store_true",
                           help="Show long status")
parser_status.add_argument("-d", "--describe", dest="status_describe", action="store_true",
                           help="Status output describes commits using tags (default on master)")
parser_status.add_argument("--commit", dest="status_commit", action="store_true",
                           help="Status shows full and unique commit (default on non-master)")
parser_status.add_argument("--exit", dest="status_exit", action="store_true",
                           help="Exit 0 if clean (blank) for M, Branch or Commit. Exit 1 otherwise.")
parser_status.add_argument("--exit-only", dest="status_exit_only", action="store_true",
                           help="Only set exit status, no other output.")
parser_status.add_argument("--push-clean", dest="status_push_clean", action="store_true",
                           help="Consider push clean (value 0) if exit status required.")
parser_status.add_argument("--pull-clean", dest="status_pull_clean", action="store_true",
                           help="Consider pull clean (value 0) if exit status required.")
add_list_arguments(parser_status)
parser_status.set_defaults(func=command_status)


text:
var util = require('util');
var dom = require('./dom');

var root;

module.exports = Tree;

function Tree() {
    this.element = root;
    this.browers = {};
}

Tree.attachTo = function (container) {
    root = container;
};

Tree.prototype.reset = function () {
    Object.keys(this.browsers)
        .forEach(function (browser) {
            this.browsers[browser].reset();
        }, this);
};

Tree.prototype.getBrowser = function (id) {
    return this.browsers[id] || null;
};

Tree.prototype.addBrowser = function (browserId, browserName, specs) {
    var existing = this.browsers[browser.id];
    if (!existing) {
        this.browsers[browser.id] = new Browser(browser.id, browser.name, specs, this);
    } else {
        existing.updateSpecs(specs);
    }
};

function TreeNode(specs, parent, type) {
    this.parent = parent;
    this.suites = {};
    this.specs = {};

    this._createElement(type);

    this.updateSpecs(specs);
}

TreeNode.prototype._createElement = function (type) {
    this.textElement = dom.span();
    this.element = dom.ul();

    var listItem = dom.li('closed', [
        dom.div([
            dom.i('icon-' + type),
            this.textElement
        ]),
        this.element
    ]);
    dom.on(listItem, {
        'click': function (e) {
            e.stopPropagation();

            var classes = e.currentTarget.classList;
            classes.toggle('closed');
        }
    });
    this.parent.element.appendChild(listItem);
};

TreeNode.prototype._updateText = function (text) {
    this.textElement.innerHTML = text;
}

TreeNode.prototype.updateSpecs = function (specs) {
    Object.keys(specs)
        .forEach(function (key) {
            if (key === '_') {
                this._updateSpecs(specs[key]);
            } else {
                this._updateSuite(key, specs[key]);
            }
        }, this);
};

TreeNode.prototype._updateSpecs = function (specs) {
    specs.forEach(function (spec) {
        var existing = this.specs[spec];
        if (!existing) {
            this.specs[spec] = new Spec(spec, this);
        }
    }, this);
};

TreeNode.prototype._updateSuite = function (suiteName, suite) {
    var existing = this.suites[suiteName];
    if (existing) {
        existing.updateSpecs(suite);
    } else {
        existing = new Suite(suiteName, suite, this);
    }
};

TreeNode.prototype.reset = function () {
    // body...
    this.resetStatus();

    Object.keys(this.suites)
        .concat(Object.keys(this.specs))
        .forEach(function (child) {
            child.reset();
        }, this);
};

TreeNode.prototype.resetStatus = function () {
    // body...
};

function Browser(id, name, specs, tree) {
    TreeNode.call(this, specs, tree, 'browser');

    this.id = id;
    this.name = name;

    this._updateText(name);
}
util.inherits(Browser, TreeNode);

function Suite(name, specs, parent) {
    TreeNode.call(this, specs, parent, 'suite');

    this.name = name;
    this._updateText(name);
}
util.inherits(Suite, TreeNode);

function Spec(name, parent) {
    this.name = name;
    this.parent = parent;
    this._createElement();
}

Spec.prototype._createElement = function () {
    this.element = dom.li([
        dom.i('icon-spec'),
        this.name
    ]);

    dom.on(this.element, {
        'click': function (e) {
            e.stopPropagation();

            e.currentTarget.classList.toggle('selected');
        }
    });

    this.parent.element.appendChild(this.element);
};

Spec.prototype.reset = function () {
    // Reset status
};


text:
--
-- THIS SCRIPT MUST BE REGISTERED BEFORE !!!
--

-- write or not files...
local bWriteFiles = false

-- separator
local sep = ";"

-- begin/end trigger...
local bTriggerBegin = false
local bTriggerEnd 	= false
local bProcessBegan	= false

local aListUse = {
	normal 			= { begin = function() return (a(gameData.p1.attack, "b") > 0) end, end_ = function() return (a(gameData.p1.attack, "b") == 0) 	end	},
	dashForward 	= { begin = function() return (a(gameData.p1.state, "b") == 4) end, end_ = function() return (a(gameData.p1.state, "b") ~= 4) 	end	},
	dashBackward 	= { begin = function() return (a(gameData.p1.state, "b") == 5) end, end_ = function() return (a(gameData.p1.state, "b") ~= 5) 	end	},

	jumpNeutral	 	= { begin = function() return (a(gameData.p1.state, "b") == 12) end,
						end_ = function() return (a(gameData.p1.pos_y, "ws") > 0) end },
						--end_ = function() return (a(gameData.p1.jumpRecoveryTrigger1, "b") == 2 and a(gameData.p1.jumpRecoveryTrigger2, "b") == 3) 	end	},
	jumpForward	 	= { begin = function() return (a(gameData.p1.state, "b") == 12) end,
						end_ = function() return (a(gameData.p1.pos_y, "ws") > 0) end },
						--end_ = function() return (a(gameData.p1.jumpRecoveryTrigger1, "b") == 2 and a(gameData.p1.jumpRecoveryTrigger2, "b") == 3)	end	},
	jumpBackward 	= { begin = function() return (a(gameData.p1.state, "b") == 12) end,
						end_ = function() return (a(gameData.p1.pos_y, "ws") > 0) end },
						--end_ = function() return (a(gameData.p1.jumpRecoveryTrigger1, "b") == 2 and a(gameData.p1.jumpRecoveryTrigger2, "b") == 3) 	end	},

	superjumpNeutral	= { begin = function() return (a(gameData.p1.state, "b") == 13) end,
						end_ = function() return (a(gameData.p1.pos_y, "ws") > 0) end },
						--end_ = function() return (a(gameData.p1.jumpRecoveryTrigger1, "b") == 2 and a(gameData.p1.jumpRecoveryTrigger2, "b") == 3) 	end	},
	superjumpForward 	= { begin = function() return (a(gameData.p1.state, "b") == 13) end,
						end_ = function() return (a(gameData.p1.pos_y, "ws") > 0) end },
						--end_ = function() return (a(gameData.p1.jumpRecoveryTrigger1, "b") == 2 and a(gameData.p1.jumpRecoveryTrigger2, "b") == 3) 	end	},
	superjumpBackward	= { begin = function() return (a(gameData.p1.state, "b") == 13) end,
						end_ = function() return (a(gameData.p1.pos_y, "ws") > 0) end },
						--end_ = function() return (a(gameData.p1.jumpRecoveryTrigger1, "b") == 2 and a(gameData.p1.jumpRecoveryTrigger2, "b") == 3) 	end	},

	-- P1 sa bar MUST BE empty first!!!
	wakeUp 			= { begin = function() return (a(gameData.p1.saBarContent, "b") > 0) end, end_ = function() return (a(gameData.p1.attack, "b") == 0) 	end	}, -- makoto state --> 78, others 5
	wakeUpQuickRoll = { begin = function() return (a(gameData.p1.saBarContent, "b") > 0) end, end_ = function() return (a(gameData.p1.attack, "b") == 0) 	end	},

	combo		 	= { begin = function() return (a(gameData.p1.state, "b") > 0)  end, end_ = function() return (a(gameData.p1.state, "b") == 0 and a(gameData.p2.state, "b") == 0) 	end	},
}

sScriptUse = "normal"

iMiscListIndexToRead = 12
sMiscIndexPrefix = "line_"

aMiscList = {

line_1 = "dashForward",
line_2 = "dashBackward",
line_3 = "jumpBackward",
line_4 = "jumpNeutral",
line_5 = "jumpForward",
line_6 = "superjumpBackward",
line_7 = "superjumpNeutral",
line_8 = "superjumpForward",

-- recovery cancelled by jump...
line_9 = "dashForward",
line_10 = "dashBackward",

line_11 = "wakeUp",
line_12 = "wakeUpQuickRoll",
}

print(aMiscList[sMiscIndexPrefix..iMiscListIndexToRead])

iSimpleCounter = 0
sResultToWriteInFile = ""

-- end trigger...

hb_currentFrame = 0
hb_previousFrame = 0
hb_p1Atk_counter = 0
local prevFileName = "" -- previous frame
local prevDataMame = "" -- previous frame data
local antepenultianFileName = "" -- antepenultian frame
local iResetIn = 2 -- countdown to continue to take 2 screenshot event after p1Atk back to 0...

-- get coord hitbox data...
function getRealHitboxCoord(hb_addr)
	local left   = memory.readwordsigned(hb_addr)
	local right  = memory.readwordsigned(hb_addr + 2)
	local bottom = memory.readwordsigned(hb_addr + 4)
	local top    = memory.readwordsigned(hb_addr + 6)

	--print("scr : coord read at "..h(hb_addr).." --> "..left.." "..right.." "..top.." "..bottom)

	return { left = left, right = right, top = top, bottom = bottom }
end

-- get all datas for hitbox addr...
function getHitboxData(base, type)
	local obj = {}

	obj.type			= type
	obj.facing_dir		= memory.readbyte(base + 0xA)
	obj.opponent_dir	= memory.readbyte(base + 0xB)
	obj.pos_x			= memory.readwordsigned(base + 0x64)
	obj.pos_y			= memory.readwordsigned(base + 0x68)
	obj.anim_frame		= memory.readwordsigned(base + 0x21A)

	obj.p_hb = {}
	obj.a_hb = {}
	obj.v_hb = {}

	--print("scr : P addr : "..h(base + 0x2A0).." --> "..h(base + 0x2A0))
	--print("scr : A addr : "..h(base + 0x2C8).." --> "..h(base + 0x2C8))
	--print("scr : V addr : "..h(base + 0x2A8).." --> "..h(base + 0x2A8))

	-- passive hitboxes...
	local hb_addr = memory.readdword(base + 0x2A0)

	for i = 1, 4 do
		obj.p_hb[i] = getRealHitboxCoord(hb_addr)
		hb_addr = hb_addr + 8
		--print(type.." "..i.." --> "..obj.p_hb[i].left.." "..obj.p_hb[i].right.." "..obj.p_hb[i].top.." "..obj.p_hb[i].bottom)
	end

	-- active hitboxes...
	local hb_addr = memory.readdword(base + 0x2C8)

	for i = 1, 4 do
		obj.a_hb[i] = getRealHitboxCoord(hb_addr)
		hb_addr = hb_addr + 8

		--print(type.." "..i.." --> "..obj.a_hb[i].left.." "..obj.a_hb[i].right.." "..obj.a_hb[i].top.." "..obj.a_hb[i].bottom)
	end

	-- vulnerability hitboxes...
	local hb_addr = memory.readdword(base + 0x2A8)

	for i = 1, 4 do
		obj.v_hb[i] = getRealHitboxCoord(hb_addr)
		hb_addr = hb_addr + 8

		--print(type.." "..i.." --> "..obj.v_hb[i].left.." "..obj.v_hb[i].right.." "..obj.v_hb[i].top.." "..obj.v_hb[i].bottom)
	end

	return obj
end

--misc objects hitboxes...
function getObjectsHitboxesCoord()
	local obj_index
	local obj_addr
	local p_hb_addr
	local a_hb_addr

	local objects = {}

	-- This function reads all game objects other than the two player characters.
	-- This includes all projectiles and even Yang's Seiei-Enbu shadows.

	-- The game uses the same structure all over the place and groups them
	-- into lists with each element containing an index to the next element
	-- in that list. An index of -1 signals the end of the list.

	-- I believe there are at least 7 lists (0-6) but it seems everything we need
	-- (and lots we don't) is in list 3.
	local list = 3

	num_misc_objs = 1
	obj_index = memory.readwordsigned(0x02068A96 + (list * 2))

	while num_misc_objs <= 30 and obj_index ~= -1 do
		obj_addr = 0x02028990 + (obj_index * 0x800)

		-- I don't really know how to tell different game objects types apart yet so
		-- just read everything that has non-zero hitbox addresses. Seems to
		-- work fine...
		p_hb_addr = memory.readdword(obj_addr + 0x2A0)
		a_hb_addr = memory.readdword(obj_addr + 0x2C8)
		v_hb_addr = memory.readdword(obj_addr + 0x2A8) -- for test...

		if p_hb_addr ~= 0 and a_hb_addr ~= 0 then
			local data = getHitboxData(obj_addr, "Object_"..num_misc_objs)
			objects[num_misc_objs] = data
			num_misc_objs = num_misc_objs + 1

			--print("scr : obj_addr : "..h(obj_addr))
			--print(data.p_hb[2].left.." "..data.p_hb[2].right.." "..data.p_hb[2].top.." "..data.p_hb[2].bottom)
		end

		-- Get the index to the next object in this list.
		obj_index = memory.readwordsigned(obj_addr + 0x1C)
	end

	return objects
end

-- retrieve hitboxes coord...
function getHitboxCoord(player, type)
	local hb = {}
	local addr = 0x0000

	if type == "P" then
		addr = player.hb_passive_base_address
	elseif type == "A" then
		addr = player.hb_active_base_address
	elseif type == "V" then
		addr = player.hb_vulnerability_pointer
	elseif type == "O" then
		addr = player
	end

	local hb_addr = memory.readdword(addr)
	--print("search at "..h(addr).." --> "..h(hb_addr))

	for i = 1, 4 do
		local left   = memory.readwordsigned(hb_addr)
		local right  = memory.readwordsigned(hb_addr + 2)
		local bottom = memory.readwordsigned(hb_addr + 4)
		local top    = memory.readwordsigned(hb_addr + 6)

		hb[i] = { left = left, right = right, top = top, bottom = bottom }

		--[[
		if type == "V" then
			print(" --> value read at "..h(addr).." = "..left)
			print(" --> value read at "..h(addr + 2).." = "..top)
			print(" --> value read at "..h(addr + 4).." = "..right)
			print(" --> value read at "..h(addr + 6).." = "..bottom)
		end
		--]]

		hb_addr = hb_addr + 8
	end

	--if type == "O" then print(hb) end

	return hb
end

-- take a table of 4 hitbox coords and return a string with these data concatened...
function formatHitboxString(hb, bOnScreen)
	local str = ""

	for i = 1, 4 do
		if bOnScreen ~= nil then
			str = str.."\n"..bOnScreen.." "..i.." : "..hb[i].left..","..hb[i].right..","..hb[i].top..","..hb[i].bottom
		else
			str = str..sep..hb[i].left..","..hb[i].right..","..hb[i].top..","..hb[i].bottom
		end
	end

	return string.sub(str, 2)
end

-- take a complete object and return a string with these data concatened...
function formatHitboxStringFromData(hb, bOnScreen)
	local str = "#BEGIN#"

	for iObj, oObj in pairs(hb) do
		for iIndex, oVal in pairs(oObj) do
			if iIndex == "p_hb" or iIndex == "a_hb" or iIndex == "v_hb" then
				str = str.."\n"..iIndex..":"

				for i = 1, 4 do
					str = str..oVal[i].left..","..oVal[i].right..","..oVal[i].top..","..oVal[i].bottom..sep
				end

				str = string.sub(str, 0, -2)
			else
				str = str.."\n"..iIndex..":"..oVal
			end
		end
	end

	str = str.."\n".."#END#"

	--print(str)

	return str
end

function fbaScreenshot()
	--gui.clearuncommitted()

	-- only fba, mame crash while screenshot...
	if fba or mame then
		-- avoid doing process several times...
		hb_currentFrame = emu.framecount()

		if hb_currentFrame ~= hb_previousFrame then

			local efc = emu.framecount()
			local fileName_Fba = ""
			local data_Mame = ""

			local p1Atk 	= a(gameData.p1.attack, "b")
			local p1State 	= a(gameData.p1.state, "b")
			local p1pos_x 	= a(gameData.p1.pos_x, "ws")
			local p1pos_y 	= a(gameData.p1.pos_y, "ws")
			local p1Frame 	= a(gameData.p1.anim_frame, "w")
			local p2Atk 	= a(gameData.p2.attack, "b")
			local p2State 	= a(gameData.p2.state, "b")
			local p2pos_x 	= a(gameData.p2.pos_x, "ws")
			local p2pos_y 	= a(gameData.p2.pos_y, "ws")
			local p2Frame 	= a(gameData.p2.anim_frame, "w")
			local p1activeThrow		= a(gameData.p1.activeThrow, "b")
			local p2activeThrow		= a(gameData.p2.activeThrow, "b")
			local p1saBarContent	= a(gameData.p1.saBarContent, "b")
			local p2saBarContent	= a(gameData.p2.saBarContent, "b")

			local p1jumpRecoveryTrigger1	= a(gameData.p1.jumpRecoveryTrigger1, "b")
			local p1jumpRecoveryTrigger2	= a(gameData.p1.jumpRecoveryTrigger2, "b")

			local gamePhase = a(gameData.game.game_phase, "b")
			local screen_center_x = a(gameData.game.screen_center_x, "ws")
			local screen_center_y = a(gameData.game.screen_center_y, "ws")
			local superfreeze = a(gameData.game.superfreeze, "b")

			if bWriteFiles == false then
				sScriptUse = aMiscList[sMiscIndexPrefix..iMiscListIndexToRead]
			end

			bTriggerBegin = aListUse[sScriptUse].begin()
			bTriggerEnd = aListUse[sScriptUse].end_() and iSimpleCounter > 3

			if bProcessBegan == false and bTriggerBegin then
				bProcessBegan = true
			end

			if bProcessBegan then
				iSimpleCounter = iSimpleCounter + 1
				print(iSimpleCounter.." : "..tostring(bTriggerEnd).." / "..tostring((iSimpleCounter > 3)))
			end

			if bTriggerEnd then
				if p1State == 12 then sCancel = "CancelledRecovery" else sCancel = "" end
				print(sScriptUse..sCancel.." : "..(iSimpleCounter - 1).." frames")
				sResultToWriteInFile = sScriptUse..sCancel..":"..(iSimpleCounter - 1).."\n"
				wrFile(sResultToWriteInFile, a(chars.p1addr, "b").."_misc_frames_data.txt")

				if bWriteFiles == false then iMiscListIndexToRead = iMiscListIndexToRead + 1 end

				bProcessBegan = false
				iSimpleCounter = 0
			end

			--print(tostring(bTriggerBegin).." / "..tostring(bTriggerEnd).." / "..tostring(bProcessBegan))

			local p1_hb_P = getHitboxCoord(gameData.p1, "P")
			local p1_hb_A = getHitboxCoord(gameData.p1, "A")
			local p1_hb_V = getHitboxCoord(gameData.p1, "V")

			local p2_hb_P = getHitboxCoord(gameData.p2, "P")
			local p2_hb_A = getHitboxCoord(gameData.p2, "A")
			local p2_hb_V = getHitboxCoord(gameData.p2, "V")

			data_Mame = 				 "ScriptUse:"..sScriptUse
			data_Mame = data_Mame.."\n".."P1:"..a(chars.p1addr, "b")
			data_Mame = data_Mame.."\n".."P2:"..a(chars.p2addr, "b")
			data_Mame = data_Mame.."\n".."screen_center_x:"..screen_center_x
			data_Mame = data_Mame.."\n".."screen_center_y:"..screen_center_y
			data_Mame = data_Mame.."\n".."superfreeze:"..superfreeze
			data_Mame = data_Mame.."\n".."p1Atk:"..p1Atk
			data_Mame = data_Mame.."\n".."p2Atk:"..p2Atk
			data_Mame = data_Mame.."\n".."p1State:"..p1State
			data_Mame = data_Mame.."\n".."p2State:"..p2State
			data_Mame = data_Mame.."\n".."p1activeThrow:"..p1activeThrow
			data_Mame = data_Mame.."\n".."p2activeThrow:"..p2activeThrow
			data_Mame = data_Mame.."\n".."p1saBarContent:"..p1saBarContent
			data_Mame = data_Mame.."\n".."p2saBarContent:"..p2saBarContent
			data_Mame = data_Mame.."\n".."p1jumpRecoveryTrigger1:"..p1jumpRecoveryTrigger1
			data_Mame = data_Mame.."\n".."p1jumpRecoveryTrigger2:"..p1jumpRecoveryTrigger2

			data_Mame = data_Mame.."\n"..formatHitboxStringFromData({getHitboxData(gameData.p1.hb_base_address, "P1")})
			data_Mame = data_Mame.."\n"..formatHitboxStringFromData({getHitboxData(gameData.p2.hb_base_address, "P2")})
			data_Mame = data_Mame.."\n"..formatHitboxStringFromData(getObjectsHitboxesCoord())

			--print(data_Mame)

			-- format the future filename...
			local prefix = a(chars.p1addr, "b")..sep..a(chars.p2addr, "b")

			fileName_Fba = fileName_Fba..sScriptUse
			fileName_Fba = fileName_Fba..sep..screen_center_x
			fileName_Fba = fileName_Fba..sep..screen_center_y
			fileName_Fba = fileName_Fba..sep..p1pos_x
			fileName_Fba = fileName_Fba..sep..p1pos_y
			fileName_Fba = fileName_Fba..sep..p2pos_x
			fileName_Fba = fileName_Fba..sep..p2pos_y
			fileName_Fba = fileName_Fba..sep..superfreeze
			fileName_Fba = fileName_Fba..sep.."p1_hb_P"..sep..formatHitboxString(p1_hb_P)..sep.."p1_hb_P"

			if fba then
				-- fba, screenshot function...

				local bTakeScreenshot = false

				-- for fba screenshot function :
				-- current frame screenshot must be done next frame, but correct frame data are those from the current frame...

				if bTriggerBegin or bProcessBegan then
					-- increment counter...
					hb_p1Atk_counter = hb_p1Atk_counter + 1

					-- only take screenshot after 2 incrementations...
					if hb_p1Atk_counter > 2 then
						bTakeScreenshot = true
					end
				elseif bTriggerEnd then
					-- verify counter to get the last two screenshot after p1Atk back to 0...
					if hb_p1Atk_counter > 2 and iResetIn > 0 then
						bTakeScreenshot = true

						iResetIn = iResetIn - 1
						hb_p1Atk_counter = hb_p1Atk_counter + 1
					else
						hb_p1Atk_counter = 0
						iResetIn = 2
					end
				else
					--print("???")
				end

				if bTakeScreenshot == true then
					--print(hb_p1Atk_counter.." --> "..prefix..sep..string.format("%03s", (hb_p1Atk_counter - 2))..sep..antepenultianFileName)
					if bWriteFiles then scr(prefix..sep..string.format("%03s", (hb_p1Atk_counter - 2))..sep..antepenultianFileName) end
				elseif hb_p1Atk_counter == 2 then
					-- process begin, also store previous data for frame 0...
					--print(hb_p1Atk_counter.." --> "..prefix..sep..string.format("%03s", (hb_p1Atk_counter - 2))..sep..antepenultianFileName)
					if bWriteFiles then scr(prefix..sep..string.format("%03s", (hb_p1Atk_counter - 2))..sep..antepenultianFileName) end
				end

				antepenultianFileName = prevFileName
				prevFileName = fileName_Fba
			else
				-- mame, frame data stored in file...
				if bTriggerBegin or bProcessBegan then
					-- if process begin, also store previous data for frame 0...
					if hb_p1Atk_counter == 0 then
						local finalNameMame = prefix..sep..string.format("%03s", hb_p1Atk_counter)..sep..prevFileName
						--print(finalNameMame)

						-- for mame, store all data in a file...
						if bWriteFiles then wrFile("frame:"..string.format("%03s", hb_p1Atk_counter).."\n"..prevDataMame, finalNameMame..".frame") end
						displayValue("File written : "..hb_p1Atk_counter, 170, 68, 0x99ff99ff)
					end

					-- increment counter...
					hb_p1Atk_counter = hb_p1Atk_counter + 1

					local finalNameMame = prefix..sep..string.format("%03s", hb_p1Atk_counter)..sep..fileName_Fba
					--print(finalNameMame)

					-- for mame, store all data in a file...
					if bWriteFiles then wrFile("frame:"..string.format("%03s", hb_p1Atk_counter).."\n"..data_Mame, finalNameMame..".frame") end
					displayValue("File written : "..hb_p1Atk_counter, 170, 68, 0x99ff99ff)
				elseif bTriggerEnd then
					hb_p1Atk_counter = 0
				else
					--print("???")
				end

				prevDataMame = data_Mame
				prevFileName = fileName_Fba
			end

			hb_previousFrame = hb_currentFrame

			----[[
			if bWriteFiles == false or mame then
				displayValue(sScriptUse, 170, 38, 0xff0000ff)
				displayValue(sScriptUse, 170, 38, 0xff0000ff)
				displayValue("bTriggerBegin : "..tostring(bTriggerBegin), 	170, 48, 0xff9999ff)
				displayValue("bTriggerEnd   : "..tostring(bTriggerEnd), 	170, 58, 0xff9999ff)

				displayValue("screen_center_x : "..screen_center_x, 3, 1, 0x00ffffff)
				displayValue("screen_center_y : "..screen_center_y, 3, 9, 0x00ffffff)

				displayValue("superfreeze : "..superfreeze, 170, 0, 0x00ffffff)
				displayValue(emu.framecount(), 250, 0, 0x00ffffff)

				displayValue("P1 Atk   : "..p1Atk, 			3, 50, 0xffff00ff)
				displayValue("P1 State : "..p1State, 		3, 58, 0xffff00ff)
				displayValue("P1 pos X : "..p1pos_x, 		3, 70, 0xffff00ff)
				displayValue("P1 pos Y : "..p1pos_y,		3, 78, 0xffff00ff)
				displayValue("P1 frame : "..p1Frame,		3, 90, 0xffff00ff)

				displayValue(sp(p2pos_x, 4).." : P2 pos X", 320, 50, 0xff00ffff)
				displayValue(sp(p2pos_y, 4).." : P2 pos Y",	320, 58, 0xff00ffff)
				displayValue(sp(p2Atk, 4).." : P2 Atk", 	320, 70, 0xff00ffff)
				displayValue(sp(p2State, 4).." : P2 State", 320, 78, 0xff00ffff)
				displayValue(sp(p2Frame, 4).." : P2 frame", 320, 98, 0xff00ffff)

				--displayValue(formatHitboxString(p1_hb_P, "HB P "), 160, 70, 0x00ffffff)
			end
		end

		--]]

		--[[

		displayValue(formatHitboxString(p1_hb_P, "HB P "), 285, 50, 0x00ffffff)
		displayValue(formatHitboxString(p1_hb_A, "HB A "), 285, 85, 0x00ff00ff)
		displayValue(formatHitboxString(p1_hb_V, "HB V "), 285, 120, 0xff0000ff)

		--]]
	end
end