text:
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.Windows.Forms.Design;
using System.Windows.Forms.Design.Behavior;

namespace AcadUtility.WinForms
{
    internal class PickCoordinateControlDesigner : ControlDesigner
    {
        private Adorner Adorner { get; set; }

        public override void Initialize(IComponent component)
        {
            base.Initialize(component);

            Adorner = new Adorner();
            BehaviorService.Adorners.Add(Adorner);
        }

        public override GlyphCollection GetGlyphs(GlyphSelectionType selectionType)
        {
            var coll = base.GetGlyphs(selectionType);
            if (selectionType != GlyphSelectionType.NotSelected)
                coll.Add(new VerticalDividerGlyph(BehaviorService, Adorner, (PickCoordinateControl)Control));
            return coll;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && Adorner != null)
            {
                BehaviorService b = BehaviorService;
                if (b != null)
                {
                    b.Adorners.Remove(Adorner);
                }
            }

            base.Dispose(disposing);
        }

        public override SelectionRules SelectionRules => SelectionRules.LeftSizeable | SelectionRules.RightSizeable | SelectionRules.Moveable | SelectionRules.Visible;

        public override IList SnapLines
        {
            get
            {
                var snapLines = base.SnapLines;
                snapLines.Add(new SnapLine(SnapLineType.Left, ((PickCoordinateControl)Control).DividerLocation));
                return snapLines;
            }
        }

        protected override void PreFilterProperties(IDictionary properties)
        {
            base.PreFilterProperties(properties);
            string[] propertiesToHide = { "Text" };

            foreach (string propname in propertiesToHide)
            {
                var prop = (PropertyDescriptor)properties[propname];
                if (prop != null)
                {
                    // Add Browsable(false) to attributes
                    Attribute[] attributes = new Attribute[prop.Attributes.Count + 1];
                    prop.Attributes.CopyTo(attributes, 0);
                    attributes[attributes.Length - 1] = new BrowsableAttribute(false);

                    prop = TypeDescriptor.CreateProperty(this.GetType(), propname, prop.PropertyType, attributes);
                    properties[propname] = prop;
                }
            }
        }
    }

    internal class VerticalDividerGlyph : Glyph
    {
        private int location;
        private bool visible;

        public PickCoordinateControl Control { get; set; }
        public BehaviorService BehaviorService { get; set; }
        public Adorner Adorner { get; set; }
        private int Width { get; set; }

        public int Location
        {
            get => location;
            set
            {
                Adorner.Invalidate(Bounds);
                location = Math.Min(Control.ClientRectangle.Width - 20, Math.Max(20, value));
                Adorner.Invalidate(Bounds);
            }
        }

        public bool Visible
        {
            get => visible;
            set
            {
                visible = value;
                Adorner.Invalidate(Bounds);
            }
        }

        public VerticalDividerGlyph(BehaviorService behaviorService, Adorner adorner, PickCoordinateControl control) : base(new VerticalDividerBehavior())
        {
            this.Control = control;
            this.BehaviorService = behaviorService;
            this.Adorner = adorner;
            this.Width = 5;

            this.Location = control.DividerLocation;
            this.Visible = false;
        }

        public override Cursor GetHitTest(Point p)
        {
            if (Bounds.Contains(p) || ((VerticalDividerBehavior)Behavior).DraggingGlyph)
            {
                return Cursors.VSplit;
            }

            return null;
        }

        public override void Paint(PaintEventArgs pe)
        {
            if (Visible)
            {
                using (Brush brush = new System.Drawing.Drawing2D.HatchBrush(System.Drawing.Drawing2D.HatchStyle.Percent50, Color.Black, SystemColors.Control))
                {
                    pe.Graphics.FillRectangle(brush, Bounds);
                }
            }
        }

        public override Rectangle Bounds
        {
            get
            {
                Point point = BehaviorService.ControlToAdornerWindow(Control);
                int height = Control.ClientRectangle.Height;

                return new Rectangle(point.X + Location - Width / 2, point.Y, Width, height);
            }
        }

        public void UpdateControl()
        {
            Control.DividerLocation = Location;
        }
    }

    internal class VerticalDividerBehavior : Behavior
    {
        public bool DraggingGlyph { get; set; } = false;
        private Point lastLocation;

        public override bool OnMouseDown(Glyph g, MouseButtons button, Point mouseLoc)
        {
            if (button == MouseButtons.Left)
            {
                VerticalDividerGlyph vg = (VerticalDividerGlyph)g;
                vg.Visible = true;
                DraggingGlyph = true;
                lastLocation = mouseLoc;
                return true;
            }

            return false;
        }

        public override bool OnMouseMove(Glyph g, MouseButtons button, Point mouseLoc)
        {
            if (DraggingGlyph)
            {
                VerticalDividerGlyph vg = (VerticalDividerGlyph)g;
                vg.Location = vg.Location + mouseLoc.X - lastLocation.X;
                lastLocation = mouseLoc;
                return true;
            }

            return false;
        }

        public override bool OnMouseUp(Glyph g, MouseButtons button)
        {
            if (DraggingGlyph)
            {
                VerticalDividerGlyph vg = (VerticalDividerGlyph)g;
                vg.Visible = false;
                vg.UpdateControl();
                DraggingGlyph = false;
                return true;
            }

            return false;
        }
    }
}


text:
package com.kingleung.androidhodgepodge.basic.dagger;

import dagger.Component;

/**
 * @author kingleung
 *         Created on 2017/8/31.
 */
@Component(modules = ShangjiaModule.class)
public interface PlatformComponent {
    ChiHuo waimai();

    void inject(ChiHuo chiHuo);
}

redpajama_set_name: RedPajamaGithub


text:
package stroom.explorer.impl;

import stroom.docref.DocRef;
import stroom.docref.DocRefInfo;
import stroom.docstore.api.UniqueNameUtil;
import stroom.explorer.api.ExplorerActionHandler;
import stroom.explorer.shared.DocumentType;
import stroom.explorer.shared.DocumentTypeGroup;
import stroom.explorer.shared.ExplorerConstants;
import stroom.security.api.SecurityContext;
import stroom.security.shared.DocumentPermissionNames;
import stroom.util.shared.PermissionException;

import java.util.Collections;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import javax.inject.Inject;

class SystemExplorerActionHandler implements ExplorerActionHandler {

    private static final String SYSTEM = ExplorerConstants.SYSTEM;
    private static final String FOLDER = ExplorerConstants.FOLDER;
    private final SecurityContext securityContext;
    private final ExplorerTreeDao explorerTreeDao;

    @Inject
    SystemExplorerActionHandler(final SecurityContext securityContext,
                                final ExplorerTreeDao explorerTreeDao) {
        this.securityContext = securityContext;
        this.explorerTreeDao = explorerTreeDao;
    }

    @Override
    public DocRef createDocument(final String name) {
        throw new PermissionException(securityContext.getUserId(), "You cannot create the System node");
    }

    @Override
    public DocRef copyDocument(final DocRef docRef, final Set<String> existingNames) {
        final ExplorerTreeNode explorerTreeNode = explorerTreeDao.findByUUID(docRef.getUuid());
        if (explorerTreeNode == null) {
            throw new RuntimeException("Unable to find tree node to copy");
        }

        if (!securityContext.hasDocumentPermission(docRef.getUuid(), DocumentPermissionNames.READ)) {
            throw new PermissionException(securityContext.getUserId(),
                    "You do not have permission to read (" + FOLDER + ")");
        }

        final String newName = UniqueNameUtil.getCopyName(explorerTreeNode.getName(), existingNames);
        return new DocRef(FOLDER, UUID.randomUUID().toString(), newName);
    }

    @Override
    public DocRef moveDocument(final String uuid) {
        throw new PermissionException(securityContext.getUserId(), "You cannot move the System node");
    }

    @Override
    public DocRef renameDocument(final String uuid, final String name) {
        throw new PermissionException(securityContext.getUserId(), "You cannot rename the System node");
    }

    @Override
    public void deleteDocument(final String uuid) {
        throw new PermissionException(securityContext.getUserId(), "You cannot delete the System node");
    }

    @Override
    public DocRefInfo info(final String uuid) {
        throw new PermissionException(securityContext.getUserId(), "You cannot get info about the System node");
    }

    @Override
    public DocumentType getDocumentType() {
        return new DocumentType(DocumentTypeGroup.SYSTEM, SystemExplorerActionHandler.SYSTEM,
                SystemExplorerActionHandler.SYSTEM);
    }

    ////////////////////////////////////////////////////////////////////////
    // START OF HasDependencies
    ////////////////////////////////////////////////////////////////////////

    @Override
    public Map<DocRef, Set<DocRef>> getDependencies() {
        return Collections.emptyMap();
    }

    @Override
    public Set<DocRef> getDependencies(final DocRef docRef) {
        return Collections.emptySet();
    }

    @Override
    public void remapDependencies(final DocRef docRef, final Map<DocRef, DocRef> remappings) {
    }

    ////////////////////////////////////////////////////////////////////////
    // END OF HasDependencies
    ////////////////////////////////////////////////////////////////////////
}


text:
namespace app {
namespace Uno {

::uDelegateType* Action__Outracks_Simulator_Bytecode_WriteProperty__Uno_IO_BinaryWriter__typeof();

}}

#endif


text:
class PDAConfiguration < Struct.new(:state, :stack)
  STUCK_STATE = Object.new

  def stuck
    PDAConfiguration.new(STUCK_STATE, stack)
  end

  def stuck?
    state == STUCK_STATE
  end
end

class PDARule < Struct.new(:state, :character, :next_state, :pop_character, :push_characters)
  def applies_to?(configuration, character)
    self.state == configuration.state && self.pop_character == configuration.stack.top && self.character == character
  end

  def follow(configuration)
    PDAConfiguration.new(next_state, next_stack(configuration))
  end

  def next_stack(configuration)
    popped_stack = configuration.stack.pop
    push_characters.reverse.inject(popped_stack) { |stack, character| stack.push(character) }
  end
end


text:
from store import HistoryStore
from entry import History, HistoryEntry, group_history_by_gpath
from diff import HistoryDiff, HistoryDiffType, diff_histories
from diff import MergeAction, MergeActionType, calculate_merge_actions
from mergelog import MergeLog


text:
package org.apache.dubbo.metadata.definition;

import org.apache.dubbo.common.extension.ExtensionLoader;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.metadata.definition.builder.DefaultTypeBuilder;
import org.apache.dubbo.metadata.definition.builder.TypeBuilder;
import org.apache.dubbo.metadata.definition.model.TypeDefinition;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 2015/1/27.
 */
public class TypeDefinitionBuilder {
    private static final Logger logger = LoggerFactory.getLogger(TypeDefinitionBuilder.class);
    static final List<TypeBuilder> BUILDERS;

    static {
        ExtensionLoader<TypeBuilder> extensionLoader = ExtensionLoader.getExtensionLoader(TypeBuilder.class);
        Set<TypeBuilder> tbs = extensionLoader.getSupportedExtensionInstances();
        BUILDERS = new ArrayList<>(tbs);
    }

    public static TypeDefinition build(Type type, Class<?> clazz, Map<Class<?>, TypeDefinition> typeCache) {
        TypeBuilder builder = getGenericTypeBuilder(type, clazz);
        TypeDefinition td;
        if (builder != null) {
            td = builder.build(type, clazz, typeCache);
            td.setTypeBuilderName(builder.getClass().getName());
        } else {
            td = DefaultTypeBuilder.build(clazz, typeCache);
            td.setTypeBuilderName(DefaultTypeBuilder.class.getName());
        }
        return td;
    }

    private static TypeBuilder getGenericTypeBuilder(Type type, Class<?> clazz) {
        for (TypeBuilder builder : BUILDERS) {
            try {
                if (builder.accept(type, clazz)) {
                    return builder;
                }
            } catch (NoClassDefFoundError cnfe) {
                //ignore
                logger.info("Throw classNotFound (" + cnfe.getMessage() + ") in " + builder.getClass());
            }
        }
        return null;
    }

    private Map<Class<?>, TypeDefinition> typeCache = new HashMap<>();

    public TypeDefinition build(Type type, Class<?> clazz) {
        return build(type, clazz, typeCache);
    }

    public List<TypeDefinition> getTypeDefinitions() {
        return new ArrayList<>(typeCache.values());
    }

}


text:
package net.dv8tion.jda.client.managers;

import net.dv8tion.jda.client.managers.fields.EmoteField;
import net.dv8tion.jda.core.AccountType;
import net.dv8tion.jda.core.JDA;
import net.dv8tion.jda.core.Permission;
import net.dv8tion.jda.core.entities.Emote;
import net.dv8tion.jda.core.entities.Guild;
import net.dv8tion.jda.core.entities.ISnowflake;
import net.dv8tion.jda.core.entities.Role;
import net.dv8tion.jda.core.entities.impl.EmoteImpl;
import net.dv8tion.jda.core.exceptions.AccountTypeException;
import net.dv8tion.jda.core.exceptions.PermissionException;
import net.dv8tion.jda.core.requests.Request;
import net.dv8tion.jda.core.requests.Response;
import net.dv8tion.jda.core.requests.Route;
import net.dv8tion.jda.core.requests.restaction.AuditableRestAction;
import net.dv8tion.jda.core.utils.Checks;
import org.json.JSONObject;

import java.util.Collection;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import javax.annotation.CheckReturnValue;

/**
 * An {@link #update() updatable} manager that allows
 * to modify emote settings like the {@link #getNameField() name}.
 *
 *
This manager allows to modify multiple fields at once
 * by getting the {@link net.dv8tion.jda.client.managers.fields.EmoteField EmoteField} for specific
 * properties and setting or resetting their values; followed by a call of {@link #update()}!
 *
 *
The {@link net.dv8tion.jda.client.managers.EmoteManager EmoteManager} implementation
 * simplifies this process by giving simple setters that return the {@link #update() update} {@link net.dv8tion.jda.core.requests.RestAction RestAction}
 *
 *
Note: To {@link #update() update} this manager
 * the currently logged in account requires the Permission {@link net.dv8tion.jda.core.Permission#MANAGE_EMOTES MANAGE_EMOTES} and
 * must be from {@link net.dv8tion.jda.core.AccountType#CLIENT AccountType.CLIENT}
 */
public class EmoteManagerUpdatable
{
    public static final Pattern NAME_PATTERN = Pattern.compile("^\\w+$");

    protected final EmoteImpl emote;

    protected EmoteField<String> name;
    protected EmoteField<Collection<Role>> roles;

    /**
     * Creates a new EmoteManagerUpdatable instance
     *
     * @param  emote
     *         The target {@link net.dv8tion.jda.core.entities.impl.EmoteImpl EmoteImpl} to modify
     *
     * @throws net.dv8tion.jda.core.exceptions.AccountTypeException
     *         If the currently logged in account is not from {@link net.dv8tion.jda.core.AccountType#CLIENT AccountType.CLIENT}
     * @throws java.lang.IllegalStateException
     *         If the specified Emote is {@link net.dv8tion.jda.core.entities.Emote#isFake() fake} or {@link net.dv8tion.jda.core.entities.Emote#isManaged() managed}.
     */
    public EmoteManagerUpdatable(EmoteImpl emote)
    {
        if (emote.getJDA().getAccountType() != AccountType.CLIENT)
            throw new AccountTypeException(AccountType.CLIENT);
        if (emote.isFake())
            throw new IllegalStateException("The emote you are trying to update is not an actual emote we have access to (it is fake)!");
        if (emote.isManaged())
            throw new IllegalStateException("You cannot modify a managed emote!");
        this.emote = emote;
        setupFields();
    }

    /**
     * The {@link net.dv8tion.jda.core.JDA JDA} instance of this Manager
     *
     * @return the corresponding JDA instance
     */
    public JDA getJDA()
    {
        return emote.getJDA();
    }

    /**
     * The {@link net.dv8tion.jda.core.entities.Guild Guild} this Manager's
     * {@link net.dv8tion.jda.core.entities.Emote Emote} is in.
     *
This is logically the same as calling {@code getEmote().getGuild()}
     *
     * @return The parent {@link net.dv8tion.jda.core.entities.Guild Guild}
     */
    public Guild getGuild()
    {
        return emote.getGuild();
    }

    /**
     * The target {@link net.dv8tion.jda.core.entities.Emote Emote}
     * that will be modified by this Manager
     *
     * @return The target Emote
     */
    public Emote getEmote()
    {
        return emote;
    }

    /**
     * An {@link net.dv8tion.jda.client.managers.fields.EmoteField EmoteField}
     * for the name of the selected {@link net.dv8tion.jda.core.entities.Emote Emote}.
     *
     *
To set the value use {@link net.dv8tion.jda.core.managers.fields.Field#setValue(Object) setValue(String)}
     * on the returned {@link net.dv8tion.jda.client.managers.fields.EmoteField EmoteField} instance.
     *
     *
An emote name must be an alphanumeric-with-underscores String between 2-32 chars in length!
     *
Otherwise {@link net.dv8tion.jda.core.managers.fields.Field#setValue(Object) Field.setValue(...)} will
     * throw an {@link IllegalArgumentException IllegalArgumentException}.
     *
Example names: {@code fmgSUP}, {@code tatDAB}
     *
     * @return {@link net.dv8tion.jda.client.managers.fields.EmoteField EmoteField} - Type: {@code String}
     */
    public EmoteField<String> getNameField()
    {
        return name;
    }

    /**
     * An {@link net.dv8tion.jda.client.managers.fields.EmoteField EmoteField}
     * for the restriction roles of the selected {@link net.dv8tion.jda.core.entities.Emote Emote}.
     *
If the roles are empty this Emote will be available to everyone.
     *
     *
To set the value use {@link net.dv8tion.jda.core.managers.fields.Field#setValue(Object) setValue(Collection)}
     * on the returned {@link net.dv8tion.jda.client.managers.fields.EmoteField EmoteField} instance.
     *
     *
An emote's restricted roles must not contain {@code null}!
     *
Otherwise {@link net.dv8tion.jda.core.managers.fields.Field#setValue(Object) Field.setValue(...)} will
     * throw an {@link IllegalArgumentException IllegalArgumentException}.
     *
     * @return {@link net.dv8tion.jda.client.managers.fields.EmoteField EmoteField} - Type: {@link Collection}
     *
     * @deprecated
     *         This setting is only available to whitelisted accounts and may be removed in successive builds.
     */
    @Deprecated
    public EmoteField<Collection<Role>> getRolesField()
    {
        return roles;
    }

    /**
     * Resets all {@link net.dv8tion.jda.client.managers.fields.EmoteField Fields}
     * for this manager instance by calling {@link net.dv8tion.jda.core.managers.fields.Field#reset() Field.reset()} sequentially
     *
This is automatically called by {@link #update()}
     */
    public void reset()
    {
        name.reset();
        roles.reset();
    }

    /**
     * Creates a new {@link net.dv8tion.jda.core.requests.RestAction RestAction} instance
     * that will apply all changes that have been made to this manager instance.
     *
If no changes have been made this will simply return {@link net.dv8tion.jda.core.requests.RestAction.EmptyRestAction EmptyRestAction}.
     *
     *
Before applying new changes it is recommended to call {@link #reset()} to reset previous changes.
     *
This is automatically called if this method returns successfully.
     *
     *
Possible {@link net.dv8tion.jda.core.requests.ErrorResponse ErrorResponses} for this
     * update include the following:
     *

     *
{@link net.dv8tion.jda.core.requests.ErrorResponse#UNKNOWN_EMOJI UNKNOWN_EMOJI}
     *
If the target Emote was deleted before finishing the task

     *
     *
{@link net.dv8tion.jda.core.requests.ErrorResponse#MISSING_ACCESS MISSING_ACCESS}
     *
If the currently logged in account was removed from the Guild before finishing the task

     *
     *
{@link net.dv8tion.jda.core.requests.ErrorResponse#MISSING_PERMISSIONS MISSING_PERMISSIONS}
     *
If the currently logged in account loses the {@link net.dv8tion.jda.core.Permission#MANAGE_EMOTES MANAGE_EMOTES Permission}
     *          before finishing the task

     *

     *
     * @throws net.dv8tion.jda.core.exceptions.PermissionException
     *         If the currently logged in account does not have the Permission {@link net.dv8tion.jda.core.Permission#MANAGE_EMOTES MANAGE_EMOTES}
     *         in the underlying {@link net.dv8tion.jda.core.entities.Guild Guild}.
     *
     * @return {@link net.dv8tion.jda.core.requests.restaction.AuditableRestAction AuditableRestAction}
     *
Applies all changes that have been made in a single api-call.
     */
    @CheckReturnValue
    public AuditableRestAction<Void> update()
    {
        checkPermission(Permission.MANAGE_EMOTES);

        if (!needsUpdate())
            return new AuditableRestAction.EmptyRestAction<>(getJDA(), null);

        JSONObject body = new JSONObject();

        if (name.shouldUpdate())
            body.put("name", name.getValue());
        if (roles.shouldUpdate())
            body.put("roles", roles.getValue().stream().map(ISnowflake::getId).collect(Collectors.toList()));

        reset(); //reset because we built the JSONObject needed to update
        Route.CompiledRoute route = Route.Emotes.MODIFY_EMOTE.compile(getGuild().getId(), emote.getId());
        return new AuditableRestAction<Void>(getJDA(), route, body)
        {
            @Override
            protected void handleResponse(Response response, Request<Void> request)
            {
                if (response.isOk())
                    request.onSuccess(null);
                else
                    request.onFailure(response);
            }
        };
    }

    protected boolean needsUpdate()
    {
        return name.shouldUpdate()
                || roles.shouldUpdate();
    }

    protected void checkPermission(Permission perm)
    {
        if (!getGuild().getSelfMember().hasPermission(perm))
            throw new PermissionException(perm);
    }

    protected void setupFields()
    {
        name = new EmoteField<String>(this, emote::getName)
        {
            @Override
            public void checkValue(String value)
            {
                Checks.notNull(value, "emote name");
                if (value.length() < 2 || value.length() > 32)
                    throw new IllegalArgumentException("Emote name must be 2 to 32 characters in length");

                Matcher nameMatcher = NAME_PATTERN.matcher(value);
                if (!nameMatcher.find())
                    throw new IllegalArgumentException("Provided name must be Alphanumeric characters and underscores. (a-z A-Z 0-9 _)");
            }
        };

        roles = new EmoteField<Collection<Role>>(this, emote::getRoles)
        {
            @Override
            public void checkValue(Collection<Role> value)
            {
                Checks.notNull(value, "Role Collection");
                value.forEach(r -> Checks.notNull(r, "Role in Collection"));
            }
        };
    }
}


text:
  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1">
  <title>Contents.m</title>
<link rel="stylesheet" type="text/css" href="../stpr.css">

PKERNELPROJ

Plots isolines of kernel projection.

 Synopsis:

  pkernelproj(model)

  pkernelproj(model,options)

 Description:

  This function plots isolines corresponding to points

  having equal value of projection onto kernel basis

  (e.g. onto principal component in Kernel PCA).

  See 'help kernelproj' for more help on kernel projection.

 Input:

  model [struct] Defines kernel data projection.

 options [struct] Controls apperance:

  .contours [1x1] Number of plotted contours (Default 10).

  .xgrid [1x1] Density of sampling in x-axis (default 25).x

  .ygrid [1x1] Density of sampling in y-axis (default 25).

 Example:

  help kpca;

 See also

  KERNELPROJ, KPCA, GDA.

  Source: pkernelproj.m

About:   Statistical Pattern Recognition Toolbox

 (C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac

 Czech Technical University Prague

 Faculty of Electrical Engineering

 Center for Machine Perception

Modifications:

 4-may-2004, VF

 22-jan-2003, VF

 8-July-2001, V.Franc


text:
<?php

namespace nabu\data\traits;

/**
 * @author Rafael Gutierrez <rgutierrez@nabu-3.com>
 * @since 3.0.12 Surface
 * @version 3.0.12 Surface
 * @package nabu\data\traits
 */
trait TNabuId
{
    public function createStaticEncodedId() : string
    {
        return md5(NABU_ENC_ID_PREF . $this->getId() . NABU_ENC_ID_SUFF);
    }

    public function createTemporalEncodedId(int $expires = NABU_TEMP_ENC_ID_EXPIRATION_TIME) : string
    {
        return md5(NABU_ENC_ID_PREF . $this->getId() . NABU_ENC_ID_SUFF) . sprintf("%x",time() + $expires);
    }

    public function createStaticEncodedLogin() : string
    {
        return md5(NABU_ENC_LOGIN_PREF . $this->getLogin() . NABU_ENC_LOGIN_SUFF);
    }
}


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

   <title>Departamentos en el sistema</title>

      <link href="<?= base_url().'assents/css/bootstrap.min.css'?>" rel="stylesheet">
      <meta http-equiv="Content-type" content="text/html; charset=utf-8" />

Datos cargados exitosamente

            <form action="<?php echo base_url(); ?>especialista_controller/tabla" method="POST">

                 <button class="btn btn-lg btn-success btn-block" type="submit" name="submit" value="login"> Ver lista de Especialistas </button>
             				<input style="display:none" type="text" id="usuario" name="usuario" value="<?php echo $usuario; ?>"  class="form-control" >
																	<input style="display:none" type="text" id="clave" name="clave" value="<?php echo $password; ?>"  class="form-control" >
																	<input style="display:none" type="text" id="perfil" name="perfil" value="<?php echo $perfil; ?>"  class="form-control" >
																	<input style="display:none" type="text" id="id" name="id" value="<?php echo $id; ?>"  class="form-control" >

            </form>


text:
MACRO(MACRO_PUSH_REQUIRED_VARS)

   IF(NOT DEFINED _PUSH_REQUIRED_VARS_COUNTER)
      SET(_PUSH_REQUIRED_VARS_COUNTER 0)
   ENDIF(NOT DEFINED _PUSH_REQUIRED_VARS_COUNTER)

   MATH(EXPR _PUSH_REQUIRED_VARS_COUNTER "${_PUSH_REQUIRED_VARS_COUNTER}+1")

   SET(_CMAKE_REQUIRED_INCLUDES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}    ${CMAKE_REQUIRED_INCLUDES})
   SET(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
   SET(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}   ${CMAKE_REQUIRED_LIBRARIES})
   SET(_CMAKE_REQUIRED_FLAGS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}       ${CMAKE_REQUIRED_FLAGS})
ENDMACRO(MACRO_PUSH_REQUIRED_VARS)

MACRO(MACRO_POP_REQUIRED_VARS)

# don't pop more than we pushed
   IF("${_PUSH_REQUIRED_VARS_COUNTER}" GREATER "0")

      SET(CMAKE_REQUIRED_INCLUDES    ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
      SET(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
      SET(CMAKE_REQUIRED_LIBRARIES   ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
      SET(CMAKE_REQUIRED_FLAGS       ${_CMAKE_REQUIRED_FLAGS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})

      MATH(EXPR _PUSH_REQUIRED_VARS_COUNTER "${_PUSH_REQUIRED_VARS_COUNTER}-1")
   ENDIF("${_PUSH_REQUIRED_VARS_COUNTER}" GREATER "0")

ENDMACRO(MACRO_POP_REQUIRED_VARS)


text:
package de.codecentric.capturereplay.annotation;

import de.codecentric.capturereplay.CaptureReplayAdvice;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.AnnotationConfigContextLoader;

import static org.junit.Assert.assertNotNull;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(loader = AnnotationConfigContextLoader.class, classes = CaptureReplayImportBeanDefinitionRegistrarTestContextConfiguration.class)
public class CaptureReplayImportBeanDefinitionRegistrarModeOffTest {

	@Autowired
	private ApplicationContext applicationContext;

	@Test
	public void test() {
		assertNotNull(applicationContext.getBean(CaptureReplayAdvice.class));
	}

}


text:
import numpy as np
import scipy.misc

from skimage import color, io
import time

ab_to_dist = {}
ab_to_closest_bucket = {}
reweighting_vector = np.load('../preprocessing/reweighting_vector.npy')

def image_path_to_image_and_distribution_tensor(path):
    '''Converts an image path to a LAB image and a [64, 64, 313] tensor of color distribution values.'''
    raw_img = io.imread(path)
    lab_img = color.rgb2lab(raw_img)

    img = lab_img[:, :, 1:3]
    dist = np.zeros([64, 64, 313])
    weights = np.zeros([64, 64])

    h, w, _ = dist.shape
    for x in xrange(w):
        for y in xrange(h):
            ab = tuple(np.floor(img[4 * x][4 * y]))
            dist[x][y] = _map_ab_to_distribution(ab)
            weights[x][y] = reweighting_vector[ab_to_closest_bucket[ab]]

    return lab_img[:, :, 0], dist, weights, raw_img

def _gaussian(x, var):
    '''Gaussian on np array'''
    return np.exp(-(x**2) / (2 * var**2))

def _precompute_distributions():
    '''Precomputes the distribution we want for each integer a,b value.'''
    global ab_to_dist
    print "Precomputing distributions... will take a second"

    quantized_array = np.load('pts_in_hull.npy')

    for a in xrange(-130, 130):
        for b in xrange(-130, 130):
            tiled_ab = np.tile([a, b], (313, 1))

            distances = np.linalg.norm(quantized_array - tiled_ab, axis=1)
            d = distances.copy()
            d.sort()

            low_values = (distances > np.tile(d[4], (313)))
            gaussian_distances = _gaussian(distances, 5)
            gaussian_distances[low_values] = 0

            dist = gaussian_distances / np.sum(gaussian_distances)

            ab_to_dist[(a, b)] = dist
            ab_to_closest_bucket[(a, b)] = np.argmin(distances)
    print "Done"

def _map_ab_to_distribution(ab):
    '''Map an integer (a,b) tuple to a 313 deep distribution.'''
    if len(ab_to_dist) == 0:
        _precompute_distributions()

    return ab_to_dist[ab]

_precompute_distributions()


text:
package com.tonybeltramelli.mobile.lib.loader;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;

import com.tonybeltramelli.mobile.lib.event.LoaderEvent;

/**
 *
 * @author Tony Beltramelli www.tonybeltramelli.com
 *
 */
public class ViewLoader extends AsyncTask<Void, Integer, Void> {

	private ProgressDialog _progressDialog;
	private Context _context;
	private boolean _useBar;
	private LoaderEvent _event;
	private String _title;
	private String _message;

	public void build(String title, String message, Context context)
	{
		build(title, message, context, null, false);
	}

	public void build(String title, String message, Context context, boolean useBar)
	{
		build(title, message, context, null, useBar);
	}

	public void build(String title, String message, Context context, LoaderEvent event)
	{
		build(title, message, context, event, false);
	}

	public void build(String title, String message, Context context, LoaderEvent event, boolean useBar)
	{
		_title = title;
		_message = message;

		_context = context;
		_useBar = useBar;

		_event = event;
	}

	@Override
    protected void onPreExecute()
    {
		if(_useBar)
		{
			_progressDialog = new ProgressDialog(_context);
	        _progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
	        _progressDialog.setTitle(_title);
	        _progressDialog.setMessage(_message);
	        _progressDialog.setCancelable(false);
	        _progressDialog.setIndeterminate(false);
	        _progressDialog.setMax(100);
	        _progressDialog.setProgress(0);
	        _progressDialog.show();
		}else{
			_progressDialog = ProgressDialog.show(_context, _title, _message, false, false);
		}
    }

	@Override
	protected Void doInBackground(Void... params) {
		try
        {
            synchronized (this)
            {
                int counter = 0;
                while(counter <= 4)
                {
                    this.wait(500);
                    counter++;
                    publishProgress(counter*25);
                }
            }
        }
        catch (InterruptedException e)
        {
            e.printStackTrace();
        }
		return null;
	}

	@Override
	protected void onProgressUpdate(Integer... values) {
		super.onProgressUpdate(values);

		_progressDialog.setProgress(values[0]);
		_event.onProgress();
	}

	@Override
	protected void onPostExecute(Void result) {
		super.onPostExecute(result);

		_progressDialog.dismiss();
		_event.onComplete();
	}

	public void setTitle(String title) {
		_title = title;
		_progressDialog.setTitle(_title);
	}

	public void setMessage(String message) {
		_message = message;
		_progressDialog.setMessage(_message);
	}
}


text:
package com.bitdubai.fermat_api.layer.dmp_wallet_module.crypto_wallet.interfaces;

/**
 * The interface com.bitdubai.fermat_dmp_plugin.layer.wallet_module.crypto_wallet.interfaces.ActorTransactionSummary
 * contains all methods needed to consume the Transaction Summary of an Actor.
 *
 * Created by mati on 2015.09.17.
 * Modified by Leon Acosta - (laion.cj91@gmail.com) on 18/09/15.
 * @version 1.0
 */
public interface ActorTransactionSummary {

    int getSentTransactionsNumber();

    int getReceivedTransactionsNumber();

    int getTotalTransactionsNumber();

    long getSentAmount();

    long getReceivedAmount();

    long getBalanceAmount();

}


text:
\begin{titlepage}
%
%
\begin{figure}[ht]
\begin{minipage}{0.15\textwidth}
\vspace{-10mm}
\includegraphics[width=20mm]{aristotle_logo.png}
\end{minipage}
%
\begin{minipage}{0.70\textwidth}
{
ΑΡΙΣΤΟΤΕΛΕΙΟ ΠΑΝΕΠΙΣΤΗΜΙΟ\\[0.5\baselineskip]
ΘΕΣΣΑΛΟΝΙΚΗΣ\\[0.5\baselineskip]
Τμήμα Πληροφορικής
}
\end{minipage}
%
\end{figure}

\vspace{10mm}
\hbox{ % Horizontal box
\hspace*{0.08\textwidth} % Whitespace to the left of the title page
\rule{1.5pt}{0.80\textheight} % Vertical line
\hspace*{0.02\textwidth} % Whitespace between the vertical line and title page text
\parbox[b]{0.90\textwidth}{ % Paragraph box which restricts text to less than the width of the page

{\large \textsc{Πτυχιακή Εργασία}}\\[\baselineskip] % Tagline or further description
{\noindent\LARGE\bfseries
Ανίχνευση εισβολών με αρχιτεκτονική Lambda.
}\\[2\baselineskip] % Title

{\Large Ευφροσύνη Καλτιριμίδου}\\[3\baselineskip] % Author name

{\em Επιβλέπων:}\\[0.25\baselineskip]
{\large Αθηνά Βακάλη}\\[0.25\baselineskip]
{\large Καθηγήτρια}

\vspace{0.15\textheight} % Whitespace between the title block and the publisher
{\noindent Θεσσαλονίκη 2016}\\[\baselineskip] % Publisher and logo
}}
%
%
\end{titlepage}


text:
async function foo(a = await): Promise<void> {
}


text:
'use strict';

var remove         = require('es5-ext/array/#/remove')
  , capitalize     = require('es5-ext/string/#/capitalize')
  , d              = require('d')
  , ee             = require('event-emitter')
  , deferred       = require('deferred')
  , memoize        = require('memoizee')
  , once           = require('timers-ext/once')
  , ensureStorage  = require('dbjs-persistence/ensure-storage')
  , getIndexMap    = require('./get-db-sort-index-map')
  , getIdToStorage = require('./get-id-to-storage')

  , isArray = Array.isArray, defineProperty = Object.defineProperty
  , compareStamps = function (a, b) { return a.stamp - b.stamp; };

module.exports = memoize(function (set, storage, recordType, sortKeyPath) {
	var arr = ee([]), itemsMap = getIndexMap(storage, sortKeyPath)
	  , count = 0, isInitialized = false, def = deferred(), setListener, itemsListener
	  , methodName = 'get' + ((recordType === 'direct') ? '' : capitalize.call(recordType))
	  , getStorage, storages;

	if (isArray(storage)) storages = storage.map(ensureStorage);
	else storages = [ensureStorage(storage)];

	getStorage = getIdToStorage(storages);
	arr.emitChange = once(arr.emit.bind(arr, 'change'));
	var add = function (ownerId) {
		var promise;
		if (itemsMap[ownerId]) {
			promise = deferred(itemsMap[ownerId]);
		} else {
			promise = getStorage(ownerId)(function (storage) {
				if (!storage) return;
				return storage[methodName](ownerId + (sortKeyPath ? ('/' + sortKeyPath) : ''));
			});
		}
		return promise.aside(function (data) {
			if (!set.has(ownerId)) return;
			if (!itemsMap[ownerId]) itemsMap[ownerId] = { id: ownerId, stamp: data ? data.stamp : 0 };
			arr.push(itemsMap[ownerId]);
			if (def.resolved) {
				arr.sort(compareStamps);
				arr.emitChange();
			}
		});
	};
	set.on('change', setListener = function (event) {
		if (event.type === 'add') {
			add(event.value).done();
		} else {
			remove.call(arr, itemsMap[event.value]);
			arr.emitChange();
		}
	});
	itemsMap.on('update', itemsListener = function (event) {
		if (!set.has(event.ownerId)) return;
		if (def.resolved) {
			arr.sort(compareStamps);
			arr.emitChange();
		}
	});
	set.forEach(function (ownerId) {
		++count;
		add(ownerId).done(function () {
			if (!--count && isInitialized) def.resolve(arr.sort(compareStamps));
		});
	});
	isInitialized = true;
	if (!count) def.resolve(arr.sort(compareStamps));
	defineProperty(set, '_dispose', d(function () {
		set.off(setListener);
		itemsMap.off(itemsListener);
	}));
	return def.promise;
});


text:
Simple script that predicts flight time and probability of delay for local (USA) flights.

#Description of Files and Folders

main.py: Script that creates a regression model to predict flight time and possibility of delay based on the data from the bureau of transportation statistics.

app.py: Simple application to use the regression results of main.py in a simple GUI that helps the user select the origin and destination airport and obtain the flight time and probability of delay for each of the airlines.

CSV Folder: Folder with the initial dataset. The data set from the bureau of transportation statistics was used and not uploaded to git due to its size. To use the main.py script you can go to the below webpage, download the data, and uploaded it to the CSV folder.

http://www.transtats.bts.gov/DL_SelectFields.asp?Table_ID=236

Conf Folder: Folder where the results of the regressions are saved.


text:
package com.intel.dcst.exec;

public abstract class ExecFactory {
  public abstract Executor generate(int type);

}


text:
<?php

namespace socialCocktail;

use Illuminate\Database\Eloquent\Model;

class Comentario extends Model
{
    protected $table='comentarios';
    protected $fillable=['contenido','usuario_id','coctel_id','publicacion_id'];

    //Devuelve el usuario creador
    public function usuario(){
        return $this->belongsTo('socialCocktail\User','usuario_id');
    }

    //Devuelve el coctel al cual comento
    public function coctel(){
        return $this->belongsTo('socialCocktail\Coctel');
    }

    //Devuelve la publicacion la cual comento
    public function publicacion(){
        return $this->belongsTo('socialCocktail\Publicacion');
    }

}


text:
using SQLite;
using System;
using System.Text;
using Windows.Security.Cryptography;
using Windows.Security.Cryptography.Core;
using Windows.Storage.Streams;

namespace SQLite
{
    public class SQLiteWinRTCryptoProvider : IEncryptionProvider
    {
        CryptographicKey _CryptoKey;

        public SQLiteWinRTCryptoProvider(string key)
        {
            _CryptoKey = CreateKey(key);
        }
        public string EncryptString(string value)
        {
            if (value == String.Empty)
            {
                return value;
            }
            else
            {
                var valueBuffer = CryptographicBuffer.ConvertStringToBinary(value, BinaryStringEncoding.Utf8);
                var encryptedBuffer = CryptographicEngine.Encrypt(_CryptoKey, valueBuffer, null);
                return CryptographicBuffer.EncodeToBase64String(encryptedBuffer);
            }
        }

        public string DecryptString(string value)
        {
            if (value == String.Empty)
            {
                return value;
            }
            else
            {
                return CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf8,
                    CryptographicEngine.Decrypt(_CryptoKey,
                        CryptographicBuffer.DecodeFromBase64String(value), null));

            }
        }

        private CryptographicKey CreateKey(string key)
        {
            var keyBuffer = CryptographicBuffer.ConvertStringToBinary(key, BinaryStringEncoding.Utf8);
            var keyHash = KeyDerivationAlgorithmProvider
                .OpenAlgorithm(KeyDerivationAlgorithmNames.Pbkdf2Sha256)
                .CreateKey(keyBuffer);

            var keyMaterial = CryptographicEngine.DeriveKeyMaterial(keyHash, KeyDerivationParameters.BuildForPbkdf2(keyBuffer, 10), 16);

            return SymmetricKeyAlgorithmProvider.OpenAlgorithm(SymmetricAlgorithmNames.AesCbcPkcs7).CreateSymmetricKey(keyMaterial);
        }
    }
}


text:
(function() {
    var self = this;
    module.exports = function(terms) {
        var self = this;
        return terms.term({
            constructor: function(args) {
                var self = this;
                self.isArgumentList = true;
                return self.args = args;
            },
            arguments: function() {
                var self = this;
                return self.args;
            }
        });
    };
}).call(this);


text:
package org.immutables.criteria.repository.rxjava2;

import io.reactivex.Flowable;
import io.reactivex.Single;
import org.immutables.criteria.backend.WriteResult;
import org.immutables.criteria.matcher.Projection;
import org.immutables.criteria.repository.Updater;
import org.immutables.criteria.repository.reactive.ReactiveUpdater;
import org.reactivestreams.Publisher;

import java.util.Objects;

class RxJavaUpdaterDelegate<T> implements Updater<T, Single<WriteResult >> {

  private final ReactiveUpdater<T> delegate;

  RxJavaUpdaterDelegate(ReactiveUpdater<T> delegate) {
    this.delegate = Objects.requireNonNull(delegate, "delegate");
  }

  @Override
  public <V> Setter<Single<WriteResult>> set(Projection<V> projection, V value) {
    return new RxJavaSetter<>(delegate.set(projection, value));
  }

  @Override
  public WriteExecutor<Single<WriteResult>> replace(T newValue) {
    return () -> Flowable.fromPublisher(delegate.replace(newValue).execute()).singleOrError();
  }

  @SuppressWarnings("unchecked")
  private static class RxJavaSetter<T> implements Updater.Setter<Single<WriteResult>> {

    private final ReactiveUpdater.ReactiveSetter delegate;

    private RxJavaSetter(ReactiveUpdater.ReactiveSetter delegate) {
      this.delegate = delegate;
    }

    @Override
    public <V> RxJavaSetter<T> set(Projection<V> projection, V value) {
      return new RxJavaSetter<>(delegate.set(projection, value));
    }

    @Override
    public Single<WriteResult> execute() {
      Publisher<WriteResult> execute = delegate.execute();
      return Flowable.fromPublisher(execute).singleOrError();
    }
  }
}


text:
var TestCase = require('../../../lib/test-case')
var TestEventEmitter = require('./test-event-emitter')

class SetUpUnhandledErrorTestCase extends TestCase {
	constructor() {
        super()
    }

    static shouldExcludeDuringMassTests() {
        return true
    }

    setUp(onSetUpDone) {
        var evtEmitter = new TestEventEmitter()
        var self = this
        evtEmitter.on('setUpEvent', () => {
            self.assert(false)
        })
        setTimeout(() => {
            evtEmitter.emit('setUpEvent')
        }, 5)
    }

	testUnhandledError() {
	}
}

module.exports = SetUpUnhandledErrorTestCase


text:
package net.ladieu.biometrics.keystroke.model;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import net.ladieu.biometrics.keystroke.model.persistence.SerializingTemplateStorage;
import net.ladieu.biometrics.keystroke.model.persistence.TemplateStorage;
import net.ladieu.biometrics.keystroke.stats.KeystrokeDwellTimeVisitor;
import net.ladieu.biometrics.keystroke.stats.KeystrokeFlightTimeVisitor;
import net.ladieu.biometrics.keystroke.stats.KeystrokeVisitor;
import net.ladieu.biometrics.keystroke.stats.StatisticalDatasetBuilder;

import org.jfree.data.statistics.BoxAndWhiskerCalculator;
import org.jfree.data.statistics.BoxAndWhiskerItem;
import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset;

public class StatisticalMatcher implements KeystrokeMatcher {

	private KeystrokeMatcher internalTemplate;

	private List<KeystrokeSequence> templateBasis = new ArrayList<KeystrokeSequence>();

	private List<BoxAndWhiskerItem> flightStats = new ArrayList<BoxAndWhiskerItem>();
	private List<BoxAndWhiskerItem> dwellStats = new ArrayList<BoxAndWhiskerItem>();;

	private TemplateStorage storage = new SerializingTemplateStorage();
	private String username;
	private int samplePoints;
	private boolean statsDirty = true;
	private int numberOfFilteredTemplates = 0;

	/**
	 * If constructed with both username and password, will load a clean slate
	 * for enrollment.
	 *
	 * @param username
	 *            username to enroll
	 * @param password
	 *            password to be used in authenticating user
	 */
	public StatisticalMatcher(String username, String password) {
		super();
		initialize(username, password);
	}

	/**
	 * If constructed with just a username, will attempt to load the password
	 * data from storage.
	 *
	 * @param username
	 *            username for which to load template data
	 * @throws IOException
	 *             if no template data exists
	 */
	public StatisticalMatcher(String username) throws IOException {
		super();

		restore(username);

		if (templateBasis.isEmpty()) {
			throw new IOException(
					"Template basis must contain at least one sample");
		}

		String password = templateBasis.get(0).getCapturedValue();

		initialize(username, password);
	}

	private void initialize(String username, String password) {
		this.username = username;
		internalTemplate = new ExactPhraseMatcher(password);
		samplePoints = password.length();
	}

	public void addSequence(KeystrokeSequence sequence) {
		this.templateBasis.add(sequence);
		statsDirty = true;
	}

	public void recalculateStats() {
		dwellStats.clear();
		flightStats.clear();
		if (!templateBasis.isEmpty()) {
			dwellStats.addAll(analyzeData(new KeystrokeDwellTimeVisitor()));
			flightStats.addAll(analyzeData(new KeystrokeFlightTimeVisitor()));
		}

		statsDirty = false;
	}

	public float getDistance(KeystrokeSequence sequence) {
		if (KeystrokeMatcher.NO_MATCH == internalTemplate.getDistance(sequence)) {
			return KeystrokeMatcher.NO_MATCH;
		}

		return this.getStatisticalDistance(sequence);
	}

	protected float getStatisticalDistance(KeystrokeSequence sequence) {
		return Float.valueOf(1.0f - (getNumberOfOutliers(sequence) / Float
				.valueOf(samplePoints * 2))); // 2x sample points because we
		// capture set for flight and
		// set for dwell
	}

	private int getNumberOfOutliers(KeystrokeSequence sequence) {

		int numberOfOutliers = 0;

		StatisticalDatasetBuilder statsBuilder = new StatisticalDatasetBuilder(
				this);

		DefaultBoxAndWhiskerCategoryDataset stats = statsBuilder
				.generateStats();

		int keystrokeIndex = 1;
		for (Keystroke currentKeystroke : sequence) {

			long dwell = currentKeystroke.getDwellTime();
			long flight = currentKeystroke.getFlightTime();

			long minFlight = stats.getMinRegularValue("flight", keystrokeIndex)
					.longValue();
			long maxFlight = stats.getMaxRegularValue("flight", keystrokeIndex)
					.longValue();

			long minDwell = stats.getMinRegularValue("dwell", keystrokeIndex)
					.longValue();
			long maxDwell = stats.getMaxRegularValue("dwell", keystrokeIndex)
					.longValue();

			if (dwell < minDwell || dwell > maxDwell) {
				numberOfOutliers++;
			}

			if (flight < minFlight || flight > maxFlight) {
				numberOfOutliers++;
			}

			keystrokeIndex++;
		}

		return numberOfOutliers;
	}

	public List<BoxAndWhiskerItem> getFlightTimeStatistics() {
		if (statsDirty) {
			recalculateStats();
		}
		return new ArrayList<BoxAndWhiskerItem>(flightStats);
	}

	public List<BoxAndWhiskerItem> getDwellTimeStatistics() {
		if (statsDirty) {
			recalculateStats();
		}
		return new ArrayList<BoxAndWhiskerItem>(dwellStats);
	}

	protected List<BoxAndWhiskerItem> analyzeData(
			KeystrokeVisitor<Number> visitor) {

		BoxAndWhiskerItem[] resultArray = new BoxAndWhiskerItem[samplePoints];

		for (int i = 0; i < samplePoints; i++) {
			List<Number> currentSample = new ArrayList<Number>();

			for (KeystrokeSequence currentSequence : templateBasis) {
				currentSample.add(visitor.visitKeystroke(currentSequence
						.getKeystroke(i)));
			}

			resultArray[i] = getStatsForSample(currentSample);
		}

		return Arrays.asList(resultArray);
	}

	protected BoxAndWhiskerItem getStatsForSample(List<Number> sample) {
		return BoxAndWhiskerCalculator.calculateBoxAndWhiskerStatistics(sample);
	}

	public String getTextToMatch() {
		return internalTemplate.getTextToMatch();
	}

	public void filterOutliers(Map<Integer, Set<Number>> flightOutliers,
			Map<Integer, Set<Number>> dwellOutliers) {

		List<KeystrokeSequence> filteredTemplateBasis = new ArrayList<KeystrokeSequence>();

		for (KeystrokeSequence currentSequence : templateBasis) {

			boolean sequenceContainsOutlier = false;
			int keystrokeIndex = 0;
			for (Iterator<Keystroke> i = currentSequence.iterator(); i
					.hasNext()
					&& !sequenceContainsOutlier; keystrokeIndex++) {

				Set<Number> flightOutliersForKeystroke = flightOutliers
						.get(keystrokeIndex);
				Set<Number> dwellOutliersForKeystroke = dwellOutliers
						.get(keystrokeIndex);

				Keystroke currentKeystroke = i.next();

				if (flightOutliersForKeystroke.contains(currentKeystroke
						.getFlightTime())
						|| dwellOutliersForKeystroke.contains(currentKeystroke
								.getDwellTime())) {
					sequenceContainsOutlier = true;
				}
			}

			if (!sequenceContainsOutlier) {
				filteredTemplateBasis.add(currentSequence);
			}
		}

		numberOfFilteredTemplates += templateBasis.size()
				- filteredTemplateBasis.size();

		templateBasis.clear();
		templateBasis.addAll(filteredTemplateBasis);
		statsDirty = true;
	}

	public int getNumberOfTemplatesCaptured() {
		return templateBasis.size();
	}

	public int getNumberOfFilteredTemplates() {
		return numberOfFilteredTemplates;
	}

	public void save() {
		storage.saveTemplate(username, templateBasis);
	}

	public void restore(String username) throws IOException {
		this.templateBasis = storage.getStoredTemplate(username);
		statsDirty = true;
	}

}


text:
<ng-include src="'org/cboard/view/dashboard/layout/header.html'"></ng-include>

 0">

{{paramToString(timelineFilter)}}

                <button type="button" class="btn btn-box-tool" ng-click="paramInfoShow = !paramInfoShow">

                </button>

                        <ng-include src="'org/cboard/view/dashboard/param/selector.html'" style="float: left"/>

                        <ng-include src="'org/cboard/view/dashboard/param/slider.html'" class="col-md-{{param.cfg.width}}"/>

                        {{row.nodeName}}

{{row.title}}

                                <ng-switch on="row.type">

                                                <dashboard-widget ng-show="widget.loading == false"></dashboard-widget>

{{widget.name}}

                                                            <button type="button" class="btn btn-box-tool"
                                                                    ng-if="widgetCfg"
                                                                    ng-click="config(widget)">
                                                            </button>
                                                            <button type="button" class="btn btn-box-tool"
                                                                    data-widget="collapse">
                                                            </button>

                                                         {{"COMMON.LOADING" |
                                                        translate}}

{{widget.name}}

                                                            <button type="button" class="btn btn-box-tool"
                                                                    data-widget="collapse">
                                                            </button>

                                                        {{'ADMIN.CONTACT_ADMIN' | translate}}:

 {{ri.type |
                                                                translate}}:{{ri.name}}

                                </ng-switch>


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('members', '0007_member_spent_time_factor'),
    ]

    operations = [
        migrations.AlterField(
            model_name='member',
            name='spent_time_factor',
            field=models.DecimalField(decimal_places=2, default=1, help_text='Modify this value whe this member cost8needs to be adjusted by a factor', max_digits=5, verbose_name='Factor that needs to be multiplied on the spent time price for this member'),
        ),
    ]


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

    <item>
      <title>Using #exec to set externaddr in sip.conf</title>
      <link>http://blog.leifmadsen.com/blog/2011/02/27/using-</link>
      <pubDate>Sun, 27 Feb 2011 21:57:41 +0000</pubDate>

      <guid>http://blog.leifmadsen.com/blog/2011/02/27/using-</guid>
      <description>Today I was working on a system, and knowing that the system is going to get moved, and that often one of the things forgotten is to update the externaddr= option in sip.conf (when Asterisk is sitting behind NAT), I decided to put together a little script that returns the external IP address of the system. Using this script along with an #exec in the sip.conf file will make it so the address gets updated when the system is moved to the new physical location.</description>
    </item>

    <item>
      <title>Video of '5 Things You Didn't Know Asterisk Could Do' Presentation Now Available</title>
      <link>http://blog.leifmadsen.com/blog/2010/12/21/video-of-5-things-you-didnt-know-asterisk-could-do-presentation-now-available/</link>
      <pubDate>Tue, 21 Dec 2010 15:26:43 +0000</pubDate>

      <guid>http://blog.leifmadsen.com/blog/2010/12/21/video-of-5-things-you-didnt-know-asterisk-could-do-presentation-now-available/</guid>
      <description>Check out the AstriCon website for my presentation that was recorded this year. I did three presentations this year (5 Things You Didn&rsquo;t Know Asterisk Could Do, Distributed Call Centres, and the Asterisk Project Update with Russell Bryant) but unfortunately the only one I see so far is the 5 Things presentation (which is a very good presentation! :))
The link to the presentations are here: http://www.astricon.net/videoPresentations.aspx#Digium7 with mine being at the top of the list.</description>
    </item>

    <item>
      <title>HowTo: Read a value from a file, and say it back</title>
      <link>http://blog.leifmadsen.com/blog/2009/07/17/howto-read-a-value-from-a-file-and-say-it-back/</link>
      <pubDate>Fri, 17 Jul 2009 17:21:15 +0000</pubDate>

      <guid>http://blog.leifmadsen.com/blog/2009/07/17/howto-read-a-value-from-a-file-and-say-it-back/</guid>
      <description>Preamble Today on the VoIP Users Conference we discussed my request for recipe ideas in order to start developing some additional documentation. Specifically, I&rsquo;m looking for problems that are simple, common problems that can be solved in the dialplan, and which are good examples of the dialplan language (markup, script, yadda yadda).
One of the suggestions was something posted to the Asterisk mailing list which was pretty straight forward: to read in the contents of a file, where the file contained a number which was the current temperature.</description>
    </item>

  </channel>
</rss>


text:
<?php

namespace app\models;

use Yii;

use app\models\general\GeneralLabel;
use app\models\general\GeneralMessage;

/**
 * This is the model class for table "tbl_atlet_pembangunan_kemahiran".
 *
 * @property integer $kemahiran_id
 * @property integer $atlet_id
 * @property string $jenis_kemahiran
 * @property string $nama_kemahiran
 */
class AtletPembangunanKemahiran extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'tbl_atlet_pembangunan_kemahiran';
    }

    public function behaviors()
    {
        return [
            [
                'class' => \yii\behaviors\BlameableBehavior::className(),
                'createdByAttribute' => 'created_by',
                'updatedByAttribute' => 'updated_by',
            ],
            [
                'class' => \yii\behaviors\TimestampBehavior::className(),
                'createdAtAttribute' => 'created',
                'updatedAtAttribute' => 'updated',
                'value' => new \yii\db\Expression('NOW()'),
            ],
        ];
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['atlet_id', 'jenis_kemahiran', 'tarikh_mula', 'tarikh_tamat', 'penganjur', 'lokasi'], 'required', 'skipOnEmpty' => true, 'message' => GeneralMessage::yii_validation_required],
            [['atlet_id'], 'integer', 'message' => GeneralMessage::yii_validation_integer],
            [['jenis_kemahiran'], 'string', 'max' => 30, 'tooLong' => GeneralMessage::yii_validation_string_max],
            [['nama_kemahiran'], 'string', 'max' => 100, 'tooLong' => GeneralMessage::yii_validation_string_max],
            [['jenis_kemahiran','nama_kemahiran'], function ($attribute, $params) {
                if (!\common\models\general\GeneralFunction::validateXSS($this->$attribute)) {
                    $this->addError($attribute, GeneralMessage::yii_validation_xss);
                }
            }],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'kemahiran_id' => GeneralLabel::kemahiran_id,
            'atlet_id' => GeneralLabel::atlet_id,
            'jenis_kemahiran' => GeneralLabel::jenis_kemahiran,
            'nama_kemahiran' => GeneralLabel::nama_kemahiran,
            'tarikh_mula' => GeneralLabel::tarikh_mula,
            'tarikh_tamat' => GeneralLabel::tarikh_tamat,
            'penganjur' => GeneralLabel::penganjur,
            'lokasi' => GeneralLabel::lokasi,

        ];
    }

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


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = require('babel-runtime/helpers/extends');

var _extends3 = _interopRequireDefault(_extends2);

var _isNil2 = require('lodash/isNil');

var _isNil3 = _interopRequireDefault(_isNil2);

var _classnames = require('classnames');

var _classnames2 = _interopRequireDefault(_classnames);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _lib = require('../../lib');

var _Icon = require('../../elements/Icon');

var _Icon2 = _interopRequireDefault(_Icon);

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

/**
 * A divider sub-component for Breadcrumb component.
 */
function BreadcrumbDivider(props) {
  var children = props.children,
      className = props.className,
      content = props.content,
      icon = props.icon;

  var classes = (0, _classnames2.default)('divider', className);
  var rest = (0, _lib.getUnhandledProps)(BreadcrumbDivider, props);
  var ElementType = (0, _lib.getElementType)(BreadcrumbDivider, props);

  if (!(0, _isNil3.default)(icon)) return _Icon2.default.create(icon, { defaultProps: (0, _extends3.default)({}, rest, { className: classes }) });
  if (!(0, _isNil3.default)(content)) return _react2.default.createElement(
    ElementType,
    (0, _extends3.default)({}, rest, { className: classes }),
    content
  );

  return _react2.default.createElement(
    ElementType,
    (0, _extends3.default)({}, rest, { className: classes }),
    _lib.childrenUtils.isNil(children) ? '/' : children
  );
}

BreadcrumbDivider.handledProps = ['as', 'children', 'className', 'content', 'icon'];
BreadcrumbDivider._meta = {
  name: 'BreadcrumbDivider',
  type: _lib.META.TYPES.COLLECTION,
  parent: 'Breadcrumb'
};

BreadcrumbDivider.propTypes = process.env.NODE_ENV !== "production" ? {
  /** An element type to render as (string or function). */
  as: _lib.customPropTypes.as,

  /** Primary content. */
  children: _propTypes2.default.node,

  /** Additional classes. */
  className: _propTypes2.default.string,

  /** Shorthand for primary content. */
  content: _lib.customPropTypes.contentShorthand,

  /** Render as an `Icon` component with `divider` class instead of a `div`. */
  icon: _lib.customPropTypes.itemShorthand
} : {};

BreadcrumbDivider.create = (0, _lib.createShorthandFactory)(BreadcrumbDivider, function (icon) {
  return { icon: icon };
});

exports.default = BreadcrumbDivider;


text:
package com.percolate.sdk.dto;

import com.fasterxml.jackson.annotation.*;
import com.percolate.sdk.interfaces.HasExtraFields;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ShareObject implements Serializable, HasExtraFields {

    private static final long serialVersionUID = -8957804320866631989L;

    @JsonProperty("uid")
    protected String UID;

    @JsonProperty("created_at")
    protected Date createdAt;

    @JsonProperty("local_created_at")
    protected LocalCreatedAt localCreatedAt;

    @JsonProperty("link")
    protected ShareLink link;

    @JsonProperty("owner")
    protected ShareUser owner;

    @JsonProperty("owner_uid")
    protected String ownerUID;

    @JsonProperty("type")
    protected String type;

    @JsonProperty("image")
    protected Media image;

    @JsonProperty("ugc_meta")
    protected ShareUgcMeta ugcMeta;

    @JsonIgnore
    protected Map<String, Object> extraFields = new HashMap<>();

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public LocalCreatedAt getLocalCreatedAt() {
        return localCreatedAt;
    }

    public void setLocalCreatedAt(LocalCreatedAt localCreatedAt) {
        this.localCreatedAt = localCreatedAt;
    }

    public ShareLink getLink() {
        return link;
    }

    public void setLink(ShareLink link) {
        this.link = link;
    }

    public ShareUser getOwner() {
        return owner;
    }

    public void setOwner(ShareUser owner) {
        this.owner = owner;
    }

    public String getOwnerUID() {
        return ownerUID;
    }

    public void setOwnerUID(String ownerUID) {
        this.ownerUID = ownerUID;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getUID() {
        return UID;
    }

    public void setUID(String uID) {
        UID = uID;
    }

    public Media getImage() {
        return image;
    }

    public void setImage(Media image) {
        this.image = image;
    }

    public ShareUgcMeta getUgcMeta() {
        return ugcMeta;
    }

    public void setUgcMeta(ShareUgcMeta ugcMeta) {
        this.ugcMeta = ugcMeta;
    }

    @Override
    public Map<String, Object> getExtraFields() {
        if(extraFields == null) {
            extraFields = new HashMap<>();
        }
        return extraFields;
    }

    @Override
    @JsonAnySetter
    public void putExtraField(String key, Object value) {
        getExtraFields().put(key, value);
    }
}


text:
package uk.joshiejack.harvestcore.world.storage.loot.functions;

import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import uk.joshiejack.harvestcore.HarvestCore;
import uk.joshiejack.harvestcore.item.HCItems;
import uk.joshiejack.harvestcore.item.ItemSeeds;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.storage.loot.LootContext;
import net.minecraft.world.storage.loot.conditions.LootCondition;
import net.minecraft.world.storage.loot.functions.LootFunction;

import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.Random;
import java.util.stream.Collectors;

public class SetCrop extends LootFunction {
    private final String crop;

    public SetCrop(String crop, LootCondition[] conditionsIn) {
        super(conditionsIn);
        this.crop = crop;
    }

    @Nonnull
    public ItemStack apply(@Nonnull ItemStack stack, @Nonnull Random rand, @Nonnull LootContext context) {
        if (crop.equals("random")) {
            return HCItems.SEED_BAG.withCrop(stack, ItemSeeds.data.keySet().stream()
                    .collect(Collectors.collectingAndThen(Collectors.toList(), collected -> { Collections.shuffle(collected); return collected.stream(); }))
                    .limit(1)
                    .findAny().get());
        } else return HCItems.SEED_BAG.withCrop(stack, crop);
    }

    public static class Serializer extends LootFunction.Serializer<SetCrop> {
        public Serializer() {
            super(new ResourceLocation(HarvestCore.MODID, "set_crop"), SetCrop.class);
        }

        public void serialize(@Nonnull JsonObject object, @Nonnull SetCrop functionClazz, @Nonnull JsonSerializationContext serializationContext) {
            object.addProperty("crop", functionClazz.crop);
        }

        @Nonnull
        public SetCrop deserialize(@Nonnull JsonObject object, @Nonnull JsonDeserializationContext deserializationContext, @Nonnull LootCondition[] conditionsIn) {
            return new SetCrop(object.get("crop").getAsString(), conditionsIn);
        }
    }
}


text:
import {
  Component,
  OnInit
} from '@angular/core';
import {
  WorkprocessService
} from './workprocess.service';
import { ActivatedRoute } from '@angular/router';
import { Observable } from 'rxjs/observable';
import { Http, Response } from '@angular/http';

@Component({
  selector: 'workprocess',
  templateUrl: './workprocess.component.html'
})

export class WorkprocessComponent implements OnInit {

  public localState: any;

  public topName = 'Group';
  public bottomName = 'Sub-Group';
  public selectedGroup = ' ';
  public selectedSubGroup = ' ';
  public groups = [];
  public subGroups = [];
  public subGroupsJsonResult: JSON;

  constructor(
    public route: ActivatedRoute,
    public workprocessService: WorkprocessService
  ) {}

  public ngOnInit() {
    this.route
      .data
      .subscribe((data: any) => {
        // your resolved data from route
        this.localState = data.yourData;
      });

    console.log('hello `Workprocess` component');
    // static data that is bundled
    // var mockData = require('assets/mock-data/mock-data.json');
    // console.log('mockData', mockData);
    // if you're working with mock data you can also use http.get('assets/mock-data/mock-data.json')
    this.asyncDataWithWebpack();
    this.callGroupsNetwork();
    this.callSubGroupsNetwork();
  }

  public getSubGroups(input: String) {
    return null;
  }

  public updateSubGroup(event) {
    if (event === 'Finance') {
      this.subGroups = ['Finance1' , 'Finance2' , 'Finance3'];
    } else if (event === 'HR') {
      this.subGroups = ['HR1' , 'HR2' , 'HR3'];
    } else if (event === 'POD') {
      this.subGroups = ['POD1' , 'POD2' , 'POD3'];
    }
  }

  public callGroupsNetwork() {
    this.workprocessService.getGroups().subscribe((res) => {
      this.setUpGroupsArray(res.json());
    });
  }

  public callSubGroupsNetwork() {
    this.workprocessService.getSubGroups().subscribe((res) => {
      this.subGroupsJsonResult = res.json();
    });
  }

  public setUpGroupsArray(response: JSON) {
    for (let entry of response['category']) {
      this.groups.push(entry.name);
    }
  }

  public setUpSubGroupsArray(response: JSON) {
    let subCat = response['subCategory'];
    let array = subCat['finance'];
    for (let entry of array) {
      this.subGroups.push(entry.name);
    }
  }

  private asyncDataWithWebpack() {
    // you can also async load mock data with 'es6-promise-loader'
    // you would do this if you don't want the mock-data bundled
    // remember that 'es6-promise-loader' is a promise
    setTimeout(() => {

      System.import('../../assets/mock-data/mock-data.json')
        .then((json) => {
          console.log('async mockData', json);
          this.localState = json;
        });

    });
  }

}


text:
#include "jerryscript.h"

#include "config.h"
#include "test-common.h"

static jerry_value_t
resource_name_handler (const jerry_call_info_t *call_info_p, /**< call information */
                       const jerry_value_t args_p[], /**< argument list */
                       const jerry_length_t args_count) /**< argument count */
{
  (void) call_info_p;

  jerry_value_t undefined_value = jerry_create_undefined ();
  jerry_value_t resource_name = jerry_get_resource_name (args_count > 0 ? args_p[0] : undefined_value);
  jerry_release_value (undefined_value);

  return resource_name;
} /* resource_name_handler */

int
main (void)
{
  TEST_INIT ();

  if (!jerry_is_feature_enabled (JERRY_FEATURE_LINE_INFO))
  {
    jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Line info support is disabled!\n");
    return 0;
  }

  jerry_init (JERRY_INIT_EMPTY);

  jerry_value_t global = jerry_get_global_object ();

  /* Register the "resourceName" method. */
  {
    jerry_value_t func = jerry_create_external_function (resource_name_handler);
    jerry_value_t name = jerry_create_string ((const jerry_char_t *) "resourceName");
    jerry_value_t result = jerry_set_property (global, name, func);
    jerry_release_value (result);
    jerry_release_value (name);
    jerry_release_value (func);
  }

  jerry_release_value (global);

  jerry_parse_options_t parse_options;
  parse_options.options = JERRY_PARSE_HAS_RESOURCE;

  const char *source_1 = ("function f1 () {\n"
                          "  if (resourceName() !== 'demo1.js') return false; \n"
                          "  if (resourceName(f1) !== 'demo1.js') return false; \n"
                          "  if (resourceName(5) !== '<anonymous>') return false; \n"
                          "  return f1; \n"
                          "} \n"
                          "f1();");

  parse_options.resource_name = jerry_create_string ((jerry_char_t *) "demo1.js");

  jerry_value_t program = jerry_parse ((const jerry_char_t *) source_1, strlen (source_1), &parse_options);
  TEST_ASSERT (!jerry_value_is_error (program));

  jerry_value_t run_result = jerry_run (program);
  TEST_ASSERT (!jerry_value_is_error (run_result));
  TEST_ASSERT (jerry_value_is_object (run_result));

  jerry_value_t resource_value = jerry_get_resource_name (run_result);
  jerry_value_t compare_result =
    jerry_binary_operation (JERRY_BIN_OP_STRICT_EQUAL, resource_value, parse_options.resource_name);
  TEST_ASSERT (jerry_value_is_true (compare_result));

  jerry_release_value (compare_result);
  jerry_release_value (resource_value);
  jerry_release_value (parse_options.resource_name);

  jerry_release_value (run_result);
  jerry_release_value (program);

  const char *source_2 = ("function f2 () { \n"
                          "  if (resourceName() !== 'demo2.js') return false; \n"
                          "  if (resourceName(f2) !== 'demo2.js') return false; \n"
                          "  if (resourceName(f1) !== 'demo1.js') return false; \n"
                          "  if (resourceName(Object.prototype) !== '<anonymous>') return false; \n"
                          "  if (resourceName(Function) !== '<anonymous>') return false; \n"
                          "  return f2; \n"
                          "} \n"
                          "f2(); \n");

  parse_options.resource_name = jerry_create_string ((const jerry_char_t *) "demo2.js");

  program = jerry_parse ((const jerry_char_t *) source_2, strlen (source_2), &parse_options);
  TEST_ASSERT (!jerry_value_is_error (program));

  run_result = jerry_run (program);
  TEST_ASSERT (!jerry_value_is_error (run_result));
  TEST_ASSERT (jerry_value_is_object (run_result));

  resource_value = jerry_get_resource_name (run_result);
  compare_result = jerry_binary_operation (JERRY_BIN_OP_STRICT_EQUAL, resource_value, parse_options.resource_name);
  TEST_ASSERT (jerry_value_is_true (compare_result));

  jerry_release_value (compare_result);
  jerry_release_value (resource_value);
  jerry_release_value (parse_options.resource_name);

  jerry_release_value (run_result);
  jerry_release_value (program);
  if (jerry_is_feature_enabled (JERRY_FEATURE_MODULE))
  {
    jerry_value_t anon = jerry_create_string ((const jerry_char_t *) "<anonymous>");
    const char *source_3 = "";

    parse_options.options = JERRY_PARSE_MODULE | JERRY_PARSE_HAS_RESOURCE;
    parse_options.resource_name = jerry_create_string ((const jerry_char_t *) "demo3.js");

    program = jerry_parse ((const jerry_char_t *) source_3, strlen (source_3), &parse_options);
    TEST_ASSERT (!jerry_value_is_error (program));

    resource_value = jerry_get_resource_name (program);
    compare_result = jerry_binary_operation (JERRY_BIN_OP_STRICT_EQUAL, resource_value, parse_options.resource_name);
    TEST_ASSERT (jerry_value_is_true (compare_result));

    jerry_release_value (compare_result);
    jerry_release_value (resource_value);

    run_result = jerry_module_link (program, NULL, NULL);
    TEST_ASSERT (!jerry_value_is_error (run_result));

    resource_value = jerry_get_resource_name (run_result);
    compare_result = jerry_binary_operation (JERRY_BIN_OP_STRICT_EQUAL, resource_value, anon);
    TEST_ASSERT (jerry_value_is_true (compare_result));

    jerry_release_value (compare_result);
    jerry_release_value (resource_value);
    jerry_release_value (run_result);

    run_result = jerry_module_evaluate (program);
    TEST_ASSERT (!jerry_value_is_error (run_result));

    resource_value = jerry_get_resource_name (run_result);
    compare_result = jerry_binary_operation (JERRY_BIN_OP_STRICT_EQUAL, resource_value, anon);
    TEST_ASSERT (jerry_value_is_true (compare_result));

    jerry_release_value (compare_result);
    jerry_release_value (resource_value);
    jerry_release_value (run_result);
    jerry_release_value (program);
    jerry_release_value (parse_options.resource_name);
  }
  const char *source_4 = ("function f(){} \n"
                          "f.bind().bind();");

  parse_options.options = JERRY_PARSE_HAS_RESOURCE;
  parse_options.resource_name = jerry_create_string ((jerry_char_t *) "demo4.js");

  program = jerry_parse ((const jerry_char_t *) source_4, strlen (source_4), &parse_options);
  TEST_ASSERT (!jerry_value_is_error (program));

  run_result = jerry_run (program);
  TEST_ASSERT (!jerry_value_is_error (run_result));
  TEST_ASSERT (jerry_value_is_object (run_result));

  resource_value = jerry_get_resource_name (run_result);
  compare_result = jerry_binary_operation (JERRY_BIN_OP_STRICT_EQUAL, resource_value, parse_options.resource_name);
  TEST_ASSERT (jerry_value_is_true (compare_result));
  jerry_release_value (compare_result);

  jerry_release_value (resource_value);
  jerry_release_value (parse_options.resource_name);
  jerry_release_value (run_result);
  jerry_release_value (program);

  const char *source_5 = "";

  parse_options.options = JERRY_PARSE_HAS_USER_VALUE | JERRY_PARSE_HAS_RESOURCE;
  parse_options.user_value = jerry_create_object ();
  parse_options.resource_name = jerry_create_string ((jerry_char_t *) "demo5.js");

  program = jerry_parse ((const jerry_char_t *) source_5, strlen (source_5), &parse_options);
  TEST_ASSERT (!jerry_value_is_error (program));

  resource_value = jerry_get_resource_name (program);
  compare_result = jerry_binary_operation (JERRY_BIN_OP_STRICT_EQUAL, resource_value, parse_options.resource_name);
  TEST_ASSERT (jerry_value_is_true (compare_result));

  jerry_release_value (resource_value);
  jerry_release_value (compare_result);
  jerry_release_value (parse_options.user_value);
  jerry_release_value (parse_options.resource_name);
  jerry_release_value (program);

  const char *source_6 = "(class {})";

  parse_options.options = JERRY_PARSE_HAS_RESOURCE;
  parse_options.resource_name = jerry_create_string ((jerry_char_t *) "demo6.js");

  program = jerry_parse ((const jerry_char_t *) source_6, strlen (source_6), &parse_options);
  if (!jerry_value_is_error (program))
  {
    resource_value = jerry_get_resource_name (program);
    compare_result = jerry_binary_operation (JERRY_BIN_OP_STRICT_EQUAL, resource_value, parse_options.resource_name);
    TEST_ASSERT (jerry_value_is_true (compare_result));

    jerry_release_value (resource_value);
    jerry_release_value (compare_result);
  }

  jerry_release_value (parse_options.resource_name);
  jerry_release_value (program);

  jerry_cleanup ();

  return 0;
} /* main */


text:
"use strict";

var _ = require("lodash");

module.exports = function (Store, regCb, options) {
  var regCallbacks = undefined;
  var fn = _.pluck(options, "func");
  beforeEach(function () {

    regCallbacks = Store.__get__(regCb);
    spyOn(Store, "emitChange");

    _.forEach(fn, function (f) {
      if (_.isString(f) && _.isFunction(Store[f])) {
        spyOn(Store, f);
      }
    });
  });

  afterEach(function () {
    _.forEach(fn, function (f) {
      if (_.isString(f) && _.isFunction(Store[f])) {
        Store[f].calls.reset();
      }
    });
  });

  _.forEach(options, function (opts) {
    it("should set callback for " + opts.action.type, function () {
      regCallbacks({ action: opts.action });

      if (opts.func) {
        expect(Store[opts.func]).toHaveBeenCalled();
        if (opts.args) {
          var args = Store[opts.func].calls.argsFor(0);
          opts.args = _.isArray(opts.args) ? opts.args : [opts.args];
          expect(args).toEqual(opts.args);
        }
      }

      expect(Store.emitChange).toHaveBeenCalledWith(opts.change);
    });
  });
};
//# sourceMappingURL=checkStores.js.map


text:
//===-- AppleObjCTypeEncodingParser.cpp -------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "AppleObjCTypeEncodingParser.h"

#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/ClangUtil.h"
#include "lldb/Symbol/CompilerType.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/StringLexer.h"

#include <vector>

using namespace lldb_private;

AppleObjCTypeEncodingParser::AppleObjCTypeEncodingParser(
    ObjCLanguageRuntime &runtime)
    : ObjCLanguageRuntime::EncodingToType(), m_runtime(runtime) {
  if (!m_scratch_ast_ctx_up)
    m_scratch_ast_ctx_up.reset(new ClangASTContext(runtime.GetProcess()
                                                       ->GetTarget()
                                                       .GetArchitecture()
                                                       .GetTriple()
                                                       .str()
                                                       .c_str()));
}

std::string AppleObjCTypeEncodingParser::ReadStructName(StringLexer &type) {
  StreamString buffer;
  while (type.HasAtLeast(1) && type.Peek() != '=')
    buffer.Printf("%c", type.Next());
  return buffer.GetString();
}

std::string AppleObjCTypeEncodingParser::ReadQuotedString(StringLexer &type) {
  StreamString buffer;
  while (type.HasAtLeast(1) && type.Peek() != '"')
    buffer.Printf("%c", type.Next());
  StringLexer::Character next = type.Next();
  UNUSED_IF_ASSERT_DISABLED(next);
  assert(next == '"');
  return buffer.GetString();
}

uint32_t AppleObjCTypeEncodingParser::ReadNumber(StringLexer &type) {
  uint32_t total = 0;
  while (type.HasAtLeast(1) && isdigit(type.Peek()))
    total = 10 * total + (type.Next() - '0');
  return total;
}

// as an extension to the published grammar recent runtimes emit structs like
// this:
// "{CGRect=\"origin\"{CGPoint=\"x\"d\"y\"d}\"size\"{CGSize=\"width\"d\"height\"d}}"

AppleObjCTypeEncodingParser::StructElement::StructElement()
    : name(""), type(clang::QualType()), bitfield(0) {}

AppleObjCTypeEncodingParser::StructElement
AppleObjCTypeEncodingParser::ReadStructElement(clang::ASTContext &ast_ctx,
                                               StringLexer &type,
                                               bool for_expression) {
  StructElement retval;
  if (type.NextIf('"'))
    retval.name = ReadQuotedString(type);
  if (!type.NextIf('"'))
    return retval;
  uint32_t bitfield_size = 0;
  retval.type = BuildType(ast_ctx, type, for_expression, &bitfield_size);
  retval.bitfield = bitfield_size;
  return retval;
}

clang::QualType AppleObjCTypeEncodingParser::BuildStruct(
    clang::ASTContext &ast_ctx, StringLexer &type, bool for_expression) {
  return BuildAggregate(ast_ctx, type, for_expression, '{', '}',
                        clang::TTK_Struct);
}

clang::QualType AppleObjCTypeEncodingParser::BuildUnion(
    clang::ASTContext &ast_ctx, StringLexer &type, bool for_expression) {
  return BuildAggregate(ast_ctx, type, for_expression, '(', ')',
                        clang::TTK_Union);
}

clang::QualType AppleObjCTypeEncodingParser::BuildAggregate(
    clang::ASTContext &ast_ctx, StringLexer &type, bool for_expression,
    char opener, char closer, uint32_t kind) {
  if (!type.NextIf(opener))
    return clang::QualType();
  std::string name(ReadStructName(type));

  // We do not handle templated classes/structs at the moment. If the name has
  // a < in it, we are going to abandon this. We're still obliged to parse it,
  // so we just set a flag that means "Don't actually build anything."

  const bool is_templated = name.find('<') != std::string::npos;

  if (!type.NextIf('='))
    return clang::QualType();
  bool in_union = true;
  std::vector<StructElement> elements;
  while (in_union && type.HasAtLeast(1)) {
    if (type.NextIf(closer)) {
      in_union = false;
      break;
    } else {
      auto element = ReadStructElement(ast_ctx, type, for_expression);
      if (element.type.isNull())
        break;
      else
        elements.push_back(element);
    }
  }
  if (in_union)
    return clang::QualType();

  if (is_templated)
    return clang::QualType(); // This is where we bail out.  Sorry!

  ClangASTContext *lldb_ctx = ClangASTContext::GetASTContext(&ast_ctx);
  if (!lldb_ctx)
    return clang::QualType();
  CompilerType union_type(lldb_ctx->CreateRecordType(
      nullptr, lldb::eAccessPublic, name.c_str(), kind, lldb::eLanguageTypeC));
  if (union_type) {
    ClangASTContext::StartTagDeclarationDefinition(union_type);

    unsigned int count = 0;
    for (auto element : elements) {
      if (element.name.empty()) {
        StreamString elem_name;
        elem_name.Printf("__unnamed_%u", count);
        element.name = elem_name.GetString();
      }
      ClangASTContext::AddFieldToRecordType(
          union_type, element.name.c_str(),
          CompilerType(ClangASTContext::GetASTContext(&ast_ctx),
                       element.type.getAsOpaquePtr()),
          lldb::eAccessPublic, element.bitfield);
      ++count;
    }
    ClangASTContext::CompleteTagDeclarationDefinition(union_type);
  }
  return ClangUtil::GetQualType(union_type);
}

clang::QualType AppleObjCTypeEncodingParser::BuildArray(
    clang::ASTContext &ast_ctx, StringLexer &type, bool for_expression) {
  if (!type.NextIf('['))
    return clang::QualType();
  uint32_t size = ReadNumber(type);
  clang::QualType element_type(BuildType(ast_ctx, type, for_expression));
  if (!type.NextIf(']'))
    return clang::QualType();
  ClangASTContext *lldb_ctx = ClangASTContext::GetASTContext(&ast_ctx);
  if (!lldb_ctx)
    return clang::QualType();
  CompilerType array_type(lldb_ctx->CreateArrayType(
      CompilerType(ClangASTContext::GetASTContext(&ast_ctx),
                   element_type.getAsOpaquePtr()),
      size, false));
  return ClangUtil::GetQualType(array_type);
}

// the runtime can emit these in the form of @"SomeType", giving more specifics
// this would be interesting for expression parser interop, but since we
// actually try to avoid exposing the ivar info to the expression evaluator,
// consume but ignore the type info and always return an 'id'; if anything,
// dynamic typing will resolve things for us anyway
clang::QualType AppleObjCTypeEncodingParser::BuildObjCObjectPointerType(
    clang::ASTContext &ast_ctx, StringLexer &type, bool for_expression) {
  if (!type.NextIf('@'))
    return clang::QualType();

  std::string name;

  if (type.NextIf('"')) {
    // We have to be careful here.  We're used to seeing
    //   @"NSString"
    // but in records it is possible that the string following an @ is the name
    // of the next field and @ means "id". This is the case if anything
    // unquoted except for "}", the end of the type, or another name follows
    // the quoted string.
    //
    // E.g.
    // - @"NSString"@ means "id, followed by a field named NSString of type id"
    // - @"NSString"} means "a pointer to NSString and the end of the struct" -
    // @"NSString""nextField" means "a pointer to NSString and a field named
    // nextField" - @"NSString" followed by the end of the string means "a
    // pointer to NSString"
    //
    // As a result, the rule is: If we see @ followed by a quoted string, we
    // peek. - If we see }, ), ], the end of the string, or a quote ("), the
    // quoted string is a class name. - If we see anything else, the quoted
    // string is a field name and we push it back onto type.

    name = ReadQuotedString(type);

    if (type.HasAtLeast(1)) {
      switch (type.Peek()) {
      default:
        // roll back
        type.PutBack(name.length() +
                     2); // undo our consumption of the string and of the quotes
        name.clear();
        break;
      case '}':
      case ')':
      case ']':
      case '"':
        // the quoted string is a class name – see the rule
        break;
      }
    } else {
      // the quoted string is a class name – see the rule
    }
  }

  if (for_expression && !name.empty()) {
    size_t less_than_pos = name.find('<');

    if (less_than_pos != std::string::npos) {
      if (less_than_pos == 0)
        return ast_ctx.getObjCIdType();
      else
        name.erase(less_than_pos);
    }

    DeclVendor *decl_vendor = m_runtime.GetDeclVendor();
    if (!decl_vendor)
      return clang::QualType();

    auto types = decl_vendor->FindTypes(ConstString(name), /*max_matches*/ 1);

// The user can forward-declare something that has no definition.  The runtime
// doesn't prohibit this at all. This is a rare and very weird case.  We keep
// this assert in debug builds so we catch other weird cases.
#ifdef LLDB_CONFIGURATION_DEBUG
    assert(!types.empty());
#else
    if (types.empty())
      return ast_ctx.getObjCIdType();
#endif

    return ClangUtil::GetQualType(types.front().GetPointerType());
  } else {
    // We're going to resolve this dynamically anyway, so just smile and wave.
    return ast_ctx.getObjCIdType();
  }
}

clang::QualType
AppleObjCTypeEncodingParser::BuildType(clang::ASTContext &ast_ctx,
                                       StringLexer &type, bool for_expression,
                                       uint32_t *bitfield_bit_size) {
  if (!type.HasAtLeast(1))
    return clang::QualType();

  switch (type.Peek()) {
  default:
    break;
  case '{':
    return BuildStruct(ast_ctx, type, for_expression);
  case '[':
    return BuildArray(ast_ctx, type, for_expression);
  case '(':
    return BuildUnion(ast_ctx, type, for_expression);
  case '@':
    return BuildObjCObjectPointerType(ast_ctx, type, for_expression);
  }

  switch (type.Next()) {
  default:
    type.PutBack(1);
    return clang::QualType();
  case 'c':
    return ast_ctx.CharTy;
  case 'i':
    return ast_ctx.IntTy;
  case 's':
    return ast_ctx.ShortTy;
  case 'l':
    return ast_ctx.getIntTypeForBitwidth(32, true);
  // this used to be done like this:
  //   ClangASTContext *lldb_ctx = ClangASTContext::GetASTContext(&ast_ctx);
  //   if (!lldb_ctx)
  //      return clang::QualType();
  //   return lldb_ctx->GetIntTypeFromBitSize(32, true).GetQualType();
  // which uses one of the constants if one is available, but we don't think
  // all this work is necessary.
  case 'q':
    return ast_ctx.LongLongTy;
  case 'C':
    return ast_ctx.UnsignedCharTy;
  case 'I':
    return ast_ctx.UnsignedIntTy;
  case 'S':
    return ast_ctx.UnsignedShortTy;
  case 'L':
    return ast_ctx.getIntTypeForBitwidth(32, false);
  // see note for 'l'
  case 'Q':
    return ast_ctx.UnsignedLongLongTy;
  case 'f':
    return ast_ctx.FloatTy;
  case 'd':
    return ast_ctx.DoubleTy;
  case 'B':
    return ast_ctx.BoolTy;
  case 'v':
    return ast_ctx.VoidTy;
  case '*':
    return ast_ctx.getPointerType(ast_ctx.CharTy);
  case '#':
    return ast_ctx.getObjCClassType();
  case ':':
    return ast_ctx.getObjCSelType();
  case 'b': {
    uint32_t size = ReadNumber(type);
    if (bitfield_bit_size) {
      *bitfield_bit_size = size;
      return ast_ctx.UnsignedIntTy; // FIXME: the spec is fairly vague here.
    } else
      return clang::QualType();
  }
  case 'r': {
    clang::QualType target_type = BuildType(ast_ctx, type, for_expression);
    if (target_type.isNull())
      return clang::QualType();
    else if (target_type == ast_ctx.UnknownAnyTy)
      return ast_ctx.UnknownAnyTy;
    else
      return ast_ctx.getConstType(target_type);
  }
  case '^': {
    if (!for_expression && type.NextIf('?')) {
      // if we are not supporting the concept of unknownAny, but what is being
      // created here is an unknownAny*, then we can just get away with a void*
      // this is theoretically wrong (in the same sense as 'theoretically
      // nothing exists') but is way better than outright failure in many
      // practical cases
      return ast_ctx.VoidPtrTy;
    } else {
      clang::QualType target_type = BuildType(ast_ctx, type, for_expression);
      if (target_type.isNull())
        return clang::QualType();
      else if (target_type == ast_ctx.UnknownAnyTy)
        return ast_ctx.UnknownAnyTy;
      else
        return ast_ctx.getPointerType(target_type);
    }
  }
  case '?':
    return for_expression ? ast_ctx.UnknownAnyTy : clang::QualType();
  }
}

CompilerType AppleObjCTypeEncodingParser::RealizeType(
    clang::ASTContext &ast_ctx, const char *name, bool for_expression) {
  if (name && name[0]) {
    StringLexer lexer(name);
    clang::QualType qual_type = BuildType(ast_ctx, lexer, for_expression);
    return CompilerType(ClangASTContext::GetASTContext(&ast_ctx),
                        qual_type.getAsOpaquePtr());
  }
  return CompilerType();
}


text:
#pragma once
#include <aws/AWSMigrationHub/MigrationHub_EXPORTS.h>
#include <aws/core/client/GenericClientConfiguration.h>
#include <aws/core/endpoint/DefaultEndpointProvider.h>
#include <aws/core/endpoint/EndpointParameter.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>

#include <aws/AWSMigrationHub/MigrationHubEndpointRules.h>

namespace Aws
{
namespace MigrationHub
{
namespace Endpoint
{
using EndpointParameters = Aws::Endpoint::EndpointParameters;
using Aws::Endpoint::EndpointProviderBase;
using Aws::Endpoint::DefaultEndpointProvider;

using MigrationHubClientContextParameters = Aws::Endpoint::ClientContextParameters;

using MigrationHubClientConfiguration = Aws::Client::GenericClientConfiguration<false>;
using MigrationHubBuiltInParameters = Aws::Endpoint::BuiltInParameters;

/**
 * The type for the MigrationHub Client Endpoint Provider.
 * Inherit from this Base class / "Interface" should you want to provide a custom endpoint provider.
 * The SDK must use service-specific type for each service per specification.
 */
using MigrationHubEndpointProviderBase =
    EndpointProviderBase<MigrationHubClientConfiguration, MigrationHubBuiltInParameters, MigrationHubClientContextParameters>;

using MigrationHubDefaultEpProviderBase =
    DefaultEndpointProvider<MigrationHubClientConfiguration, MigrationHubBuiltInParameters, MigrationHubClientContextParameters>;

/**
 * Default endpoint provider used for this service
 */
class AWS_MIGRATIONHUB_API MigrationHubEndpointProvider : public MigrationHubDefaultEpProviderBase
{
public:
    using MigrationHubResolveEndpointOutcome = Aws::Endpoint::ResolveEndpointOutcome;

    MigrationHubEndpointProvider()
      : MigrationHubDefaultEpProviderBase(Aws::MigrationHub::MigrationHubEndpointRules::Rules)
    {}

    ~MigrationHubEndpointProvider()
    {
    }
};
} // namespace Endpoint
} // namespace MigrationHub
} // namespace Aws


text:
(function() {
  function log(type, prefix, object) {
    const logObject = {
      type: type,
      prefix: prefix,
      url: location.href,
      agent: navigator.userAgent
    };
    if (object) {
      logObject.message = object.message ? object.message : object;
      if (object.stack) logObject.stack = object.stack;
    }
    _LTracker.push(logObject);
  }

  if (location.hostname === 'app.becollective.ly'
    || location.hostname === 'app-dev.becollective.ly') {
    window._LTracker = window._LTracker || [];
    _LTracker.push({
      'logglyKey': 'cd84d926-5a57-4598-9ab4-623eee369995',
      'sendConsoleErrors': true,
      'tag': 'loggly-jslogger'
    });

    console._error = console.error;
    console._warn = console.warn;

    console.error = function(prefix, object) {
      log('error', prefix, object);
      console._error.apply(this, arguments);
    };
    console.warn = function(prefix, object) {
      log('warn', prefix, object);
      console._warn.apply(this, arguments);
    };
  }

  window.onerror = (msg, url, line, col, error) => {
    // if (msg.indexOf('undefined') >= 0
    //   || msg.indexOf('not defined') >= 0
    //   || msg.indexOf('null') >= 0) {
    //   localStorage.clear();
    //   window.location = '/';
    // }
  };
})();