text:
using Xunit;
using System;
using System.Xml;

namespace XmlDocumentTests.XmlNodeTests
{
    public class InsertBeforeTests
    {
        [Fact]
        public static void NodeWithOneChild()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("");

            var firstChild = xmlDocument.DocumentElement.FirstChild;
            var newNode = xmlDocument.CreateElement("newElem");
            var returned = xmlDocument.DocumentElement.InsertBefore(newNode, firstChild);

            Assert.Same(newNode, returned);
            Assert.Same(xmlDocument.DocumentElement.ChildNodes[0], newNode);
            Assert.Same(xmlDocument.DocumentElement.ChildNodes[1], firstChild);
        }

        [Fact]
        public static void NodeWithNoChild()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("");
            var root = xmlDocument.DocumentElement;

            Assert.False(root.HasChildNodes);

            var newNode = xmlDocument.CreateElement("elem");
            var result = root.InsertBefore(newNode, null);

            Assert.Same(newNode, result);
            Assert.Equal(1, root.ChildNodes.Count);
            Assert.Same(result, root.ChildNodes[0]);
        }

        [Fact]
        public static void RemoveAndInsert()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("");
            var root = xmlDocument.DocumentElement;

            root.RemoveChild(root.FirstChild);
            Assert.False(root.HasChildNodes);

            var newNode = xmlDocument.CreateElement("elem");
            var result = root.InsertBefore(newNode, null);

            Assert.Same(newNode, result);
            Assert.Equal(1, root.ChildNodes.Count);
            Assert.Same(result, root.ChildNodes[0]);
        }

        [Fact]
        public static void InsertNewNodeToElement()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("");
            var root = xmlDocument.DocumentElement;
            var newNode = xmlDocument.CreateProcessingInstruction("PI", "pi data");

            root.InsertBefore(newNode, root.FirstChild);

            Assert.Equal(2, root.ChildNodes.Count);
        }

        [Fact]
        public static void InsertCDataNodeToDocumentNode()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("");
            var cDataSection = xmlDocument.CreateCDataSection("data");

            Assert.Throws<InvalidOperationException>(() => xmlDocument.InsertBefore(cDataSection, null));
        }

        [Fact]
        public static void InsertCDataNodeToDocumentFragment()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("");
            var docFragment = xmlDocument.CreateDocumentFragment();
            var cDataSection = xmlDocument.CreateCDataSection("data");

            Assert.Equal(0, docFragment.ChildNodes.Count);
            docFragment.InsertBefore(cDataSection, null);
            Assert.Equal(1, docFragment.ChildNodes.Count);
        }

        [Fact]
        public static void InsertCDataNodeToAnAttributeNode()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("");
            var attribute = xmlDocument.DocumentElement.Attributes[0];
            var cDataSection = xmlDocument.CreateCDataSection("data");

            Assert.Equal(1, attribute.ChildNodes.Count);
            Assert.Throws<InvalidOperationException>(() => attribute.InsertBefore(cDataSection, null));
            Assert.Equal(1, attribute.ChildNodes.Count);
        }

        [Fact]
        public static void InsertCDataToElementNode()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("");
            var node = xmlDocument.DocumentElement.FirstChild;
            var cDataSection = xmlDocument.CreateCDataSection("data");

            Assert.Equal(0, node.ChildNodes.Count);
            Assert.Same(cDataSection, node.InsertBefore(cDataSection, null));
            Assert.Equal(1, node.ChildNodes.Count);
        }

        [Fact]
        public static void InsertChildNodeToItself()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("");
            var node = xmlDocument.DocumentElement.FirstChild;

            var outerXmlBefore = xmlDocument.OuterXml;
            var result = xmlDocument.DocumentElement.InsertBefore(node, node);

            Assert.Equal(1, xmlDocument.DocumentElement.ChildNodes.Count);
            Assert.Same(node, result);
            Assert.Equal(1, xmlDocument.DocumentElement.ChildNodes.Count);

            Assert.Equal(outerXmlBefore, xmlDocument.OuterXml);
        }

        [Fact]
        public static void InsertCommentNodeToDocumentFragment()
        {
            var xmlDocument = new XmlDocument();
            var documentFragment = xmlDocument.CreateDocumentFragment();
            var node = xmlDocument.CreateComment("some comment");

            Assert.Equal(0, documentFragment.ChildNodes.Count);

            var result = documentFragment.InsertBefore(node, null);

            Assert.Same(node, result);
            Assert.Equal(1, documentFragment.ChildNodes.Count);
        }

        [Fact]
        public static void InsertCommentNodeToDocument()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("<root/>");

            var node = xmlDocument.CreateComment("some comment");

            Assert.Equal(0, xmlDocument.DocumentElement.ChildNodes.Count);

            var result = xmlDocument.DocumentElement.InsertBefore(node, null);

            Assert.Same(node, result);
            Assert.Equal(1, xmlDocument.DocumentElement.ChildNodes.Count);
        }

        [Fact]
        public static void InsertDocFragmentToDocFragment()
        {
            var xmlDocument = new XmlDocument();

            var root = xmlDocument.CreateElement("root");
            var docFrag1 = xmlDocument.CreateDocumentFragment();
            var docFrag2 = xmlDocument.CreateDocumentFragment();

            docFrag1.AppendChild(root);
            docFrag2.InsertBefore(docFrag1, null);

            Assert.Equal(1, docFrag2.ChildNodes.Count);
        }

        [Fact]
        public static void InsertTextNodeToCommentNode()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("<root></root>");

            var commentNode = xmlDocument.DocumentElement.FirstChild;
            var textNode = xmlDocument.CreateTextNode("text node");

            Assert.Equal(XmlNodeType.Comment, commentNode.NodeType);
            Assert.Throws<InvalidOperationException>(() => commentNode.InsertBefore(textNode, null));
        }

        [Fact]
        public static void InsertTextNodeToProcessingInstructionNode()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("<root><?PI pi instructions ?></root>");

            var processingNode = xmlDocument.DocumentElement.FirstChild;
            var textNode = xmlDocument.CreateTextNode("text node");

            Assert.Equal(XmlNodeType.ProcessingInstruction, processingNode.NodeType);
            Assert.Throws<InvalidOperationException>(() => processingNode.InsertBefore(textNode, null));
        }

        [Fact]
        public static void InsertTextNodeToTextNode()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("<root>text node</root>");

            var textNode = xmlDocument.DocumentElement.FirstChild;
            var newTextNode = xmlDocument.CreateTextNode("text node");

            Assert.Equal(XmlNodeType.Text, textNode.NodeType);
            Assert.Throws<InvalidOperationException>(() => textNode.InsertBefore(newTextNode, null));
        }

        [Fact]
        public static void InsertTextNodeToElementNode()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("<root><elem/></root>");

            var node = xmlDocument.DocumentElement.FirstChild;
            var newTextNode = xmlDocument.CreateTextNode("text node");

            Assert.Equal(XmlNodeType.Element, node.NodeType);
            var result = node.InsertBefore(newTextNode, null);

            Assert.Equal(1, node.ChildNodes.Count);
            Assert.Equal(result, node.ChildNodes[0]);
        }

        [Fact]
        public static void InsertTextNodeToDocumentFragment()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("<root/>");

            var node = xmlDocument.CreateTextNode("some comment");
            var result = xmlDocument.DocumentElement.InsertBefore(node, null);

            Assert.Same(node, result);
            Assert.Equal(1, xmlDocument.DocumentElement.ChildNodes.Count);
        }

        [Fact]
        public static void InsertAttributeNodeToDocumentNode()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("<root/>");

            var attribute = xmlDocument.CreateAttribute("attr");

            Assert.Throws<InvalidOperationException>(() => xmlDocument.InsertBefore(attribute, null));
        }

        [Fact]
        public static void InsertAttributeNodeToAttributeNode()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.LoadXml("<root attr='value'/>");

            var attribute = xmlDocument.CreateAttribute("attr");

            Assert.Throws<InvalidOperationException>(() => xmlDocument.InsertBefore(attribute, null));
        }
    }
}


text:
/**
 * Run-level persistence APIs for nutella
 */

var PersistSubModule = function(main_nutella) {
    // Store a reference to the main module
    this.main_nutella = main_nutella;
};

PersistSubModule.prototype.test = function () {
    console.log("This is just a test method for the persist sub-module");
};

module.exports = PersistSubModule;

redpajama_set_name: RedPajamaGithub


text:
package io.lindstrom.mpd.data;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText;

import java.util.Objects;

public class BaseURL {
    @JacksonXmlText
    private final String value;

    @JacksonXmlProperty(isAttribute = true)
    private final String serviceLocation;

    @JacksonXmlProperty(isAttribute = true)
    private final String byteRange;

    @JacksonXmlProperty(isAttribute = true)
    private final Double availabilityTimeOffset;

    @JacksonXmlProperty(isAttribute = true)
    private final Boolean availabilityTimeComplete;

    @SuppressWarnings("unused")
    private BaseURL() {
        this.value = null;
        this.serviceLocation = null;
        this.byteRange = null;
        this.availabilityTimeOffset = null;
        this.availabilityTimeComplete = null;
    }

    @SuppressWarnings("unused")
    private BaseURL(String value) {
        this.value = value;
        this.serviceLocation = null;
        this.byteRange = null;
        this.availabilityTimeOffset = null;
        this.availabilityTimeComplete = null;
    }

    private BaseURL(String value, String serviceLocation, String byteRange, Double availabilityTimeOffset, Boolean availabilityTimeComplete) {
        this.value = value;
        this.serviceLocation = serviceLocation;
        this.byteRange = byteRange;
        this.availabilityTimeOffset = availabilityTimeOffset;
        this.availabilityTimeComplete = availabilityTimeComplete;
    }

    public String getValue() {
        return value;
    }

    public String getServiceLocation() {
        return serviceLocation;
    }

    public String getByteRange() {
        return byteRange;
    }

    public Double getAvailabilityTimeOffset() {
        return availabilityTimeOffset;
    }

    public Boolean getAvailabilityTimeComplete() {
        return availabilityTimeComplete;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BaseURL baseURL = (BaseURL) o;
        return Objects.equals(value, baseURL.value) &&
                Objects.equals(serviceLocation, baseURL.serviceLocation) &&
                Objects.equals(byteRange, baseURL.byteRange) &&
                Objects.equals(availabilityTimeOffset, baseURL.availabilityTimeOffset) &&
                Objects.equals(availabilityTimeComplete, baseURL.availabilityTimeComplete);
    }

    @Override
    public int hashCode() {
        return Objects.hash(value, serviceLocation, byteRange, availabilityTimeOffset, availabilityTimeComplete);
    }

    @Override
    public String toString() {
        return "BaseURL{" +
                "value='" + value + '\'' +
                ", serviceLocation='" + serviceLocation + '\'' +
                ", byteRange='" + byteRange + '\'' +
                ", availabilityTimeOffset=" + availabilityTimeOffset +
                ", availabilityTimeComplete=" + availabilityTimeComplete +
                '}';
    }

    public Builder buildUpon() {
        return new Builder()
                .withValue(value)
                .withServiceLocation(serviceLocation)
                .withByteRange(byteRange)
                .withAvailabilityTimeOffset(availabilityTimeOffset)
                .withAvailabilityTimeComplete(availabilityTimeComplete);
    }

    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private String value;
        private String serviceLocation;
        private String byteRange;
        private Double availabilityTimeOffset;
        private Boolean availabilityTimeComplete;

        public Builder withValue(String value) {
            this.value = value;
            return this;
        }

        public Builder withServiceLocation(String serviceLocation) {
            this.serviceLocation = serviceLocation;
            return this;
        }

        public Builder withByteRange(String byteRange) {
            this.byteRange = byteRange;
            return this;
        }

        public Builder withAvailabilityTimeOffset(Double availabilityTimeOffset) {
            this.availabilityTimeOffset = availabilityTimeOffset;
            return this;
        }

        public Builder withAvailabilityTimeComplete(Boolean availabilityTimeComplete) {
            this.availabilityTimeComplete = availabilityTimeComplete;
            return this;
        }

        public BaseURL build() {
            return new BaseURL(value, serviceLocation, byteRange, availabilityTimeOffset, availabilityTimeComplete);
        }
    }
}


text:
export const dataHooks = {
  title: 'sidebarheader-title',
  subtitle: 'sidebarheader-subtitle',
  children: 'sidebarheader-children',
};


text:
using extensions::Extension;

// Used to simulate a click on the first element named 'Options'.
static const char kScriptClickOptionButton[] =
    "(function() { "
    "  var button = document.querySelector('.options-link');"
    "  button.click();"
    "})();";

// Test that an extension with an options page makes an 'Options' button appear
// on chrome://extensions, and that clicking the button opens a new tab with the
// extension's options page.
// Disabled because of flakiness. See http://crbug.com/174934.
IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, DISABLED_OptionsPage) {
  ExtensionService* service = extensions::ExtensionSystem::Get(
      browser()->profile())->extension_service();
  size_t installed_extensions = service->extensions()->size();
  // Install an extension with an options page.
  const Extension* extension =
      InstallExtension(test_data_dir_.AppendASCII("options.crx"), 1);
  ASSERT_TRUE(extension);
  EXPECT_EQ(installed_extensions + 1, service->extensions()->size());

  // Go to the Extension Settings page and click the Options button.
  ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIExtensionsURL));
  TabStripModel* tab_strip = browser()->tab_strip_model();
  ui_test_utils::WindowedTabAddedNotificationObserver observer(
      content::NotificationService::AllSources());
  // NOTE: Currently the above script needs to execute in an iframe. The
  // selector for that iframe may break if the layout of the extensions
  // page changes.
  EXPECT_TRUE(content::ExecuteScriptInFrame(
      tab_strip->GetActiveWebContents(),
      "//iframe[starts-with(@src, 'chrome://extension')]",
      kScriptClickOptionButton));
  observer.Wait();
  EXPECT_EQ(2, tab_strip->count());

  EXPECT_EQ(extension->GetResourceURL("options.html"),
            tab_strip->GetWebContentsAt(1)->GetURL());
}


text:
<?php

namespace Test;

use Application;

use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
use Zend\ServiceManager\Exception\ServiceNotFoundException;

class Module
{
    public function onBootstrap(MvcEvent $e)
    {
        $eventManager = $e->getApplication()->getEventManager();

        try {
            $actionButtons = $e->getApplication()->getServiceManager()->get('ApplicationActionButtons');
            $actionButtons->addActionButton(new Application\View\ActionButton('Button from Test Module'));
        } catch (ServiceNotFoundException $ex) {
            // application module seems inexistent
        }

        $moduleRouteListener = new ModuleRouteListener();
        $moduleRouteListener->attach($eventManager);

        // listen to an event from application module
        $eventManager->getSharedManager()->attach('Application', 'indexAction', function($e) {
            $this->foo();
        });
    }

    public function getConfig()
    {
        return include __DIR__ . '/config/module.config.php';
    }

    public function foo()
    {
        //die('foo called');
    }

    public function getAutoloaderConfig()
    {
        return array(
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
    }
}


text:
public class Packet05 {

	static private final byte ID = 5;

	public Packet05 () {}

	public void read() {

		ClientBase.gui.addUserToList(new User(ClientBase.in.readUTF(), new Permission(ClientBase.in.readByte())));

	}

	public byte getID() {

		return ID;

	}

}


text:
= yaml =
title: Overview
layout: tutorial
sort: 1
toc: false
= yaml =

Vanadium supports writing secure and distributed applications in Java.

By using the [Vanadium Definition Language][vdl] (VDL), Vanadium apps written in
Java can also communicate with Vanadium servers and clients written in other
languages.

Unlike other tutorials, the Java tutorials do not require a Vanadium
installation.

* [Fortune in Java][fortune]

  _Wherein_ you build a fortune teller service and a client to talk to it.

* [Location Service in Android][android]

  _Wherein_ you build an Android phone locator service.

[vdl]: /glossary.html#vanadium-definition-language-vdl-
[fortune]: /tutorials/java/fortune.html
[android]: /tutorials/java/android.html


text:
using DvachBrowser3.Posts;

namespace DvachBrowser3.ViewModels
{
    /// <summary>
    /// Ìåäèà ôàéë áåç ïðåäâàðèòåëüíîãî ïðîñìîòðà.
    /// </summary>
    public sealed class ImageMediaFileWithThumbnailViewModel : ImageMediaFileViewModelBase<PostImageWithThumbnail>
    {
        /// <summary>
        /// Êîíñòðóêòîð.
        /// </summary>
        /// <param name="parent">Ðîäèòåëüñêàÿ ìîäåëü.</param>
        /// <param name="mediaData">Äàííûå ìåäèà.</param>
        public ImageMediaFileWithThumbnailViewModel(IPostViewModel parent, PostImageWithThumbnail mediaData) : base(parent, mediaData)
        {
            ThumbnailImage = MediaData.Thumbnail != null ? new ThumbnailImageSourceViewModel(MediaData.Thumbnail) : null;
            ThumbnailImage?.SetImageCache(StaticImageCache.Thumbnails);
        }

        /// <summary>
        /// Èçîáðàæåíèå ïðåäâàðèòåëüíîãî ïðîñìîòðà.
        /// </summary>
        public override IImageSourceViewModelWithSize ThumbnailImage { get; }
    }
}


text:
namespace Azure.AI.MetricsAdvisor.Models
{
    /// <summary> The PeriodFeedbackValue. </summary>
    internal partial class PeriodFeedbackValue
    {
        /// <summary> Initializes a new instance of PeriodFeedbackValue. </summary>
        /// <param name="periodType"> the type of setting period. </param>
        /// <param name="periodValue"> the number of intervals a period contains, when no period set to 0. </param>
        public PeriodFeedbackValue(PeriodType periodType, int periodValue)
        {
            PeriodType = periodType;
            PeriodValue = periodValue;
        }

        /// <summary> the type of setting period. </summary>
        public PeriodType PeriodType { get; set; }
        /// <summary> the number of intervals a period contains, when no period set to 0. </summary>
        public int PeriodValue { get; set; }
    }
}


text:
using System.Reflection;
using System.Security;

[assembly: AssemblyTitle("boo compiler")]
[assembly: AssemblyDescription("")]


text:
/**
* @author Vera Y. Petrashkova
* @version $Revision$
*/

package org.apache.harmony.auth.tests.javax.security.sasl;

import java.security.Provider;
import java.security.Security;
import java.util.Enumeration;
import java.util.Map;

import javax.security.auth.callback.CallbackHandler;
import javax.security.sasl.Sasl;
import javax.security.sasl.SaslClient;
import javax.security.sasl.SaslClientFactory;
import javax.security.sasl.SaslException;
import javax.security.sasl.SaslServer;
import javax.security.sasl.SaslServerFactory;

import junit.framework.TestCase;

import org.apache.harmony.auth.tests.support.SpiEngUtils;

/**
 * Test for Sasl class
 */
public class Sasl2Test extends TestCase {
    Provider[] mProv;

    private static final String fClientClass01 = myClientFactory01.class
            .getName();

    private static final String fServerClass01 = myServerFactory01.class
            .getName();

    private static final String fServerClass02 = myServerFactory02.class
            .getName();

    @Override
    protected void tearDown() throws Exception {
        super.tearDown();
        if (mProv != null) {
            for (Provider element : mProv) {
                Security.removeProvider(element.getName());
            }
        }
    }

    private void addProviders() {
        for (Provider element : mProv) {
            Security.insertProviderAt(element, 2);
        }
    }

    private static final String[] mech = { "mechanism", "NEW-MECHANISM", "AA",
            "LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG-LONG" };

    private static final String CLNTSRV = "SaslClientFactory.";

    private static final String SRVSSRV = "SaslServerFactory.";

    /**
     * Test for getSaslClientFactories() method
     *
     * Assertion: returns enumeration of factories for producing SaslClient.
     *
     * Enumeration consists of 4 elements.
     *
     * 4 different providers define the same mechanism and refer to the same
     * SaslClientFactory class
     */
    public void testGetClient01() throws SaslException {
        mProv = new Provider[] {
                (new SpiEngUtils()).new MyProvider("MySaslClientProvider1",
                        "Testing provider SaslClientFactory - 1", CLNTSRV
                                .concat(mech[0]), fClientClass01),
                (new SpiEngUtils()).new MyProvider("MySaslClientProvider2",
                        "Testing provider SaslClientFactory - 2", CLNTSRV
                                .concat(mech[0]), fClientClass01),
                (new SpiEngUtils()).new MyProvider("MySaslClientProvider3",
                        "Testing provider SaslClientFactory - 3", CLNTSRV
                                .concat(mech[0]), fClientClass01),
                (new SpiEngUtils()).new MyProvider("MySaslClientProvider4",
                        "Testing provider SaslClientFactory - 4", CLNTSRV
                                .concat(mech[0]), fClientClass01) };

        addProviders();

        Enumeration<SaslClientFactory> en = Sasl.getSaslClientFactories();
        assertNotNull("List of SaslClientFactories should not be null", en);
        assertTrue("List of SaslClientFactories should have elements", en
                .hasMoreElements());
        myClientFactory01 mm = new myClientFactory01();
        String[] mech01 = mm.getMechanismNames(null);
        int l = 0;
        while (en.hasMoreElements()) {
            SaslClientFactory f = en.nextElement();
            if (f instanceof myClientFactory01) {
                l++;
                assertNull("Incorect SaslClient", f.createSaslClient(null,
                        null, null, null, null, null));
                String[] mech00 = f.getMechanismNames(null);
                assertEquals("Wrong length", mech00.length, mech01.length);
                for (int i = 0; i < mech00.length; i++) {
                    assertEquals("Wrong mechanism name", mech00[i], mech01[i]);
                }
            }
        }
        assertEquals("Incorrect number of enumeration elements", l,
                mProv.length);
    }

    /**
     * Test for getSaslClientFactories() method
     *
     * Assertion: returns enumeration of factories for producing SaslClient.
     *
     * Enumeration consists of 4 elements.
     *
     * 4 different providers define different mechanism and refer to the same
     * SaslClientFactory class
     */
    public void testGetClient02() throws SaslException {
        mProv = new Provider[] {
                (new SpiEngUtils()).new MyProvider("MySaslClientProvider1",
                        "Testing provider SaslClientFactory - 1", CLNTSRV
                                .concat(mech[0]), fClientClass01),
                (new SpiEngUtils()).new MyProvider("MySaslClientProvider2",
                        "Testing provider SaslClientFactory - 2", CLNTSRV
                                .concat(mech[1]), fClientClass01),
                (new SpiEngUtils()).new MyProvider("MySaslClientProvider3",
                        "Testing provider SaslClientFactory - 3", CLNTSRV
                                .concat(mech[2]), fClientClass01),
                (new SpiEngUtils()).new MyProvider("MySaslClientProvider4",
                        "Testing provider SaslClientFactory - 4", CLNTSRV
                                .concat(mech[3]), fClientClass01) };
        addProviders();

        Enumeration<SaslClientFactory> en = Sasl.getSaslClientFactories();
        assertNotNull("List of SaslClientFactories should not be null", en);
        assertTrue("List of SaslClientFactories should have elements", en
                .hasMoreElements());
        myClientFactory01 mm = new myClientFactory01();
        String[] mech01 = mm.getMechanismNames(null);
        int l = 0;
        while (en.hasMoreElements()) {
            SaslClientFactory f = en.nextElement();
            if (f instanceof myClientFactory01) {
                l++;
                assertNull("Incorect SaslClient", f.createSaslClient(null,
                        null, null, null, null, null));
                String[] mech00 = f.getMechanismNames(null);
                assertEquals("Wrong length", mech00.length, mech01.length);
                for (int i = 0; i < mech00.length; i++) {
                    assertEquals("Wrong mechanism name", mech00[i], mech01[i]);
                }
            }
        }
        assertEquals("Incorrect number of enumeration elements", l,
                mProv.length);
    }

    /**
     * Test for getSaslClientFactories() method
     *
     * Assertion: returns enumeration of factories for producing SaslClient.
     *
     * Enumeration consists of 2 elements.
     *
     * 2 different providers define the same mechanism and refer to the
     * different SaslClientFactory classes
     */
    public void testGetClient03() throws SaslException {
        mProv = new Provider[] {
                (new SpiEngUtils()).new MyProvider("MySaslClientProvider1",
                        "Testing provider SaslClientFactory - 1", CLNTSRV
                                .concat(mech[1]), fClientClass01),
                (new SpiEngUtils()).new MyProvider("MySaslClientProvider2",
                        "Testing provider SaslClientFactory - 2", CLNTSRV
                                .concat(mech[1]), fClientClass01) };
        addProviders();
        Enumeration<SaslClientFactory> en = Sasl.getSaslClientFactories();
        assertNotNull("List of SaslClientFactories should not be null", en);
        assertTrue("List of SaslClientFactories should have elements", en
                .hasMoreElements());

        myClientFactory01 mm1 = new myClientFactory01();
        String[] mech01 = mm1.getMechanismNames(null);
        int l = 0;
        while (en.hasMoreElements()) {
            SaslClientFactory f = en.nextElement();
            if (f instanceof myClientFactory01) {
                l++;
                assertTrue(f instanceof myClientFactory01);
                assertNull("Incorect SaslClient", f.createSaslClient(null,
                        null, null, null, null, null));
                String[] mech00 = f.getMechanismNames(null);
                assertEquals("Wrong length", mech00.length, mech01.length);
                for (int i = 0; i < mech00.length; i++) {
                    assertEquals("Wrong mechanism name", mech00[i], mech01[i]);
                }
            } else if (f instanceof myClientFactory02) {
                l++;
                try {
                    f.createSaslClient(null, null, null, null, null, null);
                    fail("SaslException should be thrown");
                } catch (SaslException e) {
                }
                assertNull("Incorect SaslClient", f.createSaslClient(
                        new String[0], null, null, null, null, null));
                String[] mech00 = f.getMechanismNames(null);
                assertEquals("Wrong length", mech00.length, mech01.length);
                for (int i = 0; i < mech00.length; i++) {
                    assertEquals("Wrong mechanism name", mech00[i], mech01[i]);
                }
            }
        }
        assertEquals("Incorrect number of enumeration elements", l,
                mProv.length);
    }

    /**
     * Test for getSaslClientFactories() method
     *
     * Assertion: returns enumeration of factories for producing SaslClient.
     *
     * Enumeration consists of 4 elements.
     *
     * 1 provider defines different mechanism and refer to the same
     * SaslClientFactory classes
     */
    public void testGetClient04() throws SaslException {
        mProv = new Provider[] { (new SpiEngUtils()).new MyProvider(
                "MySaslClientProvider1",
                "Testing provider SaslClientFactory - 1", CLNTSRV
                        .concat(mech[0]), fClientClass01) };
        mProv[0].put(CLNTSRV.concat(mech[1]), fClientClass01);
        mProv[0].put(CLNTSRV.concat(mech[2]), fClientClass01);
        mProv[0].put(CLNTSRV.concat(mech[3]), fClientClass01);

        addProviders();
        Enumeration<SaslClientFactory> en = Sasl.getSaslClientFactories();
        assertNotNull("List of SaslClientFactories should not be null", en);
        assertTrue("List of SaslClientFactories should have elements", en
                .hasMoreElements());
        myClientFactory01 mm = new myClientFactory01();
        String[] mech01 = mm.getMechanismNames(null);
        int l = 0;
        while (en.hasMoreElements()) {
            SaslClientFactory f = en.nextElement();
            if ((f instanceof myClientFactory01)) {
                l++;
                assertNull("Incorect SaslClient", f.createSaslClient(null,
                        null, null, null, null, null));
                String[] mech = f.getMechanismNames(null);
                assertEquals("Wrong length", mech.length, mech01.length);
                for (int i = 0; i < mech.length; i++) {
                    assertEquals("Wrong mechanism name", mech[i], mech01[i]);
                }
            }
        }
        assertEquals("Incorrect number of enumeration elements", l,
                mProv.length);
    }

    /**
     * Test for getSaslServerFactories() method
     *
     * Assertion: returns enumeration of factories for producing SaslServer.
     *
     * Enumeration consists of 8 elements.
     *
     * 4 different providers define different mechanism and refer to the 2
     * different SaslServerFactory classes
     */
    public void testGetServer01() throws SaslException {
        mProv = new Provider[] {
                (new SpiEngUtils()).new MyProvider("MySaslServerProvider1",
                        "Testing provider SaslServerFactory - 1", SRVSSRV
                                .concat(mech[0]), fServerClass02),
                (new SpiEngUtils()).new MyProvider("MySaslServerProvider2",
                        "Testing provider SaslServerFactory - 2", SRVSSRV
                                .concat(mech[0]), fServerClass02),
                (new SpiEngUtils()).new MyProvider("MySaslServerProvider3",
                        "Testing provider SaslServerFactory - 3", SRVSSRV
                                .concat(mech[0]), fServerClass02),
                (new SpiEngUtils()).new MyProvider("MySaslServerProvider4",
                        "Testing provider SaslServerFactory - 4", SRVSSRV
                                .concat(mech[0]), fServerClass02) };
        for (Provider element : mProv) {
            for (int j = 1; j < mech.length; j++) {
                element.put(SRVSSRV.concat(mech[j]).concat(mech[j]),
                        fServerClass02);
                element.put(SRVSSRV.concat(mech[j]).concat(mech[j]),
                        fServerClass01);
            }
            element.put(SRVSSRV.concat(mech[0]).concat(mech[0]),
                    fServerClass01);
        }
        addProviders();
        Enumeration<SaslServerFactory> en = Sasl.getSaslServerFactories();
        assertNotNull("List of SaslServerFactories should not be null", en);
        assertTrue("List of SaslServerFactories should have elements", en
                .hasMoreElements());
        myServerFactory01 mm01 = new myServerFactory01();
        String[] mech01 = mm01.getMechanismNames(null);
        int l = 0;
        while (en.hasMoreElements()) {
            SaslServerFactory f = en.nextElement();
            if (f instanceof myServerFactory02) {
                l++;
                try {
                    f.createSaslServer(null, null, null, null, null);
                    fail("SaslException should be thrown");
                } catch (SaslException e) {
                }
                assertNull("Incorect SaslClient", f.createSaslServer(null, "a",
                        null, null, null));
                assertNull("Wrong length", f.getMechanismNames(null));
            } else if (f instanceof myServerFactory01) {
                l++;
                assertNull("Not null SaslServer", f.createSaslServer(null,
                        null, null, null, null));
                String[] mech00 = f.getMechanismNames(null);
                assertEquals("Wrong length", mech00.length, mech01.length);
                for (int i = 0; i < mech00.length; i++) {
                    assertEquals("Wrong mechanism name", mech00[i], mech01[i]);
                }
            }
        }
        assertEquals("Incorrect number of enumeration elements", l,
                mProv.length * 2);
    }

    /**
     * Test for getSaslServerFactories() method
     *
     * Assertion: returns enumeration of factories for producing SaslServer.
     *
     * Enumeration consists of 4 elements.
     *
     * 4 different providers define different mechanism and refer to the same
     * SaslServerFactory class
     */
    public void testGetServer02() throws SaslException {
        mProv = new Provider[] {
                (new SpiEngUtils()).new MyProvider("MySaslServerProvider1",
                        "Testing provider SaslServerFactory - 1", SRVSSRV
                                .concat(mech[0]), fServerClass01),
                (new SpiEngUtils()).new MyProvider("MySaslServerProvider2",
                        "Testing provider SaslServerFactory - 2", SRVSSRV
                                .concat(mech[1]), fServerClass01),
                (new SpiEngUtils()).new MyProvider("MySaslServerProvider3",
                        "Testing provider SaslServerFactory - 3", SRVSSRV
                                .concat(mech[2]), fServerClass01),
                (new SpiEngUtils()).new MyProvider("MySaslServerProvider4",
                        "Testing provider SaslServerFactory - 4", SRVSSRV
                                .concat(mech[3]), fServerClass01) };
        addProviders();

        Enumeration<SaslServerFactory> en = Sasl.getSaslServerFactories();
        assertNotNull("List of SaslServerFactories should not be null", en);
        assertTrue("List of SaslServerFactories should have elements", en
                .hasMoreElements());
        myServerFactory01 mm01 = new myServerFactory01();
        String[] mech01 = mm01.getMechanismNames(null);
        int l = 0;
        while (en.hasMoreElements()) {
            SaslServerFactory f = en.nextElement();
            if (f instanceof myServerFactory01) {
                l++;
                assertNull("Incorect SaslServer", f.createSaslServer(null,
                        null, null, null, null));
                String[] mech00 = f.getMechanismNames(null);
                assertEquals("Wrong length", mech00.length, mech01.length);
                for (int i = 0; i < mech00.length; i++) {
                    assertEquals("Wrong mechanism name", mech00[i], mech01[i]);
                }
            }
        }
        assertEquals("Incorrect number of enumeration elements", l,
                mProv.length);
    }

    /**
     * Test for getSaslServerFactories() method
     *
     * Assertion: returns enumeration of factories for producing SaslServer.
     *
     * Enumeration consists of 2 elements.
     *
     * 2 different providers define the same mechanism and refer to the
     * different SaslServerFactory classes
     */
    public void testGetServer03() throws SaslException {
        mProv = new Provider[] {
                (new SpiEngUtils()).new MyProvider("MySaslServerProvider1",
                        "Testing provider SaslServerFactory - 1", SRVSSRV
                                .concat(mech[1]), fServerClass01),
                (new SpiEngUtils()).new MyProvider("MySaslServerProvider2",
                        "Testing provider SaslServerFactory - 2", SRVSSRV
                                .concat(mech[1]), fServerClass01) };
        addProviders();
        Enumeration<SaslServerFactory> en = Sasl.getSaslServerFactories();
        assertNotNull("List of SaslServerFactories should not be null", en);
        assertTrue("List of SaslServerFactories should have elements", en
                .hasMoreElements());

        myServerFactory01 mm1 = new myServerFactory01();
        String[] mech01 = mm1.getMechanismNames(null);
        int l = 0;
        while (en.hasMoreElements()) {
            SaslServerFactory f = en.nextElement();
            if (f instanceof myServerFactory01) {
                l++;
                assertTrue(f instanceof myServerFactory01);
                assertNull("Incorect SaslServer", f.createSaslServer(null,
                        null, null, null, null));
                String[] mech00 = f.getMechanismNames(null);
                assertEquals("Wrong length", mech00.length, mech01.length);
                for (int i = 0; i < mech00.length; i++) {
                    assertEquals("Wrong mechanism name", mech00[i], mech01[i]);
                }
            } else if (f instanceof myServerFactory02) {
                l++;
                try {
                    f.createSaslServer(null, null, null, null, null);
                    fail("SaslException should be thrown");
                } catch (SaslException e) {
                }
                assertNull("Incorect SaslServer", f.createSaslServer(null, "",
                        null, null, null));
                String[] mech00 = f.getMechanismNames(null);
                assertEquals("Wrong length", mech00.length, mech01.length);
                for (int i = 0; i < mech00.length; i++) {
                    assertEquals("Wrong mechanism name", mech00[i], mech01[i]);
                }
            }
        }
        assertEquals("Incorrect number of enumeration elements", l,
                mProv.length);
    }

    /**
     * Test for getSaslServerFactories() method
     *
     * Assertion: returns enumeration of factories for producing SaslServer.
     *
     * Enumeration consists of 4 elements.
     *
     * 1 provider defines different mechanism and refer to the same
     * SaslServerFactory classes
     */
    public void testGetServer04() throws SaslException {
        mProv = new Provider[] { (new SpiEngUtils()).new MyProvider(
                "MySaslServerProvider1",
                "Testing provider SaslServerFactory - 1", SRVSSRV
                        .concat(mech[0]), fServerClass02) };
        mProv[0].put(SRVSSRV.concat(mech[1]), fServerClass02);
        mProv[0].put(SRVSSRV.concat(mech[2]), fServerClass02);
        mProv[0].put(SRVSSRV.concat(mech[3]), fServerClass02);

        addProviders();
        Enumeration<SaslServerFactory> en = Sasl.getSaslServerFactories();
        assertNotNull("List of SaslServerFactories should not be null", en);
        assertTrue("List of SaslServerFactories should have elements", en
                .hasMoreElements());
        int l = 0;
        while (en.hasMoreElements()) {
            SaslServerFactory f = en.nextElement();
            if ((f instanceof myServerFactory02)) {
                l++;
                try {
                    f.createSaslServer(null, null, null, null, null);
                    fail("SaslException should be thrown");
                } catch (SaslException e) {
                }
                assertNull("Incorect SaslServer", f.createSaslServer(null, "",
                        null, null, null));
                assertNull("Wrong length", f.getMechanismNames(null));
            }
        }
        assertEquals("Incorrect number of enumeration elements", l,
                mProv.length);
    }

    /*
     * Support classes
     */
    public static class myServerFactory01 implements SaslServerFactory {
        public myServerFactory01() {
            super();
        }

        public String[] getMechanismNames(Map<String, ?> map) {
            return new String[] { "aaaa", "dddddddddddd",
                    "llllllllll sssssssss aaaaaaaaaaa c" };
        }

        public SaslServer createSaslServer(String mech, String prot,
                String srvName, Map<String, ?> prop, CallbackHandler ch) throws SaslException {
            return null;
        }
    }

    public static class myServerFactory02 implements SaslServerFactory {
        public myServerFactory02() {
            super();
        }

        public String[] getMechanismNames(Map<String, ?> map) {
            return null;
        }

        public SaslServer createSaslServer(String mech, String prot,
                String srvName, Map<String, ?> prop, CallbackHandler ch) throws SaslException {
            if (prot == null) {
                throw new SaslException("Protocol is null");
            }
            return null;
        }
    }

    public static class myClientFactory01 implements SaslClientFactory {
        public myClientFactory01() {
            super();
        }

        public String[] getMechanismNames(Map<String, ?> map) {
            return new String[] { "a1", "a2", "a3", "a4", "a5" };
        }

        public SaslClient createSaslClient(String[] mech, String prot, String auth,
                String srvName, Map<String, ?> prop, CallbackHandler ch) throws SaslException {
            return null;
        }
    }

    public static class myClientFactory02 implements SaslClientFactory {
        public myClientFactory02() {
            super();
        }

        public String[] getMechanismNames(Map<String, ?> map) {
            return new String[] { "a11", "a22", "a33", "a44", "a55", "" };
        }

        public SaslClient createSaslClient(String[] mech, String prot, String auth,
                String srvName, Map<String, ?> prop, CallbackHandler ch) throws SaslException {
            return null;
        }
    }
}


text:
layout: page
title: Ressources
level: top
---


text:
/**
 * @module ol/format/FormatType
 */

/**
 * @enum {string}
 */
export default {
  ARRAY_BUFFER: 'arraybuffer',
  JSON: 'json',
  TEXT: 'text',
  XML: 'xml'
};

//# sourceMappingURL=FormatType.js.map


text:
<?php

namespace Behat\Mink\Selector;

/**
 * Named selectors engine. Uses registered XPath selectors to create new expressions.
 *
 * @author Konstantin Kudryashov <ever.zet@gmail.com>
 */
class NamedSelector implements SelectorInterface
{
    private $replacements = array(
        // simple replacements
        '%tagTextMatch%' => 'contains(normalize-space(string(.)), %locator%)',
        '%labelTextMatch%' => './@id = //label[%tagTextMatch%]/@for',
        '%idMatch%' => './@id = %locator%',
        '%valueMatch%' => 'contains(./@value, %locator%)',
        '%idOrValueMatch%' => '(%idMatch% or %valueMatch%)',
        '%idOrNameMatch%' => '(%idMatch% or ./@name = %locator%)',
        '%placeholderMatch%' => './@placeholder = %locator%',
        '%titleMatch%' => 'contains(./@title, %locator%)',
        '%altMatch%' => 'contains(./@alt, %locator%)',
        '%relMatch%' => 'contains(./@rel, %locator%)',
        '%labelAttributeMatch%' => 'contains(./@label, %locator%)',

        // complex replacements
        '%inputTypeWithoutPlaceholderFilter%' => "./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'file'",
        '%fieldFilterWithPlaceholder%' => 'self::input[not(%inputTypeWithoutPlaceholderFilter%)] | self::textarea',
        '%fieldMatchWithPlaceholder%' => '(%idOrNameMatch% or %labelTextMatch% or %placeholderMatch%)',
        '%fieldMatchWithoutPlaceholder%' => '(%idOrNameMatch% or %labelTextMatch%)',
        '%fieldFilterWithoutPlaceholder%' => 'self::input[%inputTypeWithoutPlaceholderFilter%] | self::select',
        '%notFieldTypeFilter%' => "not(%buttonTypeFilter% or ./@type = 'hidden')",
        '%buttonMatch%' => '%idOrNameMatch% or %valueMatch% or %titleMatch%',
        '%buttonTypeFilter%' => "./@type = 'submit' or ./@type = 'image' or ./@type = 'button' or ./@type = 'reset'",
        '%linkMatch%' => '(%idMatch% or %tagTextMatch% or %titleMatch% or %relMatch%)',
        '%imgAltMatch%' => './/img[%altMatch%]',
    );

    private $selectors = array(
        'fieldset' => <<<XPATH
.//fieldset
[(%idMatch% or .//legend[%tagTextMatch%])]
XPATH

        ,'field' => <<<XPATH
.//*
[%fieldFilterWithPlaceholder%][%notFieldTypeFilter%][%fieldMatchWithPlaceholder%]
|
.//label[%tagTextMatch%]//.//*[%fieldFilterWithPlaceholder%][%notFieldTypeFilter%]
|
.//*
[%fieldFilterWithoutPlaceholder%][%notFieldTypeFilter%][%fieldMatchWithoutPlaceholder%]
|
.//label[%tagTextMatch%]//.//*[%fieldFilterWithoutPlaceholder%][%notFieldTypeFilter%]
XPATH

        ,'link' => <<<XPATH
.//a
[./@href][(%linkMatch% or %imgAltMatch%)]
|
.//*
[./@role = 'link'][(%idOrValueMatch% or %titleMatch% or %tagTextMatch%)]
XPATH

        ,'button' => <<<XPATH
.//input
[%buttonTypeFilter%][(%buttonMatch%)]
|
.//input
[./@type = 'image'][%altMatch%]
|
.//button
[(%buttonMatch% or %tagTextMatch%)]
|
.//*
[./@role = 'button'][(%buttonMatch% or %tagTextMatch%)]
XPATH

        ,'link_or_button' => <<<XPATH
.//a
[./@href][(%linkMatch% or %imgAltMatch%)]
|
.//input
[%buttonTypeFilter%][(%idOrValueMatch% or %titleMatch%)]
|
.//input
[./@type = 'image'][%altMatch%]
|
.//button
[(%idOrValueMatch% or %titleMatch% or %tagTextMatch%)]
|
.//*
[(./@role = 'button' or ./@role = 'link')][(%idOrValueMatch% or %titleMatch% or %tagTextMatch%)]
XPATH

        ,'content' => <<<XPATH
./descendant-or-self::*
[%tagTextMatch%]
XPATH

        ,'select' => <<<XPATH
.//select
[%fieldMatchWithoutPlaceholder%]
|
.//label[%tagTextMatch%]//.//select
XPATH

        ,'checkbox' => <<<XPATH
.//input
[./@type = 'checkbox'][%fieldMatchWithoutPlaceholder%]
|
.//label[%tagTextMatch%]//.//input[./@type = 'checkbox']
XPATH

        ,'radio' => <<<XPATH
.//input
[./@type = 'radio'][%fieldMatchWithoutPlaceholder%]
|
.//label[%tagTextMatch%]//.//input[./@type = 'radio']
XPATH

        ,'file' => <<<XPATH
.//input
[./@type = 'file'][%fieldMatchWithoutPlaceholder%]
|
.//label[%tagTextMatch%]//.//input[./@type = 'file']
XPATH

        ,'optgroup' => <<<XPATH
.//optgroup
[%labelAttributeMatch%]
XPATH

        ,'option' => <<<XPATH
.//option
[(./@value = %locator% or %tagTextMatch%)]
XPATH

        ,'table' => <<<XPATH
.//table
[(%idMatch% or .//caption[%tagTextMatch%])]
XPATH
    );

    /**
     * Creates selector instance.
     */
    public function __construct()
    {
        foreach ($this->replacements as $from => $to) {
            $this->replacements[$from] = strtr($to, $this->replacements);
        }

        foreach ($this->selectors as $alias => $selector) {
            $this->selectors[$alias] = strtr($selector, $this->replacements);
        }
    }

    /**
     * Registers new XPath selector with specified name.
     *
     * @param string $name  name for selector
     * @param string $xpath xpath expression
     */
    public function registerNamedXpath($name, $xpath)
    {
        $this->selectors[$name] = $xpath;
    }

    /**
     * Translates provided locator into XPath.
     *
     * @param string|array $locator selector name or array of (selector_name, locator)
     *
     * @return string
     *
     * @throws \InvalidArgumentException
     */
    public function translateToXPath($locator)
    {
        if (2 < count($locator)) {
            throw new \InvalidArgumentException('NamedSelector expects array(name, locator) as argument');
        }

        if (2 == count($locator)) {
            $selector   = $locator[0];
            $locator    = $locator[1];
        } else {
            $selector   = (string) $locator;
            $locator    = null;
        }

        if (!isset($this->selectors[$selector])) {
            throw new \InvalidArgumentException(sprintf(
                'Unknown named selector provided: "%s". Expected one of (%s)',
                $selector,
                implode(', ', array_keys($this->selectors))
            ));
        }

        $xpath = $this->selectors[$selector];

        if (null !== $locator) {
            $xpath = strtr($xpath, array('%locator%' => $locator));
        }

        return $xpath;
    }

    /**
     * Registers a replacement in the list of replacements
     *
     * This method must be called in the constructor before calling the parent constructor.
     *
     * @param string $from
     * @param string $to
     */
    protected function registerReplacement($from, $to)
    {
        $this->replacements[$from] = $to;
    }
}


text:
<?php

namespace Zotlabs\Widget;

require_once('include/contact_widgets.php');

class Categories {

	function widget($arr) {

		if((! \App::$profile['profile_uid'])
			|| (! perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(),'view_stream'))) {
			return '';
		}

		$cat = ((x($_REQUEST,'cat')) ? htmlspecialchars($_REQUEST['cat'],ENT_COMPAT,'UTF-8') : '');
		$srchurl = \App::$query_string;
		$srchurl =  rtrim(preg_replace('/cat\=[^\&].*?(\&|$)/is','',$srchurl),'&');
		$srchurl = str_replace(array('?f=','&f='),array('',''),$srchurl);

		return categories_widget($srchurl, $cat);
	}
}


text:
layout: post
date: 2017-07-04
title: "Maggie Sottero Avalon 2014 Fall Sleeveless Chapel Train Ballgown"
category: Maggie Sottero
tags: [Maggie Sottero,Ballgown,Sweetheart,Chapel Train,Sleeveless,2014,Fall]
---
### Maggie Sottero Avalon
Just **$339.99**
### 2014 Fall Sleeveless Chapel Train Ballgown

BRANDS	Maggie Sottero

Silhouette	Ballgown

Neckline	Sweetheart

Hemline/Train	Chapel Train

Sleeve	Sleeveless

Years	2014

Season	Fall

Buy it: [https://www.readybrides.com/en/maggie-sottero/3211-maggie-sottero-avalon.html](https://www.readybrides.com/en/maggie-sottero/3211-maggie-sottero-avalon.html)


text:
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

using System.Collections.Specialized;
using System.Security.Claims;
using System.Threading.Tasks;

namespace IdentityServer4.Validation
{
    internal interface IAuthorizeRequestValidator
    {
        Task<AuthorizeRequestValidationResult> ValidateAsync(NameValueCollection parameters, ClaimsPrincipal subject = null);
    }
}


text:
package com.band.render;

public enum State {
	RUNNING, PAUSED, READY, SYSPAUSE, USRPAUSE, INITRUN, SELECTIVERUN, PAUSED_RESUME
};


text:
double bundle_eval (struct bundle_callbacks *callbacks_ptr, const double *Lam_val, const unsigned *Lam_idx, unsigned Lam_count)
{
	bundle_callback_data_t *callback_data = (bundle_callback_data_t*) callbacks_ptr;
	node_t *node = callback_data->node;
	node_eval_t *node_eval = callback_data->node_eval;
	instance_t *inst = node_eval->inst;
	unsigned k;

	// get multipliers and store them in dense vector format
	if (Lam_idx == NULL) {
		assert(Lam_count == (unsigned) inst->m);
		node_eval->bundle_mul = (double*) Lam_val;
	} else {
		node_eval->bundle_mul = node_eval->bundle_mul_alloc;
		memset(node_eval->bundle_mul, 0, inst->m * sizeof(double));
		for (k = 0; k < (unsigned) Lam_count; k++)
			node_eval->bundle_mul[Lam_idx[k]] = Lam_val[k];
	}

	// evaluate lagrangian relaxation
	++node_eval->bundle_n_fi;
	node_eval_lagrangian(node_eval, node, node_eval->bundle_mul);

	// store best multipliers
	if (node_eval->z > node->lb) {
		memcpy(node->mul, node_eval->bundle_mul, inst->m * sizeof(double));
		node->lb = node_eval->z;
	}

	// cutoff tests
	if (node->lb >= node->ub - bound_eps)
		return -DBL_MAX;
	if (node_eval->bundle_n_gi > node_eval->bundle_max_gi)
		return -DBL_MAX;

	return -node_eval->z; // return opposite because BTT minimizes
}

// BTT callback to generate one or several subgradients at the current trial point
int bundle_get_subg (struct bundle_callbacks *callbacks_ptr, double *Eps, const unsigned **Indices)
{
	bundle_callback_data_t *callback_data = (bundle_callback_data_t*) callbacks_ptr;
	node_eval_t *node_eval = callback_data->node_eval;
	instance_t *inst = node_eval->inst;
	node_t *node = callback_data->node;
	hyperplane_t htemp, *h;
	ic_pair_t temp;
	int i, j, k;
	int queue_free_begin = node->min_open - node_eval->n_fixed_1;
	int queue_free_end = node->max_open - node_eval->n_fixed_1;

	++node_eval->bundle_n_gi; // increment bundle update counter

	if (node_eval->bundle_n_fi == 1 && inst->subg_cache_size) {
		// This is the first trial point and we are using a cache.
		if (node_eval->bundle_n_gi == 1) {
			// Begin by retrieving all other subgradients from the cache.
			select_hyperplanes_in_cache(node_eval, node);
		} else {
			// Return one of the many subgradients retrieved from the cache.
			assert(node_eval->n_selected > 0);
			h = &node_eval->cache[node_eval->selection[--node_eval->n_selected].i];
			*Eps = node_eval->selection[node_eval->n_selected].c + bound_eps;
			memcpy(node_eval->bundle_subg, h->subg, inst->m * sizeof(double));
			return -node_eval->n_selected; // 0 means no more, < 0 means call this callback again
		}
	} else
		node_eval->n_selected = 0;

	*Eps = 0.0;
	*Indices = NULL;

	// Compute the subgradient at the current multipliers
	h = &node_eval->current_hyperplane;
	initialize_count(node_eval->int_subg, inst->m, 1);
	for (k = 0; k < node_eval->n_x1; k++)
		clamped_count(node_eval->int_subg, inst->c[node_eval->x1[k]], node_eval->bundle_mul, inst->m);
	for (j = 0; j < inst->m; j++)
		node_eval->bundle_subg[j] = h->subg[j] = -node_eval->int_subg[j];

	// Store it in the cache, if we maintain one.
	if (inst->subg_cache_size) {
		h->eps0 = node_eval->z + ddot(inst->m, h->subg, node_eval->bundle_mul);
		h->subg_hash = get_hash_subg(node_eval->int_subg, inst->m);

		// First, compute the 'naive' key,
		h->min_open = node->min_open;
		h->max_open = node->max_open;
		h->n_x1 = node_eval->n_x1;
		for (k = 0; k < inst->n_words_in_bit_vector; k++)
			h->x[k] = 0;
		for (k = 0; k < node_eval->n_x1; k++)
			set_bit(h->x, node_eval->x1[k], 1);
		h->x_hash = get_hash_x(h->x, inst->n_words_in_bit_vector);
		memcpy(h->fixed_x, node->fix_mask, inst->n_words_in_bit_vector * sizeof(word_t));
		// then improve it by relaxing the fixed locations
		for (i = 0; i < inst->n; i++)
			if (get_bit(node->fix_mask, i)) {
				temp.c = node_eval->rc[i];
				temp.i = i;
				if ((get_bit(node->fix_val, i)
							&& -1 == ic_pair_cmp(&temp, &node_eval->queue[queue_free_begin]))
						|| (!get_bit(node->fix_val, i)
							&& 1 == ic_pair_cmp(&temp, &node_eval->queue[queue_free_end])))
					set_bit(h->fixed_x, i, 0);
			}
		h->fixed_x_hash = get_hash_x(h->fixed_x, inst->n_words_in_bit_vector);

		// Check Bloom filter
		if (0 == check_bloom_filter(node_eval)) {
			// Add to Bloom filter
			add_bloom_filter(node_eval, 1);
			if (node_eval->fresh_idx == inst->subg_cache_size - 1)
				node_eval->fresh_idx = 0;
			// Add to cache
			htemp = node_eval->cache[node_eval->fresh_idx];
			node_eval->cache[node_eval->fresh_idx++] = node_eval->current_hyperplane;
			node_eval->current_hyperplane = htemp;
			// Update Bloom filter if element was removed from cache
			if (node_eval->current_hyperplane.eps0 != INFINITY)
				add_bloom_filter(node_eval, -1);
		}
	}

	// 0 means no more subgradients available, < 0 means call this callback again
	return -node_eval->n_selected;
}

// BTT callback which provides the address to which we should write the current subgradient to.
void bundle_set_subg (struct bundle_callbacks *callbacks_ptr, double *subgradient, unsigned u)
{
	bundle_callback_data_t *callback_data = (bundle_callback_data_t*) callbacks_ptr;

	(void) u;
	callback_data->node_eval->bundle_subg = subgradient;
}

// Retrieves a selection of valid subgradients from the cache
void select_hyperplanes_in_cache (node_eval_t *node_eval, node_t *node)
{
	instance_t *inst = node_eval->inst;
	hyperplane_t *h;
	int i, j, k;
	double eps = 0.0;

	node_eval->n_selected = 0;

	// Visit the whole cache
	for (k = 0, i = node_eval->fresh_idx - 1; i != node_eval->fresh_idx; --i, k++) {
		assert(k < inst->subg_cache_size);
		if (i == -1) {
			i = inst->subg_cache_size - 1;
			if (i == node_eval->fresh_idx)
				break;
			else
				continue;
		}

		h = &node_eval->cache[i];
		if (h->eps0 == INFINITY)
			break;

		// Perform tests on the key
		if (h->min_open <= node->min_open
				&& node->min_open <= h->n_x1
				&& h->n_x1 <= node->max_open
				&& node->max_open <= h->max_open) {
			for (j = 0; j < inst->n_words_in_bit_vector; j++) {
				if (((h->x[j] ^ node->fix_val[j]) & node->fix_mask[j])
						|| (node->fix_mask[j] | h->fixed_x[j]) != node->fix_mask[j])
					break;
			}
			if (j == inst->n_words_in_bit_vector) {
				// Tests succeeded
				eps = h->eps0 - node_eval->z - ddot(inst->m, h->subg, node_eval->bundle_mul);
				assert(eps > -bound_eps);
				assert(node_eval->n_selected >= 0);
				assert(node_eval->n_selected < inst->subg_cache_size);

				node_eval->selection[node_eval->n_selected].i = i;
				node_eval->selection[node_eval->n_selected++].c = eps;
			}
		}
	}

	// Select only the best elements if we have too many
	if (node_eval->n_selected >= inst->bundle_max_size) {
		quickselect(node_eval->rng, node_eval->selection, node_eval->n_selected, inst->bundle_max_size - 1);
		node_eval->n_selected = inst->bundle_max_size - 1;
	}
}

// Applies the bundle search to optimize the multipliers for the node,
// returns 1 if a new improving primal solution was found, 0 otherwise.
int node_eval_improve_mul (node_eval_t *node_eval, node_t *node, int max_subg, double ub)
{
	instance_t *inst = node_eval->inst;
	double z = 0.0;
	int i, j, k;

	++node_eval->n_node_eval;

	// bundle-search for the best multipliers
	node->lb = 0.0;
	node->ub = ub;
	node_eval->n_selected = node_eval->bundle_n_fi = node_eval->bundle_n_gi = 0;
	node_eval->bundle_max_gi = max_subg;
	bundle_set_lambda(node_eval->bundle, node->mul);

	node_eval->cbdata.node = node;
	bundle_solve_with_callbacks(node_eval->bundle, (struct bundle_callbacks*) &node_eval->cbdata);

	// compute primal cost
	node_eval_lagrangian(node_eval, node, node->mul);
//	assert(fabs(node_eval->z - node->lb) < bound_eps);

	for (j = 0; j < inst->m; j++)
		node_eval->min_c[j] = INFINITY;

	for (k = 0; k < node_eval->n_x1; k++) {
		i = node_eval->x1[k];
		z += inst->f[i];
		for (j = 0; j < inst->m; j++)
			if (inst->c[i][j] < node_eval->min_c[j])
				node_eval->min_c[j] = inst->c[i][j];
	}

	for (j = 0; j < inst->m; j++)
		z += node_eval->min_c[j];

	if (z < node->ub) {
		node->ub = z;
		return 1;
	}

	return 0;
}

// Computes reduced costs and identifies unfixed locations in lagragian relaxation
//% Subsection 3.1
int node_eval_lagrangian_fixed (node_eval_t *node_eval, node_t *node, double *mul)
{
	instance_t *inst = node_eval->inst;
	int i, j, nfree, wi, oi;
	word_t w;

	++node_eval->n_lag_eval;

	node_eval->z = 0.0;
	node_eval->n_fixed_0 = node_eval->n_fixed_1 = 0;

	for (j = 0; j < inst->m; j++)
		node_eval->z += mul[j];

	for (nfree = i = wi = oi = 0; i < inst->n; i++, oi++) {
		node_eval->rc[i] = inst->f[i] + clamped_sum(inst->c[i], mul, inst->m);

		if (oi == 8 * sizeof(word_t))
			oi = 0, ++wi;
		w = ((word_t) 1) << oi;
		if (node->fix_mask[wi] & w) {
			if ((node->fix_val[wi] & node->fix_mask[wi]) & w) {
				node_eval->x[i] = 1;
				node_eval->x1[node_eval->n_fixed_1++] = i;
				node_eval->z += node_eval->rc[i];
			} else {
				node_eval->x[i] = 0;
				++node_eval->n_fixed_0;
			}
		} else {
			node_eval->x[i] = -1;
			node_eval->queue[nfree].i = i;
			node_eval->queue[nfree++].c = node_eval->rc[i];
		}
	}

	node_eval->n_x1 = node_eval->n_fixed_1;
	assert(nfree + node_eval->n_fixed_0 + node_eval->n_fixed_1 == inst->n);

	if ((node_eval->n_fixed_1 > node->max_open)
			|| (node->min_open + node_eval->n_fixed_0 > inst->n)) {
		node_eval->z = INFINITY;
		return 0;
	}
	return 1;
}

// Solves the lagrangian relaxation
//% Subsection 3.1
double node_eval_lagrangian (node_eval_t *node_eval, node_t *node, double *mul)
{
	instance_t *inst = node_eval->inst;
	int ni1, ni0, nfree;
	int i, k;

	if (!node_eval_lagrangian_fixed(node_eval, node, mul))
		return node_eval->z; // INFINITY

	nfree = inst->n - (node_eval->n_fixed_1 + node_eval->n_fixed_0); // number of unfixed locations

	// Identify I1
	ni1 = node->min_open - node_eval->n_fixed_1;
	if (ni1 > 0) {
		quickselect(node_eval->rng, node_eval->queue, nfree, ni1);
		for (k = 0; k < ni1; k++) {
			i = node_eval->queue[k].i;
			node_eval->x[i] = 1;
			node_eval->x1[node_eval->n_x1++] = i;
			node_eval->z += node_eval->rc[i];
		}
	} else
		ni1 = 0;

	// Identify I0
	ni0 = inst->n - node->max_open - node_eval->n_fixed_0;
	if (ni0 > 0) {
		quickselect(node_eval->rng, &node_eval->queue[ni1], nfree - ni1, nfree - ni1 - ni0);
		for (k = nfree - 1; k >= nfree - ni0; --k) {
			i = node_eval->queue[k].i;
			node_eval->x[i] = 0;
		}
	} else
		ni0 = 0;

	// Find optimal states of locations in I*
	for (k = ni1; k < nfree - ni0; k++) {
		i = node_eval->queue[k].i;
		node_eval->x[i] = 0;
		if (node_eval->rc[i] < 0.0) {
			node_eval->x[i] = 1;
			node_eval->x1[node_eval->n_x1++] = i;
			node_eval->z += node_eval->rc[i];
		}
	}

	return node_eval->z;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <item
        android:title="@string/options_menu_search"
        android:id="@+id/action_search"
        android:icon="@drawable/ic_search_white_24dp"
        app:showAsAction="ifRoom"
        />
    <item
        android:title="@string/options_menu_settings"
        android:id="@+id/action_settings"
        app:showAsAction="never"
        />
</menu>


text:
using System;
using System.Xml.Serialization;
using System.Collections;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace JdSdk.Response.Marketing
{
    [Serializable]
    public class SellerPromotionSkuListResponse : JdResponse
    {
        [JsonProperty("total_count")]
        public Nullable<Int32> TotalCount
        {
            get;
            set;
        }

        [JsonProperty("promo_sku_v_o_s")]
        public List<PromoSkuVO> PromoSkuVOS
        {
            get;
            set;
        }

    }

}


text:
var path = require('path');

var gulp  = require('gulp');
var gutil = require('gulp-util');

var _ = require('lodash');

//////////////////
// start config //
//////////////////

var moduleName = 'disciple-ui';

var dest = 'dist/';
var src = 'src/';

var destAbsPath = path.resolve(dest);

var npmConfig = require('./package.json');
var includeBrowserSync = true;

if (_.contains(gutil.env._, 'build')) {
  if (!gutil.env.production) gutil.env.production = true;
  includeBrowserSync = false;
}

var scripts = [
  src + 'js/app.js',
  src + 'js/**/*.js',
];

////////////////
// end config //
////////////////

var $ = _.object(_.map(npmConfig.devDependencies, function (version, module) {
  var name = module === 'gulp-util' ? 'gutil' : module.replace('gulp-', '').replace('-', '');
  return [name, require(module)];
}));

var plumberError = function (err) {
  gutil.beep();
  console.error(err.message, err);
};

gulp.task('styles', function () {
  return gulp.src(src + 'scss/style.scss')
    .pipe($.plumber(plumberError))
    .pipe($.sass({
      style: gutil.env.production ? 'compressed' : 'nested',
    }))
    .pipe($.autoprefixer('last 1 version'))
    .pipe(gutil.env.production ? $.rev() : gutil.noop())
    .pipe(gulp.dest(dest + 'css/'))
    .pipe(gutil.env.production ? $.inject(dest + 'index.html', {
      transform: function (filepath) {
        return '<link rel="stylesheet" href="' + filepath.replace(dest.substr(0,2) === '..' ? destAbsPath : dest, '') + '">';
      }
    }) : gutil.noop())
    .pipe(gutil.env.production ? gulp.dest(dest) : gutil.noop())
    .pipe($.browsersync.reload({ stream:true }));
});

gulp.task('copy', function () {
  // apparently gulp ignores dotfiles with globs
  gulp.src(src + 'copy/**/*', { dot: true })
    .pipe(gulp.dest(dest));

  gulp.src(src + 'img/**/*.{png,svg,gif,jpg}')
    .pipe(gulp.dest(dest + 'img/'))
    .pipe($.browsersync.reload({ stream:true }));
});

gulp.task('templates', function () {
  gulp.src([src + 'views/**/*.html', '!' + src + 'views/partials/**/*'])
    .pipe(gulp.dest(dest + 'views/'));
});

gulp.task('scripts', _.union(['index', 'bower'], gutil.env.production ? ['styles'] : []), function () {
  return gulp.src(scripts)
    .pipe($.plumber(plumberError))
    .pipe(gutil.env.production ? $.ngmin() : gutil.noop())
    .pipe(gutil.env.production ? $.concat('script.js') : gutil.noop())
    .pipe(gutil.env.production ? $.uglify() : gutil.noop())
    .pipe($.rev())
    .pipe(gulp.dest(dest + 'js/'))
    .pipe($.inject(dest + 'index.html', {
      transform: function (filepath) {
        return '<script src="' + filepath.replace(dest.substr(0,2) === '..' ? destAbsPath : dest, '').replace(/^\//, '') + '"></script>';
      }
    }))
    .pipe(gulp.dest(dest));
});

gulp.task('bower', _.union(['index'], gutil.env.production ? ['styles'] : []), function () {
  if (!gutil.env.production)
    $.bowerfiles().pipe(gulp.dest(dest + 'bower_components/'));

  return gulp.src([dest + 'index.html'])
    .pipe($.plumber(plumberError))
    .pipe($.wiredep.stream({
      ignorePath: /^\.\.\//,
      directory: 'bower_components',
      bowerJson: require('./bower.json'),
    }))
    .pipe(gulp.dest(dest));
});

gulp.task('usemin', ['index', 'bower', 'scripts', 'styles'], function () {
  if (!gutil.env.production) return;

  gulp.src(dest + 'index.html')
    .pipe($.usemin({
      js: [$.uglify(), $.rev()]
    }))
    .pipe(gulp.dest(dest))
    .pipe($.browsersync.reload({ stream:true }));
});

gulp.task('index', function () {
  // returning makes task synchronous
  // if something else depends on it
  return gulp.src(src + 'index.html')
    .pipe($.replace('<!-- browser-sync -->', '<script>angular.module(\'' + moduleName + '\').constant(\'debug\', ' + !gutil.env.production + ');<' + '/script>'))
    .pipe(gulp.dest(dest));
});

var prereqs = function () {
  var rimrafDeferred = $.q.defer();

  $.rimraf(dest, function (er) {
    if (er) throw er;
    rimrafDeferred.resolve();
    gutil.log('rimraf\'d', gutil.colors.magenta(dest));
  });

  if (!gutil.env.install) {
    return rimrafDeferred.promise;
  }

  var bowerDeferred = $.q.defer();
  var npmDeferred = $.q.defer();

  $.bower.commands.install().on('end', function () {
    bowerDeferred.resolve();
    gutil.log(gutil.colors.cyan('bower install'), 'finished');
  });

  $.npm.load(npmConfig, function () {
    $.npm.commands.install([], function () {
      gutil.log(gutil.colors.cyan('npm install'), 'finished');
      npmDeferred.resolve();
    });
  });

  return $.q.all([
    rimrafDeferred.promise,
    bowerDeferred.promise,
    npmDeferred.promise
  ]);
};

gulp.task('build', function () {
  prereqs().then(function () {
    gulp.start('run');
  });
});

var setUpServer = function () {
  var port = !gutil.env.serve || gutil.env.serve === true ? 1337 : gutil.env.serve;

  var server = $.express();

  // serve static resources from here
  server.use('/js', $.express.static(__dirname + '/dist/js'));
  server.use('/img', $.express.static(__dirname + '/dist/img'));
  server.use('/css', $.express.static(__dirname + '/dist/css'));
  server.use('/views', $.express.static(__dirname + '/dist/views'));
  server.use('/bower_components', $.express.static(__dirname + '/dist/bower_components'));
  server.use('/fonts', $.express.static(__dirname + '/dist/fonts'));
  // server.use($.expresslogger('dev'));

  // everything else gets routed to our index!
  server.get('*', function(req, res) {
    res.sendfile(__dirname + '/dist/index.html');
  });

  server.listen(port);
  console.log('Server listening on port ' + port);
};

var watchOnce = _.once(function () {
  gulp.watch(src + 'scss/**/*.scss', ['styles']);
  gulp.watch(src + 'js/**/*.js', ['scripts']);
  gulp.watch(src + 'views/**/*.html', ['templates']);
  gulp.watch([
    src + 'copy/**/*',
    src + 'img/**/*.{png,svg,gif,jpg}'
  ], { dot: true }, ['copy']);

  gulp.watch(src + 'index.html', ['index', 'scripts', 'bower', 'usemin']);

  var bs = $.browsersync.init(null, {
    ghostMode: {
      clicks: false,
      links: false,
      forms: false,
      scroll: false
    }
  });

  bs.events.on('file:changed', function (file) {
    $.terminalnotifier(file.path.replace(destAbsPath, ''), { title: 'File Changed' });
  });

  if (gutil.env.serve) setUpServer();
});

gulp.task('default', function () {
  prereqs().then(function () {
    gulp.start('run', watchOnce);
  });
});

gulp.task('run', ['copy', 'styles', 'templates', 'scripts', 'bower', 'usemin']);

gulp.task('serve', setUpServer);


text:
- Read [development guide](https://github.com/yuku-t/textcomplete/blob/master/doc/development.md) to setup development environment to your local machine.
- Commit your code on a separate branch with appropreate name.
- Write change log to [CHANGELOG.md](https://github.com/yuku-t/textcomplete/blob/master/CHANGELOG.md).
- Don't change "version" of [package.json](https://github.com/yuku-t/textcomplete/blob/master/package.json).
- Be sure to have tests and use the same coding style as the rest of the codebase.
- Before sending pull request for a feature or bug fix, run the linter and test code.

    ```bash
    npm test # run linter and all tests
    ```

- All pull requests should be made to the `master` branch.


text:
<?php

use \Pimcore\Resource;
use \Pimcore\Log;
use \Pimcore\Log\Writer;

class Admin_LogController extends \Pimcore\Controller\Action\Admin {

    public function init() {
        parent::init();
    }

    public function showAction(){
        $offset = $this->_getParam("start");
        $limit = $this->_getParam("limit");

        $orderby = "ORDER BY id DESC";
        if($this->_getParam("sort") && $this->_getParam("dir")) {
            $orderby = "ORDER BY " . $this->_getParam("sort") . " " . $this->_getParam("dir");
        }

        $queryString = " WHERE 1=1";
        if($this->_getParam("priority") != "-1" && ($this->_getParam("priority") == "0" || $this->_getParam("priority"))) {
            $queryString .= " AND priority <= " . $this->_getParam("priority");
        } else {
            $queryString .= " AND (priority = 6 OR priority = 5 OR priority = 4 OR priority = 3 OR priority = 2 OR priority = 1 OR priority = 0)";
        }
        if($this->_getParam("fromDate")) {
            $datetime = $this->_getParam("fromDate");
            if($this->_getParam("fromTime")) {
                $datetime =  substr($datetime, 0, 11) . $this->_getParam("fromTime") . ":00";
            }
            $queryString .= " AND timestamp >= '" . $datetime . "'";
        }
        if($this->_getParam("toDate")) {
            $datetime = $this->_getParam("toDate");
            if($this->_getParam("toTime")) {
                $datetime =  substr($datetime, 0, 11) . $this->_getParam("toTime") . ":00";
            }
            $queryString .= " AND timestamp <= '" . $datetime . "'";
        }

        if($this->_getParam("component")) {
            $queryString .= " AND component =  '" . $this->_getParam("component") . "'";
        }

        if($this->_getParam("relatedobject")) {
            $queryString .= " AND relatedobject = " . $this->_getParam("relatedobject");
        }

        if($this->_getParam("message")) {
            $queryString .= " AND message like '%" . $this->_getParam("message") ."%'";
        }

        $db = Resource::get();
        $count = $db->fetchCol("SELECT count(*) FROM " . Log\Helper::ERROR_LOG_TABLE_NAME . $queryString);
        $total = $count[0];

        $result = $db->fetchAll("SELECT * FROM " . Log\Helper::ERROR_LOG_TABLE_NAME . $queryString . " $orderby LIMIT $offset, $limit");

        $errorDataList = array();
        if(!empty($result)) {
            foreach($result as $r) {

                $parts = explode("/", $r['filelink']);
                $filename = $parts[count($parts)-1];
                $fileobject = str_replace(PIMCORE_DOCUMENT_ROOT, "", $r['fileobject']);

                $errorData =  array("id"=>$r['id'],
                                    "message"=>$r['message'],
                                    "timestamp"=>$r['timestamp'],
                                    "priority"=>$this->getPriorityName($r['priority']),
                                    "filename" => $filename,
                                    "fileobject" => $fileobject,
            						"relatedobject" => $r['relatedobject'],
                                    "component" => $r['component'],
                                    "source" => $r['source']);
                $errorDataList[] = $errorData;
            }
        }

        $results = array("p_totalCount"=>$total, "p_results"=>$errorDataList);
        $this->_helper->json($results);
    }

    private function getPriorityName($priority) {
        $p = Writer\Db::getPriorities();
        return $p[$priority];
    }

    public function priorityJsonAction() {

        $priorities[] = array("key" => "-1", "value" => "-");
        foreach(Writer\Db::getPriorities() as $key => $p) {
            $priorities[] = array("key" => $key, "value" => $p);
        }

        $this->_helper->json(array("priorities" => $priorities));
    }

    public function componentJsonAction() {
        $components[] = array("key" => "-", "value" => "");
        foreach(Writer\Db::getComponents() as $p) {
            $components[] = array("key" => $p, "value" => $p);
        }

        $this->_helper->json(array("components" => $components));
    }

}


text:
FROM debian:stretch-slim

ARG version=2.92

ENV USERNAME="transmission" \
    PASSWORD="password" \
    DISPLAY=":0" \
    LANG="C.UTF-8" \
    DEBIAN_FRONTEND=noninteractive

LABEL maintainer="Ian Martin <ian@imartin.net>" license="MIT" version=$version

COPY settings.json /var/lib/transmission-daemon/
COPY run.sh /

RUN apt-get -q update && \
    apt-get install -qy --force-yes transmission-daemon ca-certificates wget tar curl unrar-free procps && \
    apt-get -y autoremove && \
    apt-get -y clean && \
    rm -rf /var/lib/apt/lists/* && \
    rm -rf /tmp/* && \
    chmod +x /run.sh && \
    mkdir -p /transmission && \
    chown -R debian-transmission: /transmission

VOLUME ["/transmission"]
EXPOSE 9091 45555
USER debian-transmission
ENTRYPOINT ["/run.sh"]


text:
using System;
using System.Security.Cryptography;
using System.Text;

namespace Structurizr.Api
{
    internal class Md5Digest
    {

        internal string Generate(string content)
        {
            if (content == null)
            {
                content = "";
            }

            MD5 md5 = MD5.Create();
            byte[] textToHash = Encoding.UTF8.GetBytes(content);
            byte[] result = md5.ComputeHash(textToHash);

            return BitConverter.ToString(result).Replace("-", "").ToLower();
        }

    }
}


text:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <gradient
        android:angle="135"
        android:centerColor="#25a8ed"
        android:endColor="#0278b9"
        android:startColor="#62c9f7"
        android:type="linear" />
</shape>


text:
using OpenProtocolInterpreter.Converters;
using System;
using System.Collections.Generic;
using System.Linq;

namespace OpenProtocolInterpreter.Job
{
    /// <summary>
    /// Job ID upload reply
    /// <para>
    ///     The transmission of all the valid Job IDs of the controller.
    ///     The data field contains the number of valid Jobs currently present in the controller, and the ID of each Job.
    /// </para>
    /// <para>Message sent by: Controller</para>
    /// <para>Answer: None</para>
    /// </summary>
    public class Mid0031 : Mid, IJob, IController
    {
        private readonly IValueConverter<int> _intConverter;
        private JobIdListConverter _jobListConverter;
        private const int LAST_REVISION = 1;
        public const int MID = 31;

        public int TotalJobs
        {
            get => GetField(1, (int)DataFields.NUMBER_OF_JOBS).GetValue(_intConverter.Convert);
            private set => GetField(1, (int)DataFields.NUMBER_OF_JOBS).SetValue(_intConverter.Convert, value);
        }

        public List<int> JobIds { get; set; }

        public Mid0031() : this(LAST_REVISION)
        {

        }

        public Mid0031(Header header) : base(header)
        {
            _intConverter = new Int32Converter();
            if (JobIds == null)
                JobIds = new List<int>();
            HandleRevisions();
        }

        public Mid0031(int revision = LAST_REVISION) : this(new Header()
        {
            Mid = MID,
            Revision = revision
        })
        {

        }

        /// <summary>
        /// Revision 1 or 2 constructor
        /// </summary>
        /// <param name="totalJobs">
        ///     Revision 1 range: 00-99
        ///     <para>Revision 2 range: 0000-9999</para>
        /// </param>
        /// <param name="jobIds">
        ///     Revision 1 - range: 00-99 each
        ///     <para>Revision 2 - range: 0000-9999 each</para>
        /// </param>
        /// /// <param name="revision">Revision number (default = 2)</param>
        public Mid0031(int totalJobs, IEnumerable<int> jobIds, int revision = LAST_REVISION) : this(revision)
        {
            TotalJobs = totalJobs;
            JobIds = jobIds.ToList();
        }

        public override string Pack()
        {
            _jobListConverter = new JobIdListConverter(_intConverter, Header.Revision);
            TotalJobs = JobIds.Count;

            var eachJobField = GetField(1, (int)DataFields.EACH_JOB_ID);
            eachJobField.Size = (Header.Revision > 1 ? 4 : 2) * TotalJobs;
            eachJobField.Value = _jobListConverter.Convert(JobIds);
            return base.Pack();
        }

        public override Mid Parse(string package)
        {
            Header = ProcessHeader(package);
            HandleRevisions();

            _jobListConverter = new JobIdListConverter(_intConverter, Header.Revision);
            var eachJobField = GetField(1, (int)DataFields.EACH_JOB_ID);
            eachJobField.Size = Header.Length - eachJobField.Index;
            base.Parse(package);
            JobIds = _jobListConverter.Convert(eachJobField.Value).ToList();
            return this;
        }

        protected override Dictionary<int, List<DataField>> RegisterDatafields()
        {
            return new Dictionary<int, List<DataField>>()
            {
                {
                    1, new List<DataField>()
                            {
                                new DataField((int)DataFields.NUMBER_OF_JOBS, 20, 2, '0', DataField.PaddingOrientations.LEFT_PADDED, false),
                                new DataField((int)DataFields.EACH_JOB_ID, 22, 2, '0', DataField.PaddingOrientations.LEFT_PADDED, false)
                            }
                },
                { 2, new List<DataField>() }
            };
        }

        /// <summary>
        /// Validate all fields size
        /// </summary>
        public bool Validate(out IEnumerable<string> errors)
        {
            List<string> failed = new List<string>();

            if (Header.Revision > 1)
            {
                if (TotalJobs < 0 || TotalJobs > 9999)
                    failed.Add(new ArgumentOutOfRangeException(nameof(TotalJobs), "Range: 0000-9999").Message);
                for (int i = 0; i < JobIds.Count; i++)
                {
                    int job = JobIds[i];
                    if (job < 0 || job > 9999)
                        failed.Add(new ArgumentOutOfRangeException(nameof(JobIds), $"Failed at index[{i}] => Range: 0000-9999").Message);
                }

            }
            else
            {
                if (TotalJobs < 0 || TotalJobs > 99)
                    failed.Add(new ArgumentOutOfRangeException(nameof(TotalJobs), "Range: 00-99").Message);
                for (int i = 0; i < JobIds.Count; i++)
                {
                    int job = JobIds[i];
                    if (job < 0 || job > 99)
                        failed.Add(new ArgumentOutOfRangeException(nameof(JobIds), $"Failed at index[{i}] => Range: 00-99").Message);
                }
            }

            errors = failed;
            return errors.Any();
        }

        private void HandleRevisions()
        {
            if (Header.Revision > 1)
            {
                GetField(1, (int)DataFields.EACH_JOB_ID).Index = 24;
                GetField(1, (int)DataFields.NUMBER_OF_JOBS).Size = 4;
            }
            else
            {
                GetField(1, (int)DataFields.NUMBER_OF_JOBS).Size = GetField(1, (int)DataFields.EACH_JOB_ID).Size = 2;
            }
        }

        public enum DataFields
        {
            NUMBER_OF_JOBS,
            EACH_JOB_ID
        }

    }
}


text:
package org.apache.isis.core.commons.lang;

import java.util.List;

import org.hamcrest.CoreMatchers;
import org.junit.Assert;
import org.junit.Test;

public class StringUtils_SplitOnCommas {

    @Test
    public void length() {
        final List<String> list = StringExtensions.splitOnCommas("foo,bar");
        Assert.assertThat(list.size(), CoreMatchers.is(2));
    }

    @Test
    public void elements() {
        final List<String> list = StringExtensions.splitOnCommas("foo,bar");
        Assert.assertThat(list.get(0), CoreMatchers.is("foo"));
        Assert.assertThat(list.get(1), CoreMatchers.is("bar"));
    }

    @Test
    public void whenHasWhiteSpaceAfterComma() {
        final List<String> list = StringExtensions.splitOnCommas("foo, bar");
        Assert.assertThat(list.get(0), CoreMatchers.is("foo"));
        Assert.assertThat(list.get(1), CoreMatchers.is("bar"));
    }

    @Test
    public void whenHasLeadingWhiteSpace() {
        final List<String> list = StringExtensions.splitOnCommas(" foo, bar");
        Assert.assertThat(list.get(0), CoreMatchers.is("foo"));
        Assert.assertThat(list.get(1), CoreMatchers.is("bar"));
    }

    @Test
    public void whenNull() {
        final List<String> list = StringExtensions.splitOnCommas(null);
        Assert.assertThat(list, CoreMatchers.is(CoreMatchers.nullValue()));
    }

    @Test
    public void whenEmpty() {
        final List<String> list = StringExtensions.splitOnCommas("");
        Assert.assertThat(list.size(), CoreMatchers.is(0));
    }

    @Test
    public void whenOnlyWhiteSpace() {
        final List<String> list = StringExtensions.splitOnCommas(" ");
        Assert.assertThat(list.size(), CoreMatchers.is(0));
    }

    @Test
    public void whenOnlyWhiteSpaceTabs() {
        final List<String> list = StringExtensions.splitOnCommas("\t");
        Assert.assertThat(list.size(), CoreMatchers.is(0));
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You 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.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.camel</groupId>
        <artifactId>catalog</artifactId>
        <version>3.19.0-SNAPSHOT</version>
    </parent>

    <artifactId>camel-catalog-console</artifactId>
    <packaging>jar</packaging>
    <name>Camel :: Catalog :: Console</name>
    <description>Camel Catalog Developer Console</description>

    <properties>
        <firstVersion>3.15.0</firstVersion>
        <label>tooling</label>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-console</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-catalog</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- disable all components -->
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-allcomponents</artifactId>
            <version>${project.version}</version>
            <type>pom</type>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.camel</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- logging -->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-bundle-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-package-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <phase>process-classes</phase>
                    </execution>
                    <execution>
                        <id>generate-postcompile</id>
                        <goals>
                            <goal>generate-postcompile</goal>
                        </goals>
                        <phase>prepare-package</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                            <goal>add-resource</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/generated/java</source>
                            </sources>
                            <resources>
                                <resource>
                                    <directory>src/generated/resources</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>


text:
//
//  StyleTable.m
//  MPTransition (v 1.1.0)
//
//  Created by Mark Pospesel on 5/1/12.
//  Copyright (c) 2012 Mark Pospesel. All rights reserved.
//

#import "StyleTable.h"
#import "MPFoldTransition.h"
#import "MPFlipTransition.h"

@interface StyleTable ()

@end

@implementation StyleTable

@synthesize fold=_fold;
@synthesize style=_style;
@synthesize styleDelegate=_styleDelegate;

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

	self.navigationItem.hidesBackButton = YES;

    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
	return YES;
}

- (CGSize)contentSizeForViewInPopover
{
	return CGSizeMake(240, (6 * [self.tableView rowHeight]) + (3 * [self.tableView sectionHeaderHeight]));
}

#pragma mark - Table view data source

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
	// row = whether bit flag is on/off
	int row = [indexPath row];
	// section = which bit flag
	int section = [indexPath section];
	if (row == (([self style] & (1 << section)) >> section))
		cell.accessoryType = UITableViewCellAccessoryCheckmark;
	else
		cell.accessoryType = UITableViewCellAccessoryNone;
}

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
    }
    else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
	// row = whether bit flag is on/off
	int row = [indexPath row];
	// section = which bit flag
	int section = [indexPath section];
	if (row != (([self style] & (1 << section)) >> section))
	{
		UITableViewCell *oldCell = [tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:(([self style] & (1 << section)) >> section) inSection:section]];
		[oldCell setAccessoryType:UITableViewCellAccessoryNone];

		UITableViewCell *newCell = [tableView cellForRowAtIndexPath:indexPath];
		[newCell setAccessoryType:UITableViewCellAccessoryCheckmark];
	}

	NSUInteger newStyle = ([self style] & ~(1 << section)) | (row << section);
	[self setStyle:newStyle];
	[[self styleDelegate] styleDidChange:self.style];
	[tableView deselectRowAtIndexPath:indexPath animated:YES];
}

- (IBAction)donePressed:(id)sender {
	if ([self isFold])
	{
		// use the opposite fold style from the selected style
		MPFoldStyle popStyle = MPFoldStyleFlipFoldBit([self style]);

		[self.navigationController popViewControllerWithFoldStyle:popStyle];
	}
	else
	{
		// use the opposite flip style from the selected style
		MPFlipStyle popStyle = MPFlipStyleFlipDirectionBit([self style]);

		[self.navigationController popViewControllerWithFlipStyle:popStyle];
	}
}

@end