text:
<?php

namespace Site\UpdateVtsProperty\Process\Form;

use DvsaCommon\Model\VtsStatus;
use Site\UpdateVtsProperty\UpdateVtsPropertyAction;
use Zend\Form\Element\Select;
use Zend\Form\Form;
use Zend\InputFilter\Input;
use Zend\InputFilter\InputFilter;
use Zend\Validator\NotEmpty;

class StatusPropertyForm extends Form
{
    const FIELD_STATUS = UpdateVtsPropertyAction::VTS_STATUS_PROPERTY;
    const STATUS_EMPTY_MSG = 'you must choose a site status';

    private $statusElement;

    public function __construct()
    {
        parent::__construct(self::FIELD_STATUS);

        $statuses = VtsStatus::getStatuses();
        $options = $statuses;

        $this->statusElement = new Select();
        $this
            ->statusElement
            ->setDisableInArrayValidator(true)
            ->setAttribute('type', 'select')
            ->setValueOptions($options)
            ->setName(self::FIELD_STATUS)
            ->setLabel('Site status')
            ->setAttribute('id', 'vtsStatusSelectSet')
            ->setAttribute('required', true)
            ->setAttribute('group', true);

        $this->add($this->statusElement);

        $statusEmptyValidator = (new NotEmpty())->setMessage(self::STATUS_EMPTY_MSG, NotEmpty::IS_EMPTY);
        $statusInput = new Input(self::FIELD_STATUS);
        $statusInput
            ->setRequired(true)
            ->getValidatorChain()
            ->attach($statusEmptyValidator);

        $filter = new InputFilter();
        $filter->add($statusInput);

        $this->setInputFilter($filter);
    }

    public function getStatusElement()
    {
        return $this->statusElement;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.jackrabbit.oak.plugins.nodetype.write;

import static com.google.common.collect.Iterables.filter;
import static org.apache.jackrabbit.JcrConstants.JCR_CHILDNODEDEFINITION;
import static org.apache.jackrabbit.JcrConstants.JCR_HASORDERABLECHILDNODES;
import static org.apache.jackrabbit.JcrConstants.JCR_ISMIXIN;
import static org.apache.jackrabbit.JcrConstants.JCR_NODETYPENAME;
import static org.apache.jackrabbit.JcrConstants.JCR_PRIMARYITEMNAME;
import static org.apache.jackrabbit.JcrConstants.JCR_PRIMARYTYPE;
import static org.apache.jackrabbit.JcrConstants.JCR_PROPERTYDEFINITION;
import static org.apache.jackrabbit.JcrConstants.JCR_SUPERTYPES;
import static org.apache.jackrabbit.JcrConstants.NT_CHILDNODEDEFINITION;
import static org.apache.jackrabbit.JcrConstants.NT_NODETYPE;
import static org.apache.jackrabbit.JcrConstants.NT_PROPERTYDEFINITION;
import static org.apache.jackrabbit.oak.api.Type.NAME;
import static org.apache.jackrabbit.oak.spi.nodetype.NodeTypeConstants.JCR_IS_ABSTRACT;
import static org.apache.jackrabbit.oak.spi.nodetype.NodeTypeConstants.JCR_IS_QUERYABLE;

import java.util.Arrays;
import java.util.List;

import javax.jcr.RepositoryException;
import javax.jcr.nodetype.ConstraintViolationException;
import javax.jcr.nodetype.NodeDefinition;
import javax.jcr.nodetype.NodeDefinitionTemplate;
import javax.jcr.nodetype.NodeTypeDefinition;
import javax.jcr.nodetype.NodeTypeExistsException;
import javax.jcr.nodetype.NodeTypeTemplate;
import javax.jcr.nodetype.PropertyDefinition;
import javax.jcr.nodetype.PropertyDefinitionTemplate;

import com.google.common.base.Predicate;
import com.google.common.collect.Lists;

import org.apache.jackrabbit.oak.api.Tree;
import org.apache.jackrabbit.oak.api.Type;
import org.apache.jackrabbit.oak.namepath.NameMapper;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

class NodeTypeTemplateImpl extends NamedTemplate implements NodeTypeTemplate {

    private static final PropertyDefinition[] EMPTY_PROPERTY_DEFINITION_ARRAY =
            new PropertyDefinition[0];

    private static final NodeDefinition[] EMPTY_NODE_DEFINITION_ARRAY =
            new NodeDefinition[0];

    protected boolean isMixin;

    protected boolean isOrderable;

    protected boolean isAbstract;

    protected boolean queryable;

    private String primaryItemOakName = null; // not defined by default

    @NotNull
    private String[] superTypeOakNames = new String[0];

    private List<PropertyDefinitionTemplateImpl> propertyDefinitionTemplates = null;

    private List<NodeDefinitionTemplateImpl> nodeDefinitionTemplates = null;

    NodeTypeTemplateImpl(@NotNull NameMapper mapper) {
        super(mapper);
    }

    NodeTypeTemplateImpl(@NotNull NameMapper mapper, @NotNull NodeTypeDefinition definition)
            throws ConstraintViolationException {
        super(mapper, definition.getName());

        setMixin(definition.isMixin());
        setOrderableChildNodes(definition.hasOrderableChildNodes());
        setAbstract(definition.isAbstract());
        setQueryable(definition.isQueryable());
        String primaryItemName = definition.getPrimaryItemName();
        if (primaryItemName != null) {
            setPrimaryItemName(primaryItemName);
        }
        setDeclaredSuperTypeNames(definition.getDeclaredSupertypeNames());

        PropertyDefinition[] pds = definition.getDeclaredPropertyDefinitions();
        if (pds != null) {
            propertyDefinitionTemplates =
                    Lists.newArrayListWithCapacity(pds.length);
            for (PropertyDefinition pd : pds) {
                propertyDefinitionTemplates.add(
                        new PropertyDefinitionTemplateImpl(mapper, pd));
            }
        }

        NodeDefinition[] nds = definition.getDeclaredChildNodeDefinitions();
        if (nds != null) {
            nodeDefinitionTemplates =
                    Lists.newArrayListWithCapacity(nds.length);
            for (NodeDefinition nd : nds) {
                nodeDefinitionTemplates.add(
                        new NodeDefinitionTemplateImpl(mapper, nd));
            }
        }
    }

    /**
     * Writes this node type as an {@code nt:nodeType} child of the given
     * parent node. An exception is thrown if the child node already exists,
     * unless the {@code allowUpdate} flag is set, in which case the existing
     * node is overwritten.
     *
     * @param parent parent node under which to write this node type
     * @param allowUpdate whether to overwrite an existing type
     * @return The node type tree.
     * @throws RepositoryException if this type could not be written
     */
    Tree writeTo(@NotNull Tree parent, boolean allowUpdate) throws RepositoryException {
        String oakName = getOakName();
        if (oakName == null) {
            throw new RepositoryException("Cannot register node type: name is missing.");
        }

        Tree type = parent.getChild(oakName);
        if (!type.exists()) {
            type = parent.addChild(oakName);
            type.setProperty(JCR_PRIMARYTYPE, NT_NODETYPE, Type.NAME);
        } else if (!allowUpdate) {
            throw new NodeTypeExistsException(
                    "Node type " + getName() + " already exists");
        }

        type.setProperty(JCR_NODETYPENAME, oakName, Type.NAME);

        if (superTypeOakNames.length > 0) {
            type.setProperty(
                    JCR_SUPERTYPES,
                    Arrays.asList(superTypeOakNames), Type.NAMES);
        } else {
            type.removeProperty(JCR_SUPERTYPES);
        }

        type.setProperty(JCR_IS_ABSTRACT, isAbstract);
        type.setProperty(JCR_IS_QUERYABLE, queryable);
        type.setProperty(JCR_ISMIXIN, isMixin);

        // TODO fail (in validator?) if not orderable but a supertype is orderable
        // See 3.7.6.7 Node Type Attribute Subtyping Rules (OAK-411)
        type.setProperty(JCR_HASORDERABLECHILDNODES, isOrderable);

        // TODO fail (in validator?) if a supertype specifies a different primary item
        // See 3.7.6.7 Node Type Attribute Subtyping Rules (OAK-411)
        if (primaryItemOakName != null) {
            type.setProperty(JCR_PRIMARYITEMNAME, primaryItemOakName, Type.NAME);
        } else {
            type.removeProperty(JCR_PRIMARYITEMNAME);
        }

        // TODO fail (in validator?) on invalid item definitions
        // See 3.7.6.8 Item Definitions in Subtypes (OAK-411)
        writeItemDefinitions(type, propertyDefinitionTemplates, JCR_PROPERTYDEFINITION, NT_PROPERTYDEFINITION);
        writeItemDefinitions(type, nodeDefinitionTemplates, JCR_CHILDNODEDEFINITION, NT_CHILDNODEDEFINITION);

        return type;
    }

    private static void writeItemDefinitions(@NotNull Tree nodeTypeTree, @Nullable List<? extends ItemDefinitionTemplate> itemDefTemplates,
                                             @NotNull String nodeName, @NotNull String primaryTypeName) throws RepositoryException {
        // first remove existing
        for (Tree t : filter(nodeTypeTree.getChildren(), new SameNamePredicate(nodeName))) {
            t.remove();
        }
        // now write definitions
        int index = 1;
        if (itemDefTemplates != null) {
            for (ItemDefinitionTemplate template : itemDefTemplates) {
                String name = nodeName(nodeName, index);
                Tree tree = nodeTypeTree.getChild(name);
                if (!tree.exists()) {
                    tree = nodeTypeTree.addChild(name);
                    tree.setProperty(
                            JCR_PRIMARYTYPE, primaryTypeName, NAME);
                }
                template.writeTo(tree);
                index++;
            }
        }
    }

    private static String nodeName(String name, int index) {
        return (index == 1) ? name : name + '[' + index + ']';
    }

    private static final class SameNamePredicate implements Predicate<Tree> {

        private final String name;

        private SameNamePredicate(String name) {
            this.name = name;
        }

        @Override
        public boolean apply(Tree t) {
            String s = t.getName();
            return s.equals(name) || s.startsWith(name + "[");
        }
    }

    //------------------------------------------------------------< public >--

    @Override
    public boolean isMixin() {
        return isMixin;
    }

    @Override
    public void setMixin(boolean mixin) {
        this.isMixin = mixin;
    }

    @Override
    public boolean hasOrderableChildNodes() {
        return isOrderable ;
    }

    @Override
    public void setOrderableChildNodes(boolean orderable) {
        this.isOrderable = orderable;
    }

    @Override
    public boolean isAbstract() {
        return isAbstract;
    }

    @Override
    public void setAbstract(boolean abstractStatus) {
        this.isAbstract = abstractStatus;
    }

    @Override
    public boolean isQueryable() {
        return queryable;
    }

    @Override
    public void setQueryable(boolean queryable) {
        this.queryable = queryable;
    }

    @Override
    public String getPrimaryItemName() {
        return getJcrNameAllowNull(primaryItemOakName);
    }

    @Override
    public void setPrimaryItemName(String jcrName)
            throws ConstraintViolationException {
        this.primaryItemOakName =
                getOakNameAllowNullOrThrowConstraintViolation(jcrName);
    }

    @Override
    public String[] getDeclaredSupertypeNames() {
        return getJcrNamesAllowNull(superTypeOakNames);
    }

    @Override
    public void setDeclaredSuperTypeNames(String[] jcrNames)
            throws ConstraintViolationException {
        this.superTypeOakNames =
                getOakNamesOrThrowConstraintViolation(jcrNames);
    }

    @Override
    public PropertyDefinition[] getDeclaredPropertyDefinitions() {
        if (propertyDefinitionTemplates != null) {
            return propertyDefinitionTemplates.toArray(
                    EMPTY_PROPERTY_DEFINITION_ARRAY);
        } else {
            return null;
        }
    }

    @Override
    public List<? extends PropertyDefinitionTemplate> getPropertyDefinitionTemplates() {
        if (propertyDefinitionTemplates == null) {
            propertyDefinitionTemplates = Lists.newArrayList();
        }
        return propertyDefinitionTemplates;
    }

    @Override
    public NodeDefinition[] getDeclaredChildNodeDefinitions() {
        if (nodeDefinitionTemplates != null) {
            return nodeDefinitionTemplates.toArray(
                    EMPTY_NODE_DEFINITION_ARRAY);
        } else {
            return null;
        }
    }

    @Override
    public List<? extends NodeDefinitionTemplate> getNodeDefinitionTemplates() {
        if (nodeDefinitionTemplates == null) {
            nodeDefinitionTemplates = Lists.newArrayList();
        }
        return nodeDefinitionTemplates;
    }

    //------------------------------------------------------------< Object >--

    public String toString() {
        return String.format("NodeTypeTemplate(%s)", getOakName());
    }

}


text:
package com.manjunathshetty.hashmap.main;

public class HashContainer<K,V>{

	K Key;
	V Value;

	public HashContainer(K key,V value) {
		this.Key=key;
		this.Value=value;
	}

}


text:
package visualizer;

import invoker.Invoker;
import utils.Classifier;
import utils.ImageFilterProvider;
import utils.SegmentedVideoFrame;
import utils.SuccessProvider;

/**
 * Defines the interface that is required for any object that wants to act as a
 * data visualizer for this evolutionary system. A visualizer object must be able
 * to receive visualization data from an Invoker object and must display those data
 * using CUDA. It should also support seeking in video positions, enabling and
 * disabling GP system as well as other (TODO) functionalities.
 *
 * @author Mehran Maghoumi
 *
 */
public interface Visualizer extends SuccessProvider {

	/**
	 * Set the dimensions for the video data that this visualizer must visualize.
	 *
	 * @param width	The video width (in pixels)
	 * @param height	The video height (in pixels)
	 */
	public void setVideoDimensions(int width, int height);

	/**
	 * Set the length of the video that this visualizer shows. This method will
	 * set the maximum value for the slider that shows the video position.
	 *
	 * @param lengthInFrames
	 *            The video length in frames
	 */
	public void setVideoLength(int lengthInFrames);

	/**
	 * Used to pass a new individual to the visualizer. Usually, when a fitter
	 * individual is found in the run, this function should be called. Note
	 * that the calling thread will be blocked if the individual queue of this
	 * visualizer is full.
	 *
	 * @param classifier	The new classifier that is found during the GP run
	 * @return	True, if evolution should be continued (no eager termination)
	 * 			False, for eager termination and if the reported classifier meets the
	 * 			requirements
	 */
	public boolean passNewClassifier(Classifier classifier);

	/**
	 * Used to pass a new video frame (image) to this visualizer. Usually should
	 * be called after grabbing a frame of the video. Note that the calling
	 * thread will be blocked if the frame queue of the visualizer is full
	 *
	 * @param frame	The new frame that is obtained from the video/image
	 * @param currentPosition	The current position in the video (the current
	 * 		frame number)
	 */
	public void passNewFrame(SegmentedVideoFrame frame, int currentPosition);

	/**
	 * @return	The ImageFilterProvider implementation that this visualizer uses to filter
	 * 			images and display them
	 */
	public ImageFilterProvider getImageFilterProvider();

	/**
	 * @return	The current visualization framerate
	 */
	public double getFramerate();
}


text:
/*
Copyright (C) 1997-2001 Id Software, Inc.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

 */
package org.free.jake2.client;

import org.free.jake2.Defines;
import org.free.jake2.Globals;
import org.free.jake2.game.Cmd;
import org.free.jake2.game.cvar;
import org.free.jake2.game.usercmd_t;
import org.free.jake2.qcommon.Com;
import org.free.jake2.qcommon.Cvar;
import org.free.jake2.qcommon.MSG;
import org.free.jake2.qcommon.Netchan;
import org.free.jake2.qcommon.SizeBuffer;
import org.free.jake2.qcommon.XCommand;
import org.free.jake2.sys.Mouse;
import org.free.jake2.util.Lib;
import org.free.jake2.util.Math3D;

/**
 * CL_input
 */
public class CL_input {

  static long frame_msec;
  static long old_sys_frame_time;
  static cvar cl_nodelta;

  /*
   * ===============================================================================
   *
   * KEY BUTTONS
   *
   * Continuous button event tracking is complicated by the fact that two
   * different input sources (say, mouse button 1 and the control key) can
   * both press the same button, but the button should only be released when
   * both of the pressing key have been released.
   *
   * When a key event issues a button command (+forward, +attack, etc), it
   * appends its key number as a parameter to the command so it can be matched
   * up with the release.
   *
   * state bit 0 is the current state of the key state bit 1 is edge triggered
   * on the up to down transition state bit 2 is edge triggered on the down to
   * up transition
   *
   *
   * Key_Event (int key, qboolean down, unsigned time);
   *
   * +mlook src time
   *
   * ===============================================================================
   */
  static kbutton_t in_klook = new kbutton_t();
  static kbutton_t in_left = new kbutton_t();
  static kbutton_t in_right = new kbutton_t();
  static kbutton_t in_forward = new kbutton_t();
  static kbutton_t in_back = new kbutton_t();
  static kbutton_t in_lookup = new kbutton_t();
  static kbutton_t in_lookdown = new kbutton_t();
  static kbutton_t in_moveleft = new kbutton_t();
  static kbutton_t in_moveright = new kbutton_t();
  public static kbutton_t in_strafe = new kbutton_t();
  static kbutton_t in_speed = new kbutton_t();
  static kbutton_t in_use = new kbutton_t();
  static kbutton_t in_attack = new kbutton_t();
  static kbutton_t in_up = new kbutton_t();
  static kbutton_t in_down = new kbutton_t();
  static int in_impulse;

  static void KeyDown(kbutton_t b) {
    int k;
    String c;

    c = Cmd.Argv(1);
    if (c.length() > 0) {
      k = Lib.atoi(c);
    } else {
      k = -1; // typed manually at the console for continuous down
    }
    if (k == b.down[0] || k == b.down[1]) {
      return; // repeating key
    }
    if (b.down[0] == 0) {
      b.down[0] = k;
    } else if (b.down[1] == 0) {
      b.down[1] = k;
    } else {
      Com.Printf("Three keys down for a button!\n");
      return;
    }

    if ((b.state & 1) != 0) {
      return; // still down
    }
    // save timestamp
    c = Cmd.Argv(2);
    b.downtime = Lib.atoi(c);
    if (b.downtime == 0) {
      b.downtime = Globals.sys_frame_time - 100;
    }

    b.state |= 3; // down + impulse down
  }

  static void KeyUp(kbutton_t b) {
    int k;
    String c;
    int uptime;

    c = Cmd.Argv(1);
    if (c.length() > 0) {
      k = Lib.atoi(c);
    } else {
      // typed manually at the console, assume for unsticking, so clear
      // all
      b.down[0] = b.down[1] = 0;
      b.state = 4; // impulse up
      return;
    }

    if (b.down[0] == k) {
      b.down[0] = 0;
    } else if (b.down[1] == k) {
      b.down[1] = 0;
    } else {
      return; // key up without coresponding down (menu pass through)
    }
    if (b.down[0] != 0 || b.down[1] != 0) {
      return; // some other key is still holding it down
    }
    if ((b.state & 1) == 0) {
      return; // still up (this should not happen)
    }
    // save timestamp
    c = Cmd.Argv(2);
    uptime = Lib.atoi(c);
    if (uptime != 0) {
      b.msec += uptime - b.downtime;
    } else {
      b.msec += 10;
    }

    b.state &= ~1; // now up
    b.state |= 4; // impulse up
  }

  static void IN_KLookDown() {
    KeyDown(in_klook);
  }

  static void IN_KLookUp() {
    KeyUp(in_klook);
  }

  static void IN_UpDown() {
    KeyDown(in_up);
  }

  static void IN_UpUp() {
    KeyUp(in_up);
  }

  static void IN_DownDown() {
    KeyDown(in_down);
  }

  static void IN_DownUp() {
    KeyUp(in_down);
  }

  static void IN_LeftDown() {
    KeyDown(in_left);
  }

  static void IN_LeftUp() {
    KeyUp(in_left);
  }

  static void IN_RightDown() {
    KeyDown(in_right);
  }

  static void IN_RightUp() {
    KeyUp(in_right);
  }

  static void IN_ForwardDown() {
    KeyDown(in_forward);
  }

  static void IN_ForwardUp() {
    KeyUp(in_forward);
  }

  static void IN_BackDown() {
    KeyDown(in_back);
  }

  static void IN_BackUp() {
    KeyUp(in_back);
  }

  static void IN_LookupDown() {
    KeyDown(in_lookup);
  }

  static void IN_LookupUp() {
    KeyUp(in_lookup);
  }

  static void IN_LookdownDown() {
    KeyDown(in_lookdown);
  }

  static void IN_LookdownUp() {
    KeyUp(in_lookdown);
  }

  static void IN_MoveleftDown() {
    KeyDown(in_moveleft);
  }

  static void IN_MoveleftUp() {
    KeyUp(in_moveleft);
  }

  static void IN_MoverightDown() {
    KeyDown(in_moveright);
  }

  static void IN_MoverightUp() {
    KeyUp(in_moveright);
  }

  static void IN_SpeedDown() {
    KeyDown(in_speed);
  }

  static void IN_SpeedUp() {
    KeyUp(in_speed);
  }

  static void IN_StrafeDown() {
    KeyDown(in_strafe);
  }

  static void IN_StrafeUp() {
    KeyUp(in_strafe);
  }

  static void IN_AttackDown() {
    KeyDown(in_attack);
  }

  static void IN_AttackUp() {
    KeyUp(in_attack);
  }

  static void IN_UseDown() {
    KeyDown(in_use);
  }

  static void IN_UseUp() {
    KeyUp(in_use);
  }

  static void IN_Impulse() {
    in_impulse = Lib.atoi(Cmd.Argv(1));
  }

  /*
   * =============== CL_KeyState
   *
   * Returns the fraction of the frame that the key was down ===============
   */
  static float KeyState(kbutton_t key) {
    float val;
    long msec;

    key.state &= 1; // clear impulses

    msec = key.msec;
    key.msec = 0;

    if (key.state != 0) {
      // still down
      msec += Globals.sys_frame_time - key.downtime;
      key.downtime = Globals.sys_frame_time;
    }

    val = (float) msec / frame_msec;
    if (val < 0) {
      val = 0;
    }
    if (val > 1) {
      val = 1;
    }

    return val;
  }

  //	  ==========================================================================

  /*
   * ================ CL_AdjustAngles
   *
   * Moves the local angle positions ================
   */
  static void AdjustAngles() {
    float speed;
    float up, down;

    if ((in_speed.state & 1) != 0) {
      speed = Globals.cls.frametime * Globals.cl_anglespeedkey.value;
    } else {
      speed = Globals.cls.frametime;
    }

    if ((in_strafe.state & 1) == 0) {
      Globals.cl.viewangles[Defines.YAW] -= speed * Globals.cl_yawspeed.value * KeyState(in_right);
      Globals.cl.viewangles[Defines.YAW] += speed * Globals.cl_yawspeed.value * KeyState(in_left);
    }
    if ((in_klook.state & 1) != 0) {
      Globals.cl.viewangles[Defines.PITCH] -= speed * Globals.cl_pitchspeed.value * KeyState(in_forward);
      Globals.cl.viewangles[Defines.PITCH] += speed * Globals.cl_pitchspeed.value * KeyState(in_back);
    }

    up = KeyState(in_lookup);
    down = KeyState(in_lookdown);

    Globals.cl.viewangles[Defines.PITCH] -= speed * Globals.cl_pitchspeed.value * up;
    Globals.cl.viewangles[Defines.PITCH] += speed * Globals.cl_pitchspeed.value * down;
  }

  /*
   * ================ CL_BaseMove
   *
   * Send the intended movement message to the server ================
   */
  static void BaseMove(usercmd_t cmd) {
    AdjustAngles();

    //memset (cmd, 0, sizeof(*cmd));
    cmd.clear();

    Math3D.VectorCopy(Globals.cl.viewangles, cmd.angles);
    if ((in_strafe.state & 1) != 0) {
      cmd.sidemove += Globals.cl_sidespeed.value * KeyState(in_right);
      cmd.sidemove -= Globals.cl_sidespeed.value * KeyState(in_left);
    }

    cmd.sidemove += Globals.cl_sidespeed.value * KeyState(in_moveright);
    cmd.sidemove -= Globals.cl_sidespeed.value * KeyState(in_moveleft);

    cmd.upmove += Globals.cl_upspeed.value * KeyState(in_up);
    cmd.upmove -= Globals.cl_upspeed.value * KeyState(in_down);

    if ((in_klook.state & 1) == 0) {
      cmd.forwardmove += Globals.cl_forwardspeed.value * KeyState(in_forward);
      cmd.forwardmove -= Globals.cl_forwardspeed.value * KeyState(in_back);
    }

    //
    //	   adjust for speed key / running
    //
    if (((in_speed.state & 1) ^ (int) (Globals.cl_run.value)) != 0) {
      cmd.forwardmove *= 2;
      cmd.sidemove *= 2;
      cmd.upmove *= 2;
    }

  }

  static void ClampPitch() {

    float pitch;

    pitch = Math3D.SHORT2ANGLE(Globals.cl.frame.playerstate.pmove.delta_angles[Defines.PITCH]);
    if (pitch > 180) {
      pitch -= 360;
    }

    if (Globals.cl.viewangles[Defines.PITCH] + pitch < -360) {
      Globals.cl.viewangles[Defines.PITCH] += 360; // wrapped
    }
    if (Globals.cl.viewangles[Defines.PITCH] + pitch > 360) {
      Globals.cl.viewangles[Defines.PITCH] -= 360; // wrapped
    }
    if (Globals.cl.viewangles[Defines.PITCH] + pitch > 89) {
      Globals.cl.viewangles[Defines.PITCH] = 89 - pitch;
    }
    if (Globals.cl.viewangles[Defines.PITCH] + pitch < -89) {
      Globals.cl.viewangles[Defines.PITCH] = -89 - pitch;
    }
  }

  /*
   * ============== CL_FinishMove ==============
   */
  static void FinishMove(usercmd_t cmd) {
    int ms;
    int i;

    //
    //	   figure button bits
    //
    if ((in_attack.state & 3) != 0) {
      cmd.buttons |= Defines.BUTTON_ATTACK;
    }
    in_attack.state &= ~2;

    if ((in_use.state & 3) != 0) {
      cmd.buttons |= Defines.BUTTON_USE;
    }
    in_use.state &= ~2;

    if (Key.anykeydown != 0 && Globals.cls.key_dest == Defines.key_game) {
      cmd.buttons |= Defines.BUTTON_ANY;
    }

    // send milliseconds of time to apply the move
    ms = (int) (Globals.cls.frametime * 1000);
    if (ms > 250) {
      ms = 100; // time was unreasonable
    }
    cmd.msec = (byte) ms;

    ClampPitch();
    for (i = 0; i < 3; i++) {
      cmd.angles[i] = (short) Math3D.ANGLE2SHORT(Globals.cl.viewangles[i]);
    }

    cmd.impulse = (byte) in_impulse;
    in_impulse = 0;

    // send the ambient light level at the player's current position
    cmd.lightlevel = (byte) Globals.cl_lightlevel.value;
  }

  /*
   * ================= CL_CreateCmd =================
   */
  static void CreateCmd(usercmd_t cmd) {
    //usercmd_t cmd = new usercmd_t();

    frame_msec = Globals.sys_frame_time - old_sys_frame_time;
    if (frame_msec < 1) {
      frame_msec = 1;
    }
    if (frame_msec > 200) {
      frame_msec = 200;
    }

    // get basic movement from keyboard
    BaseMove(cmd);

    // allow mice or other external controllers to add to the move
    Mouse.Move(cmd);

    FinishMove(cmd);

    old_sys_frame_time = Globals.sys_frame_time;

    //return cmd;
  }

  /*
   * ============ CL_InitInput ============
   */
  static void InitInput() {
    Cmd.AddCommand("centerview", new XCommand() {

      public void execute() {
        Mouse.CenterView();
      }
    });

    Cmd.AddCommand("+moveup", new XCommand() {

      public void execute() {
        IN_UpDown();
      }
    });
    Cmd.AddCommand("-moveup", new XCommand() {

      public void execute() {
        IN_UpUp();
      }
    });
    Cmd.AddCommand("+movedown", new XCommand() {

      public void execute() {
        IN_DownDown();
      }
    });
    Cmd.AddCommand("-movedown", new XCommand() {

      public void execute() {
        IN_DownUp();
      }
    });
    Cmd.AddCommand("+left", new XCommand() {

      public void execute() {
        IN_LeftDown();
      }
    });
    Cmd.AddCommand("-left", new XCommand() {

      public void execute() {
        IN_LeftUp();
      }
    });
    Cmd.AddCommand("+right", new XCommand() {

      public void execute() {
        IN_RightDown();
      }
    });
    Cmd.AddCommand("-right", new XCommand() {

      public void execute() {
        IN_RightUp();
      }
    });
    Cmd.AddCommand("+forward", new XCommand() {

      public void execute() {
        IN_ForwardDown();
      }
    });
    Cmd.AddCommand("-forward", new XCommand() {

      public void execute() {
        IN_ForwardUp();
      }
    });
    Cmd.AddCommand("+back", new XCommand() {

      public void execute() {
        IN_BackDown();
      }
    });
    Cmd.AddCommand("-back", new XCommand() {

      public void execute() {
        IN_BackUp();
      }
    });
    Cmd.AddCommand("+lookup", new XCommand() {

      public void execute() {
        IN_LookupDown();
      }
    });
    Cmd.AddCommand("-lookup", new XCommand() {

      public void execute() {
        IN_LookupUp();
      }
    });
    Cmd.AddCommand("+lookdown", new XCommand() {

      public void execute() {
        IN_LookdownDown();
      }
    });
    Cmd.AddCommand("-lookdown", new XCommand() {

      public void execute() {
        IN_LookdownUp();
      }
    });
    Cmd.AddCommand("+strafe", new XCommand() {

      public void execute() {
        IN_StrafeDown();
      }
    });
    Cmd.AddCommand("-strafe", new XCommand() {

      public void execute() {
        IN_StrafeUp();
      }
    });
    Cmd.AddCommand("+moveleft", new XCommand() {

      public void execute() {
        IN_MoveleftDown();
      }
    });
    Cmd.AddCommand("-moveleft", new XCommand() {

      public void execute() {
        IN_MoveleftUp();
      }
    });
    Cmd.AddCommand("+moveright", new XCommand() {

      public void execute() {
        IN_MoverightDown();
      }
    });
    Cmd.AddCommand("-moveright", new XCommand() {

      public void execute() {
        IN_MoverightUp();
      }
    });
    Cmd.AddCommand("+speed", new XCommand() {

      public void execute() {
        IN_SpeedDown();
      }
    });
    Cmd.AddCommand("-speed", new XCommand() {

      public void execute() {
        IN_SpeedUp();
      }
    });
    Cmd.AddCommand("+attack", new XCommand() {

      public void execute() {
        IN_AttackDown();
      }
    });
    Cmd.AddCommand("-attack", new XCommand() {

      public void execute() {
        IN_AttackUp();
      }
    });
    Cmd.AddCommand("+use", new XCommand() {

      public void execute() {
        IN_UseDown();
      }
    });
    Cmd.AddCommand("-use", new XCommand() {

      public void execute() {
        IN_UseUp();
      }
    });
    Cmd.AddCommand("impulse", new XCommand() {

      public void execute() {
        IN_Impulse();
      }
    });
    Cmd.AddCommand("+klook", new XCommand() {

      public void execute() {
        IN_KLookDown();
      }
    });
    Cmd.AddCommand("-klook", new XCommand() {

      public void execute() {
        IN_KLookUp();
      }
    });

    cl_nodelta = Cvar.Get("cl_nodelta", "0", 0);
  }
  private static final SizeBuffer buf = new SizeBuffer();
  private static final byte[] data = new byte[128];
  private static final usercmd_t nullcmd = new usercmd_t();
  /*
   * ================= CL_SendCmd =================
   */

  static void SendCmd() {
    int i;
    usercmd_t cmd, oldcmd;
    int checksumIndex;

    // build a command even if not connected

    // save this command off for prediction
    i = Globals.cls.netchan.outgoing_sequence & (Defines.CMD_BACKUP - 1);
    cmd = Globals.cl.cmds[i];
    Globals.cl.cmd_time[i] = (int) Globals.cls.realtime; // for netgraph
    // ping calculation

    // fill the cmd
    CreateCmd(cmd);

    Globals.cl.cmd.set(cmd);

    if (Globals.cls.state == Defines.ca_disconnected || Globals.cls.state == Defines.ca_connecting) {
      return;
    }

    if (Globals.cls.state == Defines.ca_connected) {
      if (Globals.cls.netchan.message.cursize != 0 || Globals.curtime - Globals.cls.netchan.last_sent > 1000) {
        Netchan.Transmit(Globals.cls.netchan, 0, new byte[0]);
      }
      return;
    }

    // send a userinfo update if needed
    if (Globals.userinfo_modified) {
      CL.FixUpGender();
      Globals.userinfo_modified = false;
      MSG.WriteByte(Globals.cls.netchan.message, Defines.clc_userinfo);
      MSG.WriteString(Globals.cls.netchan.message, Cvar.Userinfo());
    }

    SizeBuffer.Init(buf, data, data.length);

    if (cmd.buttons != 0 && Globals.cl.cinematictime > 0 && !Globals.cl.attractloop
            && Globals.cls.realtime - Globals.cl.cinematictime > 1000) { // skip
      // the
      // rest
      // of
      // the
      // cinematic
      SCR.FinishCinematic();
    }

    // begin a client move command
    MSG.WriteByte(buf, Defines.clc_move);

    // save the position for a checksum byte
    checksumIndex = buf.cursize;
    MSG.WriteByte(buf, 0);

    // let the server know what the last frame we
    // got was, so the next message can be delta compressed
    if (cl_nodelta.value != 0.0f || !Globals.cl.frame.valid || Globals.cls.demowaiting) {
      MSG.WriteLong(buf, -1); // no compression
    } else {
      MSG.WriteLong(buf, Globals.cl.frame.serverframe);
    }

    // send this and the previous cmds in the message, so
    // if the last packet was dropped, it can be recovered
    i = (Globals.cls.netchan.outgoing_sequence - 2) & (Defines.CMD_BACKUP - 1);
    cmd = Globals.cl.cmds[i];
    //memset (nullcmd, 0, sizeof(nullcmd));
    nullcmd.clear();

    MSG.WriteDeltaUsercmd(buf, nullcmd, cmd);
    oldcmd = cmd;

    i = (Globals.cls.netchan.outgoing_sequence - 1) & (Defines.CMD_BACKUP - 1);
    cmd = Globals.cl.cmds[i];

    MSG.WriteDeltaUsercmd(buf, oldcmd, cmd);
    oldcmd = cmd;

    i = (Globals.cls.netchan.outgoing_sequence) & (Defines.CMD_BACKUP - 1);
    cmd = Globals.cl.cmds[i];

    MSG.WriteDeltaUsercmd(buf, oldcmd, cmd);

    // calculate a checksum over the move commands
    buf.data[checksumIndex] = Com.BlockSequenceCRCByte(buf.data, checksumIndex + 1, buf.cursize - checksumIndex - 1,
            Globals.cls.netchan.outgoing_sequence);

    //
    // deliver the message
    //
    Netchan.Transmit(Globals.cls.netchan, buf.cursize, buf.data);
  }
}


text:
<?xml version="1.0"?>
<!--
	This file serves as the default properties for a given control in Crestron Smart Graphics.
	The design tools will read this file to find the location of the appropriate XSD, Thumbnail, and SWF files.

	*Note: ALL OF THE TAGS IN THIS FILE ARE REQUIRED.*
-->
<root>
	<!--
		IsRSL:
			Tells the compiler whether or not the control is part of a Resource Shared Library (RSL).
			If the control is part of a RSL, the value should be TRUE, if it is a stand-alone SWF the value should be FALSE.
	-->
	<IsRSL>False</IsRSL>
	<!--
		ParentSWF:
			Tells the compiler what RSL file to find the class name in (set in TargetControl).
			This is only used when the IsRSL tag is set to TRUE.
	-->
	<ParentSWF>RSLName.swf</ParentSWF>
	<!--
		TargetControl:
			If using an RSL (see tags above) the TargetControl tells the compiler what class name to instantiate.
			If not using an RSL, this will point to the SWF file to be instantiated.
	-->
	<TargetControl>rgbaShape.swf</TargetControl>
	<!--
		TargetXSD:
			This is the name of the XSD that defines this controls properties for the property grid
	-->
	<TargetXSD>rgbaShape.xsd</TargetXSD>
	<!--
		CategoryName:
			This tells the design tools what category to display the control under in the Core 3 UI Control Browser
	-->
	<CategoryName>Custom</CategoryName>
	<!--
		ControlName:
			This is the user-facing name in the Core 3 UI Control Browser.
	-->
	<ControlName>RGBA Shape</ControlName>
	<!--
		Thumbnail:
			The thumbnail image name (including file extension) to be displayed for this control in the
			Core 3 UI Control Browser.  If no image is present, the default Core 3 UI icon will be used.
	-->
	<Thumbnail>ControlName.png</Thumbnail>
	<!--
		MinContainerVersion:
			The minimum container version required by this control.
	-->
	<MinContainerVersion>0.1</MinContainerVersion>
	<!--
		MinFlashVersion:
			The minimum flash version required by this control.
			FL4_1 represents Flash Lite 4.1 compatability.
			F10_1 represents Flash 10.1+ compatability.
			Valid options are:
				FL4_1
				F10_1
				FL4_1|F10_1
	-->
	<MinFlashVersion>FL4_1|F10_1</MinFlashVersion>
	<!--
		EmbeddedAppSupport:
			Contains an ID (if any) that tells the design tools what embedded application support
			is required for the particular touchpanel project.  The table of IDs and Applications
			is listed below:

			ID	Applications Name
			0	Microsoft Internet Explorer
			1	Windows Media Player
			2	WordPad
			3	Adobe Reader
			7	MediaMarker Notebook
			10	Keyboard
			13	Calibration
			14	Microsoft Inbox
			16	PowerPoint Viewer
			17	Microsoft Word Viewer
			18	Microsoft Excel Viewer
			19	NetMeeting
			21	Remote Desktop
			22	Real Player
			23	MJPEG Viewer
			24	Microsoft Picture Manager
			26	Skype
			28	VNCViewer
			29	VNCServer
	-->
	<EmbeddedAppSupport />
	<!--
		EmbeddedVideoSupport:
			Indicates whether or not the particular control or application requires embedded video support.
	-->
	<EmbeddedVideoSupport>false</EmbeddedVideoSupport>
	<!--
		VersionNumber:
			This is the version number of the control, it should be incremented with every release.
			For more information see http://en.wikipedia.org/wiki/Software_versioning
	-->
	<VersionNumber>0.0.01.00</VersionNumber>
	<!--
		Object_Name:
			This is the objects name which is user-editable.  This enables the end-user to uniquely name
			individual instances of controls/applications.
	-->
	<Object_Name>Control Name</Object_Name>
	<!--
		Description:
			This serves as the description of the control.  This property is also user-editable
			which enables the user to write a proper description for each instance of the
			control/application.
	-->
	<Description>Description of Control</Description>
	<!--
		TemplateData:
			Used by the design tools (specifically System Builder) to link signals and joins together.
	-->
	<TemplateData />
	<!--
		Properties:
			Under no circumstances should you edit this tag.  It is required by the design tools and
			runtime container to parse and serve data to the objects.
	-->
	<Properties Type="ChildProperties">
		<!--
			PositionAndSize:
				This set of properties contains the Width, Height, Top (Y), Left (X), ScaleX, and ScaleY properties.
				When an object is first added to the stage, the Width and Height properties are used as the objects
				default size parameters.  By convention, most Crestron objects will default to 0, 0.  This
				acts as a flag for the object to assume its respective styles default size(s).
		-->
		<PositionAndSize Type="Locale">
			<Width>200</Width>
			<Height>200</Height>
			<Top>0</Top>
			<Left>0</Left>
			<Z>1</Z>
			<ScaleX>1.0</ScaleX>
			<ScaleY>1.0</ScaleY>
		</PositionAndSize>

		<Color>0xFFFFFF</Color>
		<Alpha>1</Alpha>
	</Properties>
</root>


text:
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8"/>
	<title>octapush - WRLoader</title>

	<script type="text/javascript" src="../../octapush.js"></script>
	<script type="text/javascript" src="../../plugins/octapush.string.js"></script>
	<script type="text/javascript">
		console.log(_o_.string.capitalize('the range of elements processed by forEach() is set before the first invocation of callback.'));
	</script>
</head>
<body>

</body>
</html>


text:
import axios from 'axios';
import { browserHistory } from 'react-router';

// constants //
const GET_LINKS = 'GET_LINKS';
const ADD_VOTE = 'ADD_VOTE';
const GET_UPVOTES = 'GET_UPVOTES';

// action creators //
const getLinks = links => ({
  type: GET_LINKS,
  links,
});

const getUpvotes = userUpvotedLinks => ({
  type: GET_UPVOTES,
  userUpvotedLinks,
});

// thunk action creators
export const getLinksByErrId = encryptedId =>
  dispatch =>
    axios.get(`/api/search/${encryptedId}`)
      .then(res => dispatch(getLinks(res.data)))
      .catch(err => console.log(err));

export const getUserUpvotes = () =>
  dispatch =>
    axios.get('/api/upvotes')
      .then(res => dispatch(getUpvotes(res.data)))
      .catch(err => console.log(err));

export const updateVote = (info) =>
  dispatch =>
    axios.put(`/api/links/${info.vendor}`, info)
      .then(res => console.log('res:', res))
      .catch(err => console.log(err));

// reducer
const initialLinksState = {
  currentLinks: {},
  upvotedLinks: [],
};

export default function(state = initialLinksState, action) {
  const newState = Object.assign({}, state);

  switch (action.type) {
    case GET_LINKS:
      newState.currentLinks = action.links;
      break;

    case GET_UPVOTES:
      newState.upvotedLinks = action.userUpvotedLinks;
      break;

    default:
      return state;
  }

  return newState;
}


text:
module Daemons
  class ApplicationGroup
    attr_reader :app_name
    attr_reader :script

    attr_reader :monitor

    attr_reader :options

    attr_reader :applications

    attr_accessor :controller_argv
    attr_accessor :app_argv

    attr_accessor :dir_mode
    attr_accessor :dir

    # true if the application is supposed to run in multiple instances
    attr_reader :multiple

    def initialize(app_name, options = {})
      @app_name = app_name
      @options = options

      if @options[:script]
        @script = File.expand_path(@options[:script])
      end

      @monitor = nil

      @multiple = @options[:multiple] || false

      @dir_mode = @options[:dir_mode] || :script
      ['dir'].each do |k|
        @options[k] = File.expand_path(@options[k]) if @options.key?(k)
      end
      @dir = @options[:dir] || ''

      @keep_pid_files = @options[:keep_pid_files] || false

      @no_pidfiles = @options[:no_pidfiles] || false

      @pid_delimiter = @options[:pid_delimiter]

      @applications = []
    end

    # Setup the application group.
    # Currently this functions calls <tt>find_applications</tt> which finds
    # all running instances of the application and populates the application array.
    #
    def setup
      @applications = find_applications(pidfile_dir)
    end

    def pidfile_dir
      PidFile.dir(@dir_mode, @dir, script)
    end

    def find_applications(dir)
      if @no_pidfiles
        return find_applications_by_app_name(app_name)
      else
        return find_applications_by_pidfiles(dir)
      end
    end

    # TODO: identifiy the monitor process
    def find_applications_by_app_name(app_name)
      pids = []

      begin
        x = `ps auxw | grep -v grep | awk '{print $2, $11, $12}' | grep #{app_name}`
        if x && x.chomp!
          processes = x.split(/\n/).compact
          processes = processes.delete_if do |p|
            _pid, name, add = p.split(/\s/)
            # We want to make sure that the first part of the process name matches
            # so that app_name matches app_name_22

            app_name != name[0..(app_name.length - 1)] and not add.include?(app_name)
          end
          pids = processes.map { |p| p.split(/\s/)[0].to_i }
        end
      rescue ::Exception
      end

      pids.map do |f|
        app = Application.new(self, {}, PidMem.existing(f))
        setup_app(app)
        app
      end
    end

    def find_applications_by_pidfiles(dir)
      @monitor = Monitor.find(dir, app_name + '_monitor')

      reporter = Reporter.new(options)
      pid_files = PidFile.find_files(dir, app_name, ! @keep_pid_files, @pid_delimiter) do |pid, file|
        reporter.deleted_found_pidfile(pid, file)
      end

      pid_files.map do |f|
        app = Application.new(self, {}, PidFile.existing(f))
        setup_app(app)
        app
      end
    end

    def new_application(add_options = {})
      if @applications.size > 0 && !@multiple
        if options[:force]
          @applications.delete_if do |a|
            unless a.running?
              a.zap
              true
            end
          end
        end

        fail RuntimeException.new('there is already one or more instance(s) of the program running') unless @applications.empty?
      end

      app = Application.new(self, add_options)

      setup_app(app)

      @applications << app

      app
    end

    def setup_app(app)
      app.controller_argv = @controller_argv
      app.app_argv = @app_argv
      if @options[:show_status_callback]
        app.show_status_callback = @options[:show_status_callback]
      end
    end
    private :setup_app

    def create_monitor(an_app)
      if @monitor && options[:monitor]
        @monitor.stop
        @monitor = nil
      end

      if options[:monitor]
        opt = {}
        opt[:monitor_interval] = options[:monitor_interval] if options[:monitor_interval]
        @monitor = Monitor.new(an_app, opt)
        @monitor.start(self)
      end
    end

    def start_all
      @monitor.stop if @monitor
      @monitor = nil

      pids = []
      @applications.each do |a|
        pids << fork do
          a.start
        end
      end
      pids.each { |pid| Process.waitpid(pid) }
    end

    def stop_all(no_wait = false)
      if @monitor
        @monitor.stop
        @monitor = nil
        setup
      end

      threads = []

      @applications.each do |a|
        threads << Thread.new do
          a.stop(no_wait)
        end
      end

      threads.each { |t| t.join }
    end

    def reload_all
      @applications.each { |a| a.reload }
    end

    def zap_all
      @monitor.stop if @monitor

      @applications.each { |a| a.zap }
    end

    def show_status
      @applications.each { |a| a.show_status }
    end

    # Check whether at least one of the applications in the group is running. If yes, return true.
    def running?
      @applications.each { |a| return true if a.running? }
      return false
    end

  end
end


text:
package sample

import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.SQLContext
import org.scalatest._

class OlympicCalcSpec extends FunSpec with ShouldMatchers with SparkContextHelper with OlympicCalc {

  describe("OlymicCalc"){

    val olympicFilePath = "src/test/resources/olympic.csv"
    it("can find which country scored most medals"){
      withLocalSparkContext("OlymicCalc"){ sc =>
        val olympicsRDD = sc.textFile(olympicFilePath)

        findCountryHavingMostMedals(olympicsRDD) shouldBe ("United States",1312)
        //can also use DataFrame to archive this
        val sqlContext = new SQLContext(sc)
        import sqlContext.implicits._

        //if you don't have olmypics data in parquet format, you should transform
        //from rdd to dataframe
//        val olympicsDF = olympicsRDD.map(_.split(",")).
//          map(o => Olympic(o(0),o(1),o(2),o(3),o(4).toInt,o(5).toInt,o(6).toInt,o(7).toInt)).
//          toDF()

        //if you already have parquet file, just load it with sqlContext.read.parquet
        val olympicsDF = sqlContext.read.parquet("src/test/resources/olympicParqet")
        findCountryHavingMostMedalsDF(olympicsDF, sqlContext) shouldBe ("United States",1312)
      }
    }

    it("can find the year in which USA scored most medals"){
      withLocalSparkContext("OlymicCalc"){ sc =>
        val olympicsRDD = sc.textFile(olympicFilePath)
        val sqlContext = new SQLContext(sc)
        val olympicsDF = sqlContext.read.parquet("src/test/resources/olympicParqet")
        findMostMedalsYear4USA(olympicsDF,sqlContext) shouldBe "2008"
      }
    }

    it("can List the years when  "United States" scored less than 200 medals"){
      withLocalSparkContext("OlymicCalc"){ sc =>
        val olympicsRDD = sc.textFile(olympicFilePath)
        findYearsUSAMedalLt200(olympicsRDD).toSet shouldBe Array(("2010",97),("2002",84),("2006",52)).toSet
      }
    }

    it("can find Which player has medals in more than one sport"){
      withLocalSparkContext("OlymicCalc") { sc =>
        val olympicsRDD = sc.textFile(olympicFilePath)
        findPlayerHasMedalInSportsGT1(olympicsRDD) should have size 19
      }
    }
  }
}


text:
package org.conqat.engine.commons.findings.filter;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;

import org.conqat.engine.commons.ConQATParamDoc;
import org.conqat.engine.commons.ConQATPipelineProcessorBase;
import org.conqat.engine.commons.findings.Finding;
import org.conqat.engine.commons.findings.FindingCategory;
import org.conqat.engine.commons.findings.FindingGroup;
import org.conqat.engine.commons.findings.FindingReport;
import org.conqat.engine.commons.findings.FindingsList;
import org.conqat.engine.commons.node.IConQATNode;
import org.conqat.engine.commons.node.NodeUtils;
import org.conqat.engine.commons.traversal.TraversalUtils;
import org.conqat.engine.core.core.AConQATAttribute;
import org.conqat.engine.core.core.AConQATFieldParameter;
import org.conqat.engine.core.core.AConQATParameter;
import org.conqat.engine.core.core.ConQATException;

/**
 * Base class for finding filters.
 *
 * @author $Author: goede $
 * @version $Rev: 41703 $
 * @ConQAT.Rating GREEN Hash: 64C321498D73BE300AF0FA16B5A4AC2E
 */
public abstract class FindingsFilterBase extends
		ConQATPipelineProcessorBase<IConQATNode> {

	/** Standard suffix to be used in the documentation of finding filters. */
	public static final String PROCESSOR_DOC_SUFFIX = " This can be either applied to a findings report or a node hierarchy containing findings. "
			+ "In the second case, findings are removed from both the element and the findings report.";

	/** {@ConQAT.Doc} */
	@AConQATFieldParameter(parameter = ConQATParamDoc.INVERT_NAME, attribute = ConQATParamDoc.INVERT_VALUE_NAME, optional = true, description = ConQATParamDoc.INVERT_PARAM_DOC)
	public boolean invert = false;

	/** The keys to be searched for findings. */
	private final Set<String> findingKeys = new HashSet<String>();

	/** Keeps track of excluded findings for logging purposes */
	private final int excludedFindingsCount = 0;

	/** {@ConQAT.Doc} */
	@AConQATParameter(name = ConQATParamDoc.FINDING_PARAM_NAME, description = ConQATParamDoc.FINDING_KEYS_PARAM_DOC)
	public void addFindingKey(
			@AConQATAttribute(name = ConQATParamDoc.READKEY_KEY_NAME, description = ConQATParamDoc.READKEY_KEY_DESC) String key) {
		findingKeys.add(key);
	}

	/** {@inheritDoc} */
	@Override
	protected void processInput(IConQATNode input) throws ConQATException {
		if (input instanceof FindingReport) {
			processReport((FindingReport) input);
			return;
		}

		if (findingKeys.isEmpty()) {
			findingKeys.addAll(NodeUtils.getDisplayList(input).getKeyList());
		}

		for (IConQATNode node : TraversalUtils.listAllDepthFirst(input)) {
			processNode(node);
		}

		getLogger().debug("Excluded " + excludedFindingsCount + " findings");
	}

	/** Processes the findings of a report. */
	private void processReport(FindingReport report) throws ConQATException {
		for (FindingCategory category : report.getChildren()) {
			for (FindingGroup group : category.getChildren()) {
				processGroup(group);
			}

			if (!category.hasChildren()) {
				category.remove();
			}
		}
	}

	/** Processes a finding group. */
	protected void processGroup(FindingGroup group) throws ConQATException {
		for (Finding finding : group.getChildren()) {
			if (shouldRemoveFinding(null, finding)) {
				finding.remove();
				getLogger().debug("Excluding finding: " + finding);
			}
		}

		if (!group.hasChildren()) {
			group.remove();
			getLogger().debug("Excluding findinggroup: " + group);
		}
	}

	/** Processes the findings of a single node. */
	private void processNode(IConQATNode node) throws ConQATException {
		if (skipNode(node)) {
			return;
		}

		setUpOnNode(node);

		for (String findingsKey : findingKeys) {
			FindingsList findingsList = NodeUtils.getFindingsList(node,
					findingsKey);
			if (findingsList == null || findingsList.isEmpty()) {
				continue;
			}

			for (Finding finding : new ArrayList<Finding>(findingsList)) {
				if (shouldRemoveFinding(node, finding)) {
					findingsList.remove(finding);
					finding.remove();
					getLogger().debug("Excluding finding: " + finding);
				}
			}
		}
	}

	/**
	 * Set up method which is called before a node is processed. By default
	 * nothing is done. If set up is required, this method must be overwritten.
	 */
	@SuppressWarnings("unused")
	protected void setUpOnNode(IConQATNode node) throws ConQATException {
		// by default do nothing
	}

	/**
	 * Returns whether the given finding should be removed.
	 *
	 * @param node
	 *            the node the finding is attached to. May be null if filtering
	 *            on the report.
	 */
	protected boolean shouldRemoveFinding(IConQATNode node, Finding finding)
			throws ConQATException {
		if (invert) {
			return !isFiltered(node, finding);
		}
		return isFiltered(node, finding);
	}

	/**
	 * Template method used to decide whether a finding is filtered (i.e.
	 * removed).
	 *
	 * @param node
	 *            the node the finding is attached to. May be null if filtering
	 *            on the report.
	 */
	protected abstract boolean isFiltered(IConQATNode node, Finding finding)
			throws ConQATException;

	/**
	 * Template method used to skip entire nodes during filtering. Default
	 * implementation returns false.
	 */
	@SuppressWarnings("unused")
	protected boolean skipNode(IConQATNode node) throws ConQATException {
		return false;
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using MonoMac.Foundation;
using MonoMac.AppKit;
using System.Threading;
using System.IO;
using System.Collections;
using System.Reflection;
using System.Text;
using System.Diagnostics;
using System.Text.RegularExpressions;
using SharpNative.Compiler;

namespace VisualCompiler
{

	public static class ListExtensions
	{
		public static IEnumerable<string> CustomSort(this IEnumerable<string> list)
		{
			int maxLen = list.Select(s => s.Length).Max();

			return list.Select(s => new
			{
				OrgStr = s,
				SortStr = Regex.Replace(s, @"(\d+)|(\D+)", m => m.Value.PadLeft(maxLen, char.IsDigit(m.Value[0]) ? ' ' : '\xffff'))
			})
				.OrderBy(x => x.SortStr)
				.Select(x => x.OrgStr);
		}

	}

	public partial class MyDocument : MonoMac.AppKit.NSDocument
	{
		public static string LastCompiledExecutablePath {
			get;
			set;
		}

		// Called when created from unmanaged code
		public MyDocument (IntPtr handle) : base (handle)
		{
		}

		// Called when created directly from a XIB file
		[Export ("initWithCoder:")]
		public MyDocument (NSCoder coder) : base (coder)
		{
		}

		public override void WindowControllerDidLoadNib (NSWindowController windowController)
		{
			base.WindowControllerDidLoadNib (windowController);

			// Add code to here after the controller has loaded the document window

//			NSView view = new NSView ();
//			var scrollView = new NSScrollView ();
//			var clipView = new NSClipView ();
//
//			var textView = new NSTextView ();
//			clipView.AddSubview (textView);
//
//			scrollView.AddSubview (clipView);
//
//			view.AddSubview (scrollView);
//
//			windowController.Window.ContentView.AddSubview (view);

			//Xcode assistant editor aint working, so I'm resorting to finding views manually

			/*var textViews = windowController.Window.ContentView.FindViews<NSTextView> ();
			var count = 0;

			//foreach(var view in textViews)
			//{
			//	view.InsertText (new NSString("View: " + count++));
			//}//0: cshapr
			//1: output
			//2:Intermediate
			//3://CPP

			CSharpTextBox = textViews [0];
			ConsoleTextBox = textViews [1];
			IntermediateTextBox = textViews [2];
			CPPTextBox = textViews [3];
*/

			windowController.Window.Title = "Visual Compiler Mac";

			CppFileList.UsesDataSource = true;

			MainWindowViewModel.TempDir = Path.Combine (Path.GetTempPath (), "CsNative");

			if (!Directory.Exists (MainWindowViewModel.TempDir)) {
				Directory.CreateDirectory (MainWindowViewModel.TempDir);
			}

			//            Dispatcher.Invoke(() => Console.SetOut(new ControlWriter(Errors)));

			CompilerUtils.DeleteFilesByWildcards ("Test*.exe", MainWindowViewModel.TempDir);

			CSharpTextEditor.TextStorage.TextStorageDidProcessEditing += (object sender, EventArgs e) => {
				ViewModel.SourceCode = CSharpTextEditor.Value;
			};

			CPPTextEditor.TextStorage.TextStorageDidProcessEditing += (object sender, EventArgs e) => {
				ViewModel.OutputCode = CPPTextEditor.Value;
			};

			CSharpTextEditor.Value = VisualCompilerConstants.InitialCode;

			CPPRunButton.Activated += RunCPPButton_Click;

			OpenFileButton.Activated += OpenFile;

			CppFileList.Activated += SelectedFile;

			CSharpRunButton.Activated += RunCSharpButton_Click;

			TestButton.Activated += TestButton_Click;

			RunAllTests.Activated+= RunAllTests_Click;

		}

		void RunAllTests_Click (object sender, EventArgs e)
		{
			var openPanel = new NSOpenPanel ();

			openPanel.CanChooseDirectories = true;
			openPanel.CanChooseFiles = false;
			openPanel.ReleasedWhenClosed = true;
			openPanel.Prompt = "Select Folder ... ";
			openPanel.DirectoryUrl = new NSUrl (TestsDir);
			var result = openPanel.RunModal ();
			if (result == 1) {
				var filename = openPanel.Filename; // will switch to .Url later
//				var newText = File.ReadAllText (filename);
//				CSharpFilename.StringValue = Path.GetFileName (filename);
//				CSharpTextEditor.Replace (new NSRange (0, CSharpTextEditor.Value.Length), newText);
//				ViewModel.SourceCode = newText;
//				ViewModel.RecompileSource ();

				Func<string, string> strip = i => Regex.Replace(i??"", "[\r\n \t]+", " ").Trim();

				ViewModel.CompilerErrors = "\r\r" + ("Running all tests in : " + filename) + "\r\r";
				int passCount = 0;
				//			if (ResetStatus != null)
				//				ResetStatus.Stop();
					List<string> failedTestNames = new List<string> ();
				ThreadPool.QueueUserWorkItem((h) =>
					{

					var allTests = Directory.EnumerateFiles(filename).Where(u=> Path.GetExtension(u)==".cs").ToList().CustomSort();
					int noRunTests = 0;
						foreach(var file in allTests)
						{

							var shortName = Path.GetFileName(file);
						Console.WriteLine("-------------------------Running Test: " + shortName+ "-------------------------");
						ViewModel.CompilerErrors += "-------------------------Running Test: " + shortName+ "-------------------------";
						var text = Extensions.ReadFile (file);

						if(text=="-1")
							break;

							InvokeOnMainThread(()=>{
								CSharpFilename.StringValue = Path.GetFileName (file);

								CSharpTextEditor.Value = text;

							});

						CSharpOutput ="Z..)";
						CppOutput ="A..)";
						noRunTests++;
//							ViewModel.CompileAndRunCode(shortName,File.ReadAllText(file));
						CompileCSharp(false);
						CompileD();

						if (strip(CSharpOutput) == strip(CppOutput))
						{
								passCount++;
							InvokeOnMainThread(() =>
								{
									//	TestStatus.Content = "PASSED";
									//TestStatus.Background =
									//	new SolidColorBrush(System.Windows.Media.Color.FromRgb(Color.GreenYellow.R,
									//		Color.GreenYellow.G, Color.GreenYellow.B));

								ViewModel.CompilerErrors += String.Format("-------------------------Test {0} Passed:-------------------------\n", shortName);
								});
							Console.WriteLine( String.Format("-------------------------Test {0} Passed:-------------------------\n", shortName));

						}
						else
						{
							InvokeOnMainThread(() =>
								{
									//								TestStatus.Content = "FAILED";
									//								TestStatus.Background =
									//									new SolidColorBrush(System.Windows.Media.Color.FromRgb(Color.Red.R, Color.Red.G, Color.Red.B));
//										ViewModel.CompilerErrors += String.Format("Test {2} Failed:\n\nCSharp Output:\n{0}\nD Output:\n{1}",
//											CSharpOutput, CppOutput, shortName);
										ViewModel.CompilerErrors += String.Format("Test {0} Failed:\n", shortName);
								Console.WriteLine( String.Format("-------------------------Test {0} Failed:-------------------------\n", shortName));

										failedTestNames.Add(Path.GetFileNameWithoutExtension(shortName));

								});
						}
						//					if (ResetStatus == null)
						//					{
						//						ResetStatus = new Timer(2000);
						//						ResetStatus.AutoReset = false;
						//						ResetStatus.Elapsed += (o, args) => Dispatcher.Invoke(() =>
						//							{
						//								TestStatus.Content = "TEST STATUS";
						//								TestStatus.Background =
						//									new SolidColorBrush(System.Windows.Media.Color.FromRgb(Color.White.R, Color.White.G,
						//										Color.White.B));
						//							});
						//					}
						//					ResetStatus.Start();
						}

					ViewModel.CompilerErrors += String.Format("Summary \nTotal:{0} \nPass Rate:{1} \nPassed: {2} \nFailed: {3} {4}\n", noRunTests, (passCount*100)/((float)noRunTests), passCount, noRunTests-passCount, (noRunTests-passCount ==0)?"":failedTestNames.Aggregate((k,j)=>k+" , "+j));

					});

			}
		}

		void SelectedFile (object sender, EventArgs e)
		{
			if (CppFileList.SelectedIndex != -1)
			{

				var filename = ViewModel.FileList [(CppFileList.SelectedIndex)]; // will switch to .Url later
				if (File.Exists (filename.Location))
				{
					CPPFilename.StringValue = Path.GetFileName (filename.Location);
					CPPTextEditor.Value = Extensions.ReadFile (filename.Location);
				}
			}
		}

		void OpenFile (object sender, EventArgs e)
		{
			var openPanel = new NSOpenPanel ();

			openPanel.ReleasedWhenClosed = true;
			openPanel.Prompt = "Select File ... ";
			openPanel.DirectoryUrl = new NSUrl (TestsDir);
			var result = openPanel.RunModal ();
			if (result == 1) {

				var filename = openPanel.Filename; // will switch to .Url later

				if (Path.GetExtension (filename) == ".cs") {
					var newText = Extensions.ReadFile (filename);
					CSharpFilename.StringValue = Path.GetFileName (filename);
					CSharpTextEditor.Replace (new NSRange (0, CSharpTextEditor.Value.Length), newText);
					ViewModel.SourceCode = newText;
					ThreadPool.QueueUserWorkItem ((h) => {

						ViewModel.RecompileSource ();
					});
				}
				else if ((Path.GetExtension (filename) == ".sln")||(Path.GetExtension (filename) == ".csproj"))
				{
					var newText = Extensions.ReadFile (filename);
					CSharpFilename.StringValue = Path.GetFileName (filename);
					CSharpTextEditor.Replace (new NSRange (0, CSharpTextEditor.Value.Length), newText);
					ViewModel.SourceCode = newText;
					ThreadPool.QueueUserWorkItem ((h) => {
						ViewModel.RecompileSolution (filename);
					});

//					CompileSolution
				}
				else
					Console.WriteLine("Cannot Load Type " +  Path.GetExtension(filename));

			}
		}

		public void Update ()
		{
			ViewModel.RecompileSource ();
		}

		//		CompletionWindow completionWindow;

		private readonly string[] ILKeywords = {
			"LoadFunction","Call","Return","Assignment","BranchOperator","NewObject",
			"SetField","AlwaysBranch", "Label", "BinaryOperator","GetField", "CallVirtual"

		};

		private readonly string[] ILOperatorKeywords =
		{
			"add", "mul", "div", "sub", "branch"
		};

		#region Folding
//		FoldingManager foldingManager;
//		AbstractFoldingStrategy foldingStrategy;
//
//
//
//		void foldingUpdateTimer_Tick(object sender, EventArgs e)
//		{
//			if (foldingStrategy != null)
//			{
//				foldingStrategy.UpdateFoldings(foldingManager, TextEditor.Document);
//			}
//		}
		#endregion

		private void RunCSharpButton_Click(object sender, EventArgs args)
		{

			this.ViewModel.CompilerErrors = String.Empty;
			ThreadPool.QueueUserWorkItem((h) =>
				CompileCSharp (true));
		}

		private void CompileCSharp(bool clearoutput)
		{
			try
			{
				CSharpOutput = "";

//				TextWriter originalConsoleOutput = Console.Out;
			//	StringWriter writer = new StringWriter();
			//	Console.SetOut(writer);

				var start = Environment.TickCount;
//				Console.WriteLine("Running: " + LastCompiledExecutablePath);

//				this.Execute(LastCompiledExecutablePath);

				var output = ("/bin/bash").ExecuteCommand(" -c \"/usr/bin/mono --attach=disable --gc=sgen " + LastCompiledExecutablePath +"\"","");
				//Console.WriteLine(output);

				var end = Environment.TickCount - start;

				this.ViewModel.CompilerErrors +=  String.Format("CS time: {0} ms\n{1}", end,output);
				//this.ViewModel.CompilerErrors +=  output;

//				Console.SetOut(originalConsoleOutput);
			//	string result = writer.ToString() + output;
				CSharpOutput = output;
				Console.WriteLine(output);
//				this.ViewModel.CompilerErrors += (CSharpOutput);
			}
			catch (Exception ex)
			{

				this.ViewModel.CompilerErrors += ex.Message + "\n" + ex.StackTrace;
			}
		}

		public string CSharpOutput;
		public string CppOutput;
		private IList _selectedCapabilities;

		/// <summary>
		/// This gets executed in the temporary appdomain.
		/// No error handling to simplify demo.
		/// </summary>
		public void Execute(string exeName)
		{
			AppDomain appDomain = AppDomain.CreateDomain(exeName.Replace("/",""));

			// load the bytes and run Main() using reflection
			// working with bytes is useful if the assembly doesn't come from disk
//			byte[] bytes = File.ReadAllBytes(exeName);
			Assembly assembly = Assembly.LoadFile(exeName);
			MethodInfo main = assembly.EntryPoint;
			main.Invoke(null, null);
			AppDomain.Unload(appDomain);
		}

		MainWindowViewModel f = null;

		public MainWindowViewModel ViewModel
		{
			get
			{

				if (f == null) {

					this.InvokeOnMainThread (() => {
						f = new MainWindowViewModel ()
						{
							Window = this
						};
					});
				}
					return f;

			}
		}

		private void RunCPPButton_Click(object sender, EventArgs args)
		{

			ViewModel.CompilerErrors = String.Empty;
			ThreadPool.QueueUserWorkItem((h) =>
				CompileD ());

		}

		public static string BaseDir =  Path.GetFullPath (Assembly.GetExecutingAssembly().Location+ "/../../../../../../../");

		public static string BCLDir =  BaseDir+"/DCorlib/";

		public static string TestsDir =  BaseDir+"Tests/";

		public static string LastCompiledExecutable;
		private void CompileD()
		{

			if (!Directory.Exists (BCLDir)) {

				InvokeOnMainThread(() =>
					{
						ViewModel.CompilerErrors += String.Format("Please set correct BCL directory, current value \"{0}\" doesn't exist", BCLDir);
					});
				Console.WriteLine ("Please set correct BCL directory, current value {0} doesnt exist", BCLDir);
				return;
			}
				;

			//sb.ToFile(outputcpp);
			// @"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat".ExecuteCommand("",@"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\");

			var outputexe = MainWindowViewModel.TempDir + "/"+ LastCompiledExecutable.Replace(".exe", ".d").Replace(".d", "_d.exe");

			try
			{
				var start = DateTime.Now;
				//  var sb = new StringBuilder(ViewModel.OutputCode);

				//var bclDir = BCLDir;

					//Directory.GetParent(
					//	Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location + "..\\..\\..\\..\\CsNative")) +
					//"\\CsNative\\Runtime";
				//sb.ToFile(outputcpp);
				// @"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat".ExecuteCommand("",@"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\");
				var bclFiles = Directory.GetFiles(BCLDir, "*.d", SearchOption.AllDirectories)
					.OrderBy(o => o)
					.ToList();

				NativeCompilationUtils.SetCompilerOptions("dmdmac");
				NativeCompilationUtils.CompilerOptions.OptimizationFlags += " -I" + MainWindowViewModel.TempDir + " -I" + BCLDir;
				var fileList = ViewModel.FileList;
				var executableFiles = fileList.Where (j => j.Name.EndsWith (".d", StringComparison.Ordinal)).Select (k => k.Location);

				NativeCompilationUtils.CompileAppToNativeExe(executableFiles.Union(bclFiles).ToArray(), outputexe);

				ViewModel.CompilerErrors += ("\nCompiling to binary took " + (DateTime.Now - start).TotalMilliseconds + " ms\n");
				start =DateTime.Now;

				// Do not wait for the child process to exit before
				// reading to the end of its redirected stream.
				// p.WaitForExit();
				// Read the output stream first and then wait.
				string output = outputexe.ExecuteCommand("");

				var end = DateTime.Now - start;

				CppOutput = output;
				InvokeOnMainThread(() =>
					{
						ViewModel.CompilerErrors += String.Format("D time: {0} ms\n", end.TotalMilliseconds) + output ;
					Console.WriteLine(String.Format("D time: {0} ms\n", end.TotalMilliseconds) + output);
					});
			}
			catch (Exception ex)
			{

				InvokeOnMainThread(() =>
					{
						ViewModel.CompilerErrors += ex.Message + "\nStackTrace: \n" +
							ex.StackTrace;
					Console.WriteLine(ex.Message + "\nStackTrace: \n" +
						ex.StackTrace);
					});

			}
			finally
			{
				if (File.Exists(outputexe))
					File.Delete(outputexe);

			}

		}

		private void TestButton_Click(object sender, EventArgs e)
		{
			ViewModel.CompilerErrors = "";

			Func<string, string> strip = i => Regex.Replace(i, "[\r\n \t]+", " ").Trim();

//			if (ResetStatus != null)
//				ResetStatus.Stop();
			ThreadPool.QueueUserWorkItem((h) =>
				{
					CompileCSharp(false);
					CompileD();

					if (strip(CSharpOutput) == strip(CppOutput))
					{
						InvokeOnMainThread(() =>
							{
								//	TestStatus.Content = "PASSED";
								//TestStatus.Background =
								//	new SolidColorBrush(System.Windows.Media.Color.FromRgb(Color.GreenYellow.R,
								//		Color.GreenYellow.G, Color.GreenYellow.B));
						Console.WriteLine(String.Format("Test Passed:\n\nCSharp Output:\n{0}\nD Output:\n{1}",
							CSharpOutput, CppOutput));
								ViewModel.CompilerErrors = String.Format("Test Passed:\n\nCSharp Output:\n{0}\nD Output:\n{1}",
									CSharpOutput, CppOutput);
							});
					}
					else
					{
						InvokeOnMainThread(() =>
							{
//								TestStatus.Content = "FAILED";
//								TestStatus.Background =
//									new SolidColorBrush(System.Windows.Media.Color.FromRgb(Color.Red.R, Color.Red.G, Color.Red.B));
								ViewModel.CompilerErrors = "Test Failed\n" + ViewModel.CompilerErrors;
						Console.WriteLine(String.Format("Test Failed:\n\nCSharp Output:\n{0}\nD Output:\n{1}",
							CSharpOutput, CppOutput));
							});
					}
//					if (ResetStatus == null)
//					{
//						ResetStatus = new Timer(2000);
//						ResetStatus.AutoReset = false;
//						ResetStatus.Elapsed += (o, args) => Dispatcher.Invoke(() =>
//							{
//								TestStatus.Content = "TEST STATUS";
//								TestStatus.Background =
//									new SolidColorBrush(System.Windows.Media.Color.FromRgb(Color.White.R, Color.White.G,
//										Color.White.B));
//							});
//					}
//					ResetStatus.Start();
				});
		}

//		private Timer ResetStatus;

		private void OnShowCompilerOptions()
		{
//			var optionsWindow = new CompilerOptionsWindow();
//			optionsWindow.Owner = this;
//			optionsWindow.ShowDialog();
//			if (!optionsWindow.ViewModel.Accepted)
//				return;
//			ViewModel.OptimizationList.Clear();
//			ViewModel.OptimizationList.AddRange(optionsWindow.ViewModel.Capabilities);

		}

		private void OnFileOpen()
		{
//			Microsoft.Win32.OpenFileDialog dialog = new Microsoft.Win32.OpenFileDialog();
//			dialog.DefaultExt = ".cs";
//			dialog.Filter = "CSharp Source Code (.cs)|*.cs";
//			var folder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Tests\\");
//			dialog.InitialDirectory = folder;
//
//
//			bool? result = dialog.ShowDialog();
//			if (result == true)
//			{
//				TextEditor.Text = File.ReadAllText(dialog.FileName);
//			}
//			else
//			{
//
//			}

		}

//		public NSTextView CSharpTextBox;
//		public NSTextView ConsoleTextBox;
//		public NSTextView IntermediateTextBox;
//		public NSTextView CPPTextBox;

		//
		// Save support:
		//    Override one of GetAsData, GetAsFileWrapper, or WriteToUrl.
		//

		// This method should store the contents of the document using the given typeName
		// on the return NSData value.
		public override NSData GetAsData (string documentType, out NSError outError)
		{
			outError = NSError.FromDomain (NSError.OsStatusErrorDomain, -4);
			return null;
		}

		//
		// Load support:
		//    Override one of ReadFromData, ReadFromFileWrapper or ReadFromUrl
		//
		public override bool ReadFromData (NSData data, string typeName, out NSError outError)
		{
			outError = NSError.FromDomain (NSError.OsStatusErrorDomain, -4);
			return false;
		}

		// If this returns the name of a NIB file instead of null, a NSDocumentController
		// is automatically created for you.
		public override string WindowNibName {
			get {
				return "MyDocument";
			}
		}

	}
}


text:
Managers
    <form class="form-inline pull-right">
      <input class="form-control" id="givenName" type="text" placeholder="Given name" />
      <input class="form-control" id="surname" type="text" placeholder="Surname" />
      <input class="form-control" id="email" type="email" placeholder="Email" />
      <button class="btn btn-success" on-tap="create"> Invite Manager</button>
    </form>

          Name
          Email
          Action


text:
import time
from concurrent.futures import ThreadPoolExecutor

from joblib import Parallel
import pytest

from sklearn import get_config, set_config, config_context
from sklearn.utils.fixes import delayed

def test_config_context():
    assert get_config() == {
        "assume_finite": False,
        "working_memory": 1024,
        "print_changed_only": True,
        "display": "diagram",
        "array_api_dispatch": False,
        "pairwise_dist_chunk_size": 256,
        "enable_cython_pairwise_dist": True,
    }

    # Not using as a context manager affects nothing
    config_context(assume_finite=True)
    assert get_config()["assume_finite"] is False

    with config_context(assume_finite=True):
        assert get_config() == {
            "assume_finite": True,
            "working_memory": 1024,
            "print_changed_only": True,
            "display": "diagram",
            "array_api_dispatch": False,
            "pairwise_dist_chunk_size": 256,
            "enable_cython_pairwise_dist": True,
        }
    assert get_config()["assume_finite"] is False

    with config_context(assume_finite=True):
        with config_context(assume_finite=None):
            assert get_config()["assume_finite"] is True

        assert get_config()["assume_finite"] is True

        with config_context(assume_finite=False):
            assert get_config()["assume_finite"] is False

            with config_context(assume_finite=None):
                assert get_config()["assume_finite"] is False

                # global setting will not be retained outside of context that
                # did not modify this setting
                set_config(assume_finite=True)
                assert get_config()["assume_finite"] is True

            assert get_config()["assume_finite"] is False

        assert get_config()["assume_finite"] is True

    assert get_config() == {
        "assume_finite": False,
        "working_memory": 1024,
        "print_changed_only": True,
        "display": "diagram",
        "array_api_dispatch": False,
        "pairwise_dist_chunk_size": 256,
        "enable_cython_pairwise_dist": True,
    }

    # No positional arguments
    with pytest.raises(TypeError):
        config_context(True)

    # No unknown arguments
    with pytest.raises(TypeError):
        config_context(do_something_else=True).__enter__()

def test_config_context_exception():
    assert get_config()["assume_finite"] is False
    try:
        with config_context(assume_finite=True):
            assert get_config()["assume_finite"] is True
            raise ValueError()
    except ValueError:
        pass
    assert get_config()["assume_finite"] is False

def test_set_config():
    assert get_config()["assume_finite"] is False
    set_config(assume_finite=None)
    assert get_config()["assume_finite"] is False
    set_config(assume_finite=True)
    assert get_config()["assume_finite"] is True
    set_config(assume_finite=None)
    assert get_config()["assume_finite"] is True
    set_config(assume_finite=False)
    assert get_config()["assume_finite"] is False

    # No unknown arguments
    with pytest.raises(TypeError):
        set_config(do_something_else=True)

def set_assume_finite(assume_finite, sleep_duration):
    """Return the value of assume_finite after waiting `sleep_duration`."""
    with config_context(assume_finite=assume_finite):
        time.sleep(sleep_duration)
        return get_config()["assume_finite"]

@pytest.mark.parametrize("backend", ["loky", "multiprocessing", "threading"])
def test_config_threadsafe_joblib(backend):
    """Test that the global config is threadsafe with all joblib backends.
    Two jobs are spawned and sets assume_finite to two different values.
    When the job with a duration 0.1s completes, the assume_finite value
    should be the same as the value passed to the function. In other words,
    it is not influenced by the other job setting assume_finite to True.
    """
    assume_finites = [False, True]
    sleep_durations = [0.1, 0.2]

    items = Parallel(backend=backend, n_jobs=2)(
        delayed(set_assume_finite)(assume_finite, sleep_dur)
        for assume_finite, sleep_dur in zip(assume_finites, sleep_durations)
    )

    assert items == [False, True]

def test_config_threadsafe():
    """Uses threads directly to test that the global config does not change
    between threads. Same test as `test_config_threadsafe_joblib` but with
    `ThreadPoolExecutor`."""

    assume_finites = [False, True]
    sleep_durations = [0.1, 0.2]

    with ThreadPoolExecutor(max_workers=2) as e:
        items = [
            output
            for output in e.map(set_assume_finite, assume_finites, sleep_durations)
        ]

    assert items == [False, True]


text:
#ifndef POLYGRAPH__BASE_HISTOGRAM_H
#define POLYGRAPH__BASE_HISTOGRAM_H

#include "xstd/Array.h"
#include "base/AggrStat.h"
#include "base/ILog.h"
#include "base/OLog.h"
#include "base/LogObj.h"

class HistogramConstIter;

// general purpose histogram abstraction
// value range: [min, max)
class Histogram: public LogObj {
	friend class HistogramConstIter;

	public:
		typedef int Val; // change to double if needed

	public:
		Histogram();
		Histogram(Val aMin, Val aMax, int binCount);
		Histogram(const Histogram &h);
		virtual ~Histogram() {}

		void limits(Val aMin, Val aMax, int binCount);
		virtual void reset();

		void record(Val v);

		virtual OLog &store(OLog &log) const;
		virtual ILog &load(ILog &);

		virtual void add(const Histogram &h);
		Histogram &operator +=(const Histogram &h);

		bool sane() const { return stats().sane(); }
		bool known() const { return stats().known(); }
		const AggrStat &stats() const { return theStats; }

		// extreme bins' counters
		bool extreme(int bin) const { return !bin || bin == theBinMax; }
		Counter underCount() const { return theBins[0]; }
		Counter overCount() const { return theBins[theBinMax]; }

		ostream &print(ostream &os, const String &pfx) const;
		void report(double step, ostream &os) const;

	protected:
		virtual const char *type() const = 0; // val2bin type
		virtual int val2Bin(Val v) const = 0; // value is already offset
		virtual Val bin2Val(int b) const = 0; // does not offset value

		Val extract(int b) const { return bin2Val(b-1) + theValMin; }
		Counter count(const int b) const { return theBins[b]; }

	protected:
		Array<Counter> theBins; // counters are stored here
		AggrStat theStats;
		Val theValMin;
		Val theValMax;
		int theBinMax;
};

// a virtual representation of a histogram "bin"
class HistogramBin {
	public:
		HistogramBin() { reset(); }
		void reset() { count = accCount = idx = 0; min = sup = -1; }

		HistogramBin &operator +=(const HistogramBin &b);

	public:
		Histogram::Val min;
		Histogram::Val sup; // max+1
		int idx;
		Counter count;
		Counter accCount; // cumulative count
};

// constant iterator for a histogram
class HistogramConstIter {
	public:
		HistogramConstIter(const Histogram &aHist);

		operator void*() const { return theBin.idx <= theHist.theBinMax ? (void*)-1 : 0; }
		const HistogramBin &operator *() const { return theBin; }
		const HistogramBin *operator ->() const { return &theBin; }
		HistogramConstIter &operator ++();

	private:
		void sync();

	protected:
		const Histogram &theHist;
		HistogramBin theBin; // current bin;
};

// builds percentiles array with a given step (1% default)
extern void Percentiles(const Histogram &, Array<HistogramBin> &percs, double step = 0.01);

#endif


text:
package kantan.csv
package ops

import engine.WriterEngine

trait VersionSpecificCsvSinkOps[A] { self: CsvSinkOps[A] =>
  @deprecated("use writeCsv(rows, CsvConfiguration) instead", "0.1.18")
  def writeCsv[B: HeaderEncoder](rows: IterableOnce[B], sep: Char, header: String*)(
    implicit e: WriterEngine,
    sa: CsvSink[A]
  ): Unit =
    writeCsv(rows, rfc.withCellSeparator(sep).withHeader(header: _*))

  def writeCsv[B: HeaderEncoder](
    rows: IterableOnce[B],
    conf: CsvConfiguration
  )(implicit e: WriterEngine, sa: CsvSink[A]): Unit =
    CsvSink[A].write(a, rows, conf)
}


text:
from getpass import getpass
from gog import Gog

def main():
    username = raw_input("username: ")
    password = getpass("password: ")

    gog = Gog()
    logged_in = gog.login(username, password)
    if not logged_in:
        print("Failed to log in.")
        return

    gog.get_games()

    gog.download_games()
    gog.download_extras()

if __name__ == "__main__":
    main()

# vim: set ts=4 sw=4 et:


text:
<?xml version="1.0" encoding="UTF-8"?>
<sem:triples uri="http://www.lds.org/vrl/locations/specific-locations/general-specific-locations/utah-state-prison-draper-utah-usa" xmlns:sem="http://marklogic.com/semantics">
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/locations/specific-locations/general-specific-locations/utah-state-prison-draper-utah-usa</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#prefLabel</sem:predicate>
    <sem:object datatype="xsd:string" xml:lang="eng">Utah State Prison (Draper, Utah, USA)</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/locations/specific-locations/general-specific-locations/utah-state-prison-draper-utah-usa</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#inScheme</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/concept-scheme/vrl</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/locations/specific-locations/general-specific-locations/utah-state-prison-draper-utah-usa</sem:subject>
    <sem:predicate>http://www.lds.org/core#entityType</sem:predicate>
    <sem:object datatype="sem:iri">http://www.schema.org/Place</sem:object>
  </sem:triple>
</sem:triples>


text:
package w1.fi.wpadebug;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

import android.app.Activity;
import android.app.AlertDialog;
import android.os.Bundle;
import android.view.View;
import android.content.Intent;
import android.content.Context;
import android.content.DialogInterface;
import android.widget.EditText;
import android.widget.Toast;
import android.util.Log;
import android.net.wifi.WifiManager;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiConfiguration;
import android.nfc.NdefMessage;
import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;

public class MainActivity extends Activity
{
    public final static String EXTRA_MESSAGE = "w1.fi.wpadebug.MESSAGE";
    private static final String TAG = "wpadebug";

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

    public void runCommands(View view)
    {
	Intent intent = new Intent(this, CommandListActivity.class);
	startActivity(intent);
    }

    public void runWpaCommands(View view)
    {
	Intent intent = new Intent(this, WpaCommandListActivity.class);
	startActivity(intent);
    }

    public void runWpaCredentials(View view)
    {
	Intent intent = new Intent(this, WpaCredActivity.class);
	startActivity(intent);
    }

    public void runWpaCliCmd(View view)
    {
	Intent intent = new Intent(this, DisplayMessageActivity.class);
	EditText editText = (EditText) findViewById(R.id.edit_cmd);
	String cmd = editText.getText().toString();
	if (cmd.trim().length() == 0) {
	    show_alert("wpa_cli command", "Invalid command");
	    return;
	}
	wpaCmd(view, cmd);
    }

    public void wpaLogLevelInfo(View view)
    {
	wpaCmd(view, "LOG_LEVEL INFO 1");
    }

    public void wpaLogLevelDebug(View view)
    {
	wpaCmd(view, "LOG_LEVEL DEBUG 1");
    }

    public void wpaLogLevelExcessive(View view)
    {
	wpaCmd(view, "LOG_LEVEL EXCESSIVE 1");
    }

    private void wpaCmd(View view, String cmd)
    {
	Intent intent = new Intent(this, DisplayMessageActivity.class);
	String message = run("wpa_cli " + cmd);
	if (message == null)
	    return;
	intent.putExtra(EXTRA_MESSAGE, message);
	startActivity(intent);
    }

    private String run(String cmd)
    {
	try {
	    Log.d(TAG, "Running external process: " + cmd);
	    Process proc = Runtime.getRuntime().exec(new String[]{"/system/bin/mksh-su", "-c", cmd});
	    BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream()));
	    StringBuffer output = new StringBuffer();
	    int read;
	    char[] buffer = new char[1024];
	    while ((read = reader.read(buffer)) > 0)
		output.append(buffer, 0, read);
	    reader.close();
	    proc.waitFor();
	    Log.d(TAG, "External process completed - exitValue " +
		  proc.exitValue());
	    return output.toString();
	} catch (IOException e) {
	    show_alert("Could not run external program",
		       "Execution of an external program failed. " +
		       "Maybe mksh-su was not installed.");
	    return null;
	} catch (InterruptedException e) {
	    throw new RuntimeException(e);
	}
    }

    private void show_alert(String title, String message)
    {
	AlertDialog.Builder alert = new AlertDialog.Builder(this);
	alert.setTitle(title);
	alert.setMessage(message);
	alert.setPositiveButton("OK", new DialogInterface.OnClickListener() {
		public void onClick(DialogInterface dialog, int id)
		{
		}
	    });
	alert.create().show();
    }

    public void wifiManagerInfo(View view)
    {
	Intent intent = new Intent(this, DisplayMessageActivity.class);
	WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
	String message = "WifiState: " + manager.getWifiState() + "\n" +
	    "WifiEnabled: " + manager.isWifiEnabled() + "\n" +
	    "pingSupplicant: " + manager.pingSupplicant() + "\n" +
	    "DhcpInfo: " + manager.getDhcpInfo().toString() + "\n";
	intent.putExtra(EXTRA_MESSAGE, message);
	startActivity(intent);
    }

    public void wifiInfo(View view)
    {
	Intent intent = new Intent(this, DisplayMessageActivity.class);
	WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
	WifiInfo wifi = manager.getConnectionInfo();
	String message = wifi.toString() + "\n" + wifi.getSupplicantState();
	intent.putExtra(EXTRA_MESSAGE, message);
	startActivity(intent);
    }

    public void wifiConfiguredNetworks(View view)
    {
	Intent intent = new Intent(this, DisplayMessageActivity.class);
	WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
	StringBuilder sb = new StringBuilder();
	for (WifiConfiguration n: manager.getConfiguredNetworks())
	    sb.append(n.toString() + "\n");
	intent.putExtra(EXTRA_MESSAGE, sb.toString());
	startActivity(intent);
    }

    public void nfcWpsHandoverRequest(View view)
    {
	NfcAdapter nfc;
	nfc = NfcAdapter.getDefaultAdapter(this);
	if (nfc == null) {
	    Toast.makeText(this, "NFC is not available",
			   Toast.LENGTH_LONG).show();
	    return;
	}

	NdefMessage msg;
	msg = new NdefMessage(new NdefRecord[] {
		NdefRecord.createMime("application/vnd.wfa.wsc",
				      new byte[0])
	    });

	nfc.setNdefPushMessage(msg, this);
	Toast.makeText(this, "NFC push message (WSC) configured",
		       Toast.LENGTH_LONG).show();
    }
}


text:
package wicket.in.action.chapter03.section_3_3;

import java.text.NumberFormat;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;

import wicket.in.action.chapter03.section_3_1.Cart;
import wicket.in.action.chapter03.section_3_1.Cheese;

public class ShoppingCartPanel extends Panel {
  private Cart cart;
  public ShoppingCartPanel(String id, Cart cart) {
     super(id);
     this.cart = cart;
     add(new ListView("cart", new PropertyModel(this, "cart.cheeses")) {
       @Override
       protected void populateItem(ListItem item) {
           Cheese cheese = (Cheese) item.getModelObject();
           item.add(new Label("name", cheese.getName()));
           item.add(new Label("price", "$" + cheese.getPrice()));

           item.add(removeLink("remove", item));
       }
   });
   add(new Label("total", new Model() {
       @Override
       public Object getObject() {
           NumberFormat nf = NumberFormat.getCurrencyInstance();
           return nf.format(getCart().getTotal());
       }
   }));
  }

  private Cart getCart() {
     return cart;
  }
}


text:
classdef SimpleMesh < handle
    %SimpleMesh a mesh class reduced functionality.
    properties
        elementType
        p, t, matel
    end

    methods
        function msh = SimpleMesh(p, t)
            msh.p = p;
            msh.t = t;
            msh.matel = [];
            switch size(t, 1)
                case 3
                    msh.elementType = Elements.triangle;
                case 6
                    msh.elementType = Elements.triangle2I;
                otherwise
                    error('Element type not included here yet.');
            end
        end

        function [F, F0] = getMappingMatrix(this, varargin)
            [F, F0] = msh_getMappingMatrix(this, varargin{:});
        end

    end
end


text:
require 'contest'
require 'swirl/aws'

class AwsTest < Test::Unit::TestCase

  test "raises InvalidRequest on ErrorResponse" do
    e = Swirl::AWS.new(:elb, :aws_access_key_id => 'AKIA', :aws_secret_access_key => 'secret')
    def e.call!(*args, &blk)
      doc = {"ErrorResponse"=>{"Error"=>{"Code"=>"CertificateNotFound", "Type"=>"Sender"}}}
      blk.call [400, doc]
    end
    assert_raise(Swirl::InvalidRequest) { e.call "CreateLoadBalancer", {} }
  end

end


text:
ACCEPTED

#### According to
Interim Register of Marine and Nonmarine Genera

#### Published in
Mem. Soc. cubana Hist, Nat. , 10, 125.

#### Original name
null

### Remarks
null


text:
class AccessToken
  include DataMapper::Resource

  def self.salt
    ''
  end

  property :digest, String, key: true, default: lambda { |access_token, *_|
    Digest::SHA1.hexdigest([
      access_token.udid,
      AccessToken.salt,
      access_token.user.id
    ].join('_'))
  }

  property :udid, String, allow_nil: false

  belongs_to :user

  validates_uniqueness_of :udid, :scope => [ :user_id ],
    message: 'That UDID already has an access token.'

  before :save do
  end
end


text:
<?php

namespace PHPExiftool\Driver\Tag\DICOM;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class LastPulseSequenceUsed extends AbstractTag
{

    protected $Id = '0025,1006';

    protected $Name = 'LastPulseSequenceUsed';

    protected $FullName = 'DICOM::Main';

    protected $GroupName = 'DICOM';

    protected $g0 = 'DICOM';

    protected $g1 = 'DICOM';

    protected $g2 = 'Image';

    protected $Type = '?';

    protected $Writable = false;

    protected $Description = 'Last Pulse Sequence Used';

}


text:
<!--
Description: prop
Expect:      feed['title'] == u'testing \u221d entity'
-->
<rss>
<channel>
<title>testing ∝ entity</title>
</channel>
</rss>


text:
#include <aws/apigatewayv2/model/RouteSettings.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace ApiGatewayV2
{
namespace Model
{

RouteSettings::RouteSettings() :
    m_dataTraceEnabled(false),
    m_dataTraceEnabledHasBeenSet(false),
    m_detailedMetricsEnabled(false),
    m_detailedMetricsEnabledHasBeenSet(false),
    m_loggingLevel(LoggingLevel::NOT_SET),
    m_loggingLevelHasBeenSet(false),
    m_throttlingBurstLimit(0),
    m_throttlingBurstLimitHasBeenSet(false),
    m_throttlingRateLimit(0.0),
    m_throttlingRateLimitHasBeenSet(false)
{
}

RouteSettings::RouteSettings(JsonView jsonValue) :
    m_dataTraceEnabled(false),
    m_dataTraceEnabledHasBeenSet(false),
    m_detailedMetricsEnabled(false),
    m_detailedMetricsEnabledHasBeenSet(false),
    m_loggingLevel(LoggingLevel::NOT_SET),
    m_loggingLevelHasBeenSet(false),
    m_throttlingBurstLimit(0),
    m_throttlingBurstLimitHasBeenSet(false),
    m_throttlingRateLimit(0.0),
    m_throttlingRateLimitHasBeenSet(false)
{
  *this = jsonValue;
}

RouteSettings& RouteSettings::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("dataTraceEnabled"))
  {
    m_dataTraceEnabled = jsonValue.GetBool("dataTraceEnabled");

    m_dataTraceEnabledHasBeenSet = true;
  }

  if(jsonValue.ValueExists("detailedMetricsEnabled"))
  {
    m_detailedMetricsEnabled = jsonValue.GetBool("detailedMetricsEnabled");

    m_detailedMetricsEnabledHasBeenSet = true;
  }

  if(jsonValue.ValueExists("loggingLevel"))
  {
    m_loggingLevel = LoggingLevelMapper::GetLoggingLevelForName(jsonValue.GetString("loggingLevel"));

    m_loggingLevelHasBeenSet = true;
  }

  if(jsonValue.ValueExists("throttlingBurstLimit"))
  {
    m_throttlingBurstLimit = jsonValue.GetInteger("throttlingBurstLimit");

    m_throttlingBurstLimitHasBeenSet = true;
  }

  if(jsonValue.ValueExists("throttlingRateLimit"))
  {
    m_throttlingRateLimit = jsonValue.GetDouble("throttlingRateLimit");

    m_throttlingRateLimitHasBeenSet = true;
  }

  return *this;
}

JsonValue RouteSettings::Jsonize() const
{
  JsonValue payload;

  if(m_dataTraceEnabledHasBeenSet)
  {
   payload.WithBool("dataTraceEnabled", m_dataTraceEnabled);

  }

  if(m_detailedMetricsEnabledHasBeenSet)
  {
   payload.WithBool("detailedMetricsEnabled", m_detailedMetricsEnabled);

  }

  if(m_loggingLevelHasBeenSet)
  {
   payload.WithString("loggingLevel", LoggingLevelMapper::GetNameForLoggingLevel(m_loggingLevel));
  }

  if(m_throttlingBurstLimitHasBeenSet)
  {
   payload.WithInteger("throttlingBurstLimit", m_throttlingBurstLimit);

  }

  if(m_throttlingRateLimitHasBeenSet)
  {
   payload.WithDouble("throttlingRateLimit", m_throttlingRateLimit);

  }

  return payload;
}

} // namespace Model
} // namespace ApiGatewayV2
} // namespace Aws