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

namespace Microsoft.WindowsAzure.Management.SqlDatabase.Test.UnitTests.Server.Cmdlet
{
    using System.Linq;
    using System.ServiceModel;
    using System.Xml;
    using CloudService.Test;
    using Management.Test.Stubs;
    using Management.Test.Tests.Utilities;
    using Services;
    using SqlDatabase.Server.Cmdlet;
    using VisualStudio.TestTools.UnitTesting;

    [TestClass]
    public class ServerCmdletTests : TestBase
    {
        [TestInitialize]
        public void SetupTest()
        {
            Management.Extensions.CmdletSubscriptionExtensions.SessionManager = new InMemorySessionManager();
        }

        [TestMethod]
        public void NewAzureSqlDatabaseServerProcessTest()
        {
            MockCommandRuntime commandRuntime = new MockCommandRuntime();
            SimpleSqlDatabaseManagement channel = new SimpleSqlDatabaseManagement();
            channel.NewServerThunk = ar =>
            {
                string newServerName = "NewServerName";

                Assert.AreEqual("MyLogin", ((NewSqlDatabaseServerInput)ar.Values["input"]).AdministratorLogin);
                Assert.AreEqual("MyPassword", ((NewSqlDatabaseServerInput)ar.Values["input"]).AdministratorLoginPassword);
                Assert.AreEqual("MyLocation", ((NewSqlDatabaseServerInput)ar.Values["input"]).Location);

                XmlElement operationResult = new XmlDocument().CreateElement("ServerName", "http://schemas.microsoft.com/sqlazure/2010/12/");
                operationResult.InnerText = newServerName;
                return operationResult;
            };

            NewAzureSqlDatabaseServer newAzureSqlDatabaseServer = new NewAzureSqlDatabaseServer(channel) { ShareChannel = true };
            newAzureSqlDatabaseServer.CurrentSubscription = UnitTestHelper.CreateUnitTestSubscription();
            newAzureSqlDatabaseServer.CommandRuntime = commandRuntime;
            var newServerResult = newAzureSqlDatabaseServer.NewAzureSqlDatabaseServerProcess("MyLogin", "MyPassword", "MyLocation");
            Assert.AreEqual("NewServerName", newServerResult.ServerName);
            Assert.AreEqual("Success", newServerResult.OperationStatus);

            Assert.AreEqual(0, commandRuntime.ErrorRecords.Count);
        }

        [TestMethod]
        public void GetAzureSqlDatabaseServerProcessTest()
        {
            MockCommandRuntime commandRuntime = new MockCommandRuntime();
            SimpleSqlDatabaseManagement channel = new SimpleSqlDatabaseManagement();
            SqlDatabaseServerList serverList = new SqlDatabaseServerList();

            channel.NewServerThunk = ar =>
            {
                string newServerName = "TestServer" + serverList.Count.ToString();
                serverList.Add(new SqlDatabaseServer()
                {
                    Name = newServerName,
                    AdministratorLogin = ((NewSqlDatabaseServerInput)ar.Values["input"]).AdministratorLogin,
                    Location = ((NewSqlDatabaseServerInput)ar.Values["input"]).Location
                });

                XmlElement operationResult = new XmlDocument().CreateElement("ServerName", "http://schemas.microsoft.com/sqlazure/2010/12/");
                operationResult.InnerText = newServerName;
                return operationResult;
            };

            channel.GetServersThunk = ar =>
            {
                return serverList;
            };

            // Add two servers
            NewAzureSqlDatabaseServer newAzureSqlDatabaseServer = new NewAzureSqlDatabaseServer(channel) { ShareChannel = true };
            newAzureSqlDatabaseServer.CurrentSubscription = UnitTestHelper.CreateUnitTestSubscription();
            newAzureSqlDatabaseServer.CommandRuntime = commandRuntime;
            var newServerResult = newAzureSqlDatabaseServer.NewAzureSqlDatabaseServerProcess("MyLogin0", "MyPassword0", "MyLocation0");
            Assert.AreEqual("TestServer0", newServerResult.ServerName);
            Assert.AreEqual("Success", newServerResult.OperationStatus);

            newServerResult = newAzureSqlDatabaseServer.NewAzureSqlDatabaseServerProcess("MyLogin1", "MyPassword1", "MyLocation1");
            Assert.AreEqual("TestServer1", newServerResult.ServerName);
            Assert.AreEqual("Success", newServerResult.OperationStatus);

            // Get all servers
            GetAzureSqlDatabaseServer getAzureSqlDatabaseServer = new GetAzureSqlDatabaseServer(channel) { ShareChannel = true };
            getAzureSqlDatabaseServer.CurrentSubscription = UnitTestHelper.CreateUnitTestSubscription();
            getAzureSqlDatabaseServer.CommandRuntime = commandRuntime;
            var getServerResult = getAzureSqlDatabaseServer.GetAzureSqlDatabaseServersProcess(null);
            Assert.AreEqual(2, getServerResult.Count());
            var firstServer = getServerResult.First();
            Assert.AreEqual("TestServer0", firstServer.ServerName);
            Assert.AreEqual("MyLogin0", firstServer.AdministratorLogin);
            Assert.AreEqual("MyLocation0", firstServer.Location);
            Assert.AreEqual("Success", firstServer.OperationStatus);
            var lastServer = getServerResult.Last();
            Assert.AreEqual("TestServer1", lastServer.ServerName);
            Assert.AreEqual("MyLogin1", lastServer.AdministratorLogin);
            Assert.AreEqual("MyLocation1", lastServer.Location);
            Assert.AreEqual("Success", lastServer.OperationStatus);

            // Get one server
            getServerResult = getAzureSqlDatabaseServer.GetAzureSqlDatabaseServersProcess("TestServer1");
            Assert.AreEqual(1, getServerResult.Count());
            firstServer = getServerResult.First();
            Assert.AreEqual("TestServer1", firstServer.ServerName);
            Assert.AreEqual("MyLogin1", firstServer.AdministratorLogin);
            Assert.AreEqual("MyLocation1", firstServer.Location);
            Assert.AreEqual("Success", firstServer.OperationStatus);

            Assert.AreEqual(0, commandRuntime.ErrorRecords.Count);
        }

        [TestMethod]
        public void RemoveAzureSqlDatabaseServerProcessTest()
        {
            MockCommandRuntime commandRuntime = new MockCommandRuntime();
            SimpleSqlDatabaseManagement channel = new SimpleSqlDatabaseManagement();
            SqlDatabaseServerList serverList = new SqlDatabaseServerList();

            channel.NewServerThunk = ar =>
            {
                string newServerName = "TestServer" + serverList.Count.ToString();
                serverList.Add(new SqlDatabaseServer()
                {
                    Name = newServerName,
                    AdministratorLogin = ((NewSqlDatabaseServerInput)ar.Values["input"]).AdministratorLogin,
                    Location = ((NewSqlDatabaseServerInput)ar.Values["input"]).Location
                });

                XmlElement operationResult = new XmlDocument().CreateElement("ServerName", "http://schemas.microsoft.com/sqlazure/2010/12/");
                operationResult.InnerText = newServerName;
                return operationResult;
            };

            channel.GetServersThunk = ar =>
            {
                return serverList;
            };

            channel.RemoveServerThunk = ar =>
            {
                string serverName = (string)ar.Values["serverName"];
                var serverToDelete = serverList.SingleOrDefault((server) => server.Name == serverName);
                if (serverToDelete == null)
                {
                    throw new CommunicationException("Server does not exist!");
                }

                serverList.Remove(serverToDelete);
            };

            // Add two servers
            NewAzureSqlDatabaseServer newAzureSqlDatabaseServer = new NewAzureSqlDatabaseServer(channel) { ShareChannel = true };
            newAzureSqlDatabaseServer.CurrentSubscription = UnitTestHelper.CreateUnitTestSubscription();
            newAzureSqlDatabaseServer.CommandRuntime = commandRuntime;
            var newServerResult = newAzureSqlDatabaseServer.NewAzureSqlDatabaseServerProcess("MyLogin0", "MyPassword0", "MyLocation0");
            Assert.AreEqual("TestServer0", newServerResult.ServerName);
            Assert.AreEqual("Success", newServerResult.OperationStatus);

            newServerResult = newAzureSqlDatabaseServer.NewAzureSqlDatabaseServerProcess("MyLogin1", "MyPassword1", "MyLocation1");
            Assert.AreEqual("TestServer1", newServerResult.ServerName);
            Assert.AreEqual("Success", newServerResult.OperationStatus);

            // Get all servers
            GetAzureSqlDatabaseServer getAzureSqlDatabaseServer = new GetAzureSqlDatabaseServer(channel) { ShareChannel = true };
            getAzureSqlDatabaseServer.CurrentSubscription = UnitTestHelper.CreateUnitTestSubscription();
            getAzureSqlDatabaseServer.CommandRuntime = commandRuntime;
            var getServerContext = getAzureSqlDatabaseServer.GetAzureSqlDatabaseServersProcess(null);
            Assert.AreEqual(2, getServerContext.Count());

            // Remove TestServer0
            RemoveAzureSqlDatabaseServer removeAzureSqlDatabaseServer = new RemoveAzureSqlDatabaseServer(channel) { ShareChannel = true };
            removeAzureSqlDatabaseServer.CurrentSubscription = UnitTestHelper.CreateUnitTestSubscription();
            removeAzureSqlDatabaseServer.CommandRuntime = commandRuntime;
            var removeServerContext = removeAzureSqlDatabaseServer.RemoveAzureSqlDatabaseServerProcess("TestServer0");

            // Verify only one server is left
            getAzureSqlDatabaseServer = new GetAzureSqlDatabaseServer(channel) { ShareChannel = true };
            getAzureSqlDatabaseServer.CurrentSubscription = UnitTestHelper.CreateUnitTestSubscription();
            getAzureSqlDatabaseServer.CommandRuntime = commandRuntime;
            var getServerResult = getAzureSqlDatabaseServer.GetAzureSqlDatabaseServersProcess(null);
            Assert.AreEqual(1, getServerContext.Count());
            var firstServer = getServerResult.First();
            Assert.AreEqual("TestServer1", firstServer.ServerName);
            Assert.AreEqual("MyLogin1", firstServer.AdministratorLogin);
            Assert.AreEqual("MyLocation1", firstServer.Location);
            Assert.AreEqual("Success", firstServer.OperationStatus);

            Assert.AreEqual(0, commandRuntime.ErrorRecords.Count);

            // Remove TestServer0 again
            removeAzureSqlDatabaseServer = new RemoveAzureSqlDatabaseServer(channel) { ShareChannel = true };
            removeAzureSqlDatabaseServer.CurrentSubscription = UnitTestHelper.CreateUnitTestSubscription();
            removeAzureSqlDatabaseServer.CommandRuntime = commandRuntime;
            removeServerContext = removeAzureSqlDatabaseServer.RemoveAzureSqlDatabaseServerProcess("TestServer0");
            Assert.AreEqual(1, commandRuntime.ErrorRecords.Count);
            Assert.IsTrue(commandRuntime.WarningOutput.Length > 0);
        }

        [TestMethod]
        public void SetAzureSqlDatabaseServerProcessTest()
        {
            MockCommandRuntime commandRuntime = new MockCommandRuntime();
            SimpleSqlDatabaseManagement channel = new SimpleSqlDatabaseManagement();

            string password = null;

            channel.NewServerThunk = ar =>
            {
                string newServerName = "NewServerName";

                Assert.AreEqual("MyLogin", ((NewSqlDatabaseServerInput)ar.Values["input"]).AdministratorLogin);
                Assert.AreEqual("MyPassword", ((NewSqlDatabaseServerInput)ar.Values["input"]).AdministratorLoginPassword);
                Assert.AreEqual("MyLocation", ((NewSqlDatabaseServerInput)ar.Values["input"]).Location);
                password = ((NewSqlDatabaseServerInput)ar.Values["input"]).AdministratorLoginPassword;

                XmlElement operationResult = new XmlDocument().CreateElement("ServerName", "http://schemas.microsoft.com/sqlazure/2010/12/");
                operationResult.InnerText = newServerName;
                return operationResult;
            };

            channel.SetPasswordThunk = ar =>
            {
                Assert.AreEqual("NewServerName", (string)ar.Values["serverName"]);
                var passwordElement = (XmlElement)ar.Values["password"];
                Assert.AreEqual("AdministratorLoginPassword", passwordElement.Name);
                password = passwordElement.InnerText;
            };

            NewAzureSqlDatabaseServer newAzureSqlDatabaseServer = new NewAzureSqlDatabaseServer(channel) { ShareChannel = true };
            newAzureSqlDatabaseServer.CurrentSubscription = UnitTestHelper.CreateUnitTestSubscription();
            newAzureSqlDatabaseServer.CommandRuntime = commandRuntime;
            var newServerResult = newAzureSqlDatabaseServer.NewAzureSqlDatabaseServerProcess("MyLogin", "MyPassword", "MyLocation");
            Assert.AreEqual("NewServerName", newServerResult.ServerName);
            Assert.AreEqual("Success", newServerResult.OperationStatus);

            SetAzureSqlDatabaseServer setAzureSqlDatabaseServer = new SetAzureSqlDatabaseServer(channel) { ShareChannel = true };
            setAzureSqlDatabaseServer.CurrentSubscription = UnitTestHelper.CreateUnitTestSubscription();
            setAzureSqlDatabaseServer.CommandRuntime = commandRuntime;
            var setPasswordResult = setAzureSqlDatabaseServer.ResetAzureSqlDatabaseServerAdminPasswordProcess("NewServerName", "NewPassword");
            Assert.AreEqual("NewServerName", setPasswordResult.ServerName);
            Assert.AreEqual("Success", setPasswordResult.OperationStatus);
            Assert.AreEqual("NewPassword", password);

            Assert.AreEqual(0, commandRuntime.ErrorRecords.Count);
        }
    }
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0-b52-fcs
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2007.03.21 at 10:56:51 AM CDT
//

package org.apache.axis2.jaxws.description.xml.handler;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.namespace.QName;

/**
 * This type adds an "id" attribute to xsd:QName.
 *

 *

 *

 *
Java class for xsdQNameType complex type.
 *

 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <complexType name="xsdQNameType">
 *   <simpleContent>
 *     <extension base="<http://www.w3.org/2001/XMLSchema>QName">
 *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
 *     </extension>
 *   </simpleContent>
 * </complexType>
 *

 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "xsdQNameType", propOrder = {
        "value"
        })
public class XsdQNameType {

    @XmlValue
    protected QName value;
    @XmlAttribute
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    @XmlID
    protected java.lang.String id;

    /**
     * Gets the value of the value property.
     *
     * @return possible object is {@link QName }
     */
    public QName getValue() {
        return value;
    }

    /**
     * Sets the value of the value property.
     *
     * @param value allowed object is {@link QName }
     */
    public void setValue(QName value) {
        this.value = value;
    }

    /**
     * Gets the value of the id property.
     *
     * @return possible object is {@link java.lang.String }
     */
    public java.lang.String getId() {
        return id;
    }

    /**
     * Sets the value of the id property.
     *
     * @param value allowed object is {@link java.lang.String }
     */
    public void setId(java.lang.String value) {
        this.id = value;
    }

}

redpajama_set_name: RedPajamaGithub


text:
#include "config.h"
#include "public/platform/WebDeviceOrientationData.h"

#include <string.h>

namespace WebKit {

WebDeviceOrientationData::WebDeviceOrientationData()
{
    // Make sure to zero out the memory so that there are no uninitialized bits.
    // This object is used in the shared memory buffer and is memory copied by
    // two processes. Valgrind will complain if we copy around memory that is
    // only partially initialized.
    memset(this, 0, sizeof(*this));
}

} // namespace WebKit


text:
import {
  create,
  isVisible,
  attribute,
  hasClass,
  text
} from 'ember-cli-page-object';

export default create({
  scope: 'impact-circle',
  isVisible: isVisible(),
  class: attribute('class'),
  isSmall: hasClass('small'),
  isMedium: hasClass('medium'),
  isLarge: hasClass('large'),
  container: {
    scope: 'div',
    isVisible: isVisible(),
    theme: attribute('data-theme'),
    hasTooltip: hasClass('tooltipped'),
    tooltip: attribute('data-tooltip')
  },
  number: {
    scope: 'span[data-test-number]',
    isVisible: isVisible(),
    text: text(),
    decimal: attribute('data-decimal')
  },
  asterisk: {
    scope: 'span.asterisk',
    isVisible: isVisible(),
    text: text(),
    theme: attribute('data-theme')
  }
});


text:
/**
 *
 *

 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *

 * http://www.apache.org/licenses/LICENSE-2.0
 *

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.myreader.ui.easyadapter;

import android.content.Context;
import android.text.TextUtils;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;

import com.myreader.R;
import com.myreader.entity.Recommend;
import com.myreader.manager.SettingManager;
import com.myreader.util.Constant;
import com.myreader.util.FileUtils;
import com.myreader.util.FormatUtils;
import com.myreader.view.recyclerview.adapter.BaseViewHolder;
import com.myreader.view.recyclerview.adapter.RecyclerArrayAdapter;

import java.text.NumberFormat;

/**
 * @author yuyh.
 * @date 2016/9/7.
 */
public class RecommendAdapter extends RecyclerArrayAdapter<Recommend.RecommendBooks> {

    public RecommendAdapter(Context context) {
        super(context);
    }

    @Override
    public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {
        return new BaseViewHolder<Recommend.RecommendBooks>(parent, R.layout.item_recommend_list) {
            @Override
            public void setData(final Recommend.RecommendBooks item) {
                super.setData(item);
                String latelyUpdate = "";
                if (!TextUtils.isEmpty(FormatUtils.getDescriptionTimeFromDateString(item.updated))) {
                    latelyUpdate = FormatUtils.getDescriptionTimeFromDateString(item.updated) + ":";
                }

                holder.setText(R.id.tvRecommendTitle, item.title)
                        .setText(R.id.tvLatelyUpdate, latelyUpdate)
                        .setText(R.id.tvRecommendShort, item.lastChapter)
                        .setVisible(R.id.ivTopLabel, item.isTop)
                        .setVisible(R.id.ckBoxSelect, item.showCheckBox)
                        .setVisible(R.id.ivUnReadDot, FormatUtils.formatZhuiShuDateString(item.updated)
                                .compareTo(item.recentReadingTime) > 0);

                if (item.path != null && item.path.endsWith(Constant.SUFFIX_PDF)) {
                    holder.setImageResource(R.id.ivRecommendCover, R.drawable.ic_shelf_pdf);
                } else if (item.path != null && item.path.endsWith(Constant.SUFFIX_EPUB)) {
                    holder.setImageResource(R.id.ivRecommendCover, R.drawable.ic_shelf_epub);
                } else if (item.path != null && item.path.endsWith(Constant.SUFFIX_CHM)) {
                    holder.setImageResource(R.id.ivRecommendCover, R.drawable.ic_shelf_chm);
                } else if (item.isFromSD) {
                    holder.setImageResource(R.id.ivRecommendCover, R.drawable.ic_shelf_txt);
                    long fileLen = FileUtils.getChapterFile(item._id, 1).length();
                    if (fileLen > 10) {
                        double progress = ((double) SettingManager.getInstance().getReadProgress(item._id)[2]) / fileLen;
                        NumberFormat fmt = NumberFormat.getPercentInstance();
                        fmt.setMaximumFractionDigits(2);
                        holder.setText(R.id.tvRecommendShort, "当前阅读进度:" + fmt.format(progress));
                    }
                } else if (!SettingManager.getInstance().isNoneCover()) {
                    holder.setRoundImageUrl(R.id.ivRecommendCover, Constant.IMG_BASE_URL + item.cover,
                            R.drawable.cover_default);
                } else {
                    holder.setImageResource(R.id.ivRecommendCover, R.drawable.cover_default);
                }

                CheckBox ckBoxSelect = holder.getView(R.id.ckBoxSelect);
                ckBoxSelect.setChecked(item.isSeleted);
                ckBoxSelect.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                    @Override
                    public void onCheckedChanged(CompoundButton buttonView,
                                                 boolean isChecked) {
                        item.isSeleted = isChecked;
                    }
                });
            }
        };
    }

}


text:
Back to Home page

The Glyph type exposes the following members.

## Properties

	Name	Description

![Public property](media/pubproperty.gif "Public property")	Figure
Get Figure

![Protected property](media/protproperty.gif "Protected property")	Handle
Unmanaged handle of vglyph library

![Public property](media/pubproperty.gif "Public property")	Height
Get height of Figure

![Public property](media/pubproperty.gif "Public property")	HorizontalAdvance
Horizontal advance

![Public property](media/pubproperty.gif "Public property")	HorizontalBearingX
Horizontal bearing X

![Public property](media/pubproperty.gif "Public property")	HorizontalBearingY
Horizontal bearing Y

![Public property](media/pubproperty.gif "Public property")	VerticalAdvance
Vertical advance

![Public property](media/pubproperty.gif "Public property")	VerticalBearingX
Vertical bearing X

![Public property](media/pubproperty.gif "Public property")	VerticalBearingY
Vertical bearing Y

![Public property](media/pubproperty.gif "Public property")	Width
Get width of Figure

Back to Top

## See Also

#### Reference
Glyph Class
VGlyph Namespace


text:
package org.testcontainers.images.builder;

import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.api.command.InspectImageResponse;
import org.junit.Test;
import org.testcontainers.DockerClientFactory;
import org.testcontainers.utility.Base58;

import static org.assertj.core.api.Assertions.assertThat;

public class ImageFromDockerfileTest {

    @Test
    public void shouldAddDefaultLabels() {
        ImageFromDockerfile image = new ImageFromDockerfile().withDockerfileFromBuilder(it -> it.from("scratch"));

        String imageId = image.resolve();

        DockerClient dockerClient = DockerClientFactory.instance().client();

        InspectImageResponse inspectImageResponse = dockerClient.inspectImageCmd(imageId).exec();

        assertThat(inspectImageResponse.getConfig().getLabels())
            .containsAllEntriesOf(DockerClientFactory.DEFAULT_LABELS);
    }

    @Test
    public void shouldNotAddSessionLabelIfDeleteOnExitIsFalse() {
        ImageFromDockerfile image = new ImageFromDockerfile(
            "localhost/testcontainers/" + Base58.randomString(16).toLowerCase(),
            false
        )
            .withDockerfileFromBuilder(it -> it.from("scratch"));
        String imageId = image.resolve();
        DockerClient dockerClient = DockerClientFactory.instance().client();

        try {
            InspectImageResponse inspectImageResponse = dockerClient.inspectImageCmd(imageId).exec();
            assertThat(inspectImageResponse.getConfig().getLabels())
                .doesNotContainKey(DockerClientFactory.TESTCONTAINERS_SESSION_ID_LABEL);
        } finally {
            // ensure the image is deleted, even if the test fails
            dockerClient.removeImageCmd(imageId).exec();
        }
    }
}


text:
module Soteria
  # Version that the gem is on.
  VERSION = "1.0.4"
end


text:
// =================================================================================================
// Copyright 2011 Twitter, Inc.
// -------------------------------------------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this work except in compliance with the License.
// You may obtain a copy of the License in the LICENSE file, or 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.
// =================================================================================================

package com.twitter.finagle.common.zookeeper;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.logging.Logger;

import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.ZooDefs.Ids;
import org.apache.zookeeper.common.PathUtils;
import org.apache.zookeeper.data.ACL;

import com.twitter.finagle.common.zookeeper.ZooKeeperClient.ZooKeeperConnectionException;
import com.twitter.util.Duration;

/**
 * Utilities for dealing with zoo keeper.
 */
public final class ZooKeeperUtils {

  private static final Logger LOG = Logger.getLogger(ZooKeeperUtils.class.getName());

  /**
   * An appropriate default session timeout for Twitter ZooKeeper clusters.
   */
  public static final Duration DEFAULT_ZK_SESSION_TIMEOUT = Duration.fromSeconds(4);

  /**
   * The magic version number that allows any mutation to always succeed regardless of actual
   * version number.
   */
  public static final int ANY_VERSION = -1;

  /**
   * An ACL that gives all permissions any user authenticated or not.
   */
  public static final List<ACL> OPEN_ACL_UNSAFE =
      Collections.unmodifiableList(new ArrayList<>(Ids.OPEN_ACL_UNSAFE));

  /**
   * An ACL that gives all permissions to node creators and read permissions only to everyone else.
   */
  public static final List<ACL> EVERYONE_READ_CREATOR_ALL;
  static {
    List<ACL> list = new ArrayList<>(Ids.CREATOR_ALL_ACL.size() + Ids.READ_ACL_UNSAFE.size());
    list.addAll(Ids.CREATOR_ALL_ACL);
    list.addAll(Ids.READ_ACL_UNSAFE);
    EVERYONE_READ_CREATOR_ALL = Collections.unmodifiableList(list);
  }

  /**
   * Returns true if the given exception indicates an error that can be resolved by retrying the
   * operation without modification.
   *
   * @param e the exception to check
   * @return true if the causing operation is strictly retryable
   */
  public static boolean isRetryable(KeeperException e) {
    Objects.requireNonNull(e);

    switch (e.code()) {
      case CONNECTIONLOSS:
      case SESSIONEXPIRED:
      case SESSIONMOVED:
      case OPERATIONTIMEOUT:
        return true;

      case RUNTIMEINCONSISTENCY:
      case DATAINCONSISTENCY:
      case MARSHALLINGERROR:
      case BADARGUMENTS:
      case NONODE:
      case NOAUTH:
      case BADVERSION:
      case NOCHILDRENFOREPHEMERALS:
      case NODEEXISTS:
      case NOTEMPTY:
      case INVALIDCALLBACK:
      case INVALIDACL:
      case AUTHFAILED:
      case UNIMPLEMENTED:

      // These two should not be encountered - they are used internally by ZK to specify ranges
      case SYSTEMERROR:
      case APIERROR:

      case OK: // This is actually an invalid ZK exception code

      default:
        return false;
    }
  }

  /**
   * Ensures the given {@code path} exists in the ZK cluster accessed by {@code zkClient}.  If the
   * path already exists, nothing is done; however if any portion of the path is missing, it will be
   * created with the given {@code acl} as a persistent zookeeper node.  The given {@code path} must
   * be a valid zookeeper absolute path.
   *
   * @param zkClient the client to use to access the ZK cluster
   * @param acl the acl to use if creating path nodes
   * @param path the path to ensure exists
   * @throws ZooKeeperConnectionException if there was a problem accessing the ZK cluster
   * @throws InterruptedException if we were interrupted attempting to connect to the ZK cluster
   * @throws KeeperException if there was a problem in ZK
   */
  public static void ensurePath(ZooKeeperClient zkClient, List<ACL> acl, String path)
      throws ZooKeeperConnectionException, InterruptedException, KeeperException {
    Objects.requireNonNull(zkClient);
    Objects.requireNonNull(path);
    if (!path.startsWith("/")) {
      throw new IllegalArgumentException();
    }

    ensurePathInternal(zkClient, acl, path);
  }

  private static void ensurePathInternal(ZooKeeperClient zkClient, List<ACL> acl, String path)
      throws ZooKeeperConnectionException, InterruptedException, KeeperException {
    if (zkClient.get().exists(path, false) == null) {
      // The current path does not exist; so back up a level and ensure the parent path exists
      // unless we're already a root-level path.
      int lastPathIndex = path.lastIndexOf('/');
      if (lastPathIndex > 0) {
        ensurePathInternal(zkClient, acl, path.substring(0, lastPathIndex));
      }

      // We've ensured our parent path (if any) exists so we can proceed to create our path.
      try {
        zkClient.get().create(path, null, acl, CreateMode.PERSISTENT);
      } catch (KeeperException.NodeExistsException e) {
        // This ensures we don't die if a race condition was met between checking existence and
        // trying to create the node.
        LOG.info("Node existed when trying to ensure path " + path + ", somebody beat us to it?");
      }
    }
  }

  /**
   * Validate and return a normalized zookeeper path which doesn't contain consecutive slashes and
   * never ends with a slash (except for root path).
   *
   * @param path the path to be normalized
   * @return normalized path string
   */
  public static String normalizePath(String path) {
    String normalizedPath = path.replaceAll("//+", "/").replaceFirst("(.+)/$", "$1");
    PathUtils.validatePath(normalizedPath);
    return normalizedPath;
  }

  private ZooKeeperUtils() {
    // utility
  }
}


text:
package org.ehcache.jsr107.internal;

import org.ehcache.jsr107.config.ConfigurationElementState;
import org.ehcache.jsr107.config.Jsr107Configuration;
import org.ehcache.jsr107.config.Jsr107Service;
import org.ehcache.spi.service.ServiceProvider;
import org.ehcache.spi.service.Service;

public class DefaultJsr107Service implements Jsr107Service {

  private final Jsr107Configuration configuration;

  public DefaultJsr107Service(Jsr107Configuration configuration) {
    this.configuration = configuration;
  }

  @Override
  public void start(final ServiceProvider<Service> serviceProvider) {
    // no-op
  }

  @Override
  public String getTemplateNameForCache(String cacheAlias) {
    final Jsr107Configuration cfg = configuration;
    if (cfg == null) {
      return null;
    }
    String template = cfg.getTemplates().get(cacheAlias);
    if (template != null) {
      return template;
    }
    return cfg.getDefaultTemplate();
  }

  @Override
  public void stop() {
    // no-op
  }

  @Override
  public boolean jsr107CompliantAtomics() {
    final Jsr107Configuration cfg = configuration;
    if (cfg == null) {
      return true;
    }
    return cfg.isJsr107CompliantAtomics();
  }

  @Override
  public ConfigurationElementState isManagementEnabledOnAllCaches() {
    if (configuration == null) {
      return null;
    } else {
      return configuration.isEnableManagementAll();
    }
  }

  @Override
  public ConfigurationElementState isStatisticsEnabledOnAllCaches() {
    if (configuration == null) {
      return null;
    } else {
      return configuration.isEnableStatisticsAll();
    }
  }
}


text:
#!/usr/bin/env decaf

/*global require */

var File = require('File'),
    exit = require('process').exit,
    dox = require('dox');

var directories = [
    'builtins',
//    'languages',
    'modules'
];

function main(outPath) {
    outPath = outPath || 'docs/docRoot/api';

    var outFile = new File(outPath);
    outFile.removeDirectory();
    outFile.makeDirectory(true);

    var modules = {},
        globals = {},
        docs = {},
        docCount = 0;

    function processDoc(doc) {
        var module = globals;

        docCount++;
        decaf.each(doc, function(item) {
            var myModule = module;
            decaf.each(tags, function(tag) {
                switch (tag.type.toLowerCase()) {
                    case 'module':
                        if (tag.string === undefined) {
                            debugger;
                        }
                        myModule = module = modules[tag.string] = (modules[tag.string] || {});
                        break
                    case 'global':
                        myModule = globals;
                        break;
                    case 'memberof':
                        if (tag.parent=== undefined) {
                            debugger;
                        }
                        modules[tag.parent] = modules[tag.parent] || {};
                        myModule = modules[tag.parent];
                        break;
                }
            });
            if (item.ctx && !item.isPrivate) {
                myModule[item.ctx.name] = item;
            }
        });
    }

    decaf.each(directories, function(dir) {
        var f = new File(dir);
        if (!f.isDirectory()) {
            console.log(dir + ' is not a directory');
            exit(1);
        }
        decaf.each(f.list(), function(path) {
            if (path === 'process.js') {
                debugger;
                console.dir(doc);
            }
            var f = new File(dir + '/' + path),
                doc;
            if (f.isDirectory()) {
                path = dir + '/' + path;
                console.log(path + ' is a directory');
                var index = new File(path + '/index.js');
                if (index.exists()) {
                    doc = docs[path + '/index.js'] = dox.parseComments(index.readAll(), { raw: false });
                    processDoc(doc);
                }
                var lib = new File(path + '/lib');
                if (lib.isDirectory()) {
                    decaf.each(lib.list(), function(filename) {
                        f = new File(path + '/lib/' + filename);
                        if (f.exists()) {
                            doc = docs[path + '/lib/' + filename] = dox.parseComments(f.readAll(), { raw: false });
                            processDoc(doc);
                        }
                    });
                }
            }
            else {
                console.log(dir + '/' + path + ' is a file');
                doc = docs[dir + '/' + path] = dox.parseComments(f.readAll(), { raw: false });
                processDoc(doc);
           }
        });

    });
    console.log(docCount + ' documents')
    console.log('>>>>> GLOBALS');
    decaf.each(globals, function(value, key) {
        console.log('>> ' + key);
    })
//    console.dir(globals);
    console.log('>>>>> MODULES');
    decaf.each(modules, function(value, key) {
        console.log('>> ' + key);
        decaf.each(value, function(value, member) {
            console.log('>>>> ' + key + '.' + member);
        });
    })
//    console.dir(modules);
}


text:
/**
 * \file
 *
 * This file contains the worker process or thread that performs
 * the DNS resolving and validation. The worker is called by a procedure
 * and if in the background continues until exit, if in the foreground
 * returns from the procedure when done.
 */
#include "config.h"
#ifdef HAVE_SSL
#include <openssl/ssl.h>
#endif
#include "libunbound/libworker.h"
#include "libunbound/context.h"
#include "libunbound/unbound.h"
#include "libunbound/worker.h"
#include "libunbound/unbound-event.h"
#include "services/outside_network.h"
#include "services/mesh.h"
#include "services/localzone.h"
#include "services/cache/rrset.h"
#include "services/outbound_list.h"
#include "util/fptr_wlist.h"
#include "util/module.h"
#include "util/regional.h"
#include "util/random.h"
#include "util/config_file.h"
#include "util/netevent.h"
#include "util/storage/lookup3.h"
#include "util/storage/slabhash.h"
#include "util/net_help.h"
#include "util/data/dname.h"
#include "util/data/msgreply.h"
#include "util/data/msgencode.h"
#include "util/tube.h"
#include "iterator/iter_fwd.h"
#include "iterator/iter_hints.h"
#include "sldns/sbuffer.h"
#include "sldns/str2wire.h"

/** handle new query command for bg worker */
static void handle_newq(struct libworker* w, uint8_t* buf, uint32_t len);

/** delete libworker env */
static void
libworker_delete_env(struct libworker* w)
{
	if(w->env) {
		outside_network_quit_prepare(w->back);
		mesh_delete(w->env->mesh);
		context_release_alloc(w->ctx, w->env->alloc,
			!w->is_bg || w->is_bg_thread);
		sldns_buffer_free(w->env->scratch_buffer);
		regional_destroy(w->env->scratch);
		forwards_delete(w->env->fwds);
		hints_delete(w->env->hints);
		ub_randfree(w->env->rnd);
		free(w->env);
	}
#ifdef HAVE_SSL
	SSL_CTX_free(w->sslctx);
#endif
	outside_network_delete(w->back);
}

/** delete libworker struct */
static void
libworker_delete(struct libworker* w)
{
	if(!w) return;
	libworker_delete_env(w);
	comm_base_delete(w->base);
	free(w);
}

void
libworker_delete_event(struct libworker* w)
{
	if(!w) return;
	libworker_delete_env(w);
	comm_base_delete_no_base(w->base);
	free(w);
}

/** setup fresh libworker struct */
static struct libworker*
libworker_setup(struct ub_ctx* ctx, int is_bg, struct event_base* eb)
{
	unsigned int seed;
	struct libworker* w = (struct libworker*)calloc(1, sizeof(*w));
	struct config_file* cfg = ctx->env->cfg;
	int* ports;
	int numports;
	if(!w) return NULL;
	w->is_bg = is_bg;
	w->ctx = ctx;
	w->env = (struct module_env*)malloc(sizeof(*w->env));
	if(!w->env) {
		free(w);
		return NULL;
	}
	*w->env = *ctx->env;
	w->env->alloc = context_obtain_alloc(ctx, !w->is_bg || w->is_bg_thread);
	if(!w->env->alloc) {
		libworker_delete(w);
		return NULL;
	}
	w->thread_num = w->env->alloc->thread_num;
	alloc_set_id_cleanup(w->env->alloc, &libworker_alloc_cleanup, w);
	if(!w->is_bg || w->is_bg_thread) {
		lock_basic_lock(&ctx->cfglock);
	}
	w->env->scratch = regional_create_custom(cfg->msg_buffer_size);
	w->env->scratch_buffer = sldns_buffer_new(cfg->msg_buffer_size);
	w->env->fwds = forwards_create();
	if(w->env->fwds && !forwards_apply_cfg(w->env->fwds, cfg)) {
		forwards_delete(w->env->fwds);
		w->env->fwds = NULL;
	}
	w->env->hints = hints_create();
	if(w->env->hints && !hints_apply_cfg(w->env->hints, cfg)) {
		hints_delete(w->env->hints);
		w->env->hints = NULL;
	}
	if(cfg->ssl_upstream) {
		w->sslctx = connect_sslctx_create(NULL, NULL, NULL);
		if(!w->sslctx) {
			/* to make the setup fail after unlock */
			hints_delete(w->env->hints);
			w->env->hints = NULL;
		}
	}
	if(!w->is_bg || w->is_bg_thread) {
		lock_basic_unlock(&ctx->cfglock);
	}
	if(!w->env->scratch || !w->env->scratch_buffer || !w->env->fwds ||
		!w->env->hints) {
		libworker_delete(w);
		return NULL;
	}
	w->env->worker = (struct worker*)w;
	w->env->probe_timer = NULL;
	seed = (unsigned int)time(NULL) ^ (unsigned int)getpid() ^
		(((unsigned int)w->thread_num)<<17);
	seed ^= (unsigned int)w->env->alloc->next_id;
	if(!w->is_bg || w->is_bg_thread) {
		lock_basic_lock(&ctx->cfglock);
	}
	if(!(w->env->rnd = ub_initstate(seed, ctx->seed_rnd))) {
		if(!w->is_bg || w->is_bg_thread) {
			lock_basic_unlock(&ctx->cfglock);
		}
		seed = 0;
		libworker_delete(w);
		return NULL;
	}
	if(!w->is_bg || w->is_bg_thread) {
		lock_basic_unlock(&ctx->cfglock);
	}
	if(1) {
		/* primitive lockout for threading: if it overwrites another
		 * thread it is like wiping the cache (which is likely empty
		 * at the start) */
		/* note we are holding the ctx lock in normal threaded
		 * cases so that is solved properly, it is only for many ctx
		 * in different threads that this may clash */
		static int done_raninit = 0;
		if(!done_raninit) {
			done_raninit = 1;
			hash_set_raninit((uint32_t)ub_random(w->env->rnd));
		}
	}
	seed = 0;

	if(eb)
		w->base = comm_base_create_event(eb);
	else	w->base = comm_base_create(0);
	if(!w->base) {
		libworker_delete(w);
		return NULL;
	}
	if(!w->is_bg || w->is_bg_thread) {
		lock_basic_lock(&ctx->cfglock);
	}
	numports = cfg_condense_ports(cfg, &ports);
	if(numports == 0) {
		int locked = !w->is_bg || w->is_bg_thread;
		libworker_delete(w);
		if(locked) {
			lock_basic_unlock(&ctx->cfglock);
		}
		return NULL;
	}
	w->back = outside_network_create(w->base, cfg->msg_buffer_size,
		(size_t)cfg->outgoing_num_ports, cfg->out_ifs,
		cfg->num_out_ifs, cfg->do_ip4, cfg->do_ip6,
		cfg->do_tcp?cfg->outgoing_num_tcp:0,
		w->env->infra_cache, w->env->rnd, cfg->use_caps_bits_for_id,
		ports, numports, cfg->unwanted_threshold,
		&libworker_alloc_cleanup, w, cfg->do_udp, w->sslctx,
		cfg->delay_close, NULL);
	if(!w->is_bg || w->is_bg_thread) {
		lock_basic_unlock(&ctx->cfglock);
	}
	free(ports);
	if(!w->back) {
		libworker_delete(w);
		return NULL;
	}
	w->env->mesh = mesh_create(&ctx->mods, w->env);
	if(!w->env->mesh) {
		libworker_delete(w);
		return NULL;
	}
	w->env->send_query = &libworker_send_query;
	w->env->detach_subs = &mesh_detach_subs;
	w->env->attach_sub = &mesh_attach_sub;
	w->env->kill_sub = &mesh_state_delete;
	w->env->detect_cycle = &mesh_detect_cycle;
	comm_base_timept(w->base, &w->env->now, &w->env->now_tv);
	return w;
}

struct libworker* libworker_create_event(struct ub_ctx* ctx,
	struct event_base* eb)
{
	return libworker_setup(ctx, 0, eb);
}

/** handle cancel command for bg worker */
static void
handle_cancel(struct libworker* w, uint8_t* buf, uint32_t len)
{
	struct ctx_query* q;
	if(w->is_bg_thread) {
		lock_basic_lock(&w->ctx->cfglock);
		q = context_deserialize_cancel(w->ctx, buf, len);
		lock_basic_unlock(&w->ctx->cfglock);
	} else {
		q = context_deserialize_cancel(w->ctx, buf, len);
	}
	if(!q) {
		/* probably simply lookup failed, i.e. the message had been
		 * processed and answered before the cancel arrived */
		return;
	}
	q->cancelled = 1;
	free(buf);
}

/** do control command coming into bg server */
static void
libworker_do_cmd(struct libworker* w, uint8_t* msg, uint32_t len)
{
	switch(context_serial_getcmd(msg, len)) {
		default:
		case UB_LIBCMD_ANSWER:
			log_err("unknown command for bg worker %d",
				(int)context_serial_getcmd(msg, len));
			/* and fall through to quit */
		case UB_LIBCMD_QUIT:
			free(msg);
			comm_base_exit(w->base);
			break;
		case UB_LIBCMD_NEWQUERY:
			handle_newq(w, msg, len);
			break;
		case UB_LIBCMD_CANCEL:
			handle_cancel(w, msg, len);
			break;
	}
}

/** handle control command coming into server */
void
libworker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
	uint8_t* msg, size_t len, int err, void* arg)
{
	struct libworker* w = (struct libworker*)arg;

	if(err != 0) {
		free(msg);
		/* it is of no use to go on, exit */
		comm_base_exit(w->base);
		return;
	}
	libworker_do_cmd(w, msg, len); /* also frees the buf */
}

/** the background thread func */
static void*
libworker_dobg(void* arg)
{
	/* setup */
	uint32_t m;
	struct libworker* w = (struct libworker*)arg;
	struct ub_ctx* ctx;
	if(!w) {
		log_err("libunbound bg worker init failed, nomem");
		return NULL;
	}
	ctx = w->ctx;
	log_thread_set(&w->thread_num);
#ifdef THREADS_DISABLED
	/* we are forked */
	w->is_bg_thread = 0;
	/* close non-used parts of the pipes */
	tube_close_write(ctx->qq_pipe);
	tube_close_read(ctx->rr_pipe);
#endif
	if(!tube_setup_bg_listen(ctx->qq_pipe, w->base,
		libworker_handle_control_cmd, w)) {
		log_err("libunbound bg worker init failed, no bglisten");
		return NULL;
	}
	if(!tube_setup_bg_write(ctx->rr_pipe, w->base)) {
		log_err("libunbound bg worker init failed, no bgwrite");
		return NULL;
	}

	/* do the work */
	comm_base_dispatch(w->base);

	/* cleanup */
	m = UB_LIBCMD_QUIT;
	tube_remove_bg_listen(w->ctx->qq_pipe);
	tube_remove_bg_write(w->ctx->rr_pipe);
	libworker_delete(w);
	(void)tube_write_msg(ctx->rr_pipe, (uint8_t*)&m,
		(uint32_t)sizeof(m), 0);
#ifdef THREADS_DISABLED
	/* close pipes from forked process before exit */
	tube_close_read(ctx->qq_pipe);
	tube_close_write(ctx->rr_pipe);
#endif
	return NULL;
}

int libworker_bg(struct ub_ctx* ctx)
{
	struct libworker* w;
	/* fork or threadcreate */
	lock_basic_lock(&ctx->cfglock);
	if(ctx->dothread) {
		lock_basic_unlock(&ctx->cfglock);
		w = libworker_setup(ctx, 1, NULL);
		if(!w) return UB_NOMEM;
		w->is_bg_thread = 1;
#ifdef ENABLE_LOCK_CHECKS
		w->thread_num = 1; /* for nicer DEBUG checklocks */
#endif
		ub_thread_create(&ctx->bg_tid, libworker_dobg, w);
	} else {
		lock_basic_unlock(&ctx->cfglock);
#ifndef HAVE_FORK
		/* no fork on windows */
		return UB_FORKFAIL;
#else /* HAVE_FORK */
		switch((ctx->bg_pid=fork())) {
			case 0:
				w = libworker_setup(ctx, 1, NULL);
				if(!w) fatal_exit("out of memory");
				/* close non-used parts of the pipes */
				tube_close_write(ctx->qq_pipe);
				tube_close_read(ctx->rr_pipe);
				(void)libworker_dobg(w);
				exit(0);
				break;
			case -1:
				return UB_FORKFAIL;
			default:
				/* close non-used parts, so that the worker
				 * bgprocess gets 'pipe closed' when the
				 * main process exits */
				tube_close_read(ctx->qq_pipe);
				tube_close_write(ctx->rr_pipe);
				break;
		}
#endif /* HAVE_FORK */
	}
	return UB_NOERROR;
}

/** get msg reply struct (in temp region) */
static struct reply_info*
parse_reply(sldns_buffer* pkt, struct regional* region, struct query_info* qi)
{
	struct reply_info* rep;
	struct msg_parse* msg;
	if(!(msg = regional_alloc(region, sizeof(*msg)))) {
		return NULL;
	}
	memset(msg, 0, sizeof(*msg));
	sldns_buffer_set_position(pkt, 0);
	if(parse_packet(pkt, msg, region) != 0)
		return 0;
	if(!parse_create_msg(pkt, msg, NULL, qi, &rep, region)) {
		return 0;
	}
	return rep;
}

/** insert canonname */
static int
fill_canon(struct ub_result* res, uint8_t* s)
{
	char buf[255+2];
	dname_str(s, buf);
	res->canonname = strdup(buf);
	return res->canonname != 0;
}

/** fill data into result */
static int
fill_res(struct ub_result* res, struct ub_packed_rrset_key* answer,
	uint8_t* finalcname, struct query_info* rq, struct reply_info* rep)
{
	size_t i;
	struct packed_rrset_data* data;
	res->ttl = 0;
	if(!answer) {
		if(finalcname) {
			if(!fill_canon(res, finalcname))
				return 0; /* out of memory */
		}
		if(rep->rrset_count != 0)
			res->ttl = (int)rep->ttl;
		res->data = (char**)calloc(1, sizeof(char*));
		res->len = (int*)calloc(1, sizeof(int));
		return (res->data && res->len);
	}
	data = (struct packed_rrset_data*)answer->entry.data;
	if(query_dname_compare(rq->qname, answer->rk.dname) != 0) {
		if(!fill_canon(res, answer->rk.dname))
			return 0; /* out of memory */
	} else	res->canonname = NULL;
	res->data = (char**)calloc(data->count+1, sizeof(char*));
	res->len = (int*)calloc(data->count+1, sizeof(int));
	if(!res->data || !res->len)
		return 0; /* out of memory */
	for(i=0; i<data->count; i++) {
		/* remove rdlength from rdata */
		res->len[i] = (int)(data->rr_len[i] - 2);
		res->data[i] = memdup(data->rr_data[i]+2, (size_t)res->len[i]);
		if(!res->data[i])
			return 0; /* out of memory */
	}
	/* ttl for positive answers, from CNAME and answer RRs */
	if(data->count != 0) {
		size_t j;
		res->ttl = (int)data->ttl;
		for(j=0; j<rep->an_numrrsets; j++) {
			struct packed_rrset_data* d =
				(struct packed_rrset_data*)rep->rrsets[j]->
				entry.data;
			if((int)d->ttl < res->ttl)
				res->ttl = (int)d->ttl;
		}
	}
	/* ttl for negative answers */
	if(data->count == 0 && rep->rrset_count != 0)
		res->ttl = (int)rep->ttl;
	res->data[data->count] = NULL;
	res->len[data->count] = 0;
	return 1;
}

/** fill result from parsed message, on error fills servfail */
void
libworker_enter_result(struct ub_result* res, sldns_buffer* buf,
	struct regional* temp, enum sec_status msg_security)
{
	struct query_info rq;
	struct reply_info* rep;
	res->rcode = LDNS_RCODE_SERVFAIL;
	rep = parse_reply(buf, temp, &rq);
	if(!rep) {
		log_err("cannot parse buf");
		return; /* error parsing buf, or out of memory */
	}
	if(!fill_res(res, reply_find_answer_rrset(&rq, rep),
		reply_find_final_cname_target(&rq, rep), &rq, rep))
		return; /* out of memory */
	/* rcode, havedata, nxdomain, secure, bogus */
	res->rcode = (int)FLAGS_GET_RCODE(rep->flags);
	if(res->data && res->data[0])
		res->havedata = 1;
	if(res->rcode == LDNS_RCODE_NXDOMAIN)
		res->nxdomain = 1;
	if(msg_security == sec_status_secure)
		res->secure = 1;
	if(msg_security == sec_status_bogus)
		res->bogus = 1;
}

/** fillup fg results */
static void
libworker_fillup_fg(struct ctx_query* q, int rcode, sldns_buffer* buf,
	enum sec_status s, char* why_bogus)
{
	if(why_bogus)
		q->res->why_bogus = strdup(why_bogus);
	if(rcode != 0) {
		q->res->rcode = rcode;
		q->msg_security = s;
		return;
	}

	q->res->rcode = LDNS_RCODE_SERVFAIL;
	q->msg_security = 0;
	q->msg = memdup(sldns_buffer_begin(buf), sldns_buffer_limit(buf));
	q->msg_len = sldns_buffer_limit(buf);
	if(!q->msg) {
		return; /* the error is in the rcode */
	}

	/* canonname and results */
	q->msg_security = s;
	libworker_enter_result(q->res, buf, q->w->env->scratch, s);
}

void
libworker_fg_done_cb(void* arg, int rcode, sldns_buffer* buf, enum sec_status s,
	char* why_bogus)
{
	struct ctx_query* q = (struct ctx_query*)arg;
	/* fg query is done; exit comm base */
	comm_base_exit(q->w->base);

	libworker_fillup_fg(q, rcode, buf, s, why_bogus);
}

/** setup qinfo and edns */
static int
setup_qinfo_edns(struct libworker* w, struct ctx_query* q,
	struct query_info* qinfo, struct edns_data* edns)
{
	qinfo->qtype = (uint16_t)q->res->qtype;
	qinfo->qclass = (uint16_t)q->res->qclass;
	qinfo->qname = sldns_str2wire_dname(q->res->qname, &qinfo->qname_len);
	if(!qinfo->qname) {
		return 0;
	}
	edns->edns_present = 1;
	edns->ext_rcode = 0;
	edns->edns_version = 0;
	edns->bits = EDNS_DO;
	if(sldns_buffer_capacity(w->back->udp_buff) < 65535)
		edns->udp_size = (uint16_t)sldns_buffer_capacity(
			w->back->udp_buff);
	else	edns->udp_size = 65535;
	return 1;
}

int libworker_fg(struct ub_ctx* ctx, struct ctx_query* q)
{
	struct libworker* w = libworker_setup(ctx, 0, NULL);
	uint16_t qflags, qid;
	struct query_info qinfo;
	struct edns_data edns;
	int bloomfilter;
	if(!w)
		return UB_INITFAIL;
	if(!setup_qinfo_edns(w, q, &qinfo, &edns)) {
		libworker_delete(w);
		return UB_SYNTAX;
	}
	qid = 0;
	qflags = BIT_RD;
	q->w = w;
	/* see if there is a fixed answer */
	sldns_buffer_write_u16_at(w->back->udp_buff, 0, qid);
	sldns_buffer_write_u16_at(w->back->udp_buff, 2, qflags);
	if(local_zones_answer(ctx->local_zones, &qinfo, &edns,
		w->back->udp_buff, w->env->scratch, NULL, &bloomfilter)) {
		regional_free_all(w->env->scratch);
		libworker_fillup_fg(q, LDNS_RCODE_NOERROR,
			w->back->udp_buff, sec_status_insecure, NULL);
		libworker_delete(w);
		free(qinfo.qname);
		return UB_NOERROR;
	}
	/* process new query */
	if(!mesh_new_callback(w->env->mesh, &qinfo, qflags, &edns,
		w->back->udp_buff, qid, libworker_fg_done_cb, q)) {
		free(qinfo.qname);
		return UB_NOMEM;
	}
	free(qinfo.qname);

	/* wait for reply */
	comm_base_dispatch(w->base);

	libworker_delete(w);
	return UB_NOERROR;
}

void
libworker_event_done_cb(void* arg, int rcode, sldns_buffer* buf,
	enum sec_status s, char* why_bogus)
{
	struct ctx_query* q = (struct ctx_query*)arg;
	ub_event_callback_t cb = (ub_event_callback_t)q->cb;
	void* cb_arg = q->cb_arg;
	int cancelled = q->cancelled;

	/* delete it now */
	struct ub_ctx* ctx = q->w->ctx;
	lock_basic_lock(&ctx->cfglock);
	(void)rbtree_delete(&ctx->queries, q->node.key);
	ctx->num_async--;
	context_query_delete(q);
	lock_basic_unlock(&ctx->cfglock);

	if(!cancelled) {
		/* call callback */
		int sec = 0;
		if(s == sec_status_bogus)
			sec = 1;
		else if(s == sec_status_secure)
			sec = 2;
		(*cb)(cb_arg, rcode, (void*)sldns_buffer_begin(buf),
			(int)sldns_buffer_limit(buf), sec, why_bogus);
	}
}

int libworker_attach_mesh(struct ub_ctx* ctx, struct ctx_query* q,
	int* async_id)
{
	struct libworker* w = ctx->event_worker;
	uint16_t qflags, qid;
	struct query_info qinfo;
	struct edns_data edns;
	int bloomfilter;
	if(!w)
		return UB_INITFAIL;
	if(!setup_qinfo_edns(w, q, &qinfo, &edns))
		return UB_SYNTAX;
	qid = 0;
	qflags = BIT_RD;
	q->w = w;
	/* see if there is a fixed answer */
	sldns_buffer_write_u16_at(w->back->udp_buff, 0, qid);
	sldns_buffer_write_u16_at(w->back->udp_buff, 2, qflags);
	if(local_zones_answer(ctx->local_zones, &qinfo, &edns,
		w->back->udp_buff, w->env->scratch, NULL, &bloomfilter)) {
		regional_free_all(w->env->scratch);
		free(qinfo.qname);
		libworker_event_done_cb(q, LDNS_RCODE_NOERROR,
			w->back->udp_buff, sec_status_insecure, NULL);
		return UB_NOERROR;
	}
	/* process new query */
	if(async_id)
		*async_id = q->querynum;
	if(!mesh_new_callback(w->env->mesh, &qinfo, qflags, &edns,
		w->back->udp_buff, qid, libworker_event_done_cb, q)) {
		free(qinfo.qname);
		return UB_NOMEM;
	}
	free(qinfo.qname);
	return UB_NOERROR;
}

/** add result to the bg worker result queue */
static void
add_bg_result(struct libworker* w, struct ctx_query* q, sldns_buffer* pkt,
	int err, char* reason)
{
	uint8_t* msg = NULL;
	uint32_t len = 0;

	/* serialize and delete unneeded q */
	if(w->is_bg_thread) {
		lock_basic_lock(&w->ctx->cfglock);
		if(reason)
			q->res->why_bogus = strdup(reason);
		if(pkt) {
			q->msg_len = sldns_buffer_remaining(pkt);
			q->msg = memdup(sldns_buffer_begin(pkt), q->msg_len);
			if(!q->msg)
				msg = context_serialize_answer(q, UB_NOMEM,
				NULL, &len);
			else	msg = context_serialize_answer(q, err,
				NULL, &len);
		} else msg = context_serialize_answer(q, err, NULL, &len);
		lock_basic_unlock(&w->ctx->cfglock);
	} else {
		if(reason)
			q->res->why_bogus = strdup(reason);
		msg = context_serialize_answer(q, err, pkt, &len);
		(void)rbtree_delete(&w->ctx->queries, q->node.key);
		w->ctx->num_async--;
		context_query_delete(q);
	}

	if(!msg) {
		log_err("out of memory for async answer");
		return;
	}
	if(!tube_queue_item(w->ctx->rr_pipe, msg, len)) {
		log_err("out of memory for async answer");
		return;
	}
}

void
libworker_bg_done_cb(void* arg, int rcode, sldns_buffer* buf, enum sec_status s,
	char* why_bogus)
{
	struct ctx_query* q = (struct ctx_query*)arg;

	if(q->cancelled) {
		if(q->w->is_bg_thread) {
			/* delete it now */
			struct ub_ctx* ctx = q->w->ctx;
			lock_basic_lock(&ctx->cfglock);
			(void)rbtree_delete(&ctx->queries, q->node.key);
			ctx->num_async--;
			context_query_delete(q);
			lock_basic_unlock(&ctx->cfglock);
		}
		/* cancelled, do not give answer */
		return;
	}
	q->msg_security = s;
	if(!buf)
		buf = q->w->env->scratch_buffer;
	if(rcode != 0) {
		error_encode(buf, rcode, NULL, 0, BIT_RD, NULL);
	}
	add_bg_result(q->w, q, buf, UB_NOERROR, why_bogus);
}

/** handle new query command for bg worker */
static void
handle_newq(struct libworker* w, uint8_t* buf, uint32_t len)
{
	uint16_t qflags, qid;
	struct query_info qinfo;
	struct edns_data edns;
	struct ctx_query* q;
	int bloomfilter;
	if(w->is_bg_thread) {
		lock_basic_lock(&w->ctx->cfglock);
		q = context_lookup_new_query(w->ctx, buf, len);
		lock_basic_unlock(&w->ctx->cfglock);
	} else {
		q = context_deserialize_new_query(w->ctx, buf, len);
	}
	free(buf);
	if(!q) {
		log_err("failed to deserialize newq");
		return;
	}
	if(!setup_qinfo_edns(w, q, &qinfo, &edns)) {
		add_bg_result(w, q, NULL, UB_SYNTAX, NULL);
		return;
	}
	qid = 0;
	qflags = BIT_RD;
	/* see if there is a fixed answer */
	sldns_buffer_write_u16_at(w->back->udp_buff, 0, qid);
	sldns_buffer_write_u16_at(w->back->udp_buff, 2, qflags);
	if(local_zones_answer(w->ctx->local_zones, &qinfo, &edns,
		w->back->udp_buff, w->env->scratch, NULL, &bloomfilter)) {
		regional_free_all(w->env->scratch);
		q->msg_security = sec_status_insecure;
		add_bg_result(w, q, w->back->udp_buff, UB_NOERROR, NULL);
		free(qinfo.qname);
		return;
	}
	q->w = w;
	/* process new query */
	if(!mesh_new_callback(w->env->mesh, &qinfo, qflags, &edns,
		w->back->udp_buff, qid, libworker_bg_done_cb, q)) {
		add_bg_result(w, q, NULL, UB_NOMEM, NULL);
	}
	free(qinfo.qname);
}

void libworker_alloc_cleanup(void* arg)
{
	struct libworker* w = (struct libworker*)arg;
	slabhash_clear(&w->env->rrset_cache->table);
        slabhash_clear(w->env->msg_cache);
}

struct outbound_entry* libworker_send_query(uint8_t* qname, size_t qnamelen,
        uint16_t qtype, uint16_t qclass, uint16_t flags, int dnssec,
	int want_dnssec, int nocaps, struct sockaddr_storage* addr,
	socklen_t addrlen, uint8_t* zone, size_t zonelen,
	struct module_qstate* q)
{
	struct libworker* w = (struct libworker*)q->env->worker;
	struct outbound_entry* e = (struct outbound_entry*)regional_alloc(
		q->region, sizeof(*e));
	if(!e)
		return NULL;
	e->qstate = q;
	e->qsent = outnet_serviced_query(w->back, qname,
		qnamelen, qtype, qclass, flags, dnssec, want_dnssec, nocaps,
		q->env->cfg->tcp_upstream, q->env->cfg->ssl_upstream, addr,
		addrlen, zone, zonelen, libworker_handle_service_reply, e,
		w->back->udp_buff);
	if(!e->qsent) {
		return NULL;
	}
	return e;
}

int
libworker_handle_reply(struct comm_point* c, void* arg, int error,
        struct comm_reply* reply_info)
{
	struct module_qstate* q = (struct module_qstate*)arg;
	struct libworker* lw = (struct libworker*)q->env->worker;
	struct outbound_entry e;
	e.qstate = q;
	e.qsent = NULL;

	if(error != 0) {
		mesh_report_reply(lw->env->mesh, &e, reply_info, error);
		return 0;
	}
	/* sanity check. */
	if(!LDNS_QR_WIRE(sldns_buffer_begin(c->buffer))
		|| LDNS_OPCODE_WIRE(sldns_buffer_begin(c->buffer)) !=
			LDNS_PACKET_QUERY
		|| LDNS_QDCOUNT(sldns_buffer_begin(c->buffer)) > 1) {
		/* error becomes timeout for the module as if this reply
		 * never arrived. */
		mesh_report_reply(lw->env->mesh, &e, reply_info,
			NETEVENT_TIMEOUT);
		return 0;
	}
	mesh_report_reply(lw->env->mesh, &e, reply_info, NETEVENT_NOERROR);
	return 0;
}

int
libworker_handle_service_reply(struct comm_point* c, void* arg, int error,
        struct comm_reply* reply_info)
{
	struct outbound_entry* e = (struct outbound_entry*)arg;
	struct libworker* lw = (struct libworker*)e->qstate->env->worker;

	if(error != 0) {
		mesh_report_reply(lw->env->mesh, e, reply_info, error);
		return 0;
	}
	/* sanity check. */
	if(!LDNS_QR_WIRE(sldns_buffer_begin(c->buffer))
		|| LDNS_OPCODE_WIRE(sldns_buffer_begin(c->buffer)) !=
			LDNS_PACKET_QUERY
		|| LDNS_QDCOUNT(sldns_buffer_begin(c->buffer)) > 1) {
		/* error becomes timeout for the module as if this reply
		 * never arrived. */
		mesh_report_reply(lw->env->mesh, e, reply_info,
			NETEVENT_TIMEOUT);
		return 0;
	}
	mesh_report_reply(lw->env->mesh,  e, reply_info, NETEVENT_NOERROR);
	return 0;
}

/* --- fake callbacks for fptr_wlist to work --- */
void worker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
	uint8_t* ATTR_UNUSED(buffer), size_t ATTR_UNUSED(len),
	int ATTR_UNUSED(error), void* ATTR_UNUSED(arg))
{
	log_assert(0);
}

int worker_handle_request(struct comm_point* ATTR_UNUSED(c),
	void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
        struct comm_reply* ATTR_UNUSED(repinfo))
{
	log_assert(0);
	return 0;
}

int worker_handle_reply(struct comm_point* ATTR_UNUSED(c),
	void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
        struct comm_reply* ATTR_UNUSED(reply_info))
{
	log_assert(0);
	return 0;
}

int worker_handle_service_reply(struct comm_point* ATTR_UNUSED(c),
	void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
        struct comm_reply* ATTR_UNUSED(reply_info))
{
	log_assert(0);
	return 0;
}

int remote_accept_callback(struct comm_point* ATTR_UNUSED(c),
	void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
        struct comm_reply* ATTR_UNUSED(repinfo))
{
	log_assert(0);
	return 0;
}

int remote_control_callback(struct comm_point* ATTR_UNUSED(c),
	void* ATTR_UNUSED(arg), int ATTR_UNUSED(error),
        struct comm_reply* ATTR_UNUSED(repinfo))
{
	log_assert(0);
	return 0;
}

void worker_sighandler(int ATTR_UNUSED(sig), void* ATTR_UNUSED(arg))
{
	log_assert(0);
}

struct outbound_entry* worker_send_query(uint8_t* ATTR_UNUSED(qname),
	size_t ATTR_UNUSED(qnamelen), uint16_t ATTR_UNUSED(qtype),
	uint16_t ATTR_UNUSED(qclass), uint16_t ATTR_UNUSED(flags),
	int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
	int ATTR_UNUSED(nocaps), struct sockaddr_storage* ATTR_UNUSED(addr),
	socklen_t ATTR_UNUSED(addrlen), uint8_t* ATTR_UNUSED(zone),
	size_t ATTR_UNUSED(zonelen), struct module_qstate* ATTR_UNUSED(q))
{
	log_assert(0);
	return 0;
}

void
worker_alloc_cleanup(void* ATTR_UNUSED(arg))
{
	log_assert(0);
}

void worker_stat_timer_cb(void* ATTR_UNUSED(arg))
{
	log_assert(0);
}

void worker_probe_timer_cb(void* ATTR_UNUSED(arg))
{
	log_assert(0);
}

void worker_start_accept(void* ATTR_UNUSED(arg))
{
	log_assert(0);
}

void worker_stop_accept(void* ATTR_UNUSED(arg))
{
	log_assert(0);
}

int order_lock_cmp(const void* ATTR_UNUSED(e1), const void* ATTR_UNUSED(e2))
{
	log_assert(0);
	return 0;
}

int
codeline_cmp(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
{
	log_assert(0);
	return 0;
}

int replay_var_compare(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
{
        log_assert(0);
        return 0;
}

void remote_get_opt_ssl(char* ATTR_UNUSED(str), void* ATTR_UNUSED(arg))
{
        log_assert(0);
}

#ifdef UB_ON_WINDOWS
void
worker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev), void*
        ATTR_UNUSED(arg)) {
        log_assert(0);
}

void
wsvc_cron_cb(void* ATTR_UNUSED(arg))
{
        log_assert(0);
}
#endif /* UB_ON_WINDOWS */


text:
[![Version](https://img.shields.io/cocoapods/v/AYSlidingPickerView.svg?style=flat)](http://cocoapods.org/pods/AYSlidingPickerView)
[![License](https://img.shields.io/cocoapods/l/AYSlidingPickerView.svg?style=flat)](http://cocoapods.org/pods/AYSlidingPickerView)
[![Platform](https://img.shields.io/cocoapods/p/AYSlidingPickerView.svg?style=flat)](http://cocoapods.org/pods/AYSlidingPickerView)

Implementation of a picker view that can be shown by either tapping on or panning the navigation bar.

## Usage

`AYSlidingPickerView` can be used either as a singleton or as a regular object. In both cases it is necessary to specify the `mainView` and `items` properties.

`mainView` is simply the view that is currently displayed in the app's window. In most cases, it's just `self.view` in a view controller.

`items` must consist of `AYSlidingPickerViewItem` objects. You can generate them as follows:
```objc
NSMutableArray *items = [NSMutableArray new];
for (NSString *title in titles) {
  AYSlidingPickerViewItem *item = [[AYSlidingPickerViewItem alloc] initWithTitle:title handler:^(BOOL completed) {
    // Action to be performed on selection
  }];
  [items addObject:item];
}
```

For more information, please refer to the example and documentation.

## Installation

AYSlidingPickerView is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:

```ruby
pod "AYSlidingPickerView"
```

## Author

Ayan Yenbekbay, ayan.yenb@gmail.com

## License

```
Copyright (c) 2015 Ayan Yenbekbay <ayan.yenb@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```


text:
"""Constants for Traccar integration."""

CONF_MAX_ACCURACY = 'max_accuracy'
CONF_SKIP_ACCURACY_ON = 'skip_accuracy_filter_on'

ATTR_ADDRESS = 'address'
ATTR_CATEGORY = 'category'
ATTR_GEOFENCE = 'geofence'
ATTR_MOTION = 'motion'
ATTR_SPEED = 'speed'
ATTR_TRACKER = 'tracker'
ATTR_TRACCAR_ID = 'traccar_id'
ATTR_STATUS = 'status'

EVENT_DEVICE_MOVING = 'device_moving'
EVENT_COMMAND_RESULT = 'command_result'
EVENT_DEVICE_FUEL_DROP = 'device_fuel_drop'
EVENT_GEOFENCE_ENTER = 'geofence_enter'
EVENT_DEVICE_OFFLINE = 'device_offline'
EVENT_DRIVER_CHANGED = 'driver_changed'
EVENT_GEOFENCE_EXIT = 'geofence_exit'
EVENT_DEVICE_OVERSPEED = 'device_overspeed'
EVENT_DEVICE_ONLINE = 'device_online'
EVENT_DEVICE_STOPPED = 'device_stopped'
EVENT_MAINTENANCE = 'maintenance'
EVENT_ALARM = 'alarm'
EVENT_TEXT_MESSAGE = 'text_message'
EVENT_DEVICE_UNKNOWN = 'device_unknown'
EVENT_IGNITION_OFF = 'ignition_off'
EVENT_IGNITION_ON = 'ignition_on'
EVENT_ALL_EVENTS = 'all_events'


text:
define([
  "$J",
  "../../dev/Matchers",
  "cali-calcu/CommandParser"
], function ($J, Matchers, CommandParser) {

  $J.describe("cali.calcu.interpreter.mStatic.Divide()", function () {

    // setup the environment
    var epsilon = null; // how close the values should be
    var parser = null; // the parser
    beforeEach(function () {
      parser = new CommandParser();
      // this gives the toBeMatrixCloseTo function
      $J.jasmine.Expectation.addMatchers(Matchers);
      epsilon = 1e-9
    });

    it("should solve numeric equations", function (done) {
      var input = "4 / 2";
      var correct = [
        [2]
      ];
      parser.evaluate(input, function (err, ans) {
        console.debug("input : " + input);
        console.debug("output : ");
        console.debug(ans[0].ans);

        expect(ans[0].ans).toBeMatrixCloseTo(correct, epsilon);
        done();
      });
    });

    it("should solve vector equations", function (done) {
      var input = "[4, 8] / 2";
      var correct = [
        [2, 4]
      ];
      parser.evaluate(input, function (err, ans) {
        console.debug("input : " + input);
        console.debug("output : ");
        console.debug(ans[0].ans);

        expect(ans[0].ans).toBeMatrixCloseTo(correct, epsilon);
        done();
      });
    });

    it("should solve vector equations", function (done) {
      var input = "[4; 8] / 2";
      var correct = [
        [2],
        [4]
      ];
      parser.evaluate(input, function (err, ans) {
        console.debug("input : " + input);
        console.debug("output : ");
        console.debug(ans[0].ans);

        expect(ans[0].ans).toBeMatrixCloseTo(correct, epsilon);
        done();
      });
    });

    it("should solve matrix equations", function (done) {
      var input = "[4, 8; 16, 24] / 2";
      var correct = [
        [2, 4],
        [8, 12]
      ];
      parser.evaluate(input, function (err, ans) {

        expect(ans[0].ans).toBeMatrixCloseTo(correct, epsilon);
        done();
      });
    });

    it("should divide by negative numebrs", function (done) {
      var input = "[4, 8; 16, 24] / -2";
      var correct = [
        [-2, -4],
        [-8, -12]
      ];
      parser.evaluate(input, function (err, ans) {
        console.debug("input : " + input);
        console.debug("output : ");
        console.debug(ans[0].ans);

        expect(ans[0].ans).toBeMatrixCloseTo(correct, epsilon);
        done();
      });
    });
  });

});


text:
<?php
class Portfolio_model extends CI_Model {

	public function __construct() {
	        $this->load->database();
	}

	public function get_portfolio($slug = FALSE) {
	        if ($slug === FALSE)
	        {
	                $query = $this->db->get('portfolio');
	                return $query->result_array();
	        }

	        $query = $this->db->get_where('portfolio', array('slug' => $slug));
	        return $query->row_array();
	}

	public function get_portfolio_details($slug = FALSE) {
	    if ($slug === FALSE) {
            $query = $this->db->get('portfolio_detail');
            return $query->result();
	    }

	    $query = $this->db->get_where('portfolio_detail', array('slug' => $slug));
	    return $query->result();
	}

	public function get_portfolio_images($slug = FALSE) {
	    $query = ($slug === FALSE ? $this->db->get('portfolio_image') : $this->db->get_where('portfolio_image', array('slug' => $slug) ) );
		$result = $query->result();

		return ( $result );
	}
}


text:
package com.msgilligan.bitcoin.cli;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.GnuParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.ParseException;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

import com.msgilligan.bitcoin.rpc.BitcoinClient;
import com.msgilligan.bitcoin.rpc.RPCConfig;

/**
 * Base class for CLI commands that use Bitcoin RPC
 */
public abstract class CliCommand {
    static final String defaultproto = "http";
    static final String defaulthost = "127.0.0.1";
    static final int defaultport = 8332;
    static final String defaultfile = "/";
    static final String rpcuser ="bitcoinrpc";
    static final String rpcpassword ="pass";

    protected CommandLine line = null;
    protected CommandLineParser parser = null;
    protected CliOptions options;
    protected String name;
    protected HelpFormatter formatter = null;
    protected BitcoinClient client = null;

    protected CliCommand(String name, CliOptions options, String[] args) {
        this.name = name;
        this.options = options;
        parser = new GnuParser();
        try {
            this.line = this.parser.parse(options, args);
        } catch (ParseException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
    }

    public BitcoinClient getClient() {
        if (client == null) {
            System.out.println("Connecting to: " + getRPCConfig().getUrl());
            try {
                client = new BitcoinClient(getRPCConfig());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return client;
    }

    public void printHelp() {
        if (formatter == null) {
            formatter = new HelpFormatter();
        }
        formatter.printHelp(name, options, true);
    }

    public void preflight() {
        getClient();
        if (line.hasOption("help")) {
            printHelp();
            System.exit(0);
        }
        if (line.hasOption("rpcwait")) {
            boolean available = client.waitForServer(60*60);   // Wait up to 1 hour
            if (!available) {
                System.out.println("Timeout error.");
                System.exit(1);
            }
        }
    }

    private URL getServerURL() {
        String proto = defaultproto;
        String host = defaulthost;
        int port = defaultport;
        String file = defaultfile;

        URL rpcServerURL = null;
        try {
            rpcServerURL = new URL(proto, host, port, file);
        } catch (MalformedURLException e) {
            // We should be careful that this never happens
            e.printStackTrace();
            // But if it does, throw an unchecked exception
            throw new RuntimeException(e);
        }
        return rpcServerURL;
    }

    private RPCConfig getRPCConfig() {
        URL url = getServerURL();
        RPCConfig cfg = new RPCConfig();
        cfg.setUrl(url);
        cfg.setUsername(rpcuser);
        cfg.setPassword(rpcpassword);
        return cfg;
    }

}


text:
package com.cloud.api.command.user.firewall;

import com.cloud.acl.RoleType;
import com.cloud.api.APICommand;
import com.cloud.api.ApiConstants;
import com.cloud.api.BaseListTaggedResourcesCmd;
import com.cloud.api.Parameter;
import com.cloud.api.response.FirewallResponse;
import com.cloud.api.response.FirewallRuleResponse;
import com.cloud.api.response.IPAddressResponse;
import com.cloud.api.response.ListResponse;
import com.cloud.api.response.NetworkResponse;
import com.cloud.network.rules.FirewallRule;
import com.cloud.utils.Pair;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@APICommand(name = "listFirewallRules", description = "Lists all firewall rules for an IP address.", responseObject = FirewallResponse.class, entityType = {FirewallRule.class},
        requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
public class ListFirewallRulesCmd extends BaseListTaggedResourcesCmd implements IListFirewallRulesCmd {
    public static final Logger s_logger = LoggerFactory.getLogger(ListFirewallRulesCmd.class.getName());
    private static final String s_name = "listfirewallrulesresponse";

    /////////////////////////////////////////////////////
    //////////////// API parameters /////////////////////
    /////////////////////////////////////////////////////
    @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, description = "Lists rule with the specified ID.")
    private Long id;

    @Parameter(name = ApiConstants.IP_ADDRESS_ID,
            type = CommandType.UUID,
            entityType = IPAddressResponse.class,
            description = "the ID of IP address of the firewall services")
    private Long ipAddressId;

    @Parameter(name = ApiConstants.NETWORK_ID,
            type = CommandType.UUID,
            entityType = NetworkResponse.class,
            description = "list firewall rules for certain network",
            since = "4.3")
    private Long networkId;

    @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "list resources by display flag; only ROOT admin is eligible to pass this parameter",
            since = "4.4", authorized = {RoleType.Admin})
    private Boolean display;

    /////////////////////////////////////////////////////
    /////////////////// Accessors ///////////////////////
    /////////////////////////////////////////////////////

    @Override
    public Long getIpAddressId() {
        return ipAddressId;
    }

    @Override
    public FirewallRule.TrafficType getTrafficType() {
        return FirewallRule.TrafficType.Ingress;
    }

    @Override
    public Long getId() {
        return id;
    }

    @Override
    public Long getNetworkId() {
        return networkId;
    }

    @Override
    public Boolean getDisplay() {
        if (display != null) {
            return display;
        }
        return super.getDisplay();
    }

    /////////////////////////////////////////////////////
    /////////////// API Implementation///////////////////
    /////////////////////////////////////////////////////

    @Override
    public void execute() {
        final Pair<List<? extends FirewallRule>, Integer> result = _firewallService.listFirewallRules(this);
        final ListResponse<FirewallResponse> response = new ListResponse<>();
        final List<FirewallResponse> fwResponses = new ArrayList<>();

        for (final FirewallRule fwRule : result.first()) {
            final FirewallResponse ruleData = _responseGenerator.createFirewallResponse(fwRule);
            ruleData.setObjectName("firewallrule");
            fwResponses.add(ruleData);
        }
        response.setResponses(fwResponses, result.second());
        response.setResponseName(getCommandName());
        setResponseObject(response);
    }

    @Override
    public String getCommandName() {
        return s_name;
    }
}


text:
export default function testConfig() {
  this.urlPrefix = 'https://api.github.com/'

  this.get('/repos/:owner/:repo/branches/:branch', (schema, request) => {
    return schema.githubBranches.findBy({ name: request.params.branch });
  });

  this.get('/repos/:owner/:repo/branches', (schema, { params }) => {
    return schema.githubRepositories.findBy({ name: params.repo }).branches;
  });

  this.get('/repos/:owner/:repo/releases', (schema, request) => {
    return schema.githubRepositories.findBy({ name: request.params.branch }).releases;
  });

  this.get('/repos/:owner/:repo', (schema, request) => {
    return schema.githubRepositories.findBy({ name: request.params.repo });
  });

  this.get('repositories', (schema) => {
    return schema.githubRepositories.all();
  });

  this.get('repositories/:repo', (schema, request) => {
    return schema.githubRepositories.findBy({ id: request.params.repo });
  });

  this.get('user', (schema) => {
    return schema.githubUsers.first();
  });

  this.get('user/:id', (schema, request) => {
    return schema.githubUsers.findBy({ id: request.params.id })
  });

  this.get('user/repos', (schema) => {
    return schema.githubUsers.first().repositories;
  });

  this.get('users/:user/repos', (schema, { params }) => {
    return schema.githubUsers.findBy({ login: params.user }).repositories;
  });

  this.get('users/:user', (schema) => {
    return schema.githubUsers.first();
  });

  this.get('users', (schema) => {
    return schema.githubUsers.all().models;
  });

  this.get('/repos/:user/:repo/git/blobs/:blob', (schema, { params }) => {
    return schema.githubBlobs.findBy({ id: params.blob });
  });

  this.get('repos/:user/:repo/releases/:release', (schema, { params }) => {
    return schema.githubReleases.findBy({ id: params.release });
  });

  this.get('repos/:user/:repo/releases', (schema, { params }) => {
    return schema.githubRepositories.findBy({ name: params.repo }).releases;
  });

  this.get('repos/:user/:repo/pulls', (schema, { params }) => {
    return schema.githubRepositories.findBy({ name: params.repo }).pulls;
  });

  this.get('repos/:user/:repo/pulls/:pull', (schema, { params }) => {
    return schema.githubPulls.findBy({ id: params.pull });
  });

  this.get('repos/:user/:repo/git/trees/:tree', (schema, { params }) => {
    return schema.githubTrees.findBy({ id: params.tree });
  });

  this.get('repos/:user/:repo/compare/:base...:head', (schema) => {
    return schema.githubCompares.first();
  });

  this.get('repos/:user/:repo/contents/:file', (schema, { params }) => {
    return schema.githubRepositoryContents.findBy({ name: params.file });
  });

  this.get('/orgs/:org', (schema, { params }) => {
    return schema.githubOrganizations.findBy({ login: params.org });
  });

  this.get('orgs/:org/repos', (schema, { params }) => {
    return schema.githubOrganizations.findBy({ login: params.org }).repositories;
  });

  this.get('orgs/:org/members', (schema, { params }) => {
    return schema.githubOrganizations.findBy({ login: params.org }).members;
  });
}


text:
package org.broadinstitute.hellbender.engine;

import htsjdk.samtools.SAMSequenceDictionary;
import htsjdk.variant.variantcontext.VariantContext;
import htsjdk.variant.vcf.VCFHeader;
import org.broadinstitute.barclay.argparser.Argument;
import org.broadinstitute.hellbender.cmdline.StandardArgumentDefinitions;
import org.broadinstitute.hellbender.engine.filters.CountingReadFilter;
import org.broadinstitute.hellbender.exceptions.GATKException;
import org.broadinstitute.hellbender.utils.SimpleInterval;

import java.util.Spliterator;

/**
 * A VariantWalker is a tool that processes a variant at a time from a source of variants, with
 * optional contextual information from a reference, sets of reads, and/or supplementary sources
 * of Features.
 *
 * VariantWalker authors must implement the {@link #apply} method to process each variant, and may optionally implement
 * {@link #onTraversalStart}, {@link #onTraversalSuccess} and/or {@link #closeTool}.
 */
public abstract class VariantWalker extends VariantWalkerBase {

    // NOTE: using GATKPath rather than FeatureInput<VariantContext> here so that we can keep this driving source
    //       of variants separate from any other potential sources of Features
    @Argument(fullName = StandardArgumentDefinitions.VARIANT_LONG_NAME, shortName = StandardArgumentDefinitions.VARIANT_SHORT_NAME, doc = "A VCF file containing variants", common = false, optional = false)
    public GATKPath drivingVariantFile;

    // NOTE: keeping the driving source of variants separate from other, supplementary FeatureInputs in our FeatureManager in GATKTool
    // we do add the driving source to the Feature manager but we do need to treat it differently and thus this field.
    private FeatureDataSource<VariantContext> drivingVariants;
    private FeatureInput<VariantContext> drivingVariantsFeatureInput;

    @Override
    protected SAMSequenceDictionary getSequenceDictionaryForDrivingVariants() { return drivingVariants.getSequenceDictionary(); }

    @Override
    protected Spliterator<VariantContext> getSpliteratorForDrivingVariants() { return drivingVariants.spliterator(); }

    /**
     * Marked final so that tool authors don't override it. Tool authors should override {@link #onTraversalStart} instead.
     */
    @Override
    protected final void onStartup() {
        super.onStartup();
        if ( hasUserSuppliedIntervals() ) {
            drivingVariants.setIntervalsForTraversal(userIntervals);
        }
    }

    @Override
    protected void initializeDrivingVariants() {
        drivingVariantsFeatureInput = new FeatureInput<>(drivingVariantFile, "drivingVariantFile");

        // Create a FeatureDataSource for the driving variants FeatureInput, using the
        // cache lookahead value from getDrivingVariantCacheLookAheadBases()
        drivingVariants = new FeatureDataSource<>(drivingVariantsFeatureInput, getDrivingVariantCacheLookAheadBases(), VariantContext.class, cloudPrefetchBuffer, cloudIndexPrefetchBuffer,
                                                  getGenomicsDBOptions());

        // Also add the driving variants FeatureInput to FeatureManager as well so that it can be queried,
        // but use a lookahead value of 0 to avoid caching because of windowed queries that need to "look behind" as well.
        features.addToFeatureSources(0, drivingVariantsFeatureInput, VariantContext.class, cloudPrefetchBuffer, cloudIndexPrefetchBuffer,
                                     getGenomicsDBOptions());

        // Note: the intervals for the driving variants are set in onStartup()
    }

    /**
     * Returns the feature input for the driving variants file.
     */
    protected final FeatureInput<VariantContext> getDrivingVariantsFeatureInput() {
        return drivingVariantsFeatureInput;
    }

    /**
     * Gets the header associated with our driving source of variants as a VCFHeader.
     *
     * @return VCFHeader for our driving source of variants
     */
    public final VCFHeader getHeaderForVariants() {
        final Object header = drivingVariants.getHeader();

        if ( ! (header instanceof VCFHeader) ) {
            throw new GATKException("Header for " + drivingVariantFile + " is not in VCF header format");
        }

        return (VCFHeader)header;
    }

    /**
     * Implementation of variant-based traversal.
     *
     * NOTE: You should only override {@link #traverse()} if you are writing a new walker base class in the
     * engine package that extends this class. It is not meant to be overridden by tools outside of the engine
     * package.
     */
    @Override
    public void traverse() {
        final CountingReadFilter readFilter = makeReadFilter();
        // Process each variant in the input stream.
        getTransformedVariantStream( makeVariantFilter() )
                .forEach(variant -> {
                    final SimpleInterval variantInterval = new SimpleInterval(variant);
                    apply(variant,
                            new ReadsContext(reads, variantInterval, readFilter),
                            new ReferenceContext(reference, variantInterval),
                            new FeatureContext(features, variantInterval));

                    progressMeter.update(variantInterval);
                });
    }

    /**
     * Process an individual variant. Must be implemented by tool authors.
     * In general, tool authors should simply stream their output from apply(), and maintain as little internal state
     * as possible.
     *
     * @param variant Current variant being processed.
     * @param readsContext Reads overlapping the current variant. Will be an empty, but non-null, context object
     *                     if there is no backing source of reads data (in which case all queries on it will return
     *                     an empty array/iterator)
     * @param referenceContext Reference bases spanning the current variant. Will be an empty, but non-null, context object
     *                         if there is no backing source of reference data (in which case all queries on it will return
     *                         an empty array/iterator). Can request extra bases of context around the current variant's interval
     *                         by invoking {@link ReferenceContext#setWindow}
     *                         on this object before calling {@link ReferenceContext#getBases}
     * @param featureContext Features spanning the current variant. Will be an empty, but non-null, context object
     *                       if there is no backing source of Feature data (in which case all queries on it will return an
     *                       empty List).
     */
    public abstract void apply( VariantContext variant, ReadsContext readsContext, ReferenceContext referenceContext, FeatureContext featureContext );

    /**
     * Close all data sources.
     *
     * Marked final so that tool authors don't override it. Tool authors should override {@link #onTraversalSuccess} and/or
     * {@link #closeTool} instead.
     */
    @Override
    protected final void onShutdown() {
        super.onShutdown();

        if ( drivingVariants != null )
            drivingVariants.close();
    }
}


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax
{
    internal partial class SyntaxToken
    {
        internal class SyntaxIdentifier : SyntaxToken
        {
            static SyntaxIdentifier()
            {
                ObjectBinder.RegisterTypeReader(typeof(SyntaxIdentifier), r => new SyntaxIdentifier(r));
            }

            protected readonly string TextField;

            internal SyntaxIdentifier(string text)
                : base(SyntaxKind.IdentifierToken, text.Length)
            {
                this.TextField = text;
            }

            internal SyntaxIdentifier(string text, DiagnosticInfo[] diagnostics, SyntaxAnnotation[] annotations)
                : base(SyntaxKind.IdentifierToken, text.Length, diagnostics, annotations)
            {
                this.TextField = text;
            }

            internal SyntaxIdentifier(ObjectReader reader)
                : base(reader)
            {
                this.TextField = reader.ReadString();
                this.FullWidth = this.TextField.Length;
            }

            internal override void WriteTo(ObjectWriter writer)
            {
                base.WriteTo(writer);
                writer.WriteString(this.TextField);
            }

            public override string Text
            {
                get { return this.TextField; }
            }

            public override object Value
            {
                get { return this.TextField; }
            }

            public override string ValueText
            {
                get { return this.TextField; }
            }

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

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

            internal override GreenNode SetDiagnostics(DiagnosticInfo[] diagnostics)
            {
                return new SyntaxIdentifier(this.Text, diagnostics, this.GetAnnotations());
            }

            internal override GreenNode SetAnnotations(SyntaxAnnotation[] annotations)
            {
                return new SyntaxIdentifier(this.Text, this.GetDiagnostics(), annotations);
            }
        }
    }
}


text:
package org.atmosphere.vibe;

import java.io.Serializable;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;

import org.atmosphere.vibe.platform.action.Action;
import org.atmosphere.vibe.platform.action.Actions;
import org.atmosphere.vibe.platform.action.ConcurrentActions;

/**
 * {@link Server} implementation for clustering.
 *

 * With this implementation, {@code server.all(action)} have {@code action} be
 * executed with every socket in every server in the cluster.
 *

 * This implementation adopts the publish and subscribe model from Java Message
 * Service to support clustering. Here, the exchanged message represents method
 * invocation to be executed by every server in the cluster. The following
 * methods create such messages.
 *

 *
{@link Server#all()}

 *
{@link Server#all(Action)}

 *
{@link Server#byTag(String...)}

 *
{@link Server#byTag(String, Action)}

 *
{@link Server#byTag(String[], Action)}

 *

 * A message created by this server is passed to
 * {@link ClusteredServer#onpublish(Action)} and a message created by other
 * servers is expected to be passed to {@link ClusteredServer#messageAction()}.
 * Therefore, what you need to do is to publish a message given through
 * {@link ClusteredServer#onpublish(Action)} to every server in the cluster and
 * to subscribe a published message by other servers to delegate it to
 * {@link ClusteredServer#messageAction()}.
 *

 * Accordingly, such message must be able to be serialized and you have to pass
 * {@link Action} implementing {@link Serializable}. However, serialization of
 * inner classes doesn't work in some cases as expected so that always use
 * {@link Sentence} instead of action if possible unless you use lambda
 * expressions.
 *
 * @author Donghwan Kim
 * @see Note
 *      of the Serializable Interface
 */
public class ClusteredServer extends DefaultServer {

    private Actions<Map<String, Object>> publishActions = new ConcurrentActions<>();
    private Action<Map<String, Object>> messageAction = new Action<Map<String, Object>>() {
        @SuppressWarnings("unchecked")
        @Override
        public void on(Map<String, Object> map) {
            String methodName = (String) map.get("method");
            Object[] args = (Object[]) map.get("args");
            switch (methodName) {
            case "all":
                ClusteredServer.super.all((Action<ServerSocket>) args[0]);
                break;
            case "byTag":
                ClusteredServer.super.byTag((String[]) args[0], (Action<ServerSocket>) args[1]);
                break;
            default:
                throw new IllegalArgumentException("Illegal method name in processing message: "
                        + methodName);
            }
        }
    };

    @Override
    public Server all(Action<ServerSocket> action) {
        publishMessage("all", action);
        return this;
    }

    @Override
    public Server byTag(String[] names, Action<ServerSocket> action) {
        publishMessage("byTag", names, action);
        return this;
    }

    private void publishMessage(String method, Object... args) {
        Map<String, Object> map = new LinkedHashMap<>();
        map.put("method", method);
        map.put("args", args);
        publishActions.fire(Collections.unmodifiableMap(map));
    }

    /**
     * Adds an action to be called with a message to be published to every node
     * in the cluster.
     */
    public Server onpublish(Action<Map<String, Object>> action) {
        publishActions.add(action);
        return this;
    }

    /**
     * An action to receive a message published from one of nodes in the
     * cluster.
     */
    public Action<Map<String, Object>> messageAction() {
        return messageAction;
    }

}


text:
package com.verifalia.api.emailvalidations.models;

import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;

/**
 * A single item of a {@link ValidationRequest} containing an email address to validate, specified by way
 * of the {@link #inputData} property.
 */
@Getter
@Setter
@ToString
@JsonIgnoreProperties(ignoreUnknown = true)
public class ValidationRequestEntry {
    private static final int MAX_CUSTOM_LENGTH = 50;

    /**
     * The input string to validate, which should represent an email address.
     */
    private String inputData;

    /**
     * An optional, custom string which is passed back upon completing the validation job.
     * Setting this value is useful in the event you wish to have a custom reference of this {@link ValidationRequestEntry}
     * with something else (for example, a record in your database). This value accepts a string with a maximum length
     * of 50 characters.
     */
    private String custom;

    /**
     * Initializes a new {@link ValidationRequestEntry}
     * @param inputData The input data string (which should be an email address) to validate.
     */
    public ValidationRequestEntry(@NonNull final String inputData) {
        this.inputData = inputData;
    }

    /**
     * Initializes a new {@link ValidationRequestEntry}
     * @param inputData The input data string (which should be an email address) to validate.
     * @param custom An optional, custom string which is passed back upon completing the validation job.
     */
    public ValidationRequestEntry(@NonNull final String inputData, final String custom) {
        this.inputData = inputData;
        this.custom = custom;
    }

    public void setInputData(@NonNull final String inputData) {
        this.inputData = inputData;
    }

    public void setCustom(final String value) {
        if (value != null) {
            if (value.length() > MAX_CUSTOM_LENGTH) {
                throw new IllegalArgumentException("Custom value '" + value + "' exceeds the maximum allowed length of " + MAX_CUSTOM_LENGTH + " characters.");
            }
        }

        this.custom = value;
    }
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Biatorina tuberculosa Th. Fr.

### Remarks
null


text:
from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^example_app/', include('example_app.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # (r'^admin/', include(admin.site.urls)),
)