text:
package org.camunda.bpm.model.xml.test;

import static org.camunda.bpm.model.xml.test.assertions.ModelAssertions.assertThat;
import static org.junit.Assert.fail;

import java.util.Collection;

import org.camunda.bpm.model.xml.Model;
import org.camunda.bpm.model.xml.ModelInstance;
import org.camunda.bpm.model.xml.impl.type.ModelElementTypeImpl;
import org.camunda.bpm.model.xml.impl.util.ModelTypeException;
import org.camunda.bpm.model.xml.instance.ModelElementInstance;
import org.camunda.bpm.model.xml.test.assertions.AttributeAssert;
import org.camunda.bpm.model.xml.test.assertions.ChildElementAssert;
import org.camunda.bpm.model.xml.test.assertions.ModelElementTypeAssert;
import org.camunda.bpm.model.xml.type.ModelElementType;
import org.junit.Test;
import org.w3c.dom.DOMException;

public abstract class AbstractModelElementInstanceTest {

  protected class TypeAssumption {

    public final String namespaceUri;
    public final ModelElementType extendsType;
    public final boolean isAbstract;

    public TypeAssumption(boolean isAbstract) {
      this(getDefaultNamespace(), isAbstract);
    }

    public TypeAssumption(String namespaceUri, boolean isAbstract) {
      this(namespaceUri, null, isAbstract);
    }

    public TypeAssumption(Class<? extends ModelElementInstance> extendsType, boolean isAbstract) {
      this(getDefaultNamespace(), extendsType, isAbstract);
    }

    public TypeAssumption(String namespaceUri, Class<? extends ModelElementInstance> extendsType, boolean isAbstract) {
      this.namespaceUri = namespaceUri;
      this.extendsType = model.getType(extendsType);
      this.isAbstract = isAbstract;
    }
  }

  protected class ChildElementAssumption {

    public final String namespaceUri;
    public final ModelElementType childElementType;
    public final int minOccurs;
    public final int maxOccurs;

    public ChildElementAssumption(Class<? extends ModelElementInstance> childElementType) {
      this(childElementType, 0, -1);
    }

    public ChildElementAssumption(String namespaceUri, Class<? extends ModelElementInstance> childElementType) {
      this(namespaceUri, childElementType, 0, -1);
    }

    public ChildElementAssumption(Class<? extends ModelElementInstance> childElementType, int minOccurs) {
      this(childElementType, minOccurs, -1);
    }

    public ChildElementAssumption(String namespaceUri, Class<? extends ModelElementInstance> childElementType, int minOccurs) {
      this(namespaceUri, childElementType, minOccurs, -1);
    }

    public ChildElementAssumption(Class<? extends ModelElementInstance> childElementType, int minOccurs, int maxOccurs) {
      this(getDefaultNamespace(), childElementType, minOccurs, maxOccurs);
    }

    public ChildElementAssumption(String namespaceUri, Class<? extends ModelElementInstance> childElementType, int minOccurs, int maxOccurs) {
      this.namespaceUri = namespaceUri;
      this.childElementType = model.getType(childElementType);
      this.minOccurs = minOccurs;
      this.maxOccurs = maxOccurs;
    }
  }

  protected class AttributeAssumption {

    public final String attributeName;
    public final String namespace;
    public final boolean isIdAttribute;
    public final boolean isRequired;
    public final Object defaultValue;

    public AttributeAssumption(String attributeName) {
      this(attributeName, false, false);
    }

    public AttributeAssumption(String namespace, String attributeName) {
      this(namespace, attributeName, false, false);
    }

    public AttributeAssumption(String attributeName, boolean isIdAttribute) {
      this(attributeName, isIdAttribute, false);
    }

    public AttributeAssumption(String namespace, String attributeName, boolean isIdAttribute) {
      this(namespace, attributeName, isIdAttribute, false);
    }

    public AttributeAssumption(String attributeName, boolean isIdAttribute, boolean isRequired) {
      this(attributeName, isIdAttribute, isRequired, null);
    }

    public AttributeAssumption(String namespace, String attributeName, boolean isIdAttribute, boolean isRequired) {
      this(namespace, attributeName, isIdAttribute, isRequired, null);
    }

    public AttributeAssumption(String attributeName, boolean isIdAttribute, boolean isRequired, Object defaultValue) {
      this(null, attributeName, isIdAttribute, isRequired, defaultValue);
    }

    public AttributeAssumption(String namespace, String attributeName, boolean isIdAttribute, boolean isRequired, Object defaultValue) {
      this.attributeName = attributeName;
      this.namespace = namespace;
      this.isIdAttribute = isIdAttribute;
      this.isRequired = isRequired;
      this.defaultValue = defaultValue;
    }
  }

  public static ModelInstance modelInstance;
  public static Model model;
  public static ModelElementType modelElementType;

  public static void initModelElementType(GetModelElementTypeRule modelElementTypeRule) {
    modelInstance = modelElementTypeRule.getModelInstance();
    model = modelElementTypeRule.getModel();
    modelElementType = modelElementTypeRule.getModelElementType();
    assertThat(modelInstance).isNotNull();
    assertThat(model).isNotNull();
    assertThat(modelElementType).isNotNull();
  }

  public abstract String getDefaultNamespace();
  public abstract TypeAssumption getTypeAssumption();
  public abstract Collection<ChildElementAssumption> getChildElementAssumptions();
  public abstract Collection<AttributeAssumption> getAttributesAssumptions();

  public ModelElementTypeAssert assertThatType() {
    return assertThat(modelElementType);
  }

  public AttributeAssert assertThatAttribute(String attributeName) {
    return assertThat(modelElementType.getAttribute(attributeName));
  }

  public ChildElementAssert assertThatChildElement(ModelElementType childElementType) {
    ModelElementTypeImpl modelElementTypeImpl = (ModelElementTypeImpl) modelElementType;
    return assertThat(modelElementTypeImpl.getChildElementCollection(childElementType));
  }

  public ModelElementType getType(Class<? extends ModelElementInstance> instanceClass) {
    return model.getType(instanceClass);
  }

  @Test
  public void testType() {
    assertThatType().isPartOfModel(model);

    TypeAssumption assumption = getTypeAssumption();
    assertThatType().hasTypeNamespace(assumption.namespaceUri);

    if (assumption.isAbstract) {
      assertThatType().isAbstract();
    }
    else {
      assertThatType().isNotAbstract();
    }
    if (assumption.extendsType == null) {
      assertThatType().extendsNoType();
    }
    else {
      assertThatType().extendsType(assumption.extendsType);
    }

    if (assumption.isAbstract) {
      try {
        modelInstance.newInstance(modelElementType);
        fail("Element type " + modelElementType.getTypeName() + " is abstract.");
      }
      catch (DOMException e) {
        // expected exception
      }
      catch (ModelTypeException e) {
        // expected exception
      }
      catch (Exception e) {
        fail("Unexpected exception " + e.getMessage());
      }
    }
    else {
      ModelElementInstance modelElementInstance = modelInstance.newInstance(modelElementType);
      assertThat(modelElementInstance).isNotNull();
    }
  }

  @Test
  public void testChildElements() {
    Collection<ChildElementAssumption> childElementAssumptions = getChildElementAssumptions();
    if (childElementAssumptions == null) {
      assertThatType().hasNoChildElements();
    }
    else {
      assertThat(modelElementType.getChildElementTypes().size()).isEqualTo(childElementAssumptions.size());
      for (ChildElementAssumption assumption : childElementAssumptions) {
        assertThatType().hasChildElements(assumption.childElementType);
        if (assumption.namespaceUri != null) {
          assertThat(assumption.childElementType).hasTypeNamespace(assumption.namespaceUri);
        }
        assertThatChildElement(assumption.childElementType)
          .occursMinimal(assumption.minOccurs)
          .occursMaximal(assumption.maxOccurs);
      }
    }
  }

  @Test
  public void testAttributes() {
    Collection<AttributeAssumption> attributesAssumptions = getAttributesAssumptions();
    if (attributesAssumptions == null) {
      assertThatType().hasNoAttributes();
    }
    else {
      assertThat(attributesAssumptions).hasSameSizeAs(modelElementType.getAttributes());
      for (AttributeAssumption assumption : attributesAssumptions) {
        assertThatType().hasAttributes(assumption.attributeName);
        AttributeAssert attributeAssert = assertThatAttribute(assumption.attributeName);

        attributeAssert.hasOwningElementType(modelElementType);

        if (assumption.namespace != null) {
          attributeAssert.hasNamespaceUri(assumption.namespace);
        }
        else {
          attributeAssert.hasNoNamespaceUri();
        }

        if (assumption.isIdAttribute) {
          attributeAssert.isIdAttribute();
        }
        else {
          attributeAssert.isNotIdAttribute();
        }

        if (assumption.isRequired) {
          attributeAssert.isRequired();
        }
        else {
          attributeAssert.isOptional();
        }

        if (assumption.defaultValue == null) {
          attributeAssert.hasNoDefaultValue();
        }
        else {
          attributeAssert.hasDefaultValue(assumption.defaultValue);
        }

      }
    }
  }
}


text:
<url title="JMeter Plugins" template="dat/plugins.tpl"
     keywords="jmeter, plugins, load, performance, analysis, graphs, hadoop, webdriver, selenium"
     description="A custom set of plugins for Apache JMeter, not affiliated with Apache Software Foundation, graphs, load shapers, new functions."
     class="PWE\Modules\HTMLPage\HTMLPage" src="catalogue.html">

    <url link="get" class="PWE\Modules\RedirectAccepted\RedirectAccepted"
         base="http://search.maven.org/remotecontent?filepath=kg/apc/jmeter-plugins-manager/1.4/jmeter-plugins-manager-1.4.jar"
         no_final_slash="1"/>

    <url link="install" title="Install" menu="1" ico="fa-download"
         class="PWE\Modules\SimpleWiki\SimpleWiki" wiki_dir="wiki" single_page="Install" accept="1"
    />

    <url link="catalogue" title="Browse Plugins" menu="1" ico="fa-search"
         class="PWE\Modules\RedirectAccepted\RedirectAccepted" accept="1" base=""
    />

    <url link="downloads" title="Download" menu="0" class="PWE\Modules\SimpleWiki\SimpleWiki" wiki_dir="dl"
         start_page="all" files_base="files" download_link="../file" accept="1" ico="fa-download">
        <url link="file" files_base="files" class="PWE\Modules\FileDownloads\FileDownloads" accept="2"/>
        <url link="all" class="PWE\Modules\RedirectAccepted\RedirectAccepted" no_final_slash="1"
             base="/install/Install/"/>
    </url>

    <url link="wiki" class="PWE\Modules\SimpleWiki\SimpleWiki" wiki_dir="wiki" start_page="Start" ico="fa-book"
         files_base="files" download_link="../../downloads/file"
         accept="1" menu="1" title="Documentation">
        <url link="WeightedSwitchController" class="PWE\Modules\RedirectAccepted\RedirectAccepted" no_final_slash="1"
             base="https://github.com/Blazemeter/jmeter-bzm-plugins/blob/master/wsc/WeightedSwitchController.md"/>

        <url link="RotatingListener" class="PWE\Modules\RedirectAccepted\RedirectAccepted" no_final_slash="1"
             base="https://github.com/Blazemeter/jmeter-bzm-plugins/blob/master/rotating-listener/RotatingListener.md"/>

        <url link="XMPPSampler" class="PWE\Modules\RedirectAccepted\RedirectAccepted" no_final_slash="1"
             base="https://github.com/Blazemeter/jmeter-bzm-plugins/blob/master/xmpp/XMPPSampler.md"/>

        <url link="XMPPConnection" class="PWE\Modules\RedirectAccepted\RedirectAccepted" no_final_slash="1"
             base="https://github.com/Blazemeter/jmeter-bzm-plugins/blob/master/xmpp/XMPPConnection.md"/>

        <url link="DirectoryListing" class="PWE\Modules\RedirectAccepted\RedirectAccepted" no_final_slash="1"
             base="https://github.com/Blazemeter/jmeter-bzm-plugins/blob/master/directory-listing/DirectoryListing.md"/>

        <url link="LoadosophiaUploader" class="PWE\Modules\RedirectAccepted\RedirectAccepted" no_final_slash="1"
             base="https://github.com/Blazemeter/jmeter-bzm-plugins/blob/master/sense-uploader/LoadosophiaUploader.md"/>

        <url link="PerfMonAgent" class="PWE\Modules\RedirectAccepted\RedirectAccepted" no_final_slash="1"
             base="https://github.com/undera/perfmon-agent"/>

        <url link="HadoopSet" class="PWE\Modules\RedirectAccepted\RedirectAccepted" no_final_slash="1"
             base="https://github.com/undera/jmeter-hadoop"/>
    </url>

    <url link="stats" title="Usage Statistics" menu="1" ico="fa-bar-chart"
         class="PWE\Modules\HTMLPage\HTMLPage" src="stats.html"/>

    <url link="support" menu="1" title="Support Forums" class="PWE\Modules\RedirectAccepted\RedirectAccepted"
         base="http://groups.google.com/forum/#!forum/jmeter-plugins" accept="1" ico="fa-support"/>

    <url link="editor" menu="1" title="JMX Editor" class="PWE\Modules\RedirectAccepted\RedirectAccepted"
         base="/editor/?utm_source=jpgc&utm_medium=banner&utm_campaign=menu" accept="1" ico="fa-pencil-square-o"/>

    <url link="sources" title="Source Code" menu="0" ico="fa-github-alt"
         class="PWE\Modules\RedirectAccepted\RedirectAccepted" base="https://github.com/undera/jmeter-plugins"/>

    <url link="repo" class="JPGC\PluginsRepository" configs="dat/repo" template="empty.tpl"/>
</url>

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using DotNetNuke.Entities.Portals;
using DotNetNuke.Services.Search.Entities;

using Lucene.Net.Analysis;
using Lucene.Net.Analysis.Tokenattributes;

#endregion

namespace DotNetNuke.Services.Search.Internals
{
    /// <summary>
    /// SynonymFilter
    /// </summary>
    /// <remarks>Implementation is inspired by sample code in Manning Lucene In Action 2nd Edition, pg. 133</remarks>
    internal sealed class SynonymFilter : TokenFilter
    {
        private readonly Stack<string> _synonymStack = new Stack<string>();
        private State _current;
        private readonly TermAttribute _termAtt;
        private readonly PositionIncrementAttribute _posIncrAtt;

        public SynonymFilter(TokenStream input) : base(input)
        {
            _termAtt = (TermAttribute) AddAttribute<ITermAttribute>();
            _posIncrAtt = (PositionIncrementAttribute)AddAttribute<IPositionIncrementAttribute>();
        }

        public override bool IncrementToken()
        {
            //Pop buffered synonyms
            if (_synonymStack.Count > 0)
            {
                var syn = _synonymStack.Pop();
                RestoreState(_current);
                _termAtt.SetTermBuffer(syn);

                //set position increment to 0
                _posIncrAtt.PositionIncrement = 0;
                return true;
            }

            //read next token
            if (!input.IncrementToken())
                return false;

            //push synonyms onto stack
            if (AddAliasesToStack())
            {
                _current = CaptureState(); //save current token
            }

            return true;
        }

        private bool AddAliasesToStack()
        {
            var portalId = 0; //default
            string cultureCode;
            var searchDoc = Thread.GetData(Thread.GetNamedDataSlot(Constants.TlsSearchInfo)) as SearchDocument;
            if (searchDoc != null)
            {
                portalId = searchDoc.PortalId;
                cultureCode = searchDoc.CultureCode;
                if (string.IsNullOrEmpty(cultureCode))
                {
                    var portalInfo = PortalController.Instance.GetPortal(portalId);
                    if (portalInfo != null)
                        cultureCode = portalInfo.DefaultLanguage;
                }
            }
            else
            {
                cultureCode = Thread.CurrentThread.CurrentCulture.Name;
            }
            var synonyms = SearchHelper.Instance.GetSynonyms(portalId, cultureCode, _termAtt.Term);
            if (synonyms.Count() == 0) return false;
            foreach (var synonym in synonyms)
            {
                _synonymStack.Push(synonym);
            }
            return true;
        }
    }
}


text:
typedef enum {
    HITCApplicationTypeWidget       = 0,        ///< Widget
    HITCApplicationTypePlugin       = 1,        ///< Plugin
} HITCApplicationType;

//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
/// Class of application (widget and plugin)
@interface HITCApplication : HITCItem

/// Application type
@property (nonatomic, assign) HITCApplicationType applicationType;

/// Initializer
- (id)initWithWidgetName:(NSString *)name tag:(NSInteger)tag;

/// Initializer
- (id)initWithPluginName:(NSString *)name tag:(NSInteger)tag;

@end


text:
namespace caffe2 {

TEST(CPUContextTest, TestAllocAlignment) {
  for (int i = 1; i < 10; ++i) {
    auto data = CPUContext::New(i);
    EXPECT_EQ((reinterpret_cast<size_t>(data.first) % gCaffe2Alignment), 0);
    data.second(data.first);
  }
}

TEST(CPUContextTest, TestAllocDealloc) {
  auto data_and_deleter = CPUContext::New(10 * sizeof(float));
  float* data = static_cast<float*>(data_and_deleter.first);
  EXPECT_NE(data, nullptr);
  auto dst_data_and_deleter = CPUContext::New(10 * sizeof(float));
  float* dst_data = static_cast<float*>(dst_data_and_deleter.first);
  EXPECT_NE(dst_data, nullptr);
  for (int i = 0; i < 10; ++i) {
    data[i] = i;
  }
  DeviceOption option;
  CPUContext context(option);
  context.Copy<float, CPUContext, CPUContext>(10, data, dst_data);
  for (int i = 0; i < 10; ++i) {
    EXPECT_FLOAT_EQ(dst_data[i], i);
  }
  data_and_deleter.second(data);
  dst_data_and_deleter.second(dst_data);
}

}  // namespace caffe2


text:
define(['angular', 'three', 'threexCannonWorld', 'threexCannonBody'], function (angular, three, threexCannonWorld, threexCannonBody) {
    'use strict';

    var fct = function () {
        var worldx, material;

        var physic = function (gravity, friction) {
            var g = gravity || 0;
            var f = friction || 0.005;

            this.worldx = new THREEx.CannonWorld().start();
            this.worldx.world.defaultContactMaterial.friction = f;

            this.material = new CANNON.Material('stone');
            this.worldx.world.addContactMaterial(new CANNON.ContactMaterial(
                this.material,
                this.material,
                0.5, // friction
                0.1 // Restitution
            ));
        };

        physic.prototype.addSphere = function (mesh, opts) {
            if (typeof mesh.geometry !== 'undefined' && mesh.geometry instanceof THREE.SphereGeometry) {
                var obj = {
                    mesh: mesh,
                };
                if (typeof opts === 'object') {
                    if (typeof opts.mass !== 'undefined') {
                        //obj.mass = opts.mass;
                    }
                }
                var tmp = new THREEx.CannonBody(obj).addTo(this.worldx);

                return tmp;
            }
        };

        physic.prototype.addCube = function (mesh, opts) {
            if (typeof mesh.geometry !== 'undefined' && mesh.geometry instanceof THREE.BoxGeometry) {
                var obj = {
                    mesh: mesh
                };
                if (typeof opts === 'object') {
                    if (typeof opts.mass !== 'undefined') {
                        obj.mass = opts.mass;
                    }
                }
                var tmp = new THREEx.CannonBody(obj).addTo(this.worldx);

                return tmp;
            }
        };

        physic.prototype.applyForce = function (force, delta, obj) {
            var f = new THREE.Vector3(force.x, force.y, force.z);

            if (obj instanceof THREEx.CannonBody) {
                obj.applyImpulse(f, delta, {x:obj.mesh.position.x, y: obj.mesh.position.y, z: obj.mesh.position.z});
                //obj.applyForce({x:obj.mesh.position.x, y: obj.mesh.position.y, z: obj.mesh.position.z});
            }
        };

        physic.prototype.applyAngularVelocity = function (obj, force) {
            obj.applyAngularVelocity(force);
        }

        return physic;
    };

    return fct;
})


text:
"""Settings for the ``localized_names`` app."""

CUSTOM_FORMAT_MODULE_PATHS = [
    'multilingual_project_blog.formats',
    'localized_names.formats'
]


text:
<?php
// Version: 1.1; Reports

$txt['generate_reports_desc'] = 'From this section you can generate a variety of reports to assist in the administration of your forum. Simply follow the steps below to select the option of your choice.';
$txt['generate_reports_continue'] = 'Continue';
$txt['generate_reports_type'] = 'Select Type of Report';
$txt['gr_type_boards'] = 'Boards';
$txt['gr_type_desc_boards'] = 'Reports showing the current settings and access levels for each of boards on your forum.';
$txt['gr_type_board_perms'] = 'Board Permissions';
$txt['gr_type_desc_board_perms'] = 'Generate reports showing permissions each membergroup has across the different boards in your forum.';
$txt['gr_type_member_groups'] = 'Membergroups';
$txt['gr_type_desc_member_groups'] = 'Report showing the settings for each membergroup on your forum.';
$txt['gr_type_group_perms'] = 'Group Permissions';
$txt['gr_type_desc_group_perms'] = 'Report on the permissions each membergroup has in the forum.';
$txt['gr_type_staff'] = 'Staff';
$txt['gr_type_desc_staff'] = 'This report summarizes all members who currently have positions of authority on the forum.';

$txt['full_member'] = 'Full Member';
$txt['results'] = 'Results';

// Board permissions
$txt['board_perms_permission'] = 'Permission';
$txt['board_perms_allow'] = 'Allow';
$txt['board_perms_deny'] = 'Deny';
$txt['board_perms_name_announce_topic'] = 'Announce topic';
$txt['board_perms_name_approve_posts'] = 'Approve posts';
$txt['board_perms_name_delete_any'] = 'Delete any posts';
$txt['board_perms_name_delete_own'] = 'Delete own posts';
$txt['board_perms_name_delete_replies'] = 'Delete replies to own topics';
$txt['board_perms_name_lock_any'] = 'Lock any topic';
$txt['board_perms_name_lock_own'] = 'Lock own topic';
$txt['board_perms_name_make_sticky'] = 'Pin topics';
$txt['board_perms_name_mark_any_notify'] = 'Request notification on any topic';
$txt['board_perms_name_mark_notify'] = 'Request notification on own topics';
$txt['board_perms_name_merge_any'] = 'Merge topics';
$txt['board_perms_name_moderate_board'] = 'Moderate the board';
$txt['board_perms_name_modify_any'] = 'Modify any post';
$txt['board_perms_name_modify_own'] = 'Modify own posts';
$txt['board_perms_name_modify_replies'] = 'Modify replies to own topics';
$txt['board_perms_name_move_any'] = 'Move Any Topic';
$txt['board_perms_name_move_own'] = 'Move Own Topics';
$txt['board_perms_name_poll_add_any'] = 'Add poll to any topics';
$txt['board_perms_name_poll_add_own'] = 'Add poll to own topics';
$txt['board_perms_name_poll_edit_any'] = 'Edit any poll';
$txt['board_perms_name_poll_edit_own'] = 'Edit own polls';
$txt['board_perms_name_poll_lock_any'] = 'Lock any poll';
$txt['board_perms_name_poll_lock_own'] = 'Lock own polls';
$txt['board_perms_name_poll_post'] = 'Post new poll';
$txt['board_perms_name_poll_remove_any'] = 'Remove any poll';
$txt['board_perms_name_poll_remove_own'] = 'Remove own polls';
$txt['board_perms_name_poll_view'] = 'View polls';
$txt['board_perms_name_poll_vote'] = 'Vote in polls';
$txt['board_perms_name_post_attachment'] = 'Post attachments';
$txt['board_perms_name_post_new'] = 'Post new topics';
$txt['board_perms_name_post_reply_any'] = 'Post replies in any topic';
$txt['board_perms_name_post_reply_own'] = 'Post replies in own topics';
$txt['board_perms_name_post_unapproved_attachments'] = 'Post unapproved attachments';
$txt['board_perms_name_post_unapproved_topics'] = 'Post unapproved topics';
$txt['board_perms_name_post_unapproved_replies_any'] = 'Post unapproved replies in any topic';
$txt['board_perms_name_post_unapproved_replies_own'] = 'Post unapproved replies in own topic';
$txt['board_perms_name_remove_any'] = 'Remove any topic';
$txt['board_perms_name_remove_own'] = 'Remove own topics';
$txt['board_perms_name_report_any'] = 'Report any post';
$txt['board_perms_name_send_topic'] = 'Send topics to friends';
$txt['board_perms_name_split_any'] = 'Split any topics';
$txt['board_perms_name_view_attachments'] = 'View attachments';

$txt['board_perms_group_no_polls'] = 'This board does not allow polls';
$txt['board_perms_group_reply_only'] = 'This board only allows users to make replies to topics';
$txt['board_perms_group_read_only'] = 'This board does not allow posting';

// Membergroup info!
$txt['member_group_color'] = 'Color';
$txt['member_group_min_posts'] = 'Minimum Posts';
$txt['member_group_max_messages'] = 'Max Personal Messages';
$txt['member_group_icons'] = 'Icons';
$txt['member_group_settings'] = 'Settings';
$txt['member_group_access'] = 'Board Access';

// Board info.
$txt['none'] = 'None';
$txt['board_category'] = 'Category';
$txt['board_parent'] = 'Parent Board';
$txt['board_num_topics'] = 'Number of Topics';
$txt['board_num_posts'] = 'Number of Posts';
$txt['board_count_posts'] = 'Count Posts';
$txt['board_theme'] = 'Board Theme';
$txt['board_override_theme'] = 'Force Board Theme';
$txt['board_profile'] = 'Permissions Profile';
$txt['board_moderators'] = 'Moderators';
$txt['board_groups'] = 'Groups with Access';
$txt['board_disallowed_groups'] = 'Groups with Access Denied';

// Group Permissions.
$txt['group_perms_name_access_mod_center'] = 'Access Moderation Center';
$txt['group_perms_name_admin_forum'] = 'Admin forum';
$txt['group_perms_name_calendar_edit_any'] = 'Edit any event';
$txt['group_perms_name_calendar_edit_own'] = 'Edit own events';
$txt['group_perms_name_calendar_post'] = 'Post events';
$txt['group_perms_name_calendar_view'] = 'View events';
$txt['group_perms_name_edit_news'] = 'Edit forum news';
$txt['group_perms_name_issue_warning'] = 'Issue warnings';
$txt['group_perms_name_karma_edit'] = 'Edit user karma';
$txt['group_perms_name_manage_attachments'] = 'Manage attachments';
$txt['group_perms_name_manage_bans'] = 'Manage bans';
$txt['group_perms_name_manage_boards'] = 'Manage boards';
$txt['group_perms_name_manage_membergroups'] = 'Manage member groups';
$txt['group_perms_name_manage_permissions'] = 'Manage permissions';
$txt['group_perms_name_manage_smileys'] = 'Manage smileys and message icons';
$txt['group_perms_name_moderate_forum'] = 'Moderate the forum';
$txt['group_perms_name_pm_read'] = 'Read personal messages';
$txt['group_perms_name_pm_send'] = 'Send personal messages';
$txt['group_perms_name_profile_extra_any'] = 'Edit any additional options';
$txt['group_perms_name_profile_extra_own'] = 'Edit own additional options';
$txt['group_perms_name_profile_identity_any'] = 'Edit any account settings';
$txt['group_perms_name_profile_identity_own'] = 'Edit own account settings';
$txt['group_perms_name_profile_set_avatar'] = 'Select an avatar';
$txt['group_perms_name_profile_remove_any'] = 'Delete any account';
$txt['group_perms_name_profile_remove_own'] = 'Delete own account';
$txt['group_perms_name_profile_title_any'] = 'Edit any custom title';
$txt['group_perms_name_profile_title_own'] = 'Edit own custom title';
$txt['group_perms_name_profile_view_any'] = 'View any profile';
$txt['group_perms_name_profile_view_own'] = 'View own profile';
$txt['group_perms_name_search_posts'] = 'Search for posts';
$txt['group_perms_name_send_mail'] = 'Send a forum email to members';
$txt['group_perms_name_view_mlist'] = 'View the member list';
$txt['group_perms_name_view_stats'] = 'View forum stats';
$txt['group_perms_name_who_view'] = 'See who\'s online';

$txt['report_error_too_many_staff'] = 'You have too many staff members. The report will not work with more than 300 staff members.';
$txt['report_staff_position'] = 'Position';
$txt['report_staff_moderates'] = 'Moderates';
$txt['report_staff_posts'] = 'Posts';
$txt['report_staff_last_login'] = 'Last Login';
$txt['report_staff_all_boards'] = 'All boards';
$txt['report_staff_no_boards'] = 'No boards';


text:
// @ts-nocheck
'use strict';

/* global window document Node ShadowRoot */

/**
 * Helper functions that are passed by `toString()` by Driver to be evaluated in target page.
 */

/**
 * The `exceptionDetails` provided by the debugger protocol does not contain the useful
 * information such as name, message, and stack trace of the error when it's wrapped in a
 * promise. Instead, map to a successful object that contains this information.
 * @param {string|Error} err The error to convert
 */
/* istanbul ignore next */
function wrapRuntimeEvalErrorInBrowser(err) {
  err = err || new Error();
  const fallbackMessage = typeof err === 'string' ? err : 'unknown error';

  return {
    __failedInBrowser: true,
    name: err.name || 'Error',
    message: err.message || fallbackMessage,
    stack: err.stack || (new Error()).stack,
  };
}

/**
 * Used by _waitForCPUIdle and executed in the context of the page, updates the ____lastLongTask
 * property on window to the end time of the last long task.
 */
/* istanbul ignore next */
function registerPerformanceObserverInPage() {
  window.____lastLongTask = window.__perfNow();
  const observer = new window.PerformanceObserver(entryList => {
    const entries = entryList.getEntries();
    for (const entry of entries) {
      if (entry.entryType === 'longtask') {
        const taskEnd = entry.startTime + entry.duration;
        window.____lastLongTask = Math.max(window.____lastLongTask, taskEnd);
      }
    }
  });

  observer.observe({entryTypes: ['longtask']});
  // HACK: A PerformanceObserver will be GC'd if there are no more references to it, so attach it to
  // window to ensure we still receive longtask notifications. See https://crbug.com/742530.
  // For an example test of this behavior see https://gist.github.com/patrickhulce/69d8bed1807e762218994b121d06fea6.
  //   FIXME COMPAT: This hack isn't neccessary as of Chrome 62.0.3176.0
  //   https://bugs.chromium.org/p/chromium/issues/detail?id=742530#c7
  window.____lhPerformanceObserver = observer;
}

/**
 * Used by _waitForCPUIdle and executed in the context of the page, returns time since last long task.
 */
/* istanbul ignore next */
function checkTimeSinceLastLongTask() {
  // Wait for a delta before returning so that we're sure the PerformanceObserver
  // has had time to register the last longtask
  return new window.__nativePromise(resolve => {
    const timeoutRequested = window.__perfNow() + 50;

    setTimeout(() => {
      // Double check that a long task hasn't happened since setTimeout
      const timeoutFired = window.__perfNow();
      const timeSinceLongTask = timeoutFired - timeoutRequested < 50 ?
          timeoutFired - window.____lastLongTask : 0;
      resolve(timeSinceLongTask);
    }, 50);
  });
}

/**
 * @param {string=} selector Optional simple CSS selector to filter nodes on.
 *     Combinators are not supported.
 * @return {Array<HTMLElement>}
 */
/* istanbul ignore next */
function getElementsInDocument(selector) {
  const realMatchesFn = window.__ElementMatches || window.Element.prototype.matches;
  /** @type {Array<HTMLElement>} */
  const results = [];

  /** @param {NodeListOf<HTMLElement>} nodes */
  const _findAllElements = nodes => {
    for (let i = 0, el; el = nodes[i]; ++i) {
      if (!selector || realMatchesFn.call(el, selector)) {
        results.push(el);
      }
      // If the element has a shadow root, dig deeper.
      if (el.shadowRoot) {
        _findAllElements(el.shadowRoot.querySelectorAll('*'));
      }
    }
  };
  _findAllElements(document.querySelectorAll('*'));

  return results;
}

/**
 * Gets the opening tag text of the given node.
 * @param {Element|ShadowRoot} element
 * @param {Array<string>=} ignoreAttrs An optional array of attribute tags to not include in the HTML snippet.
 * @return {string}
 */
/* istanbul ignore next */
function getOuterHTMLSnippet(element, ignoreAttrs = []) {
  try {
    // ShadowRoots are sometimes passed in; use their hosts' outerHTML.
    if (element instanceof ShadowRoot) {
      element = element.host;
    }

    const clone = element.cloneNode();
    ignoreAttrs.forEach(attribute =>{
      clone.removeAttribute(attribute);
    });
    const reOpeningTag = /^[\s\S]*?>/;
    const match = clone.outerHTML.match(reOpeningTag);
    return (match && match[0]) || '';
  } catch (_) {
    // As a last resort, fall back to localName.
    return `<${element.localName}>`;
  }
}

/**
 * Computes a memory/CPU performance benchmark index to determine rough device class.
 * @see https://docs.google.com/spreadsheets/d/1E0gZwKsxegudkjJl8Fki_sOwHKpqgXwt8aBAfuUaB8A/edit?usp=sharing
 *
 * The benchmark creates a string of length 100,000 in a loop.
 * The returned index is the number of times per second the string can be created.
 *
 *  - 750+ is a desktop-class device, Core i3 PC, iPhone X, etc
 *  - 300+ is a high-end Android phone, Galaxy S8, low-end Chromebook, etc
 *  - 75+ is a mid-tier Android phone, Nexus 5X, etc
 *  - <75 is a budget Android phone, Alcatel Ideal, Galaxy J2, etc
 */
/* istanbul ignore next */
function ultradumbBenchmark() {
  const start = Date.now();
  let iterations = 0;

  while (Date.now() - start < 500) {
    let s = ''; // eslint-disable-line no-unused-vars
    for (let j = 0; j < 100000; j++) s += 'a';

    iterations++;
  }

  const durationInSeconds = (Date.now() - start) / 1000;
  return Math.round(iterations / durationInSeconds);
}

/**
 * Adapted from DevTools' SDK.DOMNode.prototype.path
 *   https://github.com/ChromeDevTools/devtools-frontend/blob/7a2e162ddefd/front_end/sdk/DOMModel.js#L530-L552
 * TODO: Doesn't handle frames or shadow roots...
 * @param {Node} node
 */
/* istanbul ignore next */
function getNodePath(node) {
  /** @param {Node} node */
  function getNodeIndex(node) {
    let index = 0;
    let prevNode;
    while (prevNode = node.previousSibling) {
      node = prevNode;
      // skip empty text nodes
      if (node.nodeType === Node.TEXT_NODE && node.nodeValue.trim().length === 0) continue;
      index++;
    }
    return index;
  }

  const path = [];
  while (node && node.parentNode) {
    const index = getNodeIndex(node);
    path.push([index, node.nodeName]);
    node = node.parentNode;
  }
  path.reverse();
  return path.join(',');
}

/**
 * @param {Element} node
 * @return {string}
 */
/* istanbul ignore next */
function getNodeSelector(node) {
  /**
   * @param {Element} node
   */
  function getSelectorPart(node) {
    let part = node.tagName.toLowerCase();
    if (node.id) {
      part += '#' + node.id;
    } else if (node.classList.length > 0) {
      part += '.' + node.classList[0];
    }
    return part;
  }

  const parts = [];
  while (parts.length < 4) {
    parts.unshift(getSelectorPart(node));
    if (!node.parentElement) {
      break;
    }
    node = node.parentElement;
    if (node.tagName === 'HTML') {
      break;
    }
  }
  return parts.join(' > ');
}

/**
 * This function checks if an element or an ancestor of an element is `position:fixed`.
 * In addition we ensure that the element is capable of behaving as a `position:fixed`
 * element, checking that it lives within a scrollable ancestor.
 * @param {HTMLElement} element
 * @return {boolean}
 */
/* istanbul ignore next */
function isPositionFixed(element) {
  /**
   * @param {HTMLElement} element
   * @param {string} attr
   * @return {string}
   */
  function getStyleAttrValue(element, attr) {
    // Check style before computedStyle as computedStyle is expensive.
    return element.style[attr] || window.getComputedStyle(element)[attr];
  }

  // Position fixed/sticky has no effect in case when document does not scroll.
  const htmlEl = document.querySelector('html');
  if (htmlEl.scrollHeight <= htmlEl.clientHeight ||
      !['scroll', 'auto', 'visible'].includes(getStyleAttrValue(htmlEl, 'overflowY'))) {
    return false;
  }

  let currentEl = element;
  while (currentEl) {
    const position = getStyleAttrValue(currentEl, 'position');
    if ((position === 'fixed' || position === 'sticky')) {
      return true;
    }
    currentEl = currentEl.parentElement;
  }
  return false;
}

/**
 * Generate a human-readable label for the given element, based on end-user facing
 * strings like the innerText or alt attribute.
 * Falls back to the tagName if no useful label is found.
 * @param {HTMLElement} node
 * @return {string|null}
 */
/* istanbul ignore next */
function getNodeLabel(node) {
  // Inline so that audits that import getNodeLabel don't
  // also need to import truncate
  /**
   * @param {string} str
   * @param {number} maxLength
   * @return {string}
   */
  function truncate(str, maxLength) {
    if (str.length <= maxLength) {
      return str;
    }
    return str.slice(0, maxLength - 1) + '…';
  }

  const tagName = node.tagName.toLowerCase();
  // html and body content is too broad to be useful, since they contain all page content
  if (tagName !== 'html' && tagName !== 'body') {
    const nodeLabel = node.innerText || node.getAttribute('alt') || node.getAttribute('aria-label');
    if (nodeLabel) {
      return truncate(nodeLabel, 80);
    } else {
      // If no useful label was found then try to get one from a child.
      // E.g. if an a tag contains an image but no text we want the image alt/aria-label attribute.
      const nodeToUseForLabel = node.querySelector('[alt], [aria-label]');
      if (nodeToUseForLabel) {
        return getNodeLabel(/** @type {HTMLElement} */ (nodeToUseForLabel));
      }
    }
  }
  return tagName;
}

module.exports = {
  wrapRuntimeEvalErrorInBrowserString: wrapRuntimeEvalErrorInBrowser.toString(),
  registerPerformanceObserverInPageString: registerPerformanceObserverInPage.toString(),
  checkTimeSinceLastLongTaskString: checkTimeSinceLastLongTask.toString(),
  getElementsInDocumentString: getElementsInDocument.toString(),
  getOuterHTMLSnippetString: getOuterHTMLSnippet.toString(),
  getOuterHTMLSnippet: getOuterHTMLSnippet,
  ultradumbBenchmark: ultradumbBenchmark,
  ultradumbBenchmarkString: ultradumbBenchmark.toString(),
  getNodePathString: getNodePath.toString(),
  getNodeSelectorString: getNodeSelector.toString(),
  getNodeSelector: getNodeSelector,
  getNodeLabel: getNodeLabel,
  getNodeLabelString: getNodeLabel.toString(),
  isPositionFixedString: isPositionFixed.toString(),
};


text:
(function() {
    var inputColor = document.getElementById('input-color');
    inputColor.addEventListener('input', function () {
        console.log(inputColor);
        document.body.style.backgroundColor = inputColor.value;
    });
}());


text:
package com.edgar.core.repository;

import com.edgar.core.cache.CacheProviderFactory;
import com.edgar.core.repository.transaction.Transaction;
import com.edgar.core.repository.transaction.TransactionConfig;
import com.edgar.core.repository.transaction.TransactionFactory;
import com.edgar.module.sys.repository.domain.TestTable;
import com.edgar.module.sys.repository.querydsl.QTestTable;
import com.mysema.query.sql.Configuration;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.test.context.transaction.TransactionalTestExecutionListener;
import org.springframework.transaction.annotation.Transactional;

import javax.sql.DataSource;
import java.util.ArrayList;
import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:spring/applicationContext.xml"})
@TransactionConfiguration(defaultRollback = true)
@TestExecutionListeners({DependencyInjectionTestExecutionListener.class,
        TransactionalTestExecutionListener.class})
public class PageTransactionTest {

    @Autowired
    private CacheProviderFactory cacheProviderFactory;
    @Autowired
    private DataSource dataSource;

    private Configuration configuration = ConfigurationFactory.createConfiguration(Constants.DEFAULT);

    private TransactionConfig config;

    private RowMapper<TestTable> rowMapper = BeanPropertyRowMapper.newInstance(TestTable.class);

    @Before
    public void setUp() {
        config = new TransactionConfig(dataSource, configuration, QTestTable.testTable);
        List<TestTable> testTables = new ArrayList<TestTable>();
        for (int i = 0; i < 10; i++) {
            TestTable testTable = new TestTable();
            testTable.setTestCode("000" + i);
            testTable.setDictName("000" + i);
            testTable.setParentCode("-1");
            testTable.setSorted(9999);
            testTables.add(testTable);
        }

        Transaction transaction = TransactionFactory.createDefaultBatchInsertTransaction(config, testTables);
        transaction.execute();
    }

    @After
    public void tearDown() {
        cacheProviderFactory.createCacheWrapper("TestTableCache").removeAll();
        cacheProviderFactory.createCacheWrapper("Test2TableCache").removeAll();
    }

    @Transactional
    @Test
    public void testPage() {
        QueryExample example = QueryExample.newInstance();

        Transaction transaction = TransactionFactory.createPageTransaction(config, example, 1, 10, rowMapper);
        Pagination<TestTable> testTables = transaction.execute();

        Assert.assertEquals(1, testTables.getPage());
        Assert.assertEquals((testTables.getTotalRecords() + testTables.getPageSize() - 1)
                / testTables.getPageSize(), testTables.getTotalPages());
        Assert.assertEquals(1, testTables.getPrevPage());
        Assert.assertEquals(1, testTables.getNextPage());

        transaction = TransactionFactory.createPageTransaction(config, example, 2, 10, rowMapper);
        testTables = transaction.execute();
        Assert.assertEquals(10, testTables.getRecords().size());
        Assert.assertEquals(1, testTables.getPage());
        Assert.assertEquals((testTables.getTotalRecords() + testTables.getPageSize() - 1)
                / testTables.getPageSize(), testTables.getTotalPages());
        Assert.assertEquals(1, testTables.getPrevPage());
        Assert.assertEquals(1, testTables.getNextPage());

        transaction = TransactionFactory.createPageTransaction(config, example, 3, 5, rowMapper);
        testTables = transaction.execute();
        Assert.assertEquals(2, testTables.getPage());
        Assert.assertEquals((testTables.getTotalRecords() + testTables.getPageSize() - 1)
                / testTables.getPageSize(), testTables.getTotalPages());
        Assert.assertEquals(1, testTables.getPrevPage());
        Assert.assertEquals(2, testTables.getNextPage());
    }

    @Transactional
    @Test(expected = IllegalArgumentException.class)
    public void testGreatThanMaxPage() {
        QueryExample example = QueryExample.newInstance();
        example.setMaxNumOfRecords(1000);

        Transaction transaction = TransactionFactory.createPageTransaction(config, example, 200, 10, rowMapper);
        Pagination<TestTable> testTables = transaction.execute();
    }
}


text:
//
// Copyright 2018 Google Inc.
//
// 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.
//

#import <XCTest/XCTest.h>

#import "Channel/Sources/EDOChannelPool.h"
#import "Channel/Sources/EDOHostPort.h"
#import "Service/Sources/EDOClientService.h"
#import "Service/Sources/EDOHostNamingService+Private.h"
#import "Service/Sources/EDOHostNamingService.h"
#import "Service/Sources/EDOServicePort.h"

static NSString *const kDummyServiceName = @"com.google.testService";
static const UInt16 kDummyServicePort = 1234;

@interface EDOHostNamingServiceTest : XCTestCase
@end

@implementation EDOHostNamingServiceTest {
  EDOServicePort *_dummyServicePort;
}

- (void)setUp {
  [super setUp];
  EDOHostNamingService *namingService = EDOHostNamingService.sharedService;
  _dummyServicePort = [EDOServicePort servicePortWithPort:kDummyServicePort
                                              serviceName:kDummyServiceName];
  [namingService addServicePort:_dummyServicePort];
}

- (void)tearDown {
  EDOHostNamingService *serviceObject = EDOHostNamingService.sharedService;
  [serviceObject removeServicePort:_dummyServicePort];
  [super tearDown];
}

/** Tests getting correct service name by sending ports message to @c EDOHostNamingService. */
- (void)testStartEDONamingServiceObject {
  [EDOHostNamingService.sharedService start];
  EDOHostNamingService *namingService =
      [EDOClientService rootObjectWithPort:EDOHostNamingService.namingServerPort];
  XCTAssertEqual([namingService portForServiceWithName:kDummyServiceName], kDummyServicePort);
}

/**
 * Tests sending object request to the naming service after stopping it, and verifies that
 * exception happens.
 */
- (void)testStopEDONamingServiceObject {
  EDOHostNamingService *namingService = EDOHostNamingService.sharedService;
  [namingService start];
  [namingService stop];
  // Clean up connected channels.
  [EDOChannelPool.sharedChannelPool
      removeChannelsWithPort:[EDOHostPort
                                 hostPortWithLocalPort:EDOHostNamingService.namingServerPort]];
  XCTAssertThrows([EDOClientService rootObjectWithPort:EDOHostNamingService.namingServerPort]);
}

/** Tests starting/stoping the naming service multiple times to verify idempotency. */
- (void)testStartAndStopMultipleTimes {
  EDOHostNamingService *namingService = EDOHostNamingService.sharedService;
  [namingService start];
  [namingService start];
  XCTAssertNoThrow([EDOClientService rootObjectWithPort:EDOHostNamingService.namingServerPort]);
  [namingService stop];
  [namingService stop];
  // Clean up connected channels.
  [EDOChannelPool.sharedChannelPool
      removeChannelsWithPort:[EDOHostPort
                                 hostPortWithLocalPort:EDOHostNamingService.namingServerPort]];
  XCTAssertThrows([EDOClientService rootObjectWithPort:EDOHostNamingService.namingServerPort]);
}

/** Verifies no side effect when adding the same service multiple times. */
- (void)testAddingServiceMultipleTimes {
  EDOHostNamingService *namingService = EDOHostNamingService.sharedService;
  NSString *serviceName = @"com.google.testService.adding";
  EDOServicePort *dummyPort = [EDOServicePort servicePortWithPort:12345 serviceName:serviceName];
  [namingService addServicePort:dummyPort];
  XCTAssertFalse([namingService addServicePort:dummyPort]);
  // Clean up.
  [namingService removeServicePort:dummyPort];
}

/** Verifies no side effect when removing the same service multiple times. */
- (void)testRemoveServiceMultipleTimes {
  EDOHostNamingService *namingService = EDOHostNamingService.sharedService;
  NSString *serviceName = @"com.google.testService.removing";
  EDOServicePort *dummyPort = [EDOServicePort servicePortWithPort:12346 serviceName:serviceName];
  [namingService addServicePort:dummyPort];

  [namingService removeServicePort:dummyPort];
  [namingService removeServicePort:dummyPort];

  XCTAssertTrue([namingService portForServiceWithName:serviceName] == 0);
}

/** Verifies service are added even when naming service has stopped serving. */
- (void)testAddingServiceAfterStop {
  EDOHostNamingService *namingService = EDOHostNamingService.sharedService;
  [namingService stop];
  NSString *serviceName = @"com.google.testService.stop";
  UInt16 port = 12347;
  EDOServicePort *dummyPort = [EDOServicePort servicePortWithPort:port serviceName:serviceName];
  [namingService addServicePort:dummyPort];
  XCTAssertEqual([namingService portForServiceWithName:serviceName], port);
  // Clean up.
  [namingService removeServicePort:dummyPort];
}

/**
 * Tests thread safety of adding/removing services.
 * This test adds two service ports concurrently to the naming service, and then removes them
 * concurrently. And it verifies the state of the naming service after each step.
 */
- (void)testUpdateServicesConcurrently {
  EDOHostNamingService *namingService = EDOHostNamingService.sharedService;
  NSString *serviceName1 = @"com.google.testService.concurrent1";
  UInt16 port1 = 12348;
  NSString *serviceName2 = @"com.google.testService.concurrent2";
  UInt16 port2 = 12349;
  EDOServicePort *dummyPort1 = [EDOServicePort servicePortWithPort:port1 serviceName:serviceName1];
  EDOServicePort *dummyPort2 = [EDOServicePort servicePortWithPort:port2 serviceName:serviceName2];
  dispatch_queue_t concurrentQueue = dispatch_queue_create(NULL, DISPATCH_QUEUE_CONCURRENT);
  dispatch_async(concurrentQueue, ^{
    [namingService addServicePort:dummyPort1];
  });
  dispatch_async(concurrentQueue, ^{
    [namingService addServicePort:dummyPort2];
  });
  dispatch_barrier_sync(concurrentQueue, ^{
    XCTAssertEqual([namingService portForServiceWithName:serviceName1], port1);
    XCTAssertEqual([namingService portForServiceWithName:serviceName2], port2);
  });
  dispatch_async(concurrentQueue, ^{
    [namingService removeServicePort:dummyPort1];
  });
  dispatch_async(concurrentQueue, ^{
    [namingService removeServicePort:dummyPort2];
  });
  dispatch_barrier_sync(concurrentQueue, ^{
    XCTAssertTrue([namingService portForServiceWithName:serviceName1] == 0);
    XCTAssertTrue([namingService portForServiceWithName:serviceName2] == 0);
  });
}

/**
 * Tests accessing service connection port and verifies the listen socket is created and returns a
 * non-zero port.
 */
- (void)testAccessServiceConnectionPort {
  EDOHostNamingService *namingService = EDOHostNamingService.sharedService;
  XCTAssertFalse(namingService.serviceConnectionPort == 0);
}

@end


text:
CodiVerum Yii2 Extension for hierarchy data
========================================
Extension contains abstract classes making it easy to implement tree-structured data in Yii2 Framework.
It has what's needed in hierarchical data:
  - multiple root nodes
  - selecting parent, children, siblings, ancestors, descendants (also by distance); easy for programmer and also for DBMS.
  - modifying trees like adding nodes, removing nodes and moving nodes (with or without subtree); simple (it's based on `id_parent` value changes - all the work is done by `AbstractNode` class)

I have found other solutions implementing tree structured data (like nested sets)
but I don't like using recursion or subqueries for frequent queries like selecting data.
I created my own way (I haven't found that kind of solution).

I hope you'll find it useful and easy.

This is my first open-source work so I'll be glad to hear any suggestions.
I'm sure this little library may be improved.

The basic design puts the data into two tables:

1. node:
```
id INT PRIMARY KEY auto_increment,
id_parent_node INT DEFAULT NULL,
node_level INT NOT NULL
```

2. node_ancestor:
```
id_node INT NOT NULL,
id_ancestor_node INT NOT NULL,
```

Proper foreign keys are also set.
Note that names may be easily customized (see migration section below)

Installation
------------

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist codiverum/yii2-abstracttree "dev-master"
```

or add

```
"codiverum/yii2-abstracttree": "dev-master"
```

to the require section of your `composer.json` file.

Usage
-----

Using this extension you can easily make:
  - customized migration
  - ready to use ActiveRecord classes

#### Migration ####
To make migration, you should create new migration:

```
yii migrate/create migration_name
```

Your migration should extend `codiverum\abstracttree\migrations\AbstractTreeBaseMigration` class, for example:

~~~php
use codiverum\abstracttree\migrations\AbstractTreeBaseMigration;
use yii\db\Schema;

class m150505_194334_category_tree extends AbstractTreeBaseMigration {

    public function up() {
        parent::up();
        $this->addForeignKey('fk_category_usercreated', 'category', 'id_user_created', '{{%user}}', 'id', 'SET NULL', 'CASCADE');
    }

    public function getExtraNodeTableColumns() {
        return [
            'id_user_created' => Schema::TYPE_INTEGER,
            'name' => Schema::TYPE_STRING . '(128) NOT NULL',
            'description' => Schema::TYPE_TEXT,
            'created_at' => Schema::TYPE_INTEGER,
            'updated_at' => Schema::TYPE_INTEGER
        ];
    }

    public function getNodeTableName() {
        return 'category';
    }
}
~~~

Then apply migration using command:
```
yii migrate
```

#### Models ####

Generate pivot table using Gii and you can leave it as is.
After that you can use Gii to generate model for the main table or write it on you're own. Just make sure
your class is extending `AbstractNode` class.
If you did - you can delete relations created for default columns (not in `getExtraNodeTablesColumns` migration method)
as they are already coverd in `AbstractNode` class.
You may want to add to the description of your class (use your model class name instead of `Category`):

~~~php
 * @property Category $parent
 * @property Category[] $ancestors
 * @property Category[] $descendants
 * @property Category[] $children
 * @property Category[] $siblings
~~~

For migration example above, `Category` class would look like this:

~~~php
namespace common\models;

use codiverum\abstracttree\components\interfaces\TreeNodeInterface;
use codiverum\abstracttree\models\AbstractNode;
use Yii;
use yii\db\ActiveQuery;
use common\models\User;

/**
 * This is the model class for table "category".
 *
 * @property integer $id
 * @property integer $id_parent_category
 * @property integer $id_user_created
 * @property string $name
 * @property string $description
 * @property integer $created_at
 * @property integer $updated_at
 *
 * @property User $userCreated
 * @property Category $parent
 * @property Category[] $ancestors
 * @property Category[] $descendants
 * @property Category[] $children
 * @property Category[] $siblings
 */
class Category extends AbstractNode implements TreeNodeInterface {

    public function beforeSave($insert) {
        if ($insert) {
            $this->id_user_created = Yii::$app->user->id;
        }
        return parent::beforeSave($insert);
    }

    /**
     * @inheritdoc
     */
    public static function tableName() {
        return 'category';
    }

    /**
     * @inheritdoc
     */
    public function rules() {
        return [
            [['id_parent_category', 'category_level', 'id_user_created', 'created_at', 'updated_at'], 'integer'],
            [['name', 'category_level'], 'required'],
            [['description'], 'string'],
            [['name'], 'string', 'max' => 128],
            [['name', 'id_parent_category'], 'unique', 'targetAttribute' => ['name', 'id_parent_category'], 'message' => 'The combination of Id Parent Category and Name has already been taken.']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'id' => Yii::t('db', 'ID'),
            'id_parent_category' => Yii::t('db', 'Id Parent Category'),
            'id_user_created' => Yii::t('db', 'Id User Created'),
            'name' => Yii::t('db', 'Name'),
            'category_category_level' => Yii::t('db', 'Category Level'),
            'description' => Yii::t('db', 'Description'),
            'created_at' => Yii::t('db', 'Created At'),
            'updated_at' => Yii::t('db', 'Updated At'),
            'parent.name' => Yii::t('db', 'Parent'),
            'userCreated.display_name' => Yii::t('db', 'Author'),
            'category_level' => Yii::t('db', 'Level'),
            'parent' => Yii::t('db', 'Parent'),
            'userCreated' => Yii::t('db', 'Author'),
        ];
    }

    /**
     * @return ActiveQuery
     */
    public function getUserCreated() {
        return $this->hasOne(User::className(), ['id' => 'id_user_created']);
    }

}
~~~

That's it.


text:
const { shallow, mount } = require('enzyme');
const React = require('react');

function Fixture() {
  return (

  );
}

describe('toMatchSelector', () => {
  it('works with `shallow` renders', () => {
    const wrapper = shallow(<Fixture />);

    expect(wrapper.find('#child')).toMatchSelector('span');
    expect(wrapper.find('#child')).toMatchSelector('#child');
    expect(wrapper.find('#child')).toMatchSelector('.foo');
  });

  it('works with `mount` renders', () => {
    const wrapper = mount(<Fixture />);

    expect(wrapper.find('#child')).toMatchSelector('span');
    expect(wrapper.find('#child')).toMatchSelector('#child');
    expect(wrapper.find('#child')).toMatchSelector('.foo');
  });

  it('works with with jasmines negation', () => {
    const wrapper = shallow(<Fixture />);
    expect(wrapper.find('#child')).not.toMatchSelector('ball');
  });
});


text:
package org.hamcrest.text.pattern;

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

import org.hamcrest.text.pattern.internal.ast.AnyCharacter;
import org.hamcrest.text.pattern.internal.ast.CaptureGroup;
import org.hamcrest.text.pattern.internal.ast.CharacterInRange;
import org.hamcrest.text.pattern.internal.ast.CharacterInUnicodeCategory;
import org.hamcrest.text.pattern.internal.ast.CharacterNotInRange;
import org.hamcrest.text.pattern.internal.ast.CharacterNotInUnicodeCategory;
import org.hamcrest.text.pattern.internal.ast.Choice;
import org.hamcrest.text.pattern.internal.ast.Exactly;
import org.hamcrest.text.pattern.internal.ast.Flags;
import org.hamcrest.text.pattern.internal.ast.GroupReference;
import org.hamcrest.text.pattern.internal.ast.ListOf;
import org.hamcrest.text.pattern.internal.ast.Literal;
import org.hamcrest.text.pattern.internal.ast.OneOrMore;
import org.hamcrest.text.pattern.internal.ast.Optional;
import org.hamcrest.text.pattern.internal.ast.Sequence;
import org.hamcrest.text.pattern.internal.ast.ZeroOrMore;

public abstract class Patterns {
    public static PatternComponent text(String text) {
        return new Literal(text);
    }

    public static PatternComponent anyCharacter() {
        return AnyCharacter.INSTANCE;
    }

    public static PatternComponent anyCharacterIn(String range) {
        return new CharacterInRange(range);
    }

    public static PatternComponent anyCharacterNotIn(String range) {
        return new CharacterNotInRange(range);
    }

    public static PatternComponent anyCharacterInCategory(String category) {
        return new CharacterInUnicodeCategory(category);
    }

    public static PatternComponent anyCharacterNotInCategory(String category) {
        return new CharacterNotInUnicodeCategory(category);
    }

    public static PatternComponent either(Object... alternatives) {
        return new Choice(toPatterns(alternatives));
    }

    public static PatternComponent sequence(Object... elements) {
        return new Sequence(toPatterns(elements));
    }

    public static PatternComponent optional(Object o) {
        return new Optional(toPattern(o));
    }

    public static PatternComponent zeroOrMore(Object o) {
        return new ZeroOrMore(toPattern(o));
    }

    public static PatternComponent oneOrMore(Object o) {
        return new OneOrMore(toPattern(o));
    }

    public static PatternComponent capture(String name, PatternComponent pattern) {
        return new CaptureGroup(name, pattern);
    }

    public static PatternComponent valueOf(String name) {
        return new GroupReference(name);
    }

    public static PatternComponent exactly(int requiredCount, Object o) {
        return new Exactly(requiredCount, toPattern(o));
    }

    public static PatternComponent from(int minimumCount, int maximumCount, Object o) {
        return new FromTo(minimumCount, maximumCount, toPattern(o));
    }

    public static SeparablePatternComponent listOf(Object element) {
        return new ListOf(toPattern(element), toPattern(","));
    }

    public static PatternComponent whitespace() {
        return zeroOrMore(anyCharacterInCategory("Space"));
    }

    public static PatternComponent separatedBy(Object separator, Object... elements) {
        List<Object> separated = new ArrayList<Object>(elements.length*2 - 1);

        separated.add(elements[0]);
        for (int i = 1; i < elements.length; i++) {
            separated.add(separator);
            separated.add(elements[i]);
        }

        return sequence(separated.toArray());
    }

    public static PatternComponent caseInsensitive(Object o) {
        return new Flags("i", toPattern(o));
    }

    public static PatternComponent caseSensitive(Object o) {
        return new Flags("-i", toPattern(o));
    }

    public static PatternComponent[] toPatterns(Object... args) {
        PatternComponent[] patterns = new PatternComponent[args.length];
        for (int i = 0; i < patterns.length; i++) {
            patterns[i] = toPattern(args[i]);
        }
        return patterns;
    }

    public static PatternComponent toPattern(Object object) {
        if (object instanceof PatternComponent) {
            return (PatternComponent) object;
        } else {
            return text(object.toString());
        }
    }
}


text:
(function(root, factory) {
    if (typeof define === 'function' && define.amd) {
        define(function(require, exports, module) {
            module.exports = factory(require("jquery"), require("knockout"), require("core/class"), require("framework/errors"), require("framework/html/presets").layoutSets, require("framework/html/layout_controller").DefaultLayoutController, require("../Empty/EmptyLayout.js"), require("../Simple/SimpleLayout.js"), require("animation/fx"), require("ui/toolbar"))
        })
    }
    else {
        root.DevExpress.layouts = root.DevExpress.layouts || {};
        root.DevExpress.layouts.SplitLayout = factory(jQuery, window.ko, DevExpress.Class, DevExpress.framework.errors, DevExpress.framework.html.layoutSets, DevExpress.framework.html.DefaultLayoutController, DevExpress.layouts.EmptyLayout, DevExpress.layouts.SimpleLayout, DevExpress.fx);
        root.DevExpress.framework.html.MultipaneLayoutController = root.DevExpress.layouts.SplitLayout.MultipaneLayoutController;
        root.DevExpress.framework.html.IOSSplitLayoutController = root.DevExpress.layouts.SplitLayout.IOSSplitLayoutController;
        root.DevExpress.framework.html.ToolbarController = root.DevExpress.layouts.SplitLayout.ToolbarController;
        root.DevExpress.framework.html.AndroidSplitLayoutController = root.DevExpress.layouts.SplitLayout.AndroidSplitLayoutController;
        root.DevExpress.framework.html.WinSplitLayoutController = root.DevExpress.layouts.SplitLayout.WinSplitLayoutController;
        root.DevExpress.framework.html.Win8SplitLayoutController = root.DevExpress.layouts.SplitLayout.Win8SplitLayoutController
    }
}(this, function($, ko, Class, errors, layoutSets, DefaultLayoutController, EmptyLayoutControllerModule, SimpleLayoutControllerModule, fx) {
    var exports = {},
        APPBAR_TOUCH_AREA_HEIGHT = 50,
        APPBAR_TOUCH_THRESHOLD = 50,
        EVENTS_NAMESPACE = ".dxSplitLayout",
        KEYCODE_WIN = 91,
        KEYCODE_Z = 90,
        POINTER_DOWN_EVENT_NAME,
        POINTER_UP_EVENT_NAME,
        POINTER_MOVE_EVENT_NAME;
    if (window.PointerEvent) {
        POINTER_DOWN_EVENT_NAME = "pointerdown";
        POINTER_UP_EVENT_NAME = "pointerup";
        POINTER_MOVE_EVENT_NAME = "pointermove"
    }
    else if (window.MSPointerEvent) {
        POINTER_DOWN_EVENT_NAME = "MSPointerDown";
        POINTER_UP_EVENT_NAME = "MSPointerUp";
        POINTER_MOVE_EVENT_NAME = "MSPointerMove"
    }
    else {
        POINTER_DOWN_EVENT_NAME = "mousedown";
        POINTER_UP_EVENT_NAME = "mouseup";
        POINTER_MOVE_EVENT_NAME = "mousemove"
    }
    var SplitLayoutEventHelper = Class.inherit({
            ctor: function(splitLayout) {
                this.root = splitLayout
            }, init: function() {
                    this.root._$viewPort.on(POINTER_UP_EVENT_NAME + EVENTS_NAMESPACE, $.proxy(this._pointerUpHandler, this));
                    this.root._$viewPort.on(POINTER_DOWN_EVENT_NAME + EVENTS_NAMESPACE, $.proxy(this._pointerDownHandler, this));
                    $(document).on("keydown" + EVENTS_NAMESPACE, $.proxy(this._keyDownHandler, this));
                    $(document).on("keyup" + EVENTS_NAMESPACE, $.proxy(this._keyUpHandler, this));
                    this._startTouchPoint = false;
                    this._winKeyPressed = false;
                    this._moveEvent = false;
                    this._appbarBehavior = true
                }, _pointerDownHandler: function(e) {
                    var originalEvent = e.originalEvent;
                    if (this._isTouch(originalEvent) && this._startedInAppBarArea(originalEvent)) {
                        this._startTouchPoint = {
                            x: originalEvent.clientX, y: originalEvent.clientY
                        };
                        this.root._$viewPort.on(POINTER_MOVE_EVENT_NAME + EVENTS_NAMESPACE, $.proxy(this._pointerMoveHandler, this))
                    }
                }, _pointerMoveHandler: function(e) {
                    var originalEvent = e.originalEvent;
                    if (this._thresholdExceeded(originalEvent)) {
                        this._moveEvent = true;
                        this.root._$viewPort.off(POINTER_MOVE_EVENT_NAME + EVENTS_NAMESPACE);
                        if (this._isVerticalDirection(originalEvent.clientX, originalEvent.clientY))
                            this._toggleAppBarState(true)
                    }
                }, _pointerUpHandler: function(e) {
                    this.root._$viewPort.off(POINTER_MOVE_EVENT_NAME + EVENTS_NAMESPACE);
                    var $appBar = this.root._$viewPort.find(".dx-app-bar");
                    if (e.originalEvent.button === 2) {
                        this._toggleAppBarState()
                    }
                    else if (!this._moveEvent && $appBar[0] && !$appBar[0].contains(e.target)) {
                        this._toggleAppBarState(false)
                    }
                    this._moveEvent = false
                }, _keyDownHandler: function(e) {
                    if (e.keyCode === KEYCODE_WIN) {
                        this._winKeyPressed = true
                    }
                }, _keyUpHandler: function(e) {
                    if (this._winKeyPressed && (e.keyCode === KEYCODE_Z)) {
                        this._toggleAppBarState()
                    }
                    else if (e.keyCode === KEYCODE_WIN) {
                        this._winKeyPressed = false
                    }
                }, _toggleAppBarState: function(state) {
                    if (!this.root._appBarHasCommands())
                        return;
                    this.root._$viewPort.find(".dx-app-bar").toggleClass("dx-app-bar-visible", !this._appbarBehavior || state)
                }, _isVerticalDirection: function(x, y) {
                    return Math.abs(y - this._startTouchPoint.y) > Math.abs(x - this._startTouchPoint.x)
                }, _isTouch: function(event) {
                    return event.pointerType === event.MSPOINTER_TYPE_TOUCH || event.pointerType === event.MSPOINTER_TYPE_PEN
                }, _startedInAppBarArea: function(event) {
                    return (this.root._$viewPort.height() - APPBAR_TOUCH_AREA_HEIGHT) < event.clientY
                }, _thresholdExceeded: function(originalEvent) {
                    return originalEvent.clientY < (this._startTouchPoint.y - APPBAR_TOUCH_THRESHOLD)
                }
        });
    var MultipaneLayoutController = DefaultLayoutController.inherit({
            ctor: function(options) {
                options = options || {};
                options.name = options.name || "split";
                this._detailPaneName = options.detailPaneName || "detail";
                this._masterPaneName = options.masterPaneName || "master";
                options.defaultPaneName = this._detailPaneName;
                this.callBase(options);
                this._panesConfig = options.panesConfig;
                this._activeViews = {};
                this._stateStorageKey = "dxSplitLayoutState"
            }, init: function(options) {
                    options = options || {};
                    this.callBase(options);
                    this._router = options.app && options.app.router;
                    this._onNavigatingHandler = $.proxy(this._onNavigating, this);
                    this._onNavigatedHandler = $.proxy(this._onNavigated, this);
                    this._navigationManager = options.navigationManager;
                    this._ensurePanesConfig();
                    this._initChildControllers(options)
                }, activate: function() {
                    var tasks = [];
                    this.callBase();
                    this._navigationManager.on("navigating", this._onNavigatingHandler);
                    this._navigationManager.on("navigated", this._onNavigatedHandler);
                    this._navigationManager.on("navigatingBack", this._onNavigatingBackHandler);
                    $.each(this._panesConfig, function(_, paneConfig) {
                        tasks.push(paneConfig.controller.activate())
                    });
                    return $.when.apply($, tasks)
                }, deactivate: function() {
                    var that = this,
                        tasks = [];
                    $.each(this._panesConfig, function(_, paneConfig) {
                        tasks.push(paneConfig.controller.deactivate())
                    });
                    this._navigationManager.off("navigating", this._onNavigatingHandler);
                    this._navigationManager.off("navigated", this._onNavigatedHandler);
                    this.callBase();
                    return $.when.apply($, tasks).done(function() {
                            that._activeViews = {}
                        })
                }, showView: function(viewInfo, direction) {
                    var that = this,
                        paneConfig = that._getPaneConfig(viewInfo);
                    return paneConfig.controller.showView(viewInfo, direction).done(function() {
                            that._activeViews[that._getViewPaneName(viewInfo.viewTemplateInfo)] = viewInfo
                        })
                }, activeViewInfo: function() {
                    return this._activeViews[this._masterPaneName]
                }, _updateLayoutTitle: function(viewInfo, defaultTitle) {
                    if (this._getViewPaneName(viewInfo.viewTemplateInfo) === this._masterPaneName) {
                        var title;
                        if (viewInfo.model !== undefined) {
                            title = ko.utils.unwrapObservable(viewInfo.model.title)
                        }
                        else {
                            title = (viewInfo.viewTemplateInfo || {}).title
                        }
                        this._layoutModel.title(title || defaultTitle || "")
                    }
                }, _ensurePanesConfig: function() {
                    if (!this._panesConfig) {
                        this._panesConfig = this._createPanesConfig()
                    }
                }, _createPanesConfig: function() {
                    return {}
                }, _initChildControllers: function(options) {
                    var that = this;
                    $.each(that._panesConfig, function(_, paneConfig) {
                        var controller = paneConfig.controller;
                        controller.init($.extend({}, options, {$viewPort: that._$mainLayout.find(paneConfig.selector)}));
                        $.each(["viewRendered", "viewShowing", "viewReleased", "viewHidden"], function(_, callbacksPropertyName) {
                            controller.on(callbacksPropertyName, function(args) {
                                that.fireEvent(callbacksPropertyName, [args])
                            })
                        })
                    })
                }, _onNavigating: function(args) {
                    var options = args.options,
                        $sourceElement = this._getEventSourceElement(args.options.jQueryEvent);
                    var routeValues = this._router.parse(args.uri),
                        viewTemplateInfo = this._viewEngine.getViewTemplateInfo(routeValues.view).option(),
                        pane = this._getViewPaneName(viewTemplateInfo);
                    if (pane === this._detailPaneName) {
                        options.stack = this._detailPaneName + "_pane";
                        options.root = options.root === undefined ? $sourceElement.is(this._panesConfig[this._masterPaneName].selector + " *") : options.root;
                        options.keepPositionInStack = false
                    }
                    else {
                        options.stack = options.stack || this._masterPaneCurrentStackKey
                    }
                    args.options.pane = pane
                }, _onNavigated: function(args) {
                    if (args.options.pane === this._masterPaneName) {
                        this._masterPaneCurrentStackKey = this._navigationManager.currentStackKey
                    }
                }, _getEventSourceElement: function(jQueryEvent) {
                    return jQueryEvent ? $(jQueryEvent.target) : $()
                }, _getPaneConfig: function(viewInfo) {
                    return this._panesConfig[this._getViewPaneName(viewInfo.viewTemplateInfo)]
                }, _getViewPaneName: function(viewTemplateInfo) {
                    return viewTemplateInfo.pane || this._detailPaneName
                }, _raiseEvent: function(callback) {
                    callback.fire()
                }, _ensureChildController: function(controller, layoutName) {
                    if (!controller) {
                        throw new Error(layoutName + "Controller is not found but it is required by the '" + this.name + "' layout for specified platform and device. Make sure the " + layoutName + ".* files are referenced in your main *.html file or specify other platform and device.");
                    }
                }, saveState: function(storage) {
                    var state = {};
                    $.each(this._activeViews, function(pane, viewInfo) {
                        state[pane] = {
                            uri: viewInfo.uri, stack: viewInfo.navigateOptions.stack
                        }
                    });
                    var json = JSON.stringify(state);
                    storage.setItem(this._stateStorageKey, json)
                }, restoreState: function(storage) {
                    var json = storage.getItem(this._stateStorageKey);
                    if (json) {
                        try {
                            var that = this,
                                state = JSON.parse(json);
                            $.each(state, function(pane, navigateOptions) {
                                that._navigationManager.navigate(navigateOptions.uri, {
                                    stack: navigateOptions.stack, target: 'current'
                                })
                            })
                        }
                        catch(e) {
                            this.removeState(storage);
                            throw errors.Error("E3007");
                        }
                    }
                }, removeState: function(storage) {
                    storage.removeItem(this._stateStorageKey)
                }
        });
    var IOSSplitLayoutController = MultipaneLayoutController.inherit({_createPanesConfig: function() {
                this._ensureChildController(SimpleLayoutControllerModule.SimpleLayoutController, "SimpleLayout");
                return {
                        master: {
                            controller: new SimpleLayoutControllerModule.SimpleLayoutController, selector: ".master-pane"
                        }, detail: {
                                controller: new SimpleLayoutControllerModule.SimpleLayoutController, selector: ".detail-pane"
                            }
                    }
            }});
    var ToolbarController = Class.inherit({
            ctor: function($toolbar, commandManager) {
                this._commandManager = commandManager;
                this._$toolbar = $toolbar;
                this._toolbar = $toolbar.dxToolbar("instance");
                this._commandContainer = $toolbar.dxCommandContainer("instance")
            }, showViews: function(viewInfos) {
                    var that = this,
                        commands = this._mergeCommands(viewInfos),
                        toolbarItems = that._toolbar.option("items");
                    var newItems = $.map(toolbarItems, function(item) {
                            return item.command ? undefined : item
                        });
                    that._toolbar.option("items", newItems);
                    fx.off = true;
                    that._commandManager.renderCommandsToContainers(commands, [that._commandContainer]);
                    fx.off = false
                }, _mergeCommands: function(viewInfos) {
                    var result = [],
                        idHash = {};
                    $.each(viewInfos, function(_, viewInfo) {
                        if (viewInfo.commands) {
                            $.each(viewInfo.commands, function(_, command) {
                                var id = command.option("id");
                                if (!(id in idHash)) {
                                    idHash[id] = true;
                                    result.push(command)
                                }
                            })
                        }
                    });
                    return result
                }
        });
    var AndroidSplitLayoutController = MultipaneLayoutController.inherit({
            ctor: function(options) {
                options = options || {};
                options.layoutModel = options.layoutModel || this._createLayoutModel();
                this.callBase(options)
            }, init: function(options) {
                    this.callBase(options);
                    this.toolbarController = new ToolbarController(this._$mainLayout.find(".header-toolbar"), this._commandManager)
                }, _createLayoutModel: function() {
                    return {title: ko.observable("")}
                }, showView: function(viewInfo, direction) {
                    var that = this;
                    that._updateLayoutTitle(viewInfo);
                    return that.callBase(viewInfo, direction).done(function() {
                            that.toolbarController.showViews(that._activeViews)
                        })
                }, _createPanesConfig: function() {
                    this._ensureChildController(EmptyLayoutControllerModule.EmptyLayoutController, "EmptyLayout");
                    return {
                            master: {
                                controller: new EmptyLayoutControllerModule.EmptyLayoutController, selector: ".master-pane"
                            }, detail: {
                                    controller: new EmptyLayoutControllerModule.EmptyLayoutController, selector: ".detail-pane"
                                }
                        }
                }
        });
    var WinSplitLayoutController = MultipaneLayoutController.inherit({
            ctor: function(options) {
                options = options || {};
                this._eventHelper = new SplitLayoutEventHelper(this);
                options.layoutModel = options.layoutModel || this._createLayoutModel();
                this.callBase(options)
            }, init: function(options) {
                    this.callBase(options);
                    this._eventHelper.init();
                    this.headerToolbarController = new ToolbarController(this._$mainLayout.find(".header-toolbar"), this._commandManager)
                }, showView: function(viewInfo, direction) {
                    var that = this;
                    that._updateLayoutTitle(viewInfo);
                    return that.callBase(viewInfo, direction).done(function() {
                            that.headerToolbarController.showViews(that._activeViews)
                        })
                }, _createLayoutModel: function() {
                    return {title: ko.observable("")}
                }, _createPanesConfig: function() {
                    this._ensureChildController(EmptyLayoutControllerModule.EmptyLayoutController, "EmptyLayout");
                    return {
                            master: {
                                controller: new EmptyLayoutControllerModule.EmptyLayoutController, selector: ".left-content"
                            }, detail: {
                                    controller: new EmptyLayoutControllerModule.EmptyLayoutController, selector: ".right-content"
                                }
                        }
                }, _appBarHasCommands: function() {
                    var footerToolbar = this._$viewPort.find(".footer-toolbar").data("dxToolbar");
                    return footerToolbar ? footerToolbar.option("items").length : false
                }
        });
    var Win8SplitLayoutController = WinSplitLayoutController.inherit({
            init: function(options) {
                this.callBase(options);
                this.footerToolbarController = new ToolbarController(this._$mainLayout.find(".footer-toolbar"), this._commandManager)
            }, showView: function(viewInfo, direction) {
                    var that = this;
                    return that.callBase(viewInfo, direction).done(function() {
                            that.footerToolbarController.showViews(that._activeViews)
                        })
                }
        });
    layoutSets["split"] = layoutSets["split"] || [];
    layoutSets["split"].push({
        platform: "ios", tablet: true, controller: new IOSSplitLayoutController
    });
    layoutSets["split"].push({
        platform: "android", tablet: true, controller: new AndroidSplitLayoutController
    });
    layoutSets["split"].push({
        platform: "generic", tablet: true, controller: new IOSSplitLayoutController
    });
    layoutSets["split"].push({
        platform: "win", phone: false, controller: new WinSplitLayoutController
    });
    layoutSets["split"].push({
        platform: "win", version: [8], phone: false, controller: new Win8SplitLayoutController
    });
    exports.MultipaneLayoutController = MultipaneLayoutController;
    exports.IOSSplitLayoutController = IOSSplitLayoutController;
    exports.ToolbarController = ToolbarController;
    exports.AndroidSplitLayoutController = AndroidSplitLayoutController;
    exports.WinSplitLayoutController = WinSplitLayoutController;
    exports.Win8SplitLayoutController = Win8SplitLayoutController;
    return exports
}));


text:
<? defined('C5_EXECUTE') or die("Access Denied."); ?>

<?=Loader::helper('concrete/dashboard')->getDashboardPaneHeaderWrapper(t('Connect to Community'), false)?>
<?
	$mi = Marketplace::getInstance();
	if ($mi->hasConnectionError() && $mi->getConnectionError() == Marketplace::E_MARKETPLACE_SUPPORT_MANUALLY_DISABLED) { ?>

<?=t("External marketplace support has been disabled for this website.")?>

	<? } else { ?>

		<?
		print $mi->getMarketplaceFrame('100%', '300', false, $startStep);
	}
?>
<?=Loader::helper('concrete/dashboard')->getDashboardPaneFooterWrapper();?>


text:
class ReDNS::Record::TXT < ReDNS::Record::Null
end


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

<TITLE>
Uses of Interface org.hibernate.engine.Mapping (Hibernate API Documentation)
</TITLE>

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

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Interface
org.hibernate.engine.Mapping

Packages that use Mapping

org.hibernate.cfg

	This package defines APIs for configuring Hibernate, and classes
	for building the Hibernate configuration-time metamodel.

org.hibernate.dialect

	This package abstracts the SQL dialect of the underlying database.

org.hibernate.dialect.function

	A framework for defining database-specific SQL functions
	that are available via the dialect.

org.hibernate.engine

	This package contains classes that are "shared" by other packages,
	and implementations of some key algorithms.

org.hibernate.impl

	This package contains implementations of the
	central Hibernate APIs, especially the
	Hibernate session.

org.hibernate.mapping

	This package defines the Hibernate configuration-time metamodel.

org.hibernate.persister

	A persister defines a mapping strategy for a collection
	or entity.

org.hibernate.persister.collection

	This package abstracts the persistence mechanism for collections.

org.hibernate.persister.entity

	This package abstracts persistence mechanisms for
	entities, and defines the Hibernate runtime
	metamodel.

org.hibernate.type

	A Hibernate <tt>Type</tt> is a strategy for mapping a
	Java property type to a JDBC type or types.

Uses of Mapping in org.hibernate.cfg

Methods in org.hibernate.cfg that return Mapping

 Mapping
Configuration.buildMapping()

Uses of Mapping in org.hibernate.dialect

Methods in org.hibernate.dialect with parameters of type Mapping

 Type
DerbyDialect.DerbyTrimFunctionEmulation.getReturnType(Type columnType,
              Mapping mapping)

Uses of Mapping in org.hibernate.dialect.function

Methods in org.hibernate.dialect.function with parameters of type Mapping

 Type
VarArgsSQLFunction.getReturnType(Type columnType,
              Mapping mapping)

 Type
StandardSQLFunction.getReturnType(Type columnType,
              Mapping mapping)

 Type
SQLFunctionTemplate.getReturnType(Type columnType,
              Mapping mapping)

 Type
SQLFunction.getReturnType(Type columnType,
              Mapping mapping)

          The function return type

 Type
PositionSubstringFunction.getReturnType(Type columnType,
              Mapping mapping)

 Type
NvlFunction.getReturnType(Type columnType,
              Mapping mapping)

 Type
NoArgSQLFunction.getReturnType(Type columnType,
              Mapping mapping)

 Type
ClassicCountFunction.getReturnType(Type columnType,
              Mapping mapping)

 Type
ClassicAvgFunction.getReturnType(Type columnType,
              Mapping mapping)

 Type
CharIndexFunction.getReturnType(Type columnType,
              Mapping mapping)

 Type
CastFunction.getReturnType(Type columnType,
              Mapping mapping)

 Type
AnsiTrimEmulationFunction.getReturnType(Type columnType,
              Mapping mapping)

Uses of Mapping in org.hibernate.engine

Subinterfaces of Mapping in org.hibernate.engine

 interface
SessionFactoryImplementor

          Defines the internal contract between the <tt>SessionFactory</tt> and other parts of
 Hibernate such as implementors of <tt>Type</tt>.

Methods in org.hibernate.engine with parameters of type Mapping

static String[]
JoinHelper.getAliasedLHSColumnNames(AssociationType type,
                         String alias,
                         int property,
                         OuterJoinLoadable lhsPersister,
                         Mapping mapping)

          Get the aliased columns of the owning entity which are to
 be used in the join

static String[]
JoinHelper.getLHSColumnNames(AssociationType type,
                  int property,
                  OuterJoinLoadable lhsPersister,
                  Mapping mapping)

          Get the columns of the owning entity which are to
 be used in the join

static String[]
JoinHelper.getAliasedLHSColumnNames(AssociationType type,
                         String alias,
                         int property,
                         int begin,
                         OuterJoinLoadable lhsPersister,
                         Mapping mapping)

          Get the aliased columns of the owning entity which are to
 be used in the join

static String[]
JoinHelper.getLHSColumnNames(AssociationType type,
                  int property,
                  int begin,
                  OuterJoinLoadable lhsPersister,
                  Mapping mapping)

          Get the columns of the owning entity which are to
 be used in the join

Uses of Mapping in org.hibernate.impl

Classes in org.hibernate.impl that implement Mapping

 class
SessionFactoryImpl

          Concrete implementation of the <tt>SessionFactory</tt> interface.

Constructors in org.hibernate.impl with parameters of type Mapping

SessionFactoryImpl(Configuration cfg,
                   Mapping mapping,
                   Settings settings,
                   EventListeners listeners)

Uses of Mapping in org.hibernate.mapping

Methods in org.hibernate.mapping with parameters of type Mapping

 boolean
Value.isValid(Mapping mapping)

 String
UniqueKey.sqlCreateString(Dialect dialect,
                Mapping p,
                String defaultCatalog,
                String defaultSchema)

 void
UnionSubclass.validate(Mapping mapping)

 boolean
ToOne.isValid(Mapping mapping)

 void
Table.validateColumns(Dialect dialect,
                Mapping mapping,
                TableMetadata tableInfo)

 Iterator
Table.sqlAlterStrings(Dialect dialect,
                Mapping p,
                TableMetadata tableInfo,
                String defaultCatalog,
                String defaultSchema)

 String
Table.sqlTemporaryTableCreateString(Dialect dialect,
                              Mapping mapping)

 String
Table.sqlCreateString(Dialect dialect,
                Mapping p,
                String defaultCatalog,
                String defaultSchema)

 void
SingleTableSubclass.validate(Mapping mapping)

 boolean
SimpleValue.isValid(Mapping mapping)

 String
SimpleAuxiliaryDatabaseObject.sqlCreateString(Dialect dialect,
                Mapping p,
                String defaultCatalog,
                String defaultSchema)

 void
Set.validate(Mapping mapping)

 void
RootClass.validate(Mapping mapping)

 String
RelationalModel.sqlCreateString(Dialect dialect,
                Mapping p,
                String defaultCatalog,
                String defaultSchema)

 boolean
Property.isValid(Mapping mapping)

 void
PersistentClass.validate(Mapping mapping)

 void
PersistentClass.prepareTemporaryTables(Mapping mapping,
                       Dialect dialect)

 boolean
OneToMany.isValid(Mapping mapping)

 void
JoinedSubclass.validate(Mapping mapping)

 void
IndexedCollection.validate(Mapping mapping)

 String
Index.sqlCreateString(Dialect dialect,
                Mapping mapping,
                String defaultCatalog,
                String defaultSchema)

 void
IdentifierCollection.validate(Mapping mapping)

 String
Constraint.sqlCreateString(Dialect dialect,
                Mapping p,
                String defaultCatalog,
                String defaultSchema)

 int
Column.getSqlTypeCode(Mapping mapping)

 String
Column.getSqlType(Dialect dialect,
           Mapping mapping)

 void
Collection.validate(Mapping mapping)

 boolean
Collection.isValid(Mapping mapping)

Uses of Mapping in org.hibernate.persister

Methods in org.hibernate.persister with parameters of type Mapping

static EntityPersister
PersisterFactory.createClassPersister(PersistentClass model,
                     CacheConcurrencyStrategy cache,
                     SessionFactoryImplementor factory,
                     Mapping cfg)

Uses of Mapping in org.hibernate.persister.collection

Constructors in org.hibernate.persister.collection with parameters of type Mapping

CompositeElementPropertyMapping(String[] elementColumns,
                                String[] elementFormulaTemplates,
                                AbstractComponentType compositeType,
                                Mapping factory)

Uses of Mapping in org.hibernate.persister.entity

Methods in org.hibernate.persister.entity with parameters of type Mapping

protected  String
UnionSubclassEntityPersister.generateSubquery(PersistentClass model,
                 Mapping mapping)

protected  void
AbstractPropertyMapping.initPropertyPaths(String path,
                  Type type,
                  String[] columns,
                  String[] formulaTemplates,
                  Mapping factory)

protected  void
AbstractPropertyMapping.initIdentifierPropertyPaths(String path,
                            EntityType etype,
                            String[] columns,
                            Mapping factory)

protected  void
AbstractPropertyMapping.initComponentPropertyPaths(String path,
                           AbstractComponentType type,
                           String[] columns,
                           String[] formulaTemplates,
                           Mapping factory)

protected  void
AbstractEntityPersister.initPropertyPaths(Mapping mapping)

protected  void
AbstractEntityPersister.postConstruct(Mapping mapping)

Constructors in org.hibernate.persister.entity with parameters of type Mapping

UnionSubclassEntityPersister(PersistentClass persistentClass,
                             CacheConcurrencyStrategy cache,
                             SessionFactoryImplementor factory,
                             Mapping mapping)

SingleTableEntityPersister(PersistentClass persistentClass,
                           CacheConcurrencyStrategy cache,
                           SessionFactoryImplementor factory,
                           Mapping mapping)

JoinedSubclassEntityPersister(PersistentClass persistentClass,
                              CacheConcurrencyStrategy cache,
                              SessionFactoryImplementor factory,
                              Mapping mapping)

Uses of Mapping in org.hibernate.type

Methods in org.hibernate.type with parameters of type Mapping

 int[]
Type.sqlTypes(Mapping mapping)

          Return the SQL type codes for the columns mapped by this type.

 int
Type.getColumnSpan(Mapping mapping)

          How many columns are used to persist this type.

 Object
Type.fromXMLNode(org.dom4j.Node xml,
            Mapping factory)

          Parse the XML representation of an instance.

 boolean[]
Type.toColumnNullness(Object value,
                 Mapping mapping)

          Given an instance of the type, return an array of boolean, indicating
 which mapped columns would be null.

 int
SpecialOneToOneType.getColumnSpan(Mapping mapping)

 int[]
SpecialOneToOneType.sqlTypes(Mapping mapping)

 int
OneToOneType.getColumnSpan(Mapping session)

 int[]
OneToOneType.sqlTypes(Mapping session)

 boolean[]
OneToOneType.toColumnNullness(Object value,
                 Mapping mapping)

 Object
NullableType.fromXMLString(String xml,
              Mapping factory)

 int
NullableType.getColumnSpan(Mapping session)

 int[]
NullableType.sqlTypes(Mapping session)

 Object
NullableType.fromXMLNode(org.dom4j.Node xml,
            Mapping factory)

 boolean[]
NullableType.toColumnNullness(Object value,
                 Mapping mapping)

 int[]
MetaType.sqlTypes(Mapping mapping)

 int
MetaType.getColumnSpan(Mapping mapping)

 Object
MetaType.fromXMLString(String xml,
              Mapping factory)

 Object
MetaType.fromXMLNode(org.dom4j.Node xml,
            Mapping factory)

 boolean[]
MetaType.toColumnNullness(Object value,
                 Mapping mapping)

 int
ManyToOneType.getColumnSpan(Mapping mapping)

 int[]
ManyToOneType.sqlTypes(Mapping mapping)

 boolean[]
ManyToOneType.toColumnNullness(Object value,
                 Mapping mapping)

 Type
EntityType.getIdentifierOrUniqueKeyType(Mapping factory)

 String
EntityType.getIdentifierOrUniqueKeyPropertyName(Mapping factory)

 Object
EntityType.fromXMLNode(org.dom4j.Node xml,
            Mapping factory)

 int[]
CustomType.sqlTypes(Mapping pi)

 int
CustomType.getColumnSpan(Mapping session)

 Object
CustomType.fromXMLString(String xml,
              Mapping factory)

 Object
CustomType.fromXMLNode(org.dom4j.Node xml,
            Mapping factory)

 boolean[]
CustomType.toColumnNullness(Object value,
                 Mapping mapping)

 int
CompositeCustomType.getColumnSpan(Mapping mapping)

 int[]
CompositeCustomType.sqlTypes(Mapping mapping)

 Object
CompositeCustomType.fromXMLNode(org.dom4j.Node xml,
            Mapping factory)

 boolean[]
CompositeCustomType.toColumnNullness(Object value,
                 Mapping mapping)

 int[]
ComponentType.sqlTypes(Mapping mapping)

 int
ComponentType.getColumnSpan(Mapping mapping)

 Object
ComponentType.fromXMLNode(org.dom4j.Node xml,
            Mapping factory)

 boolean[]
ComponentType.toColumnNullness(Object value,
                 Mapping mapping)

 int[]
CollectionType.sqlTypes(Mapping session)

 int
CollectionType.getColumnSpan(Mapping session)

 Object
CollectionType.fromXMLNode(org.dom4j.Node xml,
            Mapping factory)

 boolean[]
CollectionType.toColumnNullness(Object value,
                 Mapping mapping)

 Object
ClobType.fromXMLNode(org.dom4j.Node xml,
            Mapping factory)

 int
ClobType.getColumnSpan(Mapping mapping)

 int[]
ClobType.sqlTypes(Mapping mapping)

 boolean[]
ClobType.toColumnNullness(Object value,
                 Mapping mapping)

 Object
BlobType.fromXMLNode(org.dom4j.Node xml,
            Mapping factory)

 int
BlobType.getColumnSpan(Mapping mapping)

 int[]
BlobType.sqlTypes(Mapping mapping)

 boolean[]
BlobType.toColumnNullness(Object value,
                 Mapping mapping)

 int
AnyType.getColumnSpan(Mapping session)

 int[]
AnyType.sqlTypes(Mapping mapping)

 Object
AnyType.fromXMLNode(org.dom4j.Node xml,
            Mapping factory)

 boolean[]
AnyType.toColumnNullness(Object value,
                 Mapping mapping)

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes