text:
package org.ayo.richtext.awesometext;

import android.content.Context;
import android.graphics.drawable.BitmapDrawable;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.text.style.ImageSpan;
import android.view.View;
import android.widget.TextView;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class AwesomeTextHandler {

    private final static int DEFAULT_RENDER_APPLY_MODE = Spannable.SPAN_EXCLUSIVE_EXCLUSIVE;
    private final static int UPPER_LEFT_X = 0;
    private final static int UPPER_LEFT_Y = 0;

    public interface ViewSpanRenderer {
        public abstract View getView(final String text, final Context context);
    }

    public interface ViewSpanClickListener {
        public void onClick(String text, Context context);
    }

    private TextView view;
    private Context context;
    private Map<String, ViewSpanRenderer> renderers;

    public AwesomeTextHandler() {
        renderers = new HashMap<>();
    }

    public AwesomeTextHandler addViewSpanRenderer(String pattern, ViewSpanRenderer viewSpanRenderer) {
        renderers.put(pattern, viewSpanRenderer);
        if (view != null) {
            applyRenderers();
        }
        return this;
    }

    public Map<String, ViewSpanRenderer> getViewSpanRenderers() {
        return renderers;
    }

    public void setView(TextView view) {
        this.view = view;
        this.context = view.getContext();
        applyRenderers();
    }

    public void setText(String text) {
        if (view != null) {
            view.setText(text);
            applyRenderers();
        } else {
            throw new IllegalStateException("View mustn't be null");
        }
    }

    private void applyRenderers() {
        if (renderers != null) {
            Spannable spannableString = new SpannableString(view.getText());
            Set<String> spanPatterns = renderers.keySet();
            for (String spanPattern : spanPatterns) {
                Pattern pattern = Pattern.compile(spanPattern);
                Matcher matcher = pattern.matcher(spannableString);
                while (matcher.find()) {
                    int end = matcher.end();
                    int start = matcher.start();
                    ViewSpanRenderer renderer = renderers.get(spanPattern);
                    String text = matcher.group(0);
                    View view = renderer.getView(text, context);
                    BitmapDrawable bitmpaDrawable = (BitmapDrawable) ViewUtils.convertViewToDrawable(view);
                    bitmpaDrawable.setBounds(UPPER_LEFT_X, UPPER_LEFT_Y, bitmpaDrawable.getIntrinsicWidth(), bitmpaDrawable.getIntrinsicHeight());
                    spannableString.setSpan(new ImageSpan(bitmpaDrawable), start, end, DEFAULT_RENDER_APPLY_MODE);
                    if (renderer instanceof ViewSpanClickListener) {
                        enableClickEvents();
                        ClickableSpan clickableSpan = getClickableSpan(text, (ViewSpanClickListener) renderer);
                        spannableString.setSpan(clickableSpan, start, end, DEFAULT_RENDER_APPLY_MODE);
                    }
                }
            }
            view.setText(spannableString);
        }
    }

    private void enableClickEvents() {
        view.setMovementMethod(LinkMovementMethod.getInstance());
        view.setHighlightColor(context.getResources().getColor(android.R.color.transparent));
    }

    private ClickableSpan getClickableSpan(final String text, final ViewSpanClickListener listener) {
        ClickableSpan clickableSpan = new ClickableSpanWithoutFormat() {
            @Override
            public void onClick(View view) {
                listener.onClick(text, context);
            }
        };
        return clickableSpan;
    }
}


text:
<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Title
    |--------------------------------------------------------------------------
    |
    */

    'title' => 'Yeoman Admin Control Panel',

    /*
    |--------------------------------------------------------------------------
    | Logo
    |--------------------------------------------------------------------------
    |
    */

    'logo' => '<b>YEOMAN</b>',

    'logo_mini' => '',

    /**
     * 支持 gentelella,adminlte,sb-admin
     */
    'admin_theme' => 'adminlte',
    /*
    |--------------------------------------------------------------------------
    | Layout
    |--------------------------------------------------------------------------
    |
    | Choose a layout for your admin panel. The available layout options:
    | null, 'boxed', 'fixed', 'top-nav'. null is the default, top-nav
    | removes the sidebar and places your menu in the top navbar
    |
    */

    'layout' => null,

    /*
    |--------------------------------------------------------------------------
    | Collapse Sidebar
    |--------------------------------------------------------------------------
    |
    | Here we choose and option to be able to start with a collapsed side
    | bar. To adjust your sidebar layout simply set this  either true
    | this is compatible with layouts except top-nav layout option
    |
    */

    'collapse_sidebar' => false,

    /*
    |--------------------------------------------------------------------------
    | URLs
    |--------------------------------------------------------------------------
    |
    | Register here your dashboard, logout, login and register URLs. The
    | logout URL automatically sends a POST request in Laravel 5.3 or higher.
    | You can set the request to a GET or POST with logout_method.
    | Set register_url to null if you don't want a register link.
    |
    */

    'dashboard_url' => 'admin',

    'logout_url' => 'logout',

    'logout_method' => null,

    'login_url' => 'admin/login',

    'register_url' => null,

    'password_reset_url'=>'admin/password/reset',

    'password_email_url'=>'admin/password/email',

    /*
    |--------------------------------------------------------------------------
    | Menu Items
    |--------------------------------------------------------------------------
    |
    | Specify your menu items to display in the left sidebar. Each menu item
    | should have a text and and a URL. You can also specify an icon from
    | Font Awesome. A string instead of an array represents a header in sidebar
    | layout. The 'can' is a filter on Laravel's built in Gate functionality.
    |
    */

    /*
    |--------------------------------------------------------------------------
    | Plugins Initialization
    |--------------------------------------------------------------------------
    |
    | Choose which JavaScript plugins should be included. At this moment,
    | only DataTables is supported as a plugin. Set the value to true
    | to include the JavaScript file from a CDN via a script tag.
    |
    */

    'plugins' => [
        'datatables' => true,
    ],
];

redpajama_set_name: RedPajamaGithub


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.brouwersystems.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author tonybrouwer
 */
@Entity
@Table(name = "MONTHLY_SALES")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MonthlySales.findAll", query = "SELECT m FROM MonthlySales m order by m.id desc"),
    @NamedQuery(name = "MonthlySales.findById", query = "SELECT m FROM MonthlySales m WHERE m.id = :id"),
    @NamedQuery(name = "MonthlySales.findByStore", query = "SELECT m FROM MonthlySales m WHERE m.store.id = :id order by m.salesDate desc"),
    @NamedQuery(name = "MonthlySales.findBySalesAmt", query = "SELECT m FROM MonthlySales m WHERE m.salesAmt = :salesAmt"),
    @NamedQuery(name = "MonthlySales.findByCostAmt", query = "SELECT m FROM MonthlySales m WHERE m.costAmt = :costAmt")})
public class MonthlySales implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_MONTHLY_SALES")
    @SequenceGenerator(name="SEQ_MONTHLY_SALES", sequenceName="SEQ_MONTHLY_SALES", allocationSize=1)
    private Long id;

    @Basic(optional = false)
    @NotNull
    @Column(name = "SALES_DATE")
    @Temporal(TemporalType.DATE)
    private Date salesDate;

    @Max(value=1000000) @Min(value=0)
    @Basic(optional = false)
    @NotNull
    @Column(name = "SALES_AMT")
    private BigDecimal salesAmt;

    @Max(value=1000000) @Min(value=0)
    @Basic(optional = false)
    @NotNull
    @Column(name = "COST_AMT")
    private BigDecimal costAmt;

    @JoinColumn(name = "STORE_ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Store store;

    public MonthlySales() {
    }

    public MonthlySales(Long id) {
        this.id = id;
    }

    public MonthlySales(Long id, Date salesDate) {
        this.id = id;
        this.salesDate = salesDate;
    }

    public MonthlySales(Long id, BigDecimal salesAmt, BigDecimal costAmt) {
        this.id = id;
        this.salesAmt = salesAmt;
        this.costAmt = costAmt;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getSalesDate() {
        return salesDate;
    }

    public void setSalesDate(Date salesDate) {
        this.salesDate = salesDate;
    }

    public BigDecimal getSalesAmt() {
        return salesAmt;
    }

    public void setSalesAmt(BigDecimal salesAmt) {
        this.salesAmt = salesAmt;
    }

    public BigDecimal getCostAmt() {
        return costAmt;
    }

    public void setCostAmt(BigDecimal costAmt) {
        this.costAmt = costAmt;
    }

    public Store getStore() {
        return store;
    }

    public void setStore(Store store) {
        this.store = store;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MonthlySales)) {
            return false;
        }
        MonthlySales other = (MonthlySales) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.datascape.model.MonthlySales[ id=" + id + " ]";
    }
}


text:
package org.apache.hyracks.api.dataflow.value;

import java.io.Serializable;

@SuppressWarnings("rawtypes")
public final class RecordDescriptor implements Serializable {
    private static final long serialVersionUID = 1L;

    private final ISerializerDeserializer[] fields;
    private final ITypeTraits[] typeTraits;

    // leaving this constructor for backwards-compatibility
    public RecordDescriptor(ISerializerDeserializer[] fields) {
        this.fields = fields;
        this.typeTraits = null;
    }

    // temporarily adding constructor to include type traits
    public RecordDescriptor(ISerializerDeserializer[] fields, ITypeTraits[] typeTraits) {
        this.fields = fields;
        this.typeTraits = typeTraits;
    }

    public int getFieldCount() {
        return fields.length;
    }

    public ISerializerDeserializer[] getFields() {
        return fields;
    }

    public ITypeTraits[] getTypeTraits() {
        return typeTraits;
    }
}


text:
<tool id="EMBOSS: water107" name="water" version="5.0.0">
  <description>Smith-Waterman local alignment</description>
  <command>water -asequence $input1 -bsequence $input2 -outfile $out_file1 -gapopen "$gapopen" -gapextend "$gapextend" -brief $brief -aformat3 $out_format1 -auto</command>
  <inputs>
    <param format="fasta" name="input1" type="data">
      Sequence 1
    </param>
    <param format="fasta" name="input2" type="data">
      Sequence 2
    </param>
    <param name="gapopen" size="6" type="text" value="10.0">
      Gap open penalty
    </param>
    <param name="gapextend" size="6" type="text" value="0.5">
      Gap extension penalty
    </param>
    <param name="brief" type="select">
      Brief identity and similarity
      <option value="yes">Yes</option>
      <option value="no">No</option>
    </param>
    <param name="out_format1" type="select">
      Output Alignment File Format
      <option value="srs">SRS (m)</option>
      <option value="simple">Simple (m)</option>
      <option value="fasta">FASTA (m)</option>
      <option value="msf">MSF (m)</option>
      <option value="pair">Pair (p)</option>
      <option value="markx0">Markx0 (p)</option>
      <option value="markx1">Markx1 (p)</option>
      <option value="markx2">Markx2 (p)</option>
      <option value="markx3">Markx3 (p)</option>
      <option value="markx10">Markx10 (p)</option>
      <option value="srspair">SRS pair (p)</option>
      <option value="score">Score (p)</option>
    </param>
  </inputs>
  <outputs>
    <data format="srs" name="out_file1" />
  </outputs>
  <tests>
    <test>
      <param name="input1" value="2.fasta"/>
      <param name="input2" value="1.fasta"/>
      <param name="gapopen" value="10.0"/>
      <param name="gapextend" value="0.5"/>
      <param name="brief" value="no"/>
      <param name="out_format1" value="score"/>
      <output name="out_file1" file="emboss_water_out.score"/>
    </test>
  </tests>

  <help>

.. class:: warningmark

The input datasets need to be sequences.

-----

    You can view the original documentation here_.

    .. _here: http://emboss.sourceforge.net/apps/release/5.0/emboss/apps/water.html
  </help>
</tool>


text:
package com.microsoft.bingads.v10.adinsight;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for anonymous complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="KeywordIds" type="{http://schemas.microsoft.com/2003/10/Serialization/Arrays}ArrayOflong" minOccurs="0"/>
 *         <element name="TargetPositionForAds" type="{http://schemas.datacontract.org/2004/07/Microsoft.BingAds.Advertiser.AdInsight.Api.DataContract.Entity}TargetAdPosition" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "keywordIds",
    "targetPositionForAds"
})
@XmlRootElement(name = "GetEstimatedBidByKeywordIdsRequest", namespace = "Microsoft.Advertiser.AdInsight.Api.Service")
public class GetEstimatedBidByKeywordIdsRequest {

    @XmlElement(name = "KeywordIds", namespace = "Microsoft.Advertiser.AdInsight.Api.Service", nillable = true)
    protected ArrayOflong keywordIds;
    @XmlElement(name = "TargetPositionForAds", namespace = "Microsoft.Advertiser.AdInsight.Api.Service")
    @XmlSchemaType(name = "string")
    protected TargetAdPosition targetPositionForAds;

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

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

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

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

}


text:
<?php

namespace Sibudec\AdminBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class EditorialType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('name',null,array('label'=>'Nombre'))
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Sibudec\AdminBundle\Entity\Editorial'
        ));
    }

    public function getName()
    {
        return 'sibudec_adminbundle_editorialtype';
    }
}


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

<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>Uses of Class org.apache.solr.common.cloud.ClusterState (Solr 4.10.2 API)</title>
<meta name="date" content="2014-10-26">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.apache.solr.common.cloud.ClusterState

Packages that use ClusterState

Package
Description

org.apache.solr.common.cloud

Common Solr Cloud and ZooKeeper related classes reused on both clients & server.

Uses of ClusterState in org.apache.solr.common.cloud

Fields in org.apache.solr.common.cloud declared as ClusterState

Modifier and Type
Field and Description

protected ClusterState
ZkStateReader.clusterState

Methods in org.apache.solr.common.cloud that return ClusterState

Modifier and Type
Method and Description

ClusterState
ClusterState.copyWith(Map<String,DocCollection> modified)

ClusterState
ZkStateReader.getClusterState()

static ClusterState
ClusterState.load(Integer version,
    byte[] bytes,
    Set<String> liveNodes)

Create ClusterState from json string that is typically stored in zookeeper.

static ClusterState
ClusterState.load(SolrZkClient zkClient,
    Set<String> liveNodes,
    ZkStateReader stateReader)

Create ClusterState by reading the current state from zookeeper.

Overview

Package

Class

Use

Tree

Deprecated

Help

Prev

Next

Frames

No Frames

All Classes

          Copyright © 2000-2014 Apache Software Foundation.  All Rights Reserved.


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="Tyler" >

    <title>Résumé</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/grayscale.css" rel="stylesheet">

    <link rel="stylesheet" href="css/mystyle.css">
    <link rel="stylesheet" href="css/resumestyle.css">
    <link rel="stylesheet" href="css/isostyle.css">
    <link rel="stylesheet" href="css/iso.css">

    <link href="font-awesome-4.2.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">

    <link rel="shortcut icon" href="img/WebsiteLogo.ico.png">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">

                </button>

                    Home

                        Résumé

Résumé

An overview of my knowledge, skills, and experience.

Explore

                Education

                Leadership

                Technical Skills

                Professional Experience

California Polytechnic State University, San Luis Obispo

                  B.S. in Computer Engineering

                  5th Year Undergraduate

                  Graduating June 2016

                  Dean's List 5 Times

                  View School Courses »

Northrop Grumman Collaboration Project (Cal Poly SLO)

                  Computer Vision Technical Lead for Aerial and Underwater Systems

                  Lead Computer Engineer for Underwater Systems

Eagle Scout

                  Active Member of the Boy Scouts of America (BSA) for 8 Years

                  Positions Held: Patrol Leader, Troop Guide, Historian

                  Member of the Order of the Arrow (National Honor Society for BSA)

Music Programs

                  Played Clarinet in Music Ensembles for 13 Years

                  Positions Held: University Marching Band Section Leader, Uniform Manager

                  Received "Section of the Year" Award Under My Leadership

Cal Poly Week of Welcome Orientation Program

                  Participated for 2 Years
                  Positions Held: Event Staff and Group Leader

Programming Languages

                  C, Java, Python, C++, VBA, Ruby, HTML, CSS, JavaScript, Swift, AppleScript

*Always excited to learn new programming concepts and languages*

Relevant Knowledge

                  Artificial Neural Networks

                  Monte Carlo Localization

                  PID Controllers

                  AHRS Algorithms

                  Computer Vision

                  AVR Microcontrollers

Operating Systems

                  Windows ('95 - 10)

                  OS X (Leopard - El Capitan)

                  Linux (Ubuntu, CentOS, Fedora, RedHat)

Development Environments

                  Unix Terminal (VIM), Xcode, Atmel Studio, MATLAB, Visual Studio, Eclipse, Netbeans

Adobe Systems Incorporated

Security Engineering Intern

                  June 2015 - September 2015

                  Contributed to Open Source Security Tools

                  Implemented Security Tools

The Aerospace Corporation

Software Development Intern

                  July 2011 - September 2014

                  Recurring Internship Offer for 4 Years

                  Worked On Over 20 Projects

                  View Work Projects »

Copyright © Tyler Mau 2014


text:
<?php

/*
|--------------------------------------------------------------------------
| Module Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for the module.
| It's a breeze. Simply tell Nova the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

Route::post('contacts',  array('uses' => 'Messages@store'));

// The authentication protected File serving.
Route::get('contacts/{method}/{token}/{filename}', array(
    'middleware' => 'auth',
    'uses'  => 'Attachments@serve',
    'where' => array(
        'method' => '(download|preview)',
    ),
));

// The administration group's wheres.
$wheres = array(
    'id'  => '\d+',
    'cid' => '\d+',
    'gid' => '\d+'
);

// The Adminstration Routes.
Route::group(array('prefix' => 'admin', 'middleware' => 'auth', 'namespace' => 'Admin', 'where' => $wheres), function ()
{
    Route::get( 'contacts',               'Contacts@index');
    Route::get( 'contacts/create',        'Contacts@create');
    Route::post('contacts',               'Contacts@store');
    Route::get( 'contacts/{id}',          'Contacts@show');
    Route::get( 'contacts/{id}/edit',     'Contacts@edit');
    Route::post('contacts/{id}',          'Contacts@update');
    Route::post('contacts/{id}/destroy',  'Contacts@destroy');

    // The Field Groups and their Field Items.
    Route::get( 'contacts/{cid}/field-groups',              'FieldGroups@index');
    Route::post('contacts/{cid}/field-groups',              'FieldGroups@store');
    Route::post('contacts/{cid}/field-groups/{id}/update',  'FieldGroups@update');
    Route::post('contacts/{cid}/field-groups/{id}/destroy', 'FieldGroups@destroy');

    Route::get( 'contacts/field-groups/{gid}/items/create',       'FieldItems@create');
    Route::post('contacts/field-groups/{gid}/items',              'FieldItems@store');
    Route::get( 'contacts/field-groups/{gid}/items/{id}',         'FieldItems@show');
    Route::get( 'contacts/field-groups/{gid}/items/{id}/edit',    'FieldItems@edit');
    Route::post('contacts/field-groups/{gid}/items/{id}',         'FieldItems@update');
    Route::post('contacts/field-groups/{gid}/items/{id}/destroy', 'FieldItems@destroy');

    // The Contact Messages.
    Route::get( 'contacts/{cid}/messages',        'Messages@index');
    Route::get( 'contacts/{cid}/messages/search', 'Messages@search');

    Route::get( 'contacts/{cid}/messages/{id}',   'Messages@show');
    Route::post('contacts/{cid}/messages/{id}',   'Messages@destroy');
});


text:
import {dev} from './log';
import {fromClassForDoc} from './service';
import {isExperimentOn} from './experiments';
import {makeBodyVisible} from './style-installer';
import {viewerPromiseForDoc} from './viewer';

/**
 * @type {boolean}
 */
let deactivated = /nochunking=1/.test(self.location.hash);

/**
 * @const {!Promise}
 */
const resolved = Promise.resolve();

/**
 * Run the given function. For visible documents the function will be
 * called in a micro task (Essentially ASAP). If the document is
 * not visible, tasks will yield to the event loop (to give the browser
 * time to do other things) and may even be further delayed until
 * there is time.
 *
 * @param {!Node|!./service/ampdoc-impl.AmpDoc} nodeOrAmpDoc
 * @param {function()} fn Function that will be called as a "chunk".
 */
export function chunk(nodeOrAmpDoc, fn) {
  if (deactivated) {
    resolved.then(fn);
    return;
  }
  const service = fromClassForDoc(nodeOrAmpDoc, 'chunk', Chunks);
  service.run_(fn);
};

/**
 * Use a standard micro task for every invocation. This should only
 * be called from the AMP bootstrap script if it is known that
 * chunking makes no sense. In particular this is the case when
 * AMP runs in the `amp-shadow` multi document mode.
 */
export function deactivateChunking() {
  deactivated = true;
};

export function activateChunkingForTesting() {
  deactivated = false;
};

/**
 * Runs all currently scheduled chunks.
 * Independent of errors it will unwind the queue. Will afterwards
 * throw the first encountered error.
 * @param {!Node|!./service/ampdoc-impl.AmpDoc} nodeOrAmpDoc
 */
export function runChunksForTesting(nodeOrAmpDoc) {
  const service = fromClassForDoc(nodeOrAmpDoc, 'chunk', Chunks);
  const errors = [];
  while (true) {
    try {
      if (!service.execute_()) {
        break;
      }
    } catch (e) {
      errors.push(e);
    }
  }
  if (errors.length) {
    throw errors[0];
  }
}

class Chunks {
  /**
   * @param {!./service/ampdoc-impl.AmpDoc} ampDoc
   */
  constructor(ampDoc) {
    /** @private @const */
    this.ampDoc_ = ampDoc;
    /** @private @const {!Window} */
    this.win_ = ampDoc.win;
    /** @private @const {!Array<function()>} */
    this.tasks_ = [];
    /** @private {?./service/viewer-impl.Viewer} */
    this.viewer_ = null;
    /** @private @const {function()} */
    this.boundExecute_ = () => this.execute_();
    /** @private @const {boolean} */
    this.active_ = isExperimentOn(this.win_, 'chunked-amp');

    if (!this.active_) {
      return;
    }
    if (!this.win_.requestIdleCallback) {
      this.win_.addEventListener('message', this.boundExecute_);
    }
    viewerPromiseForDoc(ampDoc).then(viewer => {
      this.viewer_ = viewer;
      viewer.onVisibilityChanged(() => {
        if (viewer.isVisible()) {
          this.execute_();
        }
      });
      if (viewer.isVisible()) {
        this.execute_();
      }
    });
  }

  /**
   * Run fn as a "chunk". It'll run in a micro task when the doc is visible
   * and otherwise run it after having yielded to the event queue once.
   * @param {function()} fn
   * @private
   */
  run_(fn) {
    this.tasks_.push(fn);
    this.schedule_();
  }

  /**
   * Run a task.
   * Schedule the next round if there are more tasks.
   * @return {boolean} Whether anything was executed.
   * @private
   */
  execute_() {
    const t = this.tasks_.shift();
    if (!t) {
      return false;
    }
    const before = Date.now();
    try {
      t();
    } catch (e) {
      // We run early in init. All errors should show the doc.
      makeBodyVisible(self.document);
      throw e;
    } finally {
      if (this.tasks_.length) {
        this.schedule_();
      }
      dev().fine('CHUNK', t.displayName || t.name,
          'Duration', Date.now() - before);
    }
    return true;
  }

  /**
   * Schedule running a task.
   * @private
   */
  schedule_() {
    if (!this.active_ || this.isVisible_()) {
      resolved.then(this.boundExecute_);
      return;
    }
    // If requestIdleCallback exists, schedule a task with it, but
    // do not wait longer than one second.
    if (this.win_.requestIdleCallback) {
      this.win_.requestIdleCallback(this.boundExecute_, {
        timeout: 1000,
      });
      return;
    }
    // The message doesn't actually matter.
    this.win_.postMessage/*OK*/('amp-macro-task', '*');
  }

  /**
   * @return {boolean}
   * @private
   */
  isVisible_() {
    // Ask the viewer first.
    if (this.viewer_) {
      return this.viewer_.isVisible();
    }
    // There is no viewer yet. Lets try to guess whether we are visible.
    if (this.win_.document.hidden) {
      return false;
    }
    // Viewers send a URL param if we are not visible.
    return !(/visibilityState=(hidden|prerender)/.test(
        this.win_.location.hash));
  }
}

/**
 * @return {!Promise}
 */
export function resolvedObjectforTesting() {
  return resolved;
}


text:
package com.fu.group10.capstone.apps.teachermobileapp.dao;

/**
 * Created by QuangTV on 7/13/2015.
 */
public class ReportDetailDAO {
    private String equipmentName;
    private String description;
    private String damaged;
    private boolean status;
    private String solution;
    private String resolveTime;

    public ReportDetailDAO(String equipmentName, String description, String damaged, boolean status) {
        this.equipmentName = equipmentName;
        this.description = description;
        this.damaged = damaged;
        this.status = status;
    }

    public String getEquipmentName() {
        return equipmentName;
    }

    public void setEquipmentName(String equipmentName) {
        this.equipmentName = equipmentName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getDamaged() {
        return damaged;
    }

    public void setDamaged(String damaged) {
        this.damaged = damaged;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public String getSolution() {
        return solution;
    }

    public void setSolution(String solution) {
        this.solution = solution;
    }

    public String getResolveTime() {
        return resolveTime;
    }

    public void setResolveTime(String resolveTime) {
        this.resolveTime = resolveTime;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<infinispan
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:infinispan:config:12.1 https://infinispan.org/schemas/infinispan-config-12.1.xsd"
        xmlns="urn:infinispan:config:12.1">
    <cache-container shutdown-hook="REGISTER">
        <transport cluster="ispn-cluster" stack="udp"/>

        <distributed-cache name="bookCache" owners="1">
            <encoding>
                <key media-type="application/x-protostream"/>
                <value media-type="application/x-protostream"/>
            </encoding>
        </distributed-cache>

        <serialization marshaller="org.infinispan.commons.marshall.JavaSerializationMarshaller">
            <allow-list>
                <class>org.littlewings.infinispan.distexec.protostream.entity.SerializableSummary</class>
            </allow-list>
        </serialization>
    </cache-container>
</infinispan>


text:
(function(){

  gs.base.Task = gs.Object.create(gs.Proto,{

    async: {writable: true, value: true},
    baseUrl: {writable: true, value: null},
    config: {writable: true, value: null},
    context: {writable: true, value: null},
    dfd: {writable: true, value: null},
    hasError: {writable: true, value: false},
    provider: {writable: true, value: null},
    request: {writable: true, value: null},
    response: {writable: true, value: null},
    target: {writable: true, value: null},
    uris: {writable: true, value: null},
    val: {writable: true, value: null},
    verbose: {writable: true, value: false},
    writer: {writable: true, value: null},
    writers: {writable: true, value: null},

    newTask: {value: function(options) {
      var task = gs.Object.create(gs.base.Task).mixin({
        response: gs.Object.create(gs.base.Response),
        uris: gs.Object.create(gs.base.Uris),
        val: gs.Object.create(gs.base.Val),
        writer: gs.Object.create(gs.writer.AtomWriter),
      }).mixin(options);
      return task;
    }}

  });

}());


text:
package fr.caladan.slickgraph;

import java.util.List;

import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.paint.Color;

/**
 * Timeseries model to visualize
 */
public class Timeseries {

	/** Name of the timeseries */
	protected SimpleStringProperty nameProperty;
	public SimpleStringProperty nameProperty() {
		return nameProperty;
	}
	public String getName() {
		return nameProperty.get();
	}
	public void setName(String name) {
		nameProperty.set(name);
	}

	/** Color to use for rendering */
	protected SimpleObjectProperty<Color> colorProperty;
	public SimpleObjectProperty<Color> colorProperty() {
		return colorProperty;
	}
	public Color getColor() {
		return colorProperty.get();
	}
	public void setColor(Color color) {
		colorProperty.set(color);
	}

	/** Indicates whether it is selected or not */
	protected SimpleBooleanProperty selectedProperty;
	public SimpleBooleanProperty selectedProperty() {
		return selectedProperty;
	}
	public boolean isSelected() {
		return selectedProperty.get();
	}
	public void setSelected(boolean selected) {
		selectedProperty.set(selected);
	}

	/** List of timestamps that constitutes the timeseries */
	protected ObservableList<Double> data;
	public ObservableList<Double> getData() {
		return data;
	}
	public void setData(List<Double> data) throws Exception {
		if (data == null) {
			this.data.clear();
			return;
		}

		// check if the timeseries is valid: timestamps are strictly growing
		int i = 0;
		boolean isValid = true;
		while (i < data.size() - 1 && isValid) {
			isValid = data.get(i) < data.get(i + 1);
			i++;
		}
		if (!isValid) {
			throw new Exception("Timeseries is not valid: timestamps should be strictly increasing");
		}

		this.data.clear();
		this.data.addAll(data);
	}

	/**
	 * Initializes all the attributes
	 *
	 * @param name Name of the timeseries
	 * @param color Color used for rendering
	 * @param data List of timestamps contained in the timeseries. Must be sorted
	 */
	public Timeseries(String name, Color color, List<Double> data) {
		nameProperty = new SimpleStringProperty(name);
		colorProperty = new SimpleObjectProperty<Color>(color);
		selectedProperty = new SimpleBooleanProperty(false);
		this.data = FXCollections.observableArrayList();
		try {
			setData(data);
		} catch (Exception e) {
			System.err.println(e.getMessage());
		}
	}

	/**
	 * Constructor that initializes the color to black by default
	 *
	 * @param name Name of the timeseries
	 * @param data List of timestamps contained in the timeseries. Must be sorted
	 * @throws Exception If the data is not valid (timestamps should be strictly increasing)
	 */
	public Timeseries(String name, List<Double> data) {
		this(name, Color.BLACK, data);
	}

	/**
	 * Constructor that initializes the timeseries with no data and black color by default
	 *
	 * @param name Name of the timeseries
	 */
	public Timeseries(String name) {
		this(name, Color.BLACK, null);
	}

	/**
	 * Constructor that initializes the timeseries with data only, put an empty name and black color by default
	 *
	 * @param data List of timestamps contained in the timeseries. Must be sorted
	 */
	public Timeseries(List<Double> data) {
		this("", Color.BLACK, data);
	}

	/**
	 * Public default constructor - initializes a timeseries with an empty name, black color and no data
	 */
	public Timeseries() {
		this("", Color.BLACK, null);
	}

}


text:
package com.google.cloud.genomics.spark.examples.rdd

import java.util.{List => JList}

import com.google.cloud.genomics.Client
import com.google.cloud.genomics.utils.OfflineAuth
import com.google.cloud.genomics.utils.ShardBoundary
import com.google.cloud.genomics.utils.ShardUtils
import com.google.cloud.genomics.utils.ShardUtils.SexChromosomeFilter
import com.google.cloud.genomics.utils.grpc.ReadStreamIterator
import com.google.genomics.v1.StreamReadsRequest
import com.google.genomics.v1.{Read => ReadModel}
import com.google.protobuf.ByteString
import com.google.protobuf.ListValue
import com.google.protobuf.Value

import org.apache.spark.Partition
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.TaskContext
import org.apache.spark.rdd.RDD
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._

/**
 * A serializable version of the Read.
 * https://github.com/googlegenomics/spark-examples/issues/84
 */
case class Read(alignedQuality: JList[Integer], cigar: String,
    id: String, mappingQuality: Int, matePosition: Option[Long],
    mateReferenceName: Option[String], fragmentName: String, alignedSequence: String,
    position: Long, readGroupSetId: String, referenceName: String,
    info: Map[String, JList[String]], fragmentLength: Int) extends Serializable

object ReadBuilder {

  val CIGAR_MATCH = Map(
      "ALIGNMENT_MATCH" -> "M",
      "CLIP_HARD" -> "H",
      "CLIP_SOFT" -> "S",
      "DELETE" -> "D",
      "INSERT" -> "I",
      "PAD" -> "P",
      "SEQUENCE_MATCH" -> "=",
      "SEQUENCE_MISMATCH" -> "X",
      "SKIP" -> "N")

  def fromJavaRead(r: ReadModel) = {
    val readKey = ReadKey(r.getAlignment.getPosition.getReferenceName,
        r.getAlignment.getPosition.getPosition)

   val cigar =  r.getAlignment.getCigarList.map(cigarUnit =>
     cigarUnit.getOperationLength() +
     CIGAR_MATCH(cigarUnit.getOperation().name())).mkString("")

    val read = Read(
        r.getAlignedQualityList,
        cigar,
        r.getId,
        r.getAlignment.getMappingQuality,
        Some(r.getNextMatePosition.getPosition),
        Some(r.getNextMatePosition.getReferenceName),
        r.getFragmentName,
        r.getAlignedSequence,
        r.getAlignment.getPosition.getPosition,
        r.getReadGroupSetId,
        r.getAlignment.getPosition.getReferenceName,
        r.getInfo.mapValues(_.getValuesList.map(_.getStringValue()).toList.asJava).toMap,
        r.getFragmentLength)
        (readKey, read)
  }
}

/**
 * A simple Spark RDD backed by Google Genomics Readstore and populated
 * via the StreamReads API call (https://cloud.google.com/genomics/reference/rpc/google.genomics.v1#streamingreadservice).
 */
class ReadsRDD(sc: SparkContext,
               applicationName: String,
               auth: OfflineAuth,
               readGroupSetId: String,
               readsPartitioner: ReadsPartitioner)
               extends RDD[(ReadKey, Read)](sc, Nil) {

  override def getPartitions: Array[Partition] = {
    readsPartitioner.getPartitions(readGroupSetId)
  }

  override def compute(part: Partition, ctx: TaskContext):
    Iterator[(ReadKey, Read)] = {
    val client = Client(auth).genomics
    val partition = part.asInstanceOf[ReadsPartition]
    val request = partition.getReadsRequest
    val responses = ReadStreamIterator.enforceShardBoundary(
        auth, request, ShardBoundary.Requirement.STRICT, null);
    val iterator = responses.flatMap(readResponse => {
      readResponse.getAlignmentsList().map(read => {
          ReadBuilder.fromJavaRead(read)
        })
      })
    // Wrap the iterator to read the number of initialized requests once
    // it is fully traversed.
    new Iterator[(ReadKey, Read)]() {
      def hasNext = {
        val hasNext = iterator.hasNext
        hasNext
      }

      def next = iterator.next
    }
  }
}

/**
 * Defines a search range over a contig.
 */
case class ReadsPartition(
    override val index: Int, serializedRequest: ByteString)
    extends Partition {

  def getReadsRequest = StreamReadsRequest.parseFrom(serializedRequest)

  def range = {
    val request = getReadsRequest
    request.getEnd() - request.getStart()
  }
}

/**
 * Indexes a Read to its partition.
 */
case class ReadKey(contig: String, position: Long)

trait ReadsPartitioner extends Serializable {
  def getPartitions(readGroupSetId: String): Array[Partition]
}

/**
 * Describes partitions for a set of contigs and their ranges.
 */
class AllReferencesReadsPartitioner(numberOfBasesPerShard: Long,
    auth: OfflineAuth) extends ReadsPartitioner {

  // Generates all partitions for all mapped Reads in the contig space.
  def getPartitions(readGroupSetId: String): Array[Partition] = {
    println(s"ReadGroupSetId: ${readGroupSetId}; All refs, exclude XY")
    ShardUtils.getReadRequests(
        readGroupSetId, SexChromosomeFilter.INCLUDE_XY,
        numberOfBasesPerShard, auth).zipWithIndex.map {
      case(request, index) => ReadsPartition(index, request.toByteString())
    }.toArray
  }
}

class ReferencesReadsPartitioner(references: String,
    numberOfBasesPerShard: Long) extends ReadsPartitioner {
  // Generates all partitions for all mapped Reads in the contig space.
  def getPartitions(readGroupSetId: String): Array[Partition] = {
    println(s"ReadGroupSetId: ${readGroupSetId}; Refs: ${references}")
    ShardUtils.getReadRequests(
        List(readGroupSetId), references, numberOfBasesPerShard).zipWithIndex.map {
      case(request, index) => ReadsPartition(index, request.toByteString)
    }.toArray
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
    <project name="build-ant-apps" default="build-ant-apps" xmlns:mvn="antlib:org.apache.maven.artifact.ant">
        <description>
            Builds ANT applications $Rev: 561 $
        </description>

            <!-- Preamble definitions -->
        <dirname property="module.root.folder" file="${ant.file}"/>
        <import file="${module.root.folder}${file.separator}build-base.xml"/>

        <target name="build-ant-runner" depends="ant-apps-base" unless="skip.build.ant.runner" description="Builds ANT runner application">
            <ant dir="${module.root.folder}${file.separator}antrunner" target="build-ant-runner" inheritall="false">
                <propertyset refid="inherited-sub-ant-props"/>
            </ant>
            <property name="skip.build.ant.runner" value="true"/>
        </target>

        <target name="build-ant-apps" depends="build-ant-runner" description="Builds ANT applications"/>

        <target name="clean-ant-apps" depends="ant-apps-base" description="Cleans up ANT applications">
            <ant dir="${module.root.folder}${file.separator}antrunner" target="clean-ant-runner" inheritall="false">
                <propertyset refid="inherited-sub-ant-props"/>
            </ant>
        </target>
    </project>


text:
package org.codehaus.enunciate.samples.genealogy.services;

import com.sun.jersey.multipart.FormDataParam;
import org.codehaus.enunciate.Facet;
import org.codehaus.enunciate.contract.jaxrs.ResourceMethodSignature;
import org.codehaus.enunciate.jaxrs.*;
import org.codehaus.enunciate.samples.genealogy.data.Person;
import org.codehaus.enunciate.samples.genealogy.data.PersonExt;
import org.codehaus.enunciate.samples.genealogy.data.RootElementMapWrapper;
import org.codehaus.enunciate.samples.genealogy.exceptions.EisAccountException;

import javax.activation.DataHandler;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import java.io.InputStream;
import java.util.Collection;

/**
 * The person service is used to access persons in the database.
 *
 * @author Ryan Heaton
 */
@WebService (
  targetNamespace = "http://enunciate.codehaus.org/samples/full"
)
public interface PersonService {

  /**
   * Stores a person in the database.
   *
   * @since Version E
   * @param person The person to store in the database.
   *
<codes>
   *                 <code>This</code>
   *                 <code>is</code>
   *                 </codes>

   * @return The person that was stored (presumably modified for storage).
   * @HTTP 333 if something weird happens.
   */
  @SOAPBinding (
    parameterStyle = SOAPBinding.ParameterStyle.BARE
  )
  @PUT
  @Path ("/pedigree/person")
  @ResponseHeaders (
    @ResponseHeader( name = "Location", description = "The location of the person stored.")
  )
  Person storePerson(Person person);

  @GET
  @Path("/pedigree/personext/{id}")
  @StatusCodes ({
    @ResponseCode ( code = 404, condition = "The person is not found.")
  })
  @Warnings ({
    @ResponseCode ( code = 299, condition = "The reason the person wasn't found.")
  })
  PersonExt readExtPerson(@PathParam("id") String id);

  @GET
  @Path("/pedigree/admin/persons/{id}")
  @StatusCodes ({
    @ResponseCode ( code = 404, condition = "The person is not found.")
  })
  @Warnings ({
    @ResponseCode ( code = 299, condition = "The reason the person wasn't found.")
  })
  @Facet (name = "http://enunciate.codehaus.org/samples/full#admin" )
  PersonExt readPersonAdmin(@PathParam("id") String id);

  /**
   * Reads a set of persons from the database.  Intended as an example of
   * collections as SOAP parameters.
   * @param personIds The ids of the persons to read.
   * @return The persons that were read.
   * @throws ServiceException If the read of one or more of the people failed.
   */
  Collection<Person> readPersons(Collection<String> personIds) throws ServiceException, EisAccountException;

  /**
   * Deletes a person from the database.  Not a one-way method, but still void.
   *
   * @param PErsonId The id of the person.
   * @param message The message about the delete.
   * @throws ServiceException If some problem occurred when deleting the person.
   */
  @DELETE
  @Path("/remover/pedigree/person/{id}")
  void deletePerson(@PathParam ("id") String PErsonId, @HeaderParam("X-Message") String message) throws ServiceException;

  /**
   * Store some generic properties.
   *
   * @param map The map of generic properties.
   * @return The generic properties.
   * @throws ServiceException Upon a problem.
   */
  @PUT
  @Path("/properties/generic")
  RootElementMapWrapper storeGenericProperties(RootElementMapWrapper map) throws ServiceException;

  /**
   * Uploads some files.
   *
   * @param files The files
   * @param length The length(s) of the files.
   * @param somename Another name.
   */
  @WebMethod ( exclude = true )
  @POST
  @Path("/posterdude")
  @ResourceMethodSignature(
    input = Person.class,
    output = Person.class,
    queryParams = { @QueryParam("length"), @QueryParam("somename") }
  )
  void uploadFiles(DataHandler[] files, String length) throws ServiceException;

  @WebMethod (exclude = true)
  @POST
  @Path("/multipart")
  @Consumes( MediaType.MULTIPART_FORM_DATA )
  void postMultipart(@FormDataParam("file1") InputStream file1, @FormDataParam("file2") InputStream file2);
// todo: uncomment when wanting to spend time investigating why jaxb doesn't work with the JAX-WS types the same way it does its own.
//  /**
//   * Reads the family of a given person.  Tests out maps.
//   *
//   * @param personId The id of the person for which to read the family.
//   * @return The persons in the family by relationship type.
//   * @throws ServiceException If some problem occurred.
//   */
//  Map<RelationshipType, Person> readFamily(String personId) throws ServiceException;
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Annls mycol. 14(5): 346 (1916)

#### Original name
Cylindrosporium nesliae Bubák, 1916

### Remarks
null


text:
typedef NS_ENUM(NSInteger, MGOrientation) {
    MGOrientationLeft,
    MGOrientationUp,
    MGOrientationRight,
    MGOrientationDown,
};

@interface MGDetectRectInfo : NSObject

@property (nonatomic, assign) float confidence;

@property (nonatomic, assign) float angle;

@property (nonatomic, assign) MGOrientation orient;

@property (nonatomic, assign) CGRect rect;

@end


text:
//---------------------------------------------------------------------
// <copyright file="PluralizationServiceUtil.cs" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//
// @owner       Microsoft
// @backupOwner Microsoft
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Globalization;

namespace Voodoo.CodeGeneration.Pluralizer
{
    internal static class PluralizationServiceUtil
    {
        internal static bool DoesWordContainSuffix(string word, IEnumerable<string> suffixes, CultureInfo culture)
        {
            return suffixes.Any(s => word.EndsWith(s, true, culture));
        }

        internal static bool TryInflectOnSuffixInWord(string word, IEnumerable<string> suffixes, Func<string, string> operationOnWord, CultureInfo culture, out string newWord)
        {
            newWord = null;

            if (PluralizationServiceUtil.DoesWordContainSuffix(word, suffixes, culture))
            {
                newWord = operationOnWord(word);
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}


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

#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_CREDENTIAL_CONSTANTS_H
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_CREDENTIAL_CONSTANTS_H

#include "google/cloud/storage/version.h"
#include <chrono>

namespace google {
namespace cloud {
namespace storage {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
namespace oauth2 {

/**
 * Supported signing algorithms used in JWT auth flows.
 *
 * We currently only support RSA with SHA-256, but use this enum for
 * readability and easy addition of support for other algorithms.
 */
// NOLINTNEXTLINE(readability-identifier-naming)
enum class JwtSigningAlgorithms { RS256 };

/// The max lifetime in seconds of an access token.
constexpr std::chrono::seconds GoogleOAuthAccessTokenLifetime() {
  return std::chrono::seconds(3600);
}

/**
 * Returns the slack to consider when checking if an access token is expired.
 *
 * This time should be subtracted from a token's expiration time when checking
 * if it is expired. This prevents race conditions where, for example, one might
 * check expiration time one second before the expiration, see that the token is
 * still valid, then attempt to use it two seconds later and receive an
 * error.
 */
constexpr std::chrono::seconds GoogleOAuthAccessTokenExpirationSlack() {
  return std::chrono::seconds(300);
}

/// The endpoint to fetch an OAuth 2.0 access token from.
inline char const* GoogleOAuthRefreshEndpoint() {
  static constexpr char kEndpoint[] = "https://oauth2.googleapis.com/token";
  return kEndpoint;
}

/// String representing the "cloud-platform" OAuth 2.0 scope.
inline char const* GoogleOAuthScopeCloudPlatform() {
  static constexpr char kScope[] =
      "https://www.googleapis.com/auth/cloud-platform";
  return kScope;
}
}  // namespace oauth2
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
}  // namespace storage
}  // namespace cloud
}  // namespace google

#endif  // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_OAUTH2_CREDENTIAL_CONSTANTS_H


text:
using System;
using System.Collections.Generic;
using Zenject;
using NUnit.Framework;
using ModestTree;
using Assert=ModestTree.Assert;

namespace Zenject.Tests.Injection
{
    [TestFixture]
    public class TestStructInjection : ZenjectUnitTestFixture
    {
        struct Test1
        {
        }

        class Test2
        {
            public Test2(Test1 t1)
            {
            }
        }

        [Test]
        public void TestCase1()
        {
            Container.Bind<Test1>().FromInstance(new Test1()).NonLazy();
            Container.Bind<Test2>().AsSingle().NonLazy();

            Container.ResolveDependencyRoots();

            var t2 = Container.Resolve<Test2>();

            Assert.That(t2 != null);
        }
    }
}


text:
package org.apache.ignite.igfs;

import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import org.apache.ignite.IgniteFileSystem;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
import org.apache.ignite.internal.processors.igfs.IgfsImpl;
import org.apache.ignite.internal.util.typedef.CA;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.testframework.GridTestUtils;

/**
 * Tests fragmentizer work.
 */
public class IgfsFragmentizerSelfTest extends IgfsFragmentizerAbstractSelfTest {
    /**
     * @throws Exception If failed.
     */
    public void testReadFragmentizing() throws Exception {
        IgniteFileSystem igfs = grid(0).fileSystem("igfs");

        IgfsPath path = new IgfsPath("/someFile");

        try (IgfsOutputStream out = igfs.create(path, true)) {
            // Write 10 groups.
            for (int i = 0; i < 10 * IGFS_GROUP_SIZE; i++) {
                byte[] data = new byte[IGFS_BLOCK_SIZE];

                Arrays.fill(data, (byte)i);

                out.write(data);
            }
        }

        long start = System.currentTimeMillis();

        do {
            try (IgfsInputStream in = igfs.open(path)) {
                for (int i = 0; i < 10 * IGFS_GROUP_SIZE; i++) {
                    for (int j = 0; j < IGFS_BLOCK_SIZE; j++)
                        assertEquals(i & 0xFF, in.read());
                }

                assertEquals(-1, in.read());
            }
        }
        while (System.currentTimeMillis() - start < 7000);
    }

    /**
     * @throws Exception If failed.
     */
    public void testAppendFragmentizing() throws Exception {
        checkAppendFragmentizing(IGFS_BLOCK_SIZE / 4, false);
    }

    /**
     * @throws Exception If failed.
     */
    public void testAppendFragmentizingAligned() throws Exception {
        checkAppendFragmentizing(IGFS_BLOCK_SIZE, false);
    }

    /**
     * @throws Exception If failed.
     */
    public void testAppendFragmentizingDifferentNodes() throws Exception {
        checkAppendFragmentizing(IGFS_BLOCK_SIZE / 4, true);
    }

    /**
     * @throws Exception If failed.
     */
    public void testAppendFragmentizingAlignedDifferentNodes() throws Exception {
        checkAppendFragmentizing(IGFS_BLOCK_SIZE, true);
    }

    /**
    * @throws Exception If failed.
    */
    private void checkAppendFragmentizing(int chunkSize, boolean rotate) throws Exception {
        IgfsPath path = new IgfsPath("/someFile");

        long written = 0;

        int i = 0;
        int igfsIdx = 0;

        int fileSize = 30 * IGFS_GROUP_SIZE * IGFS_BLOCK_SIZE;

        while (written < fileSize) {
            IgniteFileSystem igfs = grid(igfsIdx).fileSystem("igfs");

            try (IgfsOutputStream out = igfs.append(path, true)) {
                byte[] data = new byte[chunkSize];

                Arrays.fill(data, (byte)i);

                out.write(data);
            }

            System.out.println("Written [start=" + written + ", filler=" + i + ']');

            written += chunkSize;
            i++;

            if (rotate && i % 5 == 0) {
                igfsIdx++;

                if (igfsIdx >= NODE_CNT)
                    igfsIdx = 0;
            }
        }

        IgniteFileSystem igfs = grid(0).fileSystem("igfs");

        try (IgfsInputStream in = igfs.open(path)) {
            i = 0;

            int read = 0;

            byte[] chunk = new byte[chunkSize];

            while (read < fileSize) {
                readFully(in, chunk);

                for (byte b : chunk)
                    assertEquals("For read offset [start=" + read + ", filler=" + (i & 0xFF) + ']',
                        i & 0xFF, b & 0xFF);

                i++;

                read += chunkSize;
            }
        }
    }

    /**
     * @throws Exception If failed.
     */
    public void testFlushFragmentizing() throws Exception {
        checkFlushFragmentizing(IGFS_BLOCK_SIZE / 4);
    }

    /**
     * @throws Exception If failed.
     */
    public void testFlushFragmentizingAligned() throws Exception {
        checkFlushFragmentizing(IGFS_BLOCK_SIZE);
    }

    /**
     * @param chunkSize Chunk size to test.
     * @throws Exception If failed.
     */
    private void checkFlushFragmentizing(int chunkSize) throws Exception {
        IgfsPath path = new IgfsPath("/someFile");

        long written = 0;
        int cnt = 0;

        int fileSize = 50 * IGFS_GROUP_SIZE * IGFS_BLOCK_SIZE;

        IgniteFileSystem igfs = grid(0).fileSystem("igfs");

        byte[] chunk = new byte[chunkSize];

        while (written < fileSize) {
            try (IgfsOutputStream out = igfs.append(path, true)) {
                for (int i = 0; i < 8; i++) {
                    Arrays.fill(chunk, (byte)cnt);

                    out.write(chunk);

                    out.flush();

                    written += chunkSize;

                    cnt++;
                }
            }
        }

        try (IgfsInputStream in = igfs.open(path)) {
            cnt = 0;

            int read = 0;

            while (read < fileSize) {
                readFully(in, chunk);

                for (byte b : chunk)
                    assertEquals("For read offset [start=" + read + ", filler=" + (cnt & 0xFF) + ']',
                        cnt & 0xFF, b & 0xFF);

                cnt++;

                read += chunkSize;
            }
        }
    }

    /**
     * @throws Exception If failed.
     */
    public void testDeleteFragmentizing() throws Exception {
        IgfsImpl igfs = (IgfsImpl)grid(0).fileSystem("igfs");

        for (int i = 0; i < 30; i++) {
            IgfsPath path = new IgfsPath("/someFile" + i);

            try (IgfsOutputStream out = igfs.create(path, true)) {
                for (int j = 0; j < 5 * IGFS_GROUP_SIZE; j++)
                    out.write(new byte[IGFS_BLOCK_SIZE]);
            }

            U.sleep(200);
        }

        igfs.format();

        igfs.awaitDeletesAsync().get();

        GridTestUtils.retryAssert(log, 50, 100, new CA() {
            @Override public void apply() {
                for (int i = 0; i < NODE_CNT; i++) {
                    IgniteEx g = grid(i);

                    GridCacheAdapter<Object, Object> cache = ((IgniteKernal)g).internalCache(DATA_CACHE_NAME);

                    assertTrue("Data cache is not empty [keys=" + cache.keySet() +
                        ", node=" + g.localNode().id() + ']', cache.isEmpty());
                }
            }
        });
    }

    /**
     * @param in Input stream to read from.
     * @param data Byte array to read to.
     * @throws IOException If read failed.
     */
    private static void readFully(InputStream in, byte[] data) throws IOException {
        int read = 0;

        while(read < data.length)
            read += in.read(data, read, data.length - read);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
          jcr:primaryType="sling:OsgiConfig"
          mobile.resourceTypes="[acs-samples/components/structure/page]"/>


text:
package yongbeom.utils.airquickutils.collections;

import android.app.Activity;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebView;

/**
 * AirQuickUtilWebChromeClient
 *
 * Created by leeyongbeom on 2017. 9. 15..
 */

public class AirQuickUtilWebChromeClient extends WebChromeClient {
    private Activity activity;

    public AirQuickUtilWebChromeClient(Activity activity) {
        this.activity = activity;
    }

    @Override
    public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
        AlertDialog alertDialog = new AlertDialog.Builder(activity).setMessage(message).setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {

            @Override
            public void onClick(DialogInterface dialog, int which) {
                result.confirm();
            }
        }).setCancelable(false).create();

        alertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public void onDismiss(DialogInterface dialog) {
                result.cancel();
            }
        });

        if (activity.isFinishing()) {
            result.confirm();
        } else {
            alertDialog.show();
        }

        return true;
    }

    @Override
    public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
        AlertDialog alertDialog = new AlertDialog.Builder(activity).setMessage(message).setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {

            @Override
            public void onClick(DialogInterface dialog, int which) {
                result.confirm();
            }
        }).setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {

            @Override
            public void onClick(DialogInterface dialog, int which) {
                result.cancel();
            }
        }).setCancelable(false).create();

        alertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
            @Override
            public void onDismiss(DialogInterface dialog) {
                result.cancel();
            }
        });

        if (activity.isFinishing()) {
            result.cancel();

        } else {
            alertDialog.show();
        }

        return true;
    }
}


text:
module Azure::DataMigration::Mgmt::V2018_07_15_preview
  module Models
    #
    # Output for command that completes online migration for an Azure SQL
    # Database Managed Instance.
    #
    class MigrateMISyncCompleteCommandOutput

      include MsRestAzure

      # @return [Array<ReportableException>] List of errors that happened
      # during the command execution
      attr_accessor :errors

      #
      # Mapper for MigrateMISyncCompleteCommandOutput class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'MigrateMISyncCompleteCommandOutput',
          type: {
            name: 'Composite',
            class_name: 'MigrateMISyncCompleteCommandOutput',
            model_properties: {
              errors: {
                client_side_validation: true,
                required: false,
                serialized_name: 'errors',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ReportableExceptionElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'ReportableException'
                      }
                  }
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
(function (root, factory) {
  if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module unless amdModuleId is set
    define(["jquery"], function (a0) {
      return (factory(a0));
    });
  } else if (typeof exports === 'object') {
    // Node. Does not work with strict CommonJS, but
    // only CommonJS-like environments that support module.exports,
    // like Node.
    module.exports = factory(require("jquery"));
  } else {
    factory(jQuery);
  }
}(this, function (jQuery) {

(function ($) {
  $.fn.selectpicker.defaults = {
    noneSelectedText: 'Nič izbranega',
    noneResultsText: 'Ni zadetkov za {0}',
    countSelectedText: function (numSelected, numTotal) {
      "Število izbranih: {0}";
    },
    maxOptionsText: function (numAll, numGroup) {
      return [
        'Omejitev dosežena (max. izbranih: {n})',
        'Omejitev skupine dosežena (max. izbranih: {n})'
      ];
    },
    selectAllText: 'Izberi vse',
    deselectAllText: 'Počisti izbor',
    multipleSeparator: ', '
  };
})(jQuery);

}));


text:
class RenameDisplayNameColumn < ActiveRecord::Migration[4.2]
  def up
    rename_column :genes, :display_name, :long_name
  end

  def down
    rename_column :genes, :long_name, :display_name
  end
end


text:
namespace HTTPServer.Server.Contracts
{
    public interface IView
    {
        string View();
    }
}


text:
package org.opencloudb.config;

/**
 * 事务隔离级别定义
 *
 * @author mycat
 */
public interface Isolations {

    public static final int READ_UNCOMMITTED = 1;
    public static final int READ_COMMITTED = 2;
    public static final int REPEATED_READ = 3;
    public static final int SERIALIZABLE = 4;

}


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('core', '0015_game_game_file'),
    ]

    operations = [
        migrations.RenameField(
            model_name='myfile',
            old_name='file',
            new_name='game_file',
        ),
        migrations.AddField(
            model_name='myfile',
            name='name',
            field=models.CharField(default='sss', max_length=100),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='game',
            name='game_file',
            field=models.ManyToManyField(to='core.MyFile', null=True, blank=True),
            preserve_default=True,
        ),
    ]


text:
package com.novartis.pcs.ontology.service.notify;

import com.novartis.pcs.ontology.entity.Curator;

public class DefaultCuratorCriteria implements CuratorCriteria {

	@Override
	public boolean verify(Curator curator) {
		return curator != null && curator.isActive()
				&& curator.getEmailAddress() != null;
	}

}


text:
// Package replicaset contains logic for watching and synchronizing
// ReplicaSets.
package replicaset


text:
xctool-node
===========

Node wrapper around XCTool (experimental)

#What it is

This is a wrapper for adding some convenience around running XCode tests via the command line (with xctool).
It provides:
- A simple console style test runner interface, for just running tests quickly.
- A command-line tool for running tests via a CI system.
- The ability to run suites or tests in series with a simulator reset in between.

#What it is not

This is not meant to be a replacement or complete wrapper in any way around xctool.
While this contains some building blocks, around running xctool via node, it's single purpose right now is to simplify setting up & running specific tests & suites via a CI.
This is not an includeable node module, and is meant to be installed via the `-g` flag only. (`npm install -g xctool-node`)

#How to use it

- `npm install -g node-xctool`
- Add an `.xctool-args` file to your XCode project base directory, with your testing scheme and project pre-filled. For instance:
```json
[
  "-workspace", "WeHeartIt.xcworkspace",
  "-scheme", "Efron CI Test",
  "-configuration", "Debug",
  "-sdk", "iphonesimulator",
  "-arch", "i386"
]
```
Note that if you specify a reporter, it will currently be ignored, as this wrapper relies on the plain reporter.
- run `xctool-node` from the root directory of your project.


text:
package org.apache.tiles.request;

/**
 * Thrown when something related to a request fails.
 *
 * @version $Rev$ $Date$
 */
public class RequestException extends RuntimeException {

    /**
     * Constructor.
     */
    public RequestException() {
    }

    /**
     * Constructor.
     *
     * @param message The message of the exception.
     */
    public RequestException(String message) {
        super(message);
    }

    /**
     * Constructor.
     *
     * @param cause The cause.
     */
    public RequestException(Throwable cause) {
        super(cause);
    }

    /**
     * Constructor.
     *
     * @param message The message of the exception.
     * @param cause The cause.
     */
    public RequestException(String message, Throwable cause) {
        super(message, cause);
    }

}


text:
import sys
import subprocess
import logging
import os
from time import clock
from result import Result

studentLogger = logging.getLogger('errorLogger.progressLogger.studentLogger')
studentLogger.setLevel(logging.INFO)
h = logging.StreamHandler()
h.setLevel(logging.INFO)
studentLogger.addHandler(h)

class Tester(object):
  """
  Tester
  abstract class representing a testing interface
  """
  __name__ = 'Tester' #the name of this class

  INPUT_STDIN = 1 #input is expected to come via standard input
  INPUT_CMDLINE = 2 #input is expected to comve via the command line
  OUTPUT_STDOUT = 3 #output of executable will be to the standard output
  OUTPUT_FILE = 4  #exectuables output will be a file

  _PROGRAM_COMPLETED = 5 #the program completed the test
  _PROGRAM_CRASHED = 6 #the program crashed during a test
  _PROGRAM_TIMED_OUT = 7 #the program timed out during a test

  def str2InputType(typename):
    """converts the string name of the input type to the internal type
    @typename: the name of the type. either
      stdin
      cmdline
    """
    if(typename.lower() == 'stdin'):
      return Tester.INPUT_STDIN
    elif(typename.lower() == 'cmdline'):
      return Tester.INPUT_CMDLINE
    else:
      raise ValueError('Unknown input type ' + typename)

  def str2OutputType(typename):
    """converts the string name of the output type to the internal type
    @typename: the name of the type. either
      stdout
      file
    """
    if(typename.lower() == 'stdout'):
      return Tester.OUTPUT_STDOUT
    elif(typename.lower() == 'file'):
      return Tester.OUTPUT_FILE
    else:
      raise ValueError('Unknown input type ' + typename)

  def __init__(self, executable,
               usingCmdArgs, usingStdin, outputType,
               inDir, solDir, scratchDir,
               maxRunTime = 5, cmdArgs = None, lines2skip = 0):
    """
    @executable: the name of the exectuable to be run
    @usingCmdArgs: Are command line arguments being used?
    @usingStdin: Will there be input from the standard input?
    @outputType: how are outputs generated: Either
      OUTPUT_STDOUT: for when the solution is sent to standard out or
      OUTPUT_FILE: for when the solution is sent to a file
    @inDir: the name of the directory containing the inputs to be used for testing
      the naming convention for the tests contained within is testname-test.filetype
    @solDir: the name of the directory containing the solutions
      the naming convention for the solutions contained within is testname-sol.filetype
    @scratchDir: directory to write scratch files in
    @maxRunTime: the maximum number of seconds to run the program or
      None to allow the program to run until completion (if it does not terminate the program will hang)
    @cmdArgs: a list of additional command line arguments to the executable
    @lines2skip: number of lines of output program and solution file to skip
    """
    self.executable = executable
    self.usingCmdArgs = usingCmdArgs
    self.usingStdin = usingStdin
    self.outputType = outputType
    self.inDir = inDir
    self.solDir = solDir
    self.scratchDir = scratchDir
    self.maxRunTime = maxRunTime
    self.lines2skip = lines2skip
    if cmdArgs == None:
      self.cmdArgs = []
    else:
      self.cmdArgs = cmdArgs.copy()

    self.testFiles = [self.inDir + os.sep +
                      test for test in os.listdir(inDir) if not test.startswith('.')] #get the tests in the test directory
    self.testFiles.sort() #make the tests sorted

    if(scratchDir == None):
      self.userOut = None
    else:
      self.userOut = scratchDir + os.sep + 'userOut.txt' #file to temporarily store the use's output

    self.startTime = 0 #when did the test begin running
    self.endTime = 0   #when did the test end running

    self.results = [] #the results of the testing

  def _runOne(self, inFileName, outFileName = None):
    """run self.executable using the inputs contained in inFileName
       @inFileName: the name of the file containing the inputs
       @outFileName: the name of the file to write the program's stdout to if the solution is contained in the stdout
       @returns: the success status of running the program
       """
    #determine how to pass input file
    infile = None #the input file to be used
    additionalArgs = []
    with open(inFileName) as infile:
      if(self.usingCmdArgs): #using command line arguments
        num_args = int(infile.readline()) #the first line contains the number of command line arguments
        for i in range(num_args): #read the command arguments in
          additionalArgs.append(infile.readline().strip())
      #remaining lines in the file are considerd input to be given
      #via standard input

      #determine how outputs will be generated
      outfile = None
      if(self.outputType == Tester.OUTPUT_STDOUT): #outputting to stdout
        outfile = open(outFileName,'w') #open a file to hold the results
      elif(self.outputType == Tester.OUTPUT_FILE): #outputting to a file
        raise NotImplementedError #nothing we can really do as of now
      else:
        raise NotImplementedError

      #this clears out python's buffer so that the program run through subprocess
      #actually gets input. Another fix if this stops working is to open the file in unbuffered mode
      #http://stackoverflow.com/questions/22417010/subprocess-popen-stdin-read-file
      infile.seek(infile.tell())

      studentLogger.info('Preparing to test %s on %s', self.executable, os.path.basename(inFileName))

      #start the clocks
      self.endTime = clock()
      self.startTime = clock()

      #run the program
      with subprocess.Popen([self.executable] + self.cmdArgs + additionalArgs,
                            stdin = infile,
                            stdout = outfile,
                            stderr = subprocess.PIPE,
                            universal_newlines = True) as program:
        try:
          program.wait(timeout = self.maxRunTime) #wait for the program to finish
          self.endTime = clock() #program completed
          err = '\t'.join(program.stderr.readlines()) #always have to read the pipes
          if(program.returncode != 0):
            studentLogger.warning('%s %s crashed for the following reasons:\n\t%s\n',
                                  self.executable, ' '.join(self.cmdArgs), err)
            return Tester._PROGRAM_CRASHED
          else:
            return Tester._PROGRAM_COMPLETED

        except subprocess.TimeoutExpired:
          studentLogger.warning('%s %s timed out', ' '.join(self.cmdArgs), self.executable)
          program.kill()
          return Tester._PROGRAM_TIMED_OUT

  #end _runOne

  def testOne(self, inFile, solFile):
    """
    run the executable using inFile as the inputs
    and checking the output against solFile
    @inFile: the name of the file containing the inputs
    @solFile: the name of the file containg the solution
    @returns: a Result
    """
    progStatus = self._runOne(inFile, self.userOut)#run the program
    testName = os.path.basename(inFile) #the name of the test
    if(progStatus == Tester._PROGRAM_CRASHED):
      return Result(testName, False, 'Crashed')
    elif(progStatus == Tester._PROGRAM_TIMED_OUT):
      return Result(testName, False, 'Timed Out')
    else: #program completed successfully
      if(self.outputType == Tester.OUTPUT_STDOUT):
        with open(self.userOut) as answer:
          (correct, out, sol) = self._checkSolution(answer, solFile)
          if(correct):
            studentLogger.info('%s %s passed test %s',
                             self.executable, ' '.join(self.cmdArgs),
                             os.path.basename(inFile))
          else:
            first_diff = ''
            i = 0
            for (i,(o,s)) in enumerate(zip(out,sol)):
              if o != s:
                first_diff = 'First mismatch at word %d\nout = %s but sol = %s' % (i,o,s)
                #print(first_diff)
                break
            studentLogger.info('%s %s failed test %s. Program output: %s \n Solution: %s \n%s\n\n',
                             self.executable, ' '.join(self.cmdArgs),
                             os.path.basename(inFile), out, sol, first_diff)
          return Result(testName, correct, self.endTime - self.startTime )
      else: #haven't done anything where solutions are contained in files
        raise NotImplementedError
  #end testOne

  def generateSolutions(self):
    """generates all the solutions"""
    for test in self.testFiles:
      outfileName = test.replace('-test', '-sol')
      outfileName = self.solDir + os.sep + os.path.basename(outfileName)
      self._runOne(test,outfileName)
  #end generateSolutions

  def testAll(self):
    """
    Test all the tests
    @returns: a list of triples of the form (testName, correct, time taken)
    correct is True if the answer is correct and False if it is wrong
    time taken is expressed in seconds.

    See Result
    """

    self.results = [] #clear old results if any exist
    for test in self.testFiles:
      #get the name of the file containing the solution to this test
      sol = test.replace('-test', '-sol') #replace test with sol
      sol = self.solDir + os.sep + os.path.basename(sol) #prepend solution directory name and remove test directory path
      self.results.append(self.testOne(test, sol))
    try:
      os.remove(self.userOut)
    except FileNotFoundError:
      pass
  #end testAll

  def getResults(self):
    """get the results of the testing"""
    return self.results.copy()
  #end getResults

  def getNumTests(self):
    """get the number of tests that are to be preformed"""
    return len(self.testFiles)
  #end getNumTests

  def getNumCorrect(self):
    """
    get the number of answers that were correct
    should only be called after testAll is run
    @returns: the number of tests that were correct
    """
    numCorrect = 0
    for res in self.results:
      if(res.correct == True):
        numCorrect += 1
    return numCorrect
  #end getNumCorrect

  def getPercentCorrect(self):
    """get the precentage of right answers
    should only be called after testAll is run
    @returns: the percentage of tests that were correct
    """
    numCorrect = self.getNumCorrect()
    numTests = float(self.getNumTests())
    return numCorrect / numTests
  #end getPercentCorrect

  def getMissedTests(self):
    """
    get a list of the test names that were missed
    should only be called after testAll is run
    @returns: a list of the test names that were missed
    """
    return [res.testName for res in self.results if not res.correct]
  #end getMissedTests

  def getPassedTests(self):
    """
    get a list of the test names that were passed correctly
    should only be called after testAll is run
    @returns: a list of the test names that were passed correctly
    """
    return [res.testName for res in self.results if res.correct]
  #getPassedTests

  def getTestNames(self):
    """
    get the names of the tests to be run
    can be called before testAll is run
    @returns: a list containg the test names
    """
    return [test.rsplit(os.sep, 1)[-1] for test in self.testFiles]

  def _checkSolution(self, progOut, solutionFileName):
    """
    checkSolution
    @progOut: the opened file containing the student's answer
    @solutionFileName: the name of the file containg the solution
    @returns a tuple containing
    (correct, program out, solution)
    """

    progOut.flush() #make sure the file is up to date
    progOut.seek(0) #go back to the begining of the file

    try:
      sol = []
      with open(solutionFileName, 'r') as solFil: #open the solution file
        for (_1,_2,_3) in zip(range(self.lines2skip), progOut, solFil): #somehow placin zip as the first argument fixes a bug
          pass #skip the leading lines of input

        sol = [] #the solution
        for line in solFil: #make it so that white space does not matter
          sol += line.strip().split()

        out = [] # the programs output
        for line in progOut: #make it so that white space will not be an issue
          out += line.strip().split()

        if(out != sol):#output does not match solution
          return (False, out, sol)

      return (True, out, sol) #if everything is correct and all lines in the solution file are used the student got it right
    except UnicodeDecodeError:
      return (False, 'NonUnicode Character. This means your print statement is printing something crazy.', sol)
  # end _checkSolution

#end class Tester

if __name__ =='__main__':
  python = sys.executable
  t = Tester('gdb', False, True, Tester.OUTPUT_STDOUT,
              'Tests', 'Solutions', '.', cmdArgs = ['-q', 'divAssembly.out'], lines2skip = 11)
  t.testAll()
  for res in t.getResults():
    print(res)


text:
namespace Envoy {
namespace Extensions {
namespace NetworkFilters {
namespace MySQLProxy {

DecodeStatus ClientSwitchResponse::parseMessage(Buffer::Instance& buffer, uint32_t remain_len) {
  if (BufferHelper::readVectorBySize(buffer, remain_len, auth_plugin_resp_) !=
      DecodeStatus::Success) {
    ENVOY_LOG(debug, "error when parsing auth plugin data of client switch response");
    return DecodeStatus::Failure;
  }
  return DecodeStatus::Success;
}

void ClientSwitchResponse::encode(Buffer::Instance& out) const {
  BufferHelper::addVector(out, auth_plugin_resp_);
}

} // namespace MySQLProxy
} // namespace NetworkFilters
} // namespace Extensions
} // namespace Envoy