text:
using UnityEngine;
using System.Collections;

public class MenuCreditsBtn : MonoBehaviour {

	public Color defaultColor;

	void OnMouseEnter() {
		guiText.color = Color.red;
	}

	void OnMouseExit() {
		guiText.color = defaultColor;
	}

	void OnMouseUp() {
		Application.LoadLevel(3);
	}
}


text:
using System.Collections.Generic;

namespace MultiWindowExample.Models
{

    public class BingImageResult
    {
        public string _type { get; set; }
        public Instrumentation instrumentation { get; set; }
        public string webSearchUrl { get; set; }
        public int totalEstimatedMatches { get; set; }

        public IEnumerable<Image> value { get; set; }
        public object queryExpansions { get; set; }
        public int nextOffsetAddCount { get; set; }
        public object pivotSuggestions { get; set; }
        public bool displayShoppingSourcesBadges { get; set; }
        public bool displayRecipeSourcesBadges { get; set; }
        public object similarTerms { get; set; }
    }

    public class Instrumentation
    {
        public string pageLoadPingUrl { get; set; }
    }

    public class Image
    {
        public string name { get; set; }
        public object datePublished { get; set; }
        public object homePageUrl { get; set; }
        public string contentSize { get; set; }
        public string hostPageDisplayUrl { get; set; }
        public int width { get; set; }
        public int height { get; set; }
        public Thumbnail thumbnail { get; set; }
        public string imageInsightsToken { get; set; }
        public object insightsSourcesSummary { get; set; }
        public string imageId { get; set; }
        public string accentColor { get; set; }
        public string webSearchUrl { get; set; }
        public string thumbnailUrl { get; set; }
        public string encodingFormat { get; set; }
        public string contentUrl { get; set; }
    }

    public class Thumbnail
    {
        public int width { get; set; }
        public int height { get; set; }
    }

}

redpajama_set_name: RedPajamaGithub


text:
This pull request...

### How should this be reviewed?

...

### Any background context you want to provide?

...

### Relevant tickets

References [Pivotal #]().

### Checklist

- [ ] This PR has been added to the relevant Pivotal card.
- [ ] Documentation added for new features/changed endpoints.
- [ ] Added appropriate feature/unit tests.
- [ ] If new attributes were added to users, these changes are also surfaced in the admin interface for user profiles.
- [ ] If new attributes were added to users, then the data team already knows about these changes.


text:
import Base.norm, Base.vecnorm
export norm_inf, norm, norm_1, vecnorm

norm_inf(x::AbstractExpr) = maximum(abs(x))
norm_1(x::AbstractExpr) = sum(abs(x))
norm_fro(x::AbstractExpr) = norm_2(vec(x))

function norm(x::AbstractExpr, p=2)
  if p == 1
    return norm_1(x)
  elseif p == 2
    return norm_2(x)
  elseif p == Inf
    return norm_inf(x)
  elseif p == :fro
    return norm_2(vec(x))
  else
    error("Norm $p not defined")
  end
end

function vecnorm(x::AbstractExpr, p=2)
  vec_x = vec(x)
  return norm(vec_x, p)
end


text:
public class Test {

  static void someMethod(double val) {

  }

  public static void main(String[] args) {
    someMethod(-1.111);
  }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Beitr. Kryptfl. Schweiz 5(4): 251 (1923)

#### Original name
Peronospora rhaetica Gäum.

### Remarks
null


text:
class UpdatePhoneNumberLength < ActiveRecord::Migration
  def up
    change_column :users, :phone_number, :string, length: 12
  end

  def down
    change_column :users, :phone_number, :string, length: 10
  end
end


text:
package com.mindoo.domino.jna.constants;

/**
 * Specifies compression algorithm used when attaching file to a note.
 *
 * @author Karsten Lehmann
 */
public enum Compression {

	/** no compression */
	NONE(0),
	/** huffman encoding for compression  */
	HUFF(1),
	/** LZ1 compression */
	LZ1(2),
	/** Huffman compression even if server supports LZ1 */
	RECOMPRESS_HUFF(3);

	private int m_val;

	Compression(int val) {
		m_val = val;
	}

	public int getValue() {
		return m_val;
	}

}


text:
Examples of how to use the [iDimensionz SendGrid web API V3 PHP client](https://github.com/idimensionz/sendgrid-webapi-v3-php)

**NOTE: you will need your SendGrid API key to use the iDimensionz SendGrid Web API and run these examples.**

##Plain Old PHP Object (POPO) Examples

The app/popo directory contains examples of using the iDimensionz SendGrid V3 API from "Plain Old PHP Objects" (popo).  To run the examples, go to the app/popo directory and type:

    php user-account.php your-SendGrid-api-key-here
OR

    php user-profile.php your-SendGrid-api-key-here
*Notice that you'll need to supply your SendGrid API key as an argument.*


text:
package com.intel.ssg.dcst.panthera.parse.sql.generator.text;

import java.util.LinkedList;
import java.util.List;

import org.antlr.runtime.tree.CommonTree;

import com.intel.ssg.dcst.panthera.parse.sql.SqlXlateException;
import com.intel.ssg.dcst.panthera.parse.sql.TranslateContext;

import br.com.porcelli.parser.plsql.PantheraParser_PLSQLParser;

/**
 * left child and then write down root and then right child.<br>
 * EasyBiOpTextGenerator.
 *
 */
public class EasyBiOpTextGenerator extends BaseTextGenerator {

  @Override
  protected String textGenerate(CommonTree root, TranslateContext context) throws Exception {
    if (root.getChildCount() == 2) {
      CommonTree op1 = (CommonTree) root.getChild(0);
      QueryTextGenerator qr1 = TextGeneratorFactory.getTextGenerator(op1);

      CommonTree op2 = (CommonTree) root.getChild(1);
      QueryTextGenerator qr2 = TextGeneratorFactory.getTextGenerator(op2);
      return qr1.textGenerateQuery(op1, context) + " " + root.getText() +
          " " + qr2.textGenerateQuery(op2, context) ;
    } else {
      if(root.getChildCount() < 3) {
        throw new SqlXlateException(root, "Calculation expression not supported.");
      }
      List<Integer> positions = new LinkedList<Integer>();
      for (int i = 0; i < root.getChildCount(); i++) {
        if(root.getChild(i).getType() == PantheraParser_PLSQLParser.SQL92_RESERVED_DATE) {
          positions.add(i);
        }
      }
      if(positions.size() > 2 || positions.size() == 0) {
        throw new SqlXlateException(root, "Calculation expression not supported.");
      } else if (positions.size() == 2 || positions.get(0) == 0) {
        //two date item, or one date item as left operand, left operand is always size 2
        return textGenerateChildRange(root, context, 0, 2) + " " +
            root.getText() + " " + textGenerateChildRange(root, context, 2, root.getChildCount());
      } else {
        //one date item and at right operand
        return textGenerateChildRange(root, context, 0, positions.get(0)) + " " +
            root.getText() + " " + textGenerateChildRange(root, context, positions.get(0), root.getChildCount());
      }
    }
  }

}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.artifactregistry.v1beta2.model;

/**
 * The response message from importing APT artifacts.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Artifact Registry API. For a detailed explanation
 * see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class ImportAptArtifactsResponse extends com.google.api.client.json.GenericJson {

  /**
   * The Apt artifacts imported.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<AptArtifact> aptArtifacts;

  static {
    // hack to force ProGuard to consider AptArtifact used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(AptArtifact.class);
  }

  /**
   * Detailed error info for packages that were not imported.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<ImportAptArtifactsErrorInfo> errors;

  static {
    // hack to force ProGuard to consider ImportAptArtifactsErrorInfo used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(ImportAptArtifactsErrorInfo.class);
  }

  /**
   * The Apt artifacts imported.
   * @return value or {@code null} for none
   */
  public java.util.List<AptArtifact> getAptArtifacts() {
    return aptArtifacts;
  }

  /**
   * The Apt artifacts imported.
   * @param aptArtifacts aptArtifacts or {@code null} for none
   */
  public ImportAptArtifactsResponse setAptArtifacts(java.util.List<AptArtifact> aptArtifacts) {
    this.aptArtifacts = aptArtifacts;
    return this;
  }

  /**
   * Detailed error info for packages that were not imported.
   * @return value or {@code null} for none
   */
  public java.util.List<ImportAptArtifactsErrorInfo> getErrors() {
    return errors;
  }

  /**
   * Detailed error info for packages that were not imported.
   * @param errors errors or {@code null} for none
   */
  public ImportAptArtifactsResponse setErrors(java.util.List<ImportAptArtifactsErrorInfo> errors) {
    this.errors = errors;
    return this;
  }

  @Override
  public ImportAptArtifactsResponse set(String fieldName, Object value) {
    return (ImportAptArtifactsResponse) super.set(fieldName, value);
  }

  @Override
  public ImportAptArtifactsResponse clone() {
    return (ImportAptArtifactsResponse) super.clone();
  }

}


text:
<?php

/**
 * @file
 * Contains \Drupal\Core\Field\Plugin\Field\FieldType\NumericItemBase.
 */

namespace Drupal\Core\Field\Plugin\Field\FieldType;

use Drupal\Core\Field\FieldItemBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Base class for numeric configurable field types.
 */
abstract class NumericItemBase extends FieldItemBase {

  /**
   * {@inheritdoc}
   */
  public static function defaultFieldSettings() {
    return array(
      'min' => '',
      'max' => '',
      'prefix' => '',
      'suffix' => '',
    ) + parent::defaultFieldSettings();
  }

  /**
   * {@inheritdoc}
   */
  public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
    $element = array();
    $settings = $this->getSettings();

    $element['min'] = array(
      '#type' => 'number',
      '#title' => t('Minimum'),
      '#default_value' => $settings['min'],
      '#description' => t('The minimum value that should be allowed in this field. Leave blank for no minimum.'),
    );
    $element['max'] = array(
      '#type' => 'number',
      '#title' => t('Maximum'),
      '#default_value' => $settings['max'],
      '#description' => t('The maximum value that should be allowed in this field. Leave blank for no maximum.'),
    );
    $element['prefix'] = array(
      '#type' => 'textfield',
      '#title' => t('Prefix'),
      '#default_value' => $settings['prefix'],
      '#size' => 60,
      '#description' => t("Define a string that should be prefixed to the value, like '$ ' or '€ '. Leave blank for none. Separate singular and plural values with a pipe ('pound|pounds')."),
    );
    $element['suffix'] = array(
      '#type' => 'textfield',
      '#title' => t('Suffix'),
      '#default_value' => $settings['suffix'],
      '#size' => 60,
      '#description' => t("Define a string that should be suffixed to the value, like ' m', ' kb/s'. Leave blank for none. Separate singular and plural values with a pipe ('pound|pounds')."),
    );

    return $element;
  }

  /**
   * {@inheritdoc}
   */
  public function isEmpty() {
    if (empty($this->value) && (string) $this->value !== '0') {
      return TRUE;
    }
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function getConstraints() {
    $constraint_manager = \Drupal::typedDataManager()->getValidationConstraintManager();
    $constraints = parent::getConstraints();

    $settings = $this->getSettings();
    $label = $this->getFieldDefinition()->getLabel();

    if (!empty($settings['min'])) {
      $min = $settings['min'];
      $constraints[] = $constraint_manager->create('ComplexData', array(
        'value' => array(
          'Range' => array(
            'min' => $min,
            'minMessage' => t('%name: the value may be no less than %min.', array('%name' => $label, '%min' => $min)),
          )
        ),
      ));
    }

    if (!empty($settings['max'])) {
      $max = $settings['max'];
      $constraints[] = $constraint_manager->create('ComplexData', array(
        'value' => array(
          'Range' => array(
            'max' => $max,
            'maxMessage' => t('%name: the value may be no greater than %max.', array('%name' => $label, '%max' => $max)),
          )
        ),
      ));
    }

    return $constraints;
  }

  /**
   * Helper method to truncate a decimal number to a given number of decimals.
   *
   * @param float $decimal
   *   Decimal number to truncate.
   * @param int $num
   *   Number of digits the output will have.
   *
   * @return float
   *   Decimal number truncated.
   */
  protected static function truncateDecimal($decimal, $num) {
    return floor($decimal * pow(10, $num)) / pow(10, $num);
  }

}


text:
#import <Foundation/Foundation.h>
#import <MAMapKit/MAOverlay.h>

@interface MAMutablePolyline : NSObject<MAOverlay>

/* save MAMapPoints by NSValue */
@property (nonatomic, strong) NSMutableArray *pointArray;

- (instancetype)initWithPoints:(NSArray *)nsvaluePoints;

- (MAMapRect)showRect;

- (MAMapPoint)mapPointForPointAt:(NSUInteger)index;

- (void)updatePoints:(NSArray *)points;

- (void)appendPoint:(MAMapPoint)point;

@end


text:
require 'vk/api/methods'

module Vk
  module API
    class Messages < Vk::Schema::Namespace
      module Methods
        # Returns a user's current status and date of last activity.
        class GetLastActivity < Schema::Method
          # @!group Properties

          self.open = false
          self.method = 'messages.getLastActivity'

          # @method initialize(arguments)
          #   @param [Hash] arguments
          #   @option arguments [Integer] :user_id User ID.
          #   @return [Messages::Methods::GetLastActivity]

          # @!group Arguments

          # @return [Integer] User ID.
          attribute :user_id, API::Types::Coercible::Int
        end
      end
    end
  end
end


text:
package org.caiiiyua.unifiedapp.ui;

import android.app.Fragment;

/**
 * Interface that permits elements to display a Fragment.
 */
public interface FragmentLauncher {
    /**
     * Launches the specified {@link Fragment}
     *
     * @param selectPosition The position of the list item to select, or -1
     */
    void launchFragment(Fragment fragment, int selectPosition);
}


text: DELETE FROM Emoji_Keyword


text:
<?php

// This file contains functions specifically related to address labels

function FontSelect($fieldname)
{
    $sFPDF_PATH = 'vendor/setasign/fpdf';

    $d = scandir($sFPDF_PATH.'/font/', SCANDIR_SORT_DESCENDING);
    $fontnames = [];
    $family = ' ';
    foreach ($d as $entry) {
        $len = strlen($entry);
        if ($len > 3) {
            if (strtoupper(mb_substr($entry, $len - 3)) == 'PHP') { // php files only
        $filename = mb_substr($entry, 0, $len - 4);
                if (mb_substr($filename, 0, strlen($family)) != $family) {
                    $family = $filename;
                }
                $fontnames[] = FilenameToFontname($filename, $family);
            }
        }
    }

    sort($fontnames);

    echo '
';
    echo ''.gettext('Font').':	';
    echo '';
    echo "<select name=\"$fieldname\">";
    foreach ($fontnames as $n) {
        $sel = '';
        if (array_key_exists($fieldname, $_COOKIE) && $_COOKIE[$fieldname] == $n) {
            $sel = ' selected';
        }
        echo '<option value="'.$n.'"'.$sel.'>'.gettext("$n").'</option>';
    }
    echo '</select>';
    echo '	';
    echo '
';
}

function FontSizeSelect($fieldname)
{
    $sizes = ['default', 6, 7, 8, 9, 10, 11, 12, 14, 16, 18];
    echo '
';
    echo ' '.gettext('Font Size').':	';
    echo '';
    echo "<select name=\"$fieldname\">";
    foreach ($sizes as $s) {
        $sel = '';
        if (array_key_exists($fieldname, $_COOKIE) && $_COOKIE[$fieldname] == $s) {
            $sel = ' selected';
        }
        echo '<option value="'.$s.'"'.$sel.'>'.gettext("$s").'</option>';
    }
    echo '</select>';
    echo '	';
    echo '
';
}

function LabelSelect($fieldname)
{
    $labels = ['Tractor', '5160', '5161', '5162', '5163', '5164', '8600', 'L7163'];
    echo '
';
    echo ''.gettext('Label Type').':	';
    echo '';
    echo "<select name=\"$fieldname\">";
    foreach ($labels as $l) {
        $sel = '';
        if (array_key_exists($fieldname, $_COOKIE) && $_COOKIE[$fieldname] == $l) {
            $sel = ' selected';
        }
        echo '<option value="'.$l.'"'.$sel.'>'.gettext("$l").'</option>';
    }
    echo '</select>';
    echo '	';
    echo '
';
}

function LabelGroupSelect($fieldname)
{
    echo '
'.gettext('Label Grouping').'	';
    echo '';
    echo "<input name=\"$fieldname\" type=\"radio\" value=\"indiv\" ";

    if (array_key_exists($fieldname, $_COOKIE) && $_COOKIE[$fieldname] != 'fam') {
        echo 'checked';
    }

    echo '>'.gettext('All Individuals').'
';
    echo "<input name=\"$fieldname\" type=\"radio\" value=\"fam\" ";

    if (array_key_exists($fieldname, $_COOKIE) && $_COOKIE[$fieldname] == 'fam') {
        echo 'checked';
    }

    echo '>'.gettext('Grouped by Family').'

';
}

function ToParentsOfCheckBox($fieldname)
{
    echo '
'.gettext('To the parents of').':	';
    echo '';
    echo "<input name=\"$fieldname\" type=\"checkbox\" ";
    echo 'id="ToParent" value="1" ';

    if (array_key_exists($fieldname, $_COOKIE) && $_COOKIE[$fieldname]) {
        echo 'checked';
    }

    echo '>

';
}

function StartRowStartColumn()
{
    echo '

	'.gettext('Start Row').':

	<input type="text" name="startrow" id="startrow" maxlength="2" size="3" value="1">

	'.gettext('Start Column').':

	<input type="text" name="startcol" id="startcol" maxlength="2" size="3" value="1">

';
}

function IgnoreIncompleteAddresses()
{
    echo '

	'.gettext('Ignore Incomplete
Addresses').':

	<input type="checkbox" name="onlyfull" id="onlyfull" value="1" checked>

';
}

function LabelFileType()
{
    echo '

		'.gettext('File Type').':

			<select name="filetype">
				<option value="PDF">PDF</option>
				<option value="CSV">CSV</option>
			</select>

';
}


text:
import * as React from 'react';
import { createMount, describeConformanceV5, createClientRender } from 'test/utils';
import DialogTitle, { dialogTitleClasses as classes } from '@material-ui/core/DialogTitle';

describe('<DialogTitle />', () => {
  const render = createClientRender();
  const mount = createMount();

  describeConformanceV5(<DialogTitle>foo</DialogTitle>, () => ({
    classes,
    inheritComponent: 'div',
    render,
    mount,
    muiName: 'MuiDialogTitle',
    refInstanceof: window.HTMLDivElement,
    testVariantProps: { disableTypography: true },
    skip: ['componentProp', 'componentsProp'],
  }));

  it('should render JSX children', () => {
    const children = <span data-testid="test-children" />;
    const { getByTestId } = render(<DialogTitle disableTypography>{children}</DialogTitle>);

    getByTestId('test-children');
  });

  it('should render string children as given string', () => {
    const children = 'Hello';
    const { getByText } = render(<DialogTitle>{children}</DialogTitle>);

    getByText('Hello');
  });
});


text:
// Copyright © 2010 onwards, Andrew Whewell
// All rights reserved.
//
// Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
//    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
//    * Neither the name of the author nor the names of the program's contributors may be used to endorse or promote products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OF THE SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.Serialization.Json;
using System.Text;
using System.Web;
using VirtualRadar.Interface;
using VirtualRadar.Interface.BaseStation;
using VirtualRadar.Interface.StandingData;
using VirtualRadar.Interface.WebServer;
using VirtualRadar.Interface.WebSite;

namespace VirtualRadar.WebSite
{
    /// <summary>
    /// Responds to requests for aircraft lists in JSON file result.
    /// </summary>
    class AircraftListJsonPage : Page
    {
        /// <summary>
        /// The object that will do the work of producing JSON files from aircraft lists.
        /// </summary>
        private AircraftListJsonBuilder _Builder;

        /// <summary>
        /// Gets or sets the aircraft list that is keeping track of aircraft that an instance of BaseStation is receiving messages from.
        /// </summary>
        public IBaseStationAircraftList BaseStationAircraftList { get; set; }

        /// <summary>
        /// Gets or sets the aircraft list that is keeping track of aircraft in a flight simulator.
        /// </summary>
        public ISimpleAircraftList FlightSimulatorAircraftList { get; set; }

        /// <summary>
        /// See base class.
        /// </summary>
        /// <param name="server"></param>
        /// <param name="args"></param>
        /// <returns></returns>
        protected override bool DoHandleRequest(IWebServer server, RequestReceivedEventArgs args)
        {
            bool result = false;

            if(args.PathAndFile.Equals("/AircraftList.json", StringComparison.OrdinalIgnoreCase)) result = HandleAircraftListJson(args, BaseStationAircraftList, false);
            else if(args.PathAndFile.Equals("/FlightSimList.json", StringComparison.OrdinalIgnoreCase)) result = HandleAircraftListJson(args, FlightSimulatorAircraftList, true);

            return result;
        }

        /// <summary>
        /// Sends the appropriate AircraftList.json content in response to the request passed across.
        /// </summary>
        /// <param name="args"></param>
        /// <param name="aircraftList"></param>
        /// <param name="isFlightSimulator"></param>
        /// <returns>Always returns true - this just helps to make the caller's code a little more compact.</returns>
        private bool HandleAircraftListJson(RequestReceivedEventArgs args, IAircraftList aircraftList, bool isFlightSimulator)
        {
            if(_Builder == null) _Builder = new AircraftListJsonBuilder(Provider);

            if(aircraftList == null) args.Response.StatusCode = HttpStatusCode.InternalServerError;
            else {
                var buildArgs = ConstructBuildArgs(args, aircraftList, isFlightSimulator);
                var json = _Builder.Build(buildArgs);

                Responder.SendJson(args.Response, json, args.QueryString["callback"]);
                args.Classification = ContentClassification.Json;
            }

            return true;
        }

        /// <summary>
        /// Creates an object that holds all of the aircraft list arguments that were extracted from the request.
        /// </summary>
        /// <param name="args"></param>
        /// <param name="aircraftList"></param>
        /// <param name="isFlightSimulator"></param>
        /// <returns></returns>
        private AircraftListJsonBuilderArgs ConstructBuildArgs(RequestReceivedEventArgs args, IAircraftList aircraftList, bool isFlightSimulator)
        {
            var result = new AircraftListJsonBuilderArgs() {
                AircraftList =          aircraftList,
                BrowserLatitude =       QueryNDouble(args, "lat"),
                BrowserLongitude =      QueryNDouble(args, "lng"),
                Filter =                isFlightSimulator ? null : ConstructFilter(args),
                IsFlightSimulatorList = isFlightSimulator,
                IsInternetClient =      args.IsInternetRequest,
                PreviousDataVersion =   QueryLong(args, "ldv", -1),
                ResendTrails =          QueryString(args, "refreshTrails", false) == "1",
                ShowShortTrail =        QueryString(args, "trFmt", true) == "S",
            };

            for(int sortColumnCount = 0;sortColumnCount < 2;++sortColumnCount) {
                var sortColumn = QueryString(args, String.Format("sortBy{0}", sortColumnCount + 1), true);
                var sortOrder = QueryString(args, String.Format("sortOrder{0}", sortColumnCount + 1), true);
                if(String.IsNullOrEmpty(sortColumn) || String.IsNullOrEmpty(sortOrder)) break;
                result.SortBy.Add(new KeyValuePair<string,bool>(sortColumn, sortOrder == "ASC"));
            }
            if(result.SortBy.Count == 0) result.SortBy.Add(new KeyValuePair<string,bool>(AircraftComparerColumn.FirstSeen, false));

            var previousAircraftIds = args.Request.Headers["X-VirtualRadarServer-AircraftIds"];
            if(!String.IsNullOrEmpty(previousAircraftIds)) {
                var decodedPreviousAircraftIds = HttpUtility.UrlDecode(previousAircraftIds);
                foreach(var chunk in decodedPreviousAircraftIds.Split(',')) {
                    int id;
                    if(int.TryParse(chunk, out id)) result.PreviousAircraft.Add(id);
                }
            }

            return result;
        }

        /// <summary>
        /// Extract the filter arguments from the request and returns them collected into an object.
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        private AircraftListJsonBuilderFilter ConstructFilter(RequestReceivedEventArgs args)
        {
            var result = new AircraftListJsonBuilderFilter() {
                AltitudeLower =                 QueryNInt(args, "fAltL"),
                AltitudeUpper =                 QueryNInt(args, "fAltU"),
                CallsignContains =              QueryString(args, "fCall", true),
                DistanceLower =                 QueryNDouble(args, "fDstL"),
                DistanceUpper =                 QueryNDouble(args, "fDstU"),
                EngineTypeEquals =              QueryNEnum<EngineType>(args, "fEgt"),
                Icao24CountryContains =         QueryString(args, "fCou", true),
                IsInterestingEquals =           QueryNBool(args, "fInt"),
                IsMilitaryEquals =              QueryNBool(args, "fMil"),
                MustTransmitPosition =          QueryNBool(args, "fNoPos") ?? false,
                OperatorContains =              QueryString(args, "fOp", true),
                RegistrationContains =          QueryString(args, "fReg", true),
                SpeciesEquals =                 QueryNEnum<Species>(args, "fSpc"),
                SquawkLower =                   QueryNInt(args, "fSqkL"),
                SquawkUpper =                   QueryNInt(args, "fSqkU"),
                TypeStartsWith =                QueryString(args, "fTyp", true),
                WakeTurbulenceCategoryEquals =  QueryNEnum<WakeTurbulenceCategory>(args, "fWtc"),
            };

            double? northBounds = QueryNDouble(args, "fNBnd");
            double? eastBounds = QueryNDouble(args, "fEBnd");
            double? southBounds = QueryNDouble(args, "fSBnd");
            double? westBounds = QueryNDouble(args, "fWBnd");

            if(northBounds != null && southBounds != null && westBounds != null && eastBounds != null) {
                result.PositionWithin = new Pair<Coordinate>(
                    new Coordinate((float)northBounds, (float)westBounds),
                    new Coordinate((float)southBounds, (float)eastBounds)
                );
            }

            return result;
        }
    }
}


text:
from django import VERSION
from django.template import Library, Node

register = Library()

class AdminMediaPrefixShimNode(Node):
    def __init__(self, admin_media_prefix):
        self.admin_media_prefix = admin_media_prefix

    def render(self, context):
        return self.admin_media_prefix

def do_admin_media_prefix(parser, token):
    if VERSION[0] == 1 and VERSION[1] < 4:
        from django.contrib.admin.templatetags.adminmedia import admin_media_prefix
        return AdminMediaPrefixShimNode(admin_media_prefix())
    else:
        from django.contrib.staticfiles.templatetags.staticfiles import do_static
        from django.template.base import Token, TOKEN_TEXT
        return do_static(parser, Token(TOKEN_TEXT, "static 'admin/'"))
register.tag('admin_media_prefix_shim', do_admin_media_prefix)


text:
<?php
require "../firelogger.php";
?><!DOCTYPE html>

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>FireLogger</title>

FireLogger for PHP - Issue #10 test

<?php
    $code = <<<'EOD'
flog("Text %text %text %text");
EOD;

    echo "
$code
";
    eval($code);
?>


text:
using System;
using Nancy.Security;

namespace NSemble.Core.Nancy
{
    public abstract class NSembleAdminModule : NSembleModule
    {
        protected NSembleAdminModule(string moduleName)
            : base(true, string.Concat(Constants.ResolverAdminAreaPrefix, "/", moduleName))
        {
            this.RequiresAuthentication();

            if (string.IsNullOrWhiteSpace(moduleName))
                throw new ArgumentException("Module name cannot be empty", "moduleName");

            if (moduleName.IndexOf('/') > -1)
                throw new ArgumentException("Module name cannot contain slashes", "moduleName");
        }
    }
}


text:
package org.lwjgl.opencl;

public class OpenCLException extends RuntimeException {

	private static final long serialVersionUID = 1L;

	public OpenCLException() {
		super();
	}

	public OpenCLException(final String message) {
		super(message);
	}

	public OpenCLException(final String message, final Throwable cause) {
		super(message, cause);
	}

	public OpenCLException(final Throwable cause) {
		super(cause);
	}

}


text:
class Zendesk2::CreateBrand
  include Zendesk2::Request

  request_method :post
  request_path { |_| '/brands.json' }
  request_body { |r| { 'brand' => r.brand_params } }

  def self.accepted_attributes
    %w(name brand_url has_help_center help_center_state active default ticket_form_ids
       subdomain host_mapping signature_template)
  end

  def brand_params
    Cistern::Hash.slice(params.fetch('brand'), *self.class.accepted_attributes)
  end

  def mock
    identity = cistern.serial_id

    record = {
      'id'                   => identity,
      'name'                 => params['name'],
      'brand_url'            => '',
      'has_help_center'      => true,
      'help_center_state'    => true,
      'active'               => true,
      'end_user_visible'     => true,
      'default'              => false,
      'ticket_form_ids'      => params['ticket_form_ids'],
      'subdomain'            => params['subdomain'],
      'host_mapping'         => '',
      'signature_template'   => '',
      'url'                  => url_for("/brands/#{identity}.json"),
    }.merge(brand_params)

    data[:brands][identity] = record

    mock_response('brand' => record)
  end
end


text:
using System;
using System.Xml;

namespace Org.Filedrops.FileSystem
{
    /// <summary>
    /// Factory for IDirectory objects.
    /// </summary>
    public static class FiledropsFileSystemFactory
    {
        /// <summary>
        /// Create an IDirectory object that is represented by an XML document.
        /// </summary>
        public static FiledropsFileSystem Create(string path)
        {
            XmlDocument document = new XmlDocument();
            document.Load(path);
            return Create(document.DocumentElement);
        }

        /// <summary>
        /// Create an IDirectory object that is represented by an XML document.
        /// </summary>
        public static FiledropsFileSystem Create(XmlElement fileSystemElement)
        {
            string type = fileSystemElement.GetAttribute("type");
            object[] argObjects = new[] { fileSystemElement };
            return (FiledropsFileSystem)Activator.CreateInstance(Type.GetType(type), argObjects);
        }
    }
}


text:
YUI.add('gallery-message-format', function (Y, NAME) {

var MODULE_NAME = "gallery-message-format",
    PluralRules, inRange,
    Formatter, StringFormatter, DateFormatter, TimeFormatter, NumberFormatter,SelectFormatter,
    PluralFormatter, ChoiceFormatter, MsgListFormatter, formatters;

/**
 * Formatter base class
 * @class MsgBaseFormatter
 * @namespace Intl
 * @private
 * @constructor
 * @param values {Array|Object} The data to be processed and inserted.
 */
Y.Intl.MsgBaseFormatter = function(values) {
    this.values = values;
};

Formatter = Y.Intl.MsgBaseFormatter;

Y.mix(Formatter.prototype, {
    /**
     * Get value of key
     * @method getValue
     * @param key {String|Number} Key/index of value in the object/array 'values'
     * @return Value from the data in 'values'
     */
    getValue: function(key) {
        if(Y.Lang.isArray(this.values)) {
            key = parseInt(key, 10);
        }
        return this.values[key];
    },

    /**
     * Get value of params.key
     * The value found will be set to params.value
     * @method getParams
     * @param params {Object} Object containing key as in { key: "KEY" }
     * @return {Boolean} True if value found, False otherwise
     */
    getParams: function(params) {
        if(!params || !params.key) {
            return false;
        }

        var value = this.getValue(params.key);

        if(value !== undefined) {
            params.value = value;
            return true;
        }

        return false;
    },

    /**
     * Format string. Will be overridden in descendants
     * @method format
     */
    format: function(/*str, config*/) {
        Y.error('Not implemented');	//Must override in descendants
    }
});

//For date and time formatters
Y.mix(Formatter, {
    /**
     * Create an instance of the formatter
     * @method createInstance
     * @static
     * //param values {Array|Object} The data to be processed and inserted.
     */
    createInstance: function(/*values*/) {
        //return new Formatter(values);
        Y.error('Not implemented');	//Must override in descendants
    },

    /**
     * Get current timezone. Used for time format
     * @method getCurrentTimeZone
     * @return {Y.Date.Timezone}
     */
    getCurrentTimeZone: function() {
        if(Y.Date === undefined || Y.Date.Timezone === undefined) { return "GMT"; }
        var systemTZoneOffset = (new Date()).getTimezoneOffset()*-60;
        return Y.Date.Timezone.getTimezoneIdForOffset(systemTZoneOffset);
    }
});
/**
 * String formatter
 * @class StringFormatter
 * @namespace Intl
 * @extends MsgBaseFormatter
 * @private
 * @constructor
 * @param values {Array|Object} The data to be processed and inserted.
 */
Y.Intl.StringFormatter = function(values) {
    StringFormatter.superclass.constructor.call(this, values);
    this.regex = "{\\s*([a-zA-Z0-9_]+)\\s*}";
};

StringFormatter = Y.Intl.StringFormatter;
Y.extend(StringFormatter, Formatter);

/**
 * Create an instance of the formatter
 * @method createInstance
 * @static
 * @param values {Array|Object} The data to be processed and inserted.
 */
StringFormatter.createInstance = function(values) {
    return new StringFormatter(values);
};

Y.mix(StringFormatter.prototype, {
    /**
     * Get parameters from regex match
     * @method getParams
     * @param params {Object} Object to receive value. Function will store key and value in this variable
     * @param matches {Array} Result of regex match over pattern string.
     * @return {Boolean} True if value found, False otherwise
     */
    getParams: function(params, matches) {
        if(matches && matches[1]) {
            params.key = matches[1];
            if(Formatter.prototype.getParams.call(this, params)) {
                return true;
            }
        }

        return false;
    },

    /**
     * Format all instances in str that can be handled by StringFormatter
     * @method format
     * @param str {String} Input string/pattern
     * @return {String} Formatted result
     */
    format: function(str) {
        var regex = new RegExp(this.regex, "gm"),
            matches = null,
            params;
        while((matches = regex.exec(str))) {
            params = {};

            if(this.getParams(params, matches)) {
                //Got a match
                str = str.replace(matches[0], params.value);
            }

        }

        return str;
    }
}, true);/**
 * Date formatter
 * @class DateFormatter
 * @extends MsgBaseFormatter
 * @namespace Intl
 * @private
 * @constructor
 * @param values {Array|Object} The data to be processed and inserted.
 */
Y.Intl.DateFormatter = function(values) {
    DateFormatter.superclass.constructor.call(this, values);
    this.styles = {
        "short":  [ 512 /*Y.Date.DATE_FORMATS.YMD_SHORT*/, 0, 0 ],
        "medium": [ 256 /*Y.Date.DATE_FORMATS.YMD_ABBREVIATED*/,0, 0 ],
        "long":   [ 128 /*Y.Date.DATE_FORMATS.YMD_LONG*/, 0, 0 ],
        "full":   [ 1 /*Y.Date.DATE_FORMATS.WYMD_LONG*/, 0, 0 ]
    };
    this.regex = "{\\s*([a-zA-Z0-9_]+)\\s*,\\s*date\\s*(,\\s*(\\w+)\\s*)?}";
};

DateFormatter = Y.Intl.DateFormatter;
Y.extend(DateFormatter, Formatter);

/**
 * Create an instance of the formatter
 * @method createInstance
 * @static
 * @param values {Array|Object} The data to be processed and inserted.
 */
DateFormatter.createInstance = function(values) {
    return new DateFormatter(values);
};

Y.mix(DateFormatter.prototype, {
    /**
     * Get parameters from regex match
     * @method getParams
     * @param params {Object} Object to receive value. Function will store the values key, value, style in this variable
     * @param matches {Array} Result of regex match over pattern string.
     * @return {Boolean} True if value found, False otherwise
     */
    getParams: function(params, matches) {
        if(matches) {
            if(matches[1]) {
                params.key = matches[1];
            }
            if(matches[3]) {
                params.style = matches[3];
            }
        }

        if(!params.style) {
            params.style = "medium";
        }			//If no style, default to medium

        if(!this.styles[params.style]) {
            return false;
        }	//Invalid style

        if(params.key && Formatter.prototype.getParams.call(this, params)) {
            return true;
        }

        return false;
    },

    /**
     * Format all instances in str that can be handled by DateFormatter
     * @method format
     * @param str {String} Input string/pattern
     * @param [config] {Object} Optional configuration parameters. Used to pass timezone for time formatting
     * @return {String} Formatted result
     */
    format: function(str, config) {
        if(Y.Date === undefined || !Y.Date.__advancedFormat ) { return str; }
        var regex = new RegExp(this.regex, "gm"),
            matches = null,
            params, style, result;
        while((matches = regex.exec(str))) {
            params = {};

            if(this.getParams(params, matches)) {
                //Got a match
                style = this.styles[params.style];
                result = Y.Date.format(new Date(params.value), {
                    timezone: config.timezone || Formatter.getCurrentTimeZone(),
                    dateFormat: style[0],
                    timeFormat: style[1],
                    timezoneFormat: style[2]
                });
                str = str.replace(matches[0], result);
            }

        }

        return str;
    }
}, true);
/**
 * Time formatter
 * @class TimeFormatter
 * @extends DateFormatter
 * @namespace Intl
 * @private
 * @constructor
 * @param values {Array|Object} The data to be processed and inserted.
 */
Y.Intl.TimeFormatter = function(values) {
    TimeFormatter.superclass.constructor.call(this, values);
    this.styles = {
        "short": [ 0, 2 /*Y.Date.TIME_FORMATS.HM_SHORT*/, 0 ],
        "medium": [ 0, 1 /*Y.Date.TIME_FORMATS.HM_ABBREVIATED*/, 0 ],
        "long": [ 0, 1 /*Y.Date.TIME_FORMATS.HM_ABBREVIATED*/, 2 /*Y.Date.TIMEZONE_FORMATS.Z_SHORT*/ ],
        "full": [ 0, 1 /*Y.Date.TIME_FORMATS.HM_ABBREVIATED*/, 1 /*Y.Date.TIMEZONE_FORMATS.Z_ABBREVIATED*/ ]
    };
    this.regex = "{\\s*([a-zA-Z0-9_]+)\\s*,\\s*time\\s*(,\\s*(\\w+)\\s*)?}";
};

TimeFormatter = Y.Intl.TimeFormatter;
Y.extend(TimeFormatter, DateFormatter);

/**
 * Create an instance of the formatter
 * @method createInstance
 * @static
 * @param values {Array|Object} The data to be processed and inserted.
 */
TimeFormatter.createInstance = function(values) {
    return new TimeFormatter(values);
};
/**
 * Number formatter
 * @class NumberFormatter
 * @extends MsgBaseFormatter
 * @namespace Intl
 * @private
 * @constructor
 * @param values {Array|Object} The data to be processed and inserted.
 */
Y.Intl.NumberFormatter = function(values) {
    NumberFormatter.superclass.constructor.call(this, values);
    this.styles = {
        "integer": 4 /*Y.Number.STYLES.NUMBER_STYLE*/,
        "percent": 8 /*Y.Number.STYLES.PERCENT_STYLE*/,
        "currency": 1 /*Y.Number.STYLES.CURRENCY_STYLE*/
    };
    this.regex = "{\\s*([a-zA-Z0-9_]+)\\s*,\\s*number\\s*(,\\s*(\\w+)\\s*)?}";
};

NumberFormatter = Y.Intl.NumberFormatter;
Y.extend(NumberFormatter, Formatter);

/**
 * Create an instance of the formatter
 * @method createInstance
 * @static
 * @param values {Array|Object} The data to be processed and inserted.
 */
NumberFormatter.createInstance = function(values) {
    return new NumberFormatter(values);
};

Y.mix(NumberFormatter.prototype, {
    /**
     * Get parameters from regex match
     * @method getParams
     * @param params {Object} Object to receive value. Function will store the values key, value, style in this variable
     * @param matches {Array} Result of regex match over pattern string.
     * @return {Boolean} True if value found, False otherwise
     */
    getParams: function(params, matches) {
        if(matches) {
            if(matches[1]) {
                params.key = matches[1];
            }
            if(matches[3]) {
                params.style = matches[3];
            }
        }

        if(!params.style) {
            params.style = "integer";	//If no style, default to medium
            params.showDecimal = true;	//Show decimal parts too
        }

        if(!this.styles[params.style]) {	//Invalid style
            return false;
        }

        if(params.key && Formatter.prototype.getParams.call(this, params)) {
            return true;
        }

        return false;
    },

    /**
     * Format all instances in str that can be handled by NumberFormatter
     * @method format
     * @param str {String} Input string/pattern
     * @return {String} Formatted result
     */
    format: function(str) {
        if(Y.Number === undefined || !Y.Number.__advancedFormat) { return str; }
        var regex = new RegExp(this.regex, "gm"),
            matches = null,
            params, config;
        while((matches = regex.exec(str))) {
            params = {};

            if(this.getParams(params, matches)) {
                //Got a match
                config = {
                    style: this.styles[params.style]
                };
                if(params.style === "integer" && !params.showDecimal) {
                    config.parseIntegerOnly = true;
                }
                str = str.replace(matches[0], Y.Number.format(params.value, config));
            }
        }

        return str;
    }
}, true);
/**
 * Select formatter. Select ouput based on value of key
 * @class SelectFormatter
 * @extends MsgBaseFormatter
 * @namespace Intl
 * @private
 * @constructor
 * @param values {Array|Object} The data to be processed and inserted.
 */
Y.Intl.SelectFormatter = function(values) {
    SelectFormatter.superclass.constructor.call(this, values);
    this.regex = "{\\s*([a-zA-Z0-9_]+)\\s*,\\s*select\\s*,\\s*";
};

SelectFormatter = Y.Intl.SelectFormatter;
Y.extend(SelectFormatter, Formatter);

/**
 * Create an instance of the formatter
 * @method createInstance
 * @static
 * @param values {Array|Object} The data to be processed and inserted.
 */
SelectFormatter.createInstance = function(values) {
    return new SelectFormatter(values);
};

Y.mix(SelectFormatter.prototype, {
    /**
     * Get parameters from regex match
     * @method getParams
     * @param params {Object} Object to receive value. Function will store key and value in this variable
     * @param matches {Array} Result of regex match over pattern string.
     * @return {Boolean} True if value found, False otherwise
     */
    getParams: function(params, matches) {
        if(matches) {
            if(matches[1]) {
                params.key = matches[1];
            }
        }

        if(params.key && Formatter.prototype.getParams.call(this, params)) {
            return true;
        }

        return false;
    },

    /**
     * Parse choices in pattern and get options array.
     * @method parseOptions
     * @param str {String} Pattern string
     * @param start {Number} Position in str to start parsing from
     * @return {Object} Object in the form:
             {
               options: [
                     { key: KEY1, value: VALUE1 },
                     { key: KEY2, value: VALUE2 },
                     ... ],
               next: i  //Index of next character in str that can be parsed
             }
     */
    parseOptions: function(str, start) {
        var options = {},
            key = "", value = "", current = "",
            i, ch;
        for(i=start; i<str.length; i++) {
            ch = str.charAt(i);
            if (ch === '\\') {
                current += ch + str.charAt(i+1);
                i++;
            } else if (ch === '}') {
                if(current === "") {
                    i++;
                    break;
                }
                value = current;
                options[key.trim()] = value;
                current = key = value = "";
            } else if (ch === '{') {
                key = current;
                current = "";
            } else {
                current += ch;
            }
        }

        if(current !== "") {
            return null;
        }

        return {
            options: options,
            next: i
        };
    },

    /**
     * Select output depending on params.value from options
     * @method select
     * @param options {Array} Array of key,value pairs
     * @param params {Object} Object containing value
     * @return {String} selected result
     */
    select: function(options, params) {
        for ( var key in options ) {
            if( key === "other" ) {
                continue;	//Will use this only if everything else fails
            }

            if( key === params.value ) {
                return options[key];
            }
        }

        return options.other;
    },

    /**
     * Format all instances in str that can be handled by SelectFormatter
     * @method format
     * @param str {String} Input string/pattern
     * @return {String} Formatted result
     */
    format: function(str) {
        var regex = new RegExp(this.regex, "gm"),
            matches = null,
            params, options, result, start;
        while((matches = regex.exec(str))) {
            params = {};

            if(this.getParams(params, matches)) {
                //Got a match
                options = this.parseOptions(str, regex.lastIndex);
                if(!options) {
                    continue;
                }

                regex.lastIndex = options.next;
                options = options.options;

                result = this.select(options, params);
                if(result) {
                    start = str.indexOf(matches[0]);
                    str = str.slice(0, start) + result + str.slice(regex.lastIndex);
                }
            }
        }

        return str;
    }
}, true);/**
 * PluralRules is used to determine the plural form in MessageFormat
 * @class PluralRules
 * @namespace Intl
 * @static
 */
Y.Intl.PluralRules = {
    /**
     * Check if n is between start and end
     * @method _inRange
     * @static
     * @private
     * @param n {Number} Number to test
     * @param start {Number} Start of range
     * @param end {Number} End of range
     * @return {Boolean} true if n is between start and end, false otherwise
     */
    _inRange: function(n, start, end) {
        return n >= start && n <= end;
    },

    /**
     * Find matching plural form for the set of rules
     * @method _matchRule
     * @static
     * @private
     * @param rules {Object} Keys will be plural forms one,two,.. Values will be boolean
     * @return {String} Returns key that has value true
     */
    _matchRule: function(rules) {
        for(var key in rules) {
            if(rules[key]) { return key; }
        }
        return "other";
    },

    /**
     * Set of rules. Each locale will have a matching rule. The corresponding functions in each set
     * will take a number as parameter and return the relevant plural form.
     */
    rules: {
        set1: function(n) {
            var mod = n % 100;
            return PluralRules._matchRule({
                few:  inRange(mod, 3, 10),
                many: inRange(mod, 11, 99),
                one:  n === 1,
                two:  n === 2,
                zero: n === 0
            });
        },

        set2: function(n) {
            return PluralRules._matchRule({
               many: n !== 0 && n%10 === 0,
               one:  n === 1,
               two:  n === 2
            });
        },

        set3: function(n) {
            return PluralRules._matchRule({
               one: n === 1
            });
        },

        set4: function(n) {
            return PluralRules._matchRule({
                one: inRange(n, 0, 1)
            });
        },

        set5: function(n) {
            return PluralRules._matchRule({
                one: inRange(n, 0, 2) && n !== 2
            });
        },

        set6: function(n) {
            return PluralRules._matchRule({
                one:  n%10 === 1 && n%100 !== 11,
                zero: n === 0
            });
        },

        set7: function(n) {
            return PluralRules._matchRule({
                one: n === 1,
                two: n === 2
            });
        },

        set8: function(n) {
            return PluralRules._matchRule({
                few:  inRange(n, 3, 6),
                many: inRange(n, 7, 10),
                one:  n === 1,
                two:  n === 2
            });
        },

        set9: function(n) {
            return PluralRules._matchRule({
                few: n === 0 || (n !== 1 && inRange(n%100, 1, 19)),
                one: n === 1
            });
        },

        set10: function(n) {
            var mod10 = n%10, mod100 = n%100;
            return PluralRules._matchRule({
                few: inRange(mod10, 2, 9) && !inRange(mod100, 11, 19),
                one: mod10 === 1 && !inRange(mod100, 11, 19)
            });
        },

        set11: function(n) {
            var mod10 = n%10, mod100 = n%100;
            return PluralRules._matchRule({
                few:  inRange(mod10, 2, 4) && !inRange(mod100, 12, 14),
                many: mod10 === 0 || inRange(mod10, 5, 9) || inRange(mod100, 11, 14),
                one:  mod10 === 1 && mod100 !== 11
            });
        },

        set12: function(n) {
            return PluralRules._matchRule({
                few: inRange(n, 2, 4),
                one: n === 1
            });
        },

        set13: function(n) {
            var mod10 = n%10, mod100 = n%100;
            return PluralRules._matchRule({
                few:  inRange(mod10, 2, 4) && !inRange(mod100, 12, 14),
                many: n !== 1 && inRange(mod10, 0, 1) || inRange(mod10, 5, 9) || inRange(mod100, 12, 14),
                one:  n === 1
            });
        },

        set14: function(n) {
            var mod = n%100;
            return PluralRules._matchRule({
                few: inRange(mod, 3, 4),
                one: mod === 1,
                two: mod === 2
            });
        },

        set15: function(n) {
            var mod = n%100;
            return PluralRules._matchRule({
                few:  n === 0 || inRange(mod, 2, 10),
                many: inRange(mod, 11, 19),
                one:  n === 1
            });
        },

        set16: function(n) {
            return PluralRules._matchRule({
                one: n%10 === 1 && n !== 11
            });
        },

        set17: function(n) {
            return PluralRules._matchRule({
                few:  n === 3,
                many: n === 6,
                one:  n === 1,
                two:  n === 2,
                zero: n === 0
            });
        },

        set18: function(n) {
            return PluralRules._matchRule({
                one:  inRange(n, 0, 2) && n !== 0 && n !== 2,
                zero: n === 0
            });
        },

        set19: function(n) {
            return PluralRules._matchRule({
                few: inRange(n, 2, 10),
                one: inRange(n, 0, 1)
            });
        },

        set20: function(n) {
            var mod1 = n%10, mod2 = n%100, mod6 = n%1000000;
            return PluralRules._matchRule({
                few:  (inRange(mod1, 3, 4) || mod1 === 9) && !inRange(mod2, 10, 19) && !inRange(mod2, 70, 79) && !inRange(mod2, 90, 99),
                many: n !== 0 && mod6 === 0,
                one:  mod1 === 1 && mod2 !== 11 && mod2 !== 71 && mod2 !== 91,
                two:  mod1 === 2 && mod2 !== 12 && mod2 !== 72 && mod2 !== 92
            });
        },

        set21: function(n) {
            return PluralRules._matchRule({
                one:  n === 1,
                zero: n === 0
            });
        },

        set22: function(n) {
            return PluralRules._matchRule({
                one: inRange(n, 0, 1) || inRange(n, 11, 99)
            });
        },

        set23: function(n) {
            return PluralRules._matchRule({
                one: inRange(n%10, 1, 2) || n%20 === 0
            });
        },

        set24: function(n) {
            return PluralRules._matchRule({
                few: inRange(n, 3, 10) || inRange(n, 13, 19),
                one: n === 1 || n === 11,
                two: n === 2 || n === 12
            });
        },

        set25: function(n) {
            return PluralRules._matchRule({
                one: n === 1 || n === 5
            });
        },

        set26: function(n) {
            var mod10 = n%10, mod100 = n%100;
            return PluralRules._matchRule({
                one: (mod10 === 1 || mod10 === 2) && (mod100 !== 11 && mod100 !== 12)
            });
        },

        set27: function(n) {
            var mod10 = n%10, mod100 = n%100;
            return PluralRules._matchRule({
                few: mod10 === 3 && mod100 !== 13,
                one: mod10 === 1 && mod100 !== 11,
                two: mod10 === 2 && mod100 !== 12
            });
        },

        set28: function(n) {
            return PluralRules._matchRule({
                many: n === 11 || n === 8 || n === 80 || n === 800
            });
        },

        set29: function(n) {
            return PluralRules._matchRule({
                few: n === 4,
                one: n === 1 || n === 3,
                two: n === 2
            });
        },

        set30: function(n) {
            return PluralRules._matchRule({
                few: n === 4,
                one: n === 1,
                two: n === 2 || n === 3
            });
        },

        set31: function(n) {
            return PluralRules._matchRule({
                few:  n === 4,
                many: n === 6,
                one:  n === 1,
                two:  n === 2 || n === 3
            });
        },

        set32: function(n) {
            return PluralRules._matchRule({
                few:  n === 4,
                many: n === 6,
                one:  Y.Array.indexOf([1,5,7,8,9,10], n) > -1,
                two: n === 2 || n === 3
            });
        },

        set33: function(n) {
            return PluralRules._matchRule({
                few:  inRange(n, 2, 9),
                many: inRange(n, 10, 19) || inRange(n, 100, 199) || inRange(n, 1000, 1999),
                one:  n === 1
            });
        }
    }
};

PluralRules = Y.Intl.PluralRules;
inRange = PluralRules._inRange;
/**
 * Plural formatter. Select ouput based on whether value of key is singular/plural
 * @class PluralFormatter
 * @extends SelectFormatter
 * @namespace Intl
 * @private
 * @constructor
 * @param values {Array|Object} The data to be processed and inserted.
 */
Y.Intl.PluralFormatter = function(values) {
    PluralFormatter.superclass.constructor.call(this, values);
    this.regex = "{\\s*([a-zA-Z0-9_]+)\\s*,\\s*plural\\s*,\\s*";

    var formats = Y.Intl.get(MODULE_NAME),
        ruleSet = formats.pluralRule;

    if(ruleSet) {
         this.rule = PluralRules.rules[ruleSet];
    }

    if(this.rule === undefined) {
         this.rule = function() { return "other"; };
    }
};

PluralFormatter = Y.Intl.PluralFormatter;
Y.extend(PluralFormatter, SelectFormatter);

/**
 * Create an instance of the formatter
 * @method createInstance
 * @static
 * @param values {Array|Object} The data to be processed and inserted.
 */
PluralFormatter.createInstance = function(values) {
    return new PluralFormatter(values);
};

/**
 * Select output depending on params.value from options
 * @method select
 * @param options {Object} Object containing results for singular/plural
 * @param params {Object} Object containing value
 * @return {String} selected result
 */
PluralFormatter.prototype.select = function(options, params) {
    var pluralForm = this.rule(params.value),
        result = options[pluralForm];

    if(result === undefined || result === null) {
        result = options.other;
    }

    result = result.replace("#", new NumberFormatter({VAL: params.value}).format("{VAL, number, integer}"));	//Use 'number' to format this part

    return result;
};
/**
 * Choice formatter. Select ouput based on numerical values
 * @class ChoiceFormatter
 * @extends SelectFormatter
 * @namespace Intl
 * @private
 * @constructor
 * @param values {Array|Object} The data to be processed and inserted.
 */
Y.Intl.ChoiceFormatter = function(values) {
    ChoiceFormatter.superclass.constructor.call(this, values);
    this.regex = "{\\s*([a-zA-Z0-9_]+)\\s*,\\s*choice\\s*,\\s*(.+)}";
};

ChoiceFormatter = Y.Intl.ChoiceFormatter;
Y.extend(ChoiceFormatter, SelectFormatter);

/**
 * Create an instance of the formatter
 * @method createInstance
 * @static
 * @param values {Array|Object} The data to be processed and inserted.
 */
ChoiceFormatter.createInstance = function(values) {
    return new ChoiceFormatter(values);
};

Y.mix(ChoiceFormatter.prototype, {
    /**
     * Parse choices in pattern and get options array.
     * @method parseOptions
     * @param choicesStr {String} Choice string from pattern
     * @return {Array} Array of objects containing value(choice), result, and relation
     */
    parseOptions: function(choicesStr) {
        var options = [],
            choicesArray = choicesStr.split("|"),
            i, j, choice, relations, rel, mapping, ch;
        for (i=0; i<choicesArray.length; i++) {
            choice = choicesArray[i];
            relations = ['#', '<', '\u2264'];
            for (j=0; j<relations.length; j++) {
                rel = relations[j];
                if(choice.indexOf(rel) !== -1) {
                    mapping = choice.split(rel);
                    ch = {
                        value: parseInt(mapping[0], 10),
                        result: mapping[1],
                        relation: rel
                    };
                    options.push(ch);
                    break;
                }
            }
        }

        return options;
    },

    /**
     * Get parameters from regex match
     * @method getParams
     * @param params {Object} Object to receive value. Function will store the values key, value, choices in this variable
     * @param matches {Array} Result of regex match over pattern string.
     * @return {Boolean} True if value found, False otherwise
     */
    getParams: function(params, matches) {
        if(SelectFormatter.prototype.getParams.call(this, params, matches)) {
            if(matches[2]) {
                params.choices = this.parseOptions(matches[2]);
                return params.choices === [] ? false: true;
            }
        }

        return false;
    },

    /**
     * Select output depending on params.value from options in params.choices
     * @method select
     * @param params {Object} Object containing value and choices
     * @return {String} selected result
     */
    select: function(params) {
        var choice, value, result, relation, i;
        for (i=0; i<params.choices.length; i++) {
            choice = params.choices[i];
            value = choice.value, result = choice.result, relation = choice.relation;

            if( (relation === '#' && value === params.value) || (relation === '<' && value < params.value)
                || (relation === '\u2264' && value <= params.value)) {
                return result;
            }
        }

        return "";
    },

    /**
     * Format all instances in str that can be handled by ChoiceFormatter
     * @method format
     * @param str {String} Input string/pattern
     * @return {String} Formatted result
     */
    format: function(str) {
        var regex = new RegExp(this.regex, "gm"),
            matches = null,
            params, result;
        while((matches = regex.exec(str))) {
            params = {};

            if(this.getParams(params, matches)) {
                result = this.select(params);
                if(result) {
                    str = str.replace(matches[0], result);
                }
            }
        }

        return str;
    }
}, true);/**
 * List formatter
 * @class MsgListFormatter
 * @namespace Intl
 * @extends StringFormatter
 * @private
 * @constructor
 * @param values {Array|Object} The data to be processed and inserted.
 */
Y.Intl.MsgListFormatter = function(values) {
      MsgListFormatter.superclass.constructor.call(this, values);
      this.regex = "{\\s*([a-zA-Z0-9_]+)\\s*,\\s*list\\s*}";
};

MsgListFormatter = Y.Intl.MsgListFormatter;
Y.extend(MsgListFormatter, StringFormatter);

/**
 * Create an instance of the formatter
 * @method createInstance
 * @static
 * @param values {Array|Object} The data to be processed and inserted.
 */
MsgListFormatter.createInstance = function(values) {
     return new MsgListFormatter(values);
};

Y.mix(MsgListFormatter.prototype, {
     /**
      * Format all instances in str that can be handled by MsgListFormatter
      * @method format
      * @param str {String} Input string/pattern
      * @return {String} Formatted result
      */
     format: function(str) {
          if(Y.Intl === undefined || Y.Intl.ListFormatter === undefined || Y.Intl.ListFormatter.format === undefined) { return str; }
          var regex = new RegExp(this.regex, "gm"),
              matches = null,
              params;

          while((matches = regex.exec(str))) {
              params = {};

              if(this.getParams(params, matches)) {
                  //Got a match
                  str = str.replace(
                             matches[0],
                             Y.Intl.ListFormatter.format( params.value )
                  );
              }
          }

          return str;
     }
}, true);

/**
 * MessageFormat enables the construction of localizable messages that combine static strings with information that only becomes available at runtime.
 * @module intl-format
 * @requires datatype-date-advanced-format, datatype-number-advanced-format, intl
 */

/**
 * Formatter classes. For each group found in the pattern, will try to parse with all of these formatters.
 * If a formatter fails to parse, the next one in the list try to do so.
 */
formatters = [ StringFormatter, DateFormatter, TimeFormatter, NumberFormatter, ChoiceFormatter, PluralFormatter, SelectFormatter, MsgListFormatter ];

Y.mix(Y.Intl, {

    /**
     * Format message that may contain date/time, numbers, etc. Choice, Select and Plural formatters are also available.
     * @method formatMessage
     * @static
     * @param pattern {String} string contains static text with embedded format elements that specify
              how to process and insert strings, numbers, and dates, as well as perform conditional processing.
     * @param values {Object|Array} The data to be processed and inserted.
     * @param [config] {Object} Optional configuration parameters
     * @return {String} Formatted result
     * @example
            //String formatting. Key is replaced by value
            Y.Intl.formatMessage("{EMPLOYEE} reports to {MANAGER}", {
                "EMPLOYEE": "Ashik",
                "MANAGER": "Dharmesh"
            });

            //3-parameter form: {KEY, type, style}. Style is optional. Type can be date/time/number. Style can be short/medium/long/full
            //For 'time', timezone can be specified as configuration param. If not specified, will default to system timezone
            Y.Intl.formatMessage("Today is {DATE, date, short}", { DATE: new Date() });
            Y.Intl.formatMessage("The time is {DATE, time, medium}", {DATE: new Date()}, {timezone: "Asia/Kolkata"});
            Y.Intl.formatMessage("There are {POPULATION_INDIA, number} million people in India.", {POPULATION_INDIA: 1241.492});

            //Select formatting. Selects output depending on value
            Y.Intl.formatMessage("{NAME} est {GENDER, select, female {allée} other {allé}} à {CITY}.", {
                "NAME": "Henri",
                "GENDER": "male",
                "CITY": "Paris"
            });

            //Plural formatting. Selects output depending on whether numerical value is singular/plural
            Y.Intl.formatMessage("{COMPANY_COUNT, plural, one {One company} other {# companies}} published new books.", {
                "COMPANY_COUNT": 1
            });

            //Choice formatting. Selects output depending on numerical value
            Y.Intl.formatMessage("There {FILE_COUNT, choice, 0#are no files|1#is one file|1<are {FILE_COUNT, number, integer} files} on disk.", {
                "FILE_COUNT": 1
            });
     */
    formatMessage: function(pattern, values, config) {
        config = config || {};
        var i, formatter;
        for(i=0; i<formatters.length; i++) {
            formatter = formatters[i].createInstance(values);
            pattern = formatter.format(pattern, config);
        }
        return pattern;
    }
});

}, 'gallery-2013.04.10-22-48', {
    "lang": [
        "am",
        "ar",
        "be",
        "cs",
        "cy",
        "fil",
        "fr",
        "ga",
        "gv",
        "he",
        "hi",
        "hr",
        "",
        "kw",
        "lt",
        "lv",
        "mk",
        "mt",
        "pl",
        "ro",
        "ru",
        "sh",
        "sk",
        "sl",
        "sr",
        "ti",
        "tl",
        "uk"
    ],
    "requires": [
        "intl"
    ]
});


text:
from heat.engine.clients import client_plugin
from heat.engine import constraints

from senlinclient import client
from senlinclient.common import exc

class SenlinClientPlugin(client_plugin.ClientPlugin):

    service_types = [CLUSTERING] = ['clustering']
    VERSION = '1'

    def _create(self):
        con = self.context
        args = {
            'auth_url': con.auth_url,
            'project_id': con.tenant_id,
            'token': self.auth_token,
        }
        return client.Client(self.VERSION, **args)

    def is_not_found(self, ex):
        return isinstance(ex, exc.HTTPNotFound)

class ProfileConstraint(constraints.BaseCustomConstraint):

    expected_exceptions = (exc.HTTPNotFound,)

    def validate_with_client(self, client, profile):
        client.client('senlin').get_profile(profile)


text:
---
# I dont' want to allow the direct navigation to this file. It'll work just as a fragment:
Published: false
---

### **[Go back <<<<](./fpf.md)**

This is just a content inside a fragment file to show how it works. It substitutes the default sidebar menu from `/toc.md`.

It can use fields on the main file too:

`{{InventedField}}`


text:
package org.zstack.sdk;

public class GetVmHostnameResult {
    public java.lang.String hostname;
    public void setHostname(java.lang.String hostname) {
        this.hostname = hostname;
    }
    public java.lang.String getHostname() {
        return this.hostname;
    }

}


text:
A simple C++ utility for manipulation of the Windows console (e.g. colors)

All functions are in the con:: namespace. For example:

    con::setTitle("Title here");

	std::cout << con::Color::BLUE << "Blue text.";

It currently can:

* Set title.
* Set cursor position.
* Set foreground/background colors (inline or otherwise).
* Clear the console.


text:
require 'spec_helper'

feature "Blank page" do
  scenario "Testing General Blank Page" do
    HomePage.open
    HomePage.wait_for_opened
    BlankPage.open
    BlankPage.wait_for_opened
  end

end


text:
class CreateBookChapters < ActiveRecord::Migration
  def change
    create_table :book_chapters do |t|
      t.string :qr_code, :limit=>40
      t.integer :section_id
      t.integer :sort_order
      t.references :graveyard, index: true
      t.string :title
      t.text :main_content

      t.timestamps
    end
  end
end


text:
<?php

/**
 * @file
 * Contains \Drupal\migrate_drupal\Tests\d6\MigrateUserConfigsTest.
 */

namespace Drupal\migrate_drupal\Tests\d6;

use Drupal\config\Tests\SchemaCheckTestTrait;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase;

/**
 * Upgrade variables to user.*.yml.
 *
 * @group migrate_drupal
 */
class MigrateUserConfigsTest extends MigrateDrupalTestBase {

  use SchemaCheckTestTrait;

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();
    $dumps = array(
      $this->getDumpDirectory() . '/Drupal6UserMail.php',
    );
    $migration = entity_load('migration', 'd6_user_mail');
    $this->prepare($migration, $dumps);
    $executable = new MigrateExecutable($migration, $this);
    $executable->import();

    $dumps = array(
      $this->getDumpDirectory() . '/Drupal6UserSettings.php',
    );
    $migration = entity_load('migration', 'd6_user_settings');
    $this->prepare($migration, $dumps);
    $executable = new MigrateExecutable($migration, $this);
    $executable->import();
  }

  /**
   * Tests migration of user variables to user.mail.yml.
   */
  public function testUserMail() {
    $config = \Drupal::config('user.mail');
    $this->assertIdentical($config->get('status_activated.subject'), 'Account details for !username at !site (approved)');
    $this->assertIdentical($config->get('status_activated.body'), "!username,\n\nYour account at !site has been activated.\n\nYou may now log in by clicking on this link or copying and pasting it in your browser:\n\n!login_url\n\nThis is a one-time login, so it can be used only once.\n\nAfter logging in, you will be redirected to !edit_uri so you can change your password.\n\nOnce you have set your own password, you will be able to log in to !login_uri in the future using:\n\nusername: !username\n");
    $this->assertIdentical($config->get('password_reset.subject'), 'Replacement login information for !username at !site');
    $this->assertIdentical($config->get('password_reset.body'), "!username,\n\nA request to reset the password for your account has been made at !site.\n\nYou may now log in to !uri_brief by clicking on this link or copying and pasting it in your browser:\n\n!login_url\n\nThis is a one-time login, so it can be used only once. It expires after one day and nothing will happen if it's not used.\n\nAfter logging in, you will be redirected to !edit_uri so you can change your password.");
    $this->assertIdentical($config->get('cancel_confirm.subject'), 'Account details for !username at !site (deleted)');
    $this->assertIdentical($config->get('cancel_confirm.body'), "!username,\n\nYour account on !site has been deleted.");
    $this->assertIdentical($config->get('register_admin_created.subject'), 'An administrator created an account for you at !site');
    $this->assertIdentical($config->get('register_admin_created.body'), "!username,\n\nA site administrator at !site has created an account for you. You may now log in to !login_uri using the following username and password:\n\nusername: !username\npassword: !password\n\nYou may also log in by clicking on this link or copying and pasting it in your browser:\n\n!login_url\n\nThis is a one-time login, so it can be used only once.\n\nAfter logging in, you will be redirected to !edit_uri so you can change your password.\n\n\n--  !site team");
    $this->assertIdentical($config->get('register_no_approval_required.subject'), 'Account details for !username at !site');
    $this->assertIdentical($config->get('register_no_approval_required.body'), "!username,\n\nThank you for registering at !site. You may now log in to !login_uri using the following username and password:\n\nusername: !username\npassword: !password\n\nYou may also log in by clicking on this link or copying and pasting it in your browser:\n\n!login_url\n\nThis is a one-time login, so it can be used only once.\n\nAfter logging in, you will be redirected to !edit_uri so you can change your password.\n\n\n--  !site team");
    $this->assertIdentical($config->get('register_pending_approval.subject'), 'Account details for !username at !site (pending admin approval)');
    $this->assertIdentical($config->get('register_pending_approval.body'), "!username,\n\nThank you for registering at !site. Your application for an account is currently pending approval. Once it has been approved, you will receive another email containing information about how to log in, set your password, and other details.\n\n\n--  !site team");
    $this->assertIdentical($config->get('status_blocked.subject'), 'Account details for !username at !site (blocked)');
    $this->assertIdentical($config->get('status_blocked.body'), "!username,\n\nYour account on !site has been blocked.");
    $this->assertConfigSchema(\Drupal::service('config.typed'), 'user.mail', $config->get());
  }

  /**
   * Tests migration of user variables to user.settings.yml.
   */
  public function testUserSettings() {
    $config = \Drupal::config('user.settings');
    $this->assertIdentical($config->get('notify.status_blocked'), TRUE);
    $this->assertIdentical($config->get('notify.status_activated'), FALSE);
    $this->assertIdentical($config->get('signatures'), TRUE);
    $this->assertIdentical($config->get('verify_mail'), FALSE);
    $this->assertIdentical($config->get('register'), 'admin_only');
    $this->assertIdentical($config->get('anonymous'), 'Guest');
  }

}


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__c_src_char_cpy_81.h
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__c_src.label.xml
Template File: sources-sink-81.tmpl.h
*/
/*
 * @description
 * CWE: 122 Heap Based Buffer Overflow
 * BadSource:  Initialize data as a large string
 * GoodSource: Initialize data as a small string
 * Sinks: cpy
 *    BadSink : Copy data to string using strcpy
 * Flow Variant: 81 Data flow: data passed in a parameter to an virtual method called via a reference
 *
 * */

#include "std_testcase.h"

#include <wchar.h>

namespace CWE122_Heap_Based_Buffer_Overflow__c_src_char_cpy_81
{

class CWE122_Heap_Based_Buffer_Overflow__c_src_char_cpy_81_base
{
public:
    /* pure virtual function */
    virtual void action(char * data) const = 0;
};

#ifndef OMITBAD

class CWE122_Heap_Based_Buffer_Overflow__c_src_char_cpy_81_bad : public CWE122_Heap_Based_Buffer_Overflow__c_src_char_cpy_81_base
{
public:
    void action(char * data) const;
};

#endif /* OMITBAD */

#ifndef OMITGOOD

class CWE122_Heap_Based_Buffer_Overflow__c_src_char_cpy_81_goodG2B : public CWE122_Heap_Based_Buffer_Overflow__c_src_char_cpy_81_base
{
public:
    void action(char * data) const;
};

#endif /* OMITGOOD */

}


text:
namespace ui {
class PresentationTimeRecorder;
}

namespace ash {

// The scroll bar for message center. This is basically views::OverlayScrollBar
// but also records the metrics for the type of scrolling (only the first event
// after the message center opens is recorded) and scrolling performance.
class MessageCenterScrollBar : public views::OverlayScrollBar {
 public:
  class Observer {
   public:
    // Called when scroll event is triggered.
    virtual void OnMessageCenterScrolled() = 0;
    virtual ~Observer() = default;
  };

  // |observer| can be null.
  explicit MessageCenterScrollBar(Observer* observer);

  MessageCenterScrollBar(const MessageCenterScrollBar&) = delete;
  MessageCenterScrollBar& operator=(const MessageCenterScrollBar&) = delete;

  ~MessageCenterScrollBar() override;

 private:
  // View overrides:
  bool OnKeyPressed(const ui::KeyEvent& event) override;
  bool OnMouseWheel(const ui::MouseWheelEvent& event) override;
  const char* GetClassName() const override;

  // ui::EventHandler overrides:
  void OnGestureEvent(ui::GestureEvent* event) override;

  // views::ScrollDelegate overrides:
  bool OnScroll(float dx, float dy) override;

  // False if no event is recorded yet. True if the first event is recorded.
  bool stats_recorded_ = false;

  Observer* const observer_;

  // Presentation time recorder for scrolling through notification list.
  std::unique_ptr<ui::PresentationTimeRecorder> presentation_time_recorder_;
};

// The new scroll bar for message center. This class will replace
// MessageCenterScrollBar in NotificationsRefresh feature.
class RoundedMessageCenterScrollBar : public RoundedScrollBar {
 public:
  METADATA_HEADER(RoundedMessageCenterScrollBar);

  // |observer| can be null.
  explicit RoundedMessageCenterScrollBar(
      MessageCenterScrollBar::Observer* observer);

  RoundedMessageCenterScrollBar(const RoundedMessageCenterScrollBar&) = delete;
  RoundedMessageCenterScrollBar& operator=(
      const RoundedMessageCenterScrollBar&) = delete;

  ~RoundedMessageCenterScrollBar() override;

 private:
  // RoundedScrollBar:
  bool OnKeyPressed(const ui::KeyEvent& event) override;
  bool OnMouseWheel(const ui::MouseWheelEvent& event) override;

  // ui::EventHandler overrides:
  void OnGestureEvent(ui::GestureEvent* event) override;

  // views::ScrollDelegate overrides:
  bool OnScroll(float dx, float dy) override;

  // False if no event is recorded yet. True if the first event is recorded.
  bool stats_recorded_ = false;

  // Unowned.
  MessageCenterScrollBar::Observer* const observer_;

  // Presentation time recorder for scrolling through notification list.
  std::unique_ptr<ui::PresentationTimeRecorder> presentation_time_recorder_;
};

}  // namespace ash

#endif  // ASH_SYSTEM_MESSAGE_CENTER_MESSAGE_CENTER_SCROLL_BAR_H_


text:
class Solution(object):
    def numUniqueEmails(self, emails):
        """
        :type emails: List[str]
        :rtype: int
        """
        email_set = set()
        for email in emails:
            elements = email.split('@')
            email_set.add(elements[0].split('+')[0].replace('.', '') + elements[1])
        return len(email_set)


text:
require 'rgitflow/printing'
require 'git'

module RGitFlow
  class Install
    include RGitFlow::Printing

    class << self
      attr_accessor :instance

      def install_tasks(opts = {})
        new(opts[:dir]).install
      end
    end

    attr_reader :dir, :git

    def initialize(dir = nil)
      @dir = dir || Dir.pwd
      @git = Git.open @dir
    end

    def install
      require 'rgitflow/tasks/scm/tasks'
      RGitFlow::Tasks::SCM.install_tasks :git => @git

      require 'rgitflow/tasks/feature/tasks'
      RGitFlow::Tasks::Feature.install_tasks :git => @git

      require 'rgitflow/tasks/hotfix/tasks'
      RGitFlow::Tasks::Hotfix.install_tasks :git => @git

      require 'rgitflow/tasks/release/tasks'
      RGitFlow::Tasks::Release.install_tasks :git => @git
    end
  end
end


text:
What will the following script print?  Explain.

sunday = "monday"; monday = "sunday"
t = {sunday = "monday", [sunday] = monday}
print(t.sunday, t[sunday], t[t.sunday])
]]

sunday = "monday"
monday = "sunday"

t = {sunday = "monday", [sunday] = monday}
--[[
This is equivalent to:
t = {sunday = "monday", ["monday"] = "sunday"}

Which is equivalent to:
t = {sunday = "monday", monday = "sunday"}
]]

print(t.sunday, t[sunday], t[t.sunday])
--[[
This is equivalent to:
print("monday", t["monday"], t["monday"])

Which is equivalent to:
print("monday", t.monday, t.monday)

Which is equivalent to:
print("monday", "sunday", "sunday")
]]


text:
<?php

namespace Swim\Entity;

class Coupon
{
   public $couponId;
   public $code;
   public $expirationDate;
}


text:
const path = require('path');

const config = {

  dev: {
    client: 'sqlite3',
    connection: {
      filename: './db/dev.sqlite3'
    },
    migrations: {
      directory: path.resolve(__dirname, 'db/migrations'),
      tableName: 'migrations'
    }
  },

  staging: {
    client: 'postgresql',
    connection: {
      database: 'my_db',
      user:     'username',
      password: 'password'
    },
    pool: {
      min: 2,
      max: 10
    },
    migrations: {
      directory: path.resolve(__dirname, 'db/migrations'),
      tableName: 'migrations'
    }
  },

  production: {
    client: 'postgresql',
    connection: {
      database: 'my_db',
      user:     'username',
      password: 'password'
    },
    pool: {
      min: 2,
      max: 10
    },
    migrations: {
      directory: path.resolve(__dirname, 'db/migrations'),
      tableName: 'migrations'
    }
  }

};

module.exports = config;


text:
<!DOCTYPE html>

		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
		<title>Mobile "Pull to Share" Interaction | Demo 1| Codrops</title>
		<meta name="description" content="Mobile pull to share interaction inpired by Google Chrome's refresh/new tab action" />
		<meta name="keywords" content="mobile, pull to share, touch, google chrome, social sharing, javascript" />
		<meta name="author" content="Codrops" />
		<link rel="shortcut icon" href="favicon.ico">
		<link rel="stylesheet" type="text/css" href="css/normalize.css" />
		<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.3.0/css/font-awesome.min.css" />
		<link rel="stylesheet" type="text/css" href="css/demo.css" />
		<link rel="stylesheet" type="text/css" href="css/component.css" />

					Share on Facebook
					Share on Twitter
					Share on Google Plus

					Previous Demo
					Back to the Codrops article

Pull to Share

					Touch & move
					Tilt

Mobile "pull to share" interaction inpired by Google Chrome's refresh/new tab action.

Pull down to reveal the sharing buttons.

Move to change the selection.

Push back up to cancel.

					 Please use a mobile phone in order to play with the effect.


text:
/*********************************************************************

  THE ENHANCE PROJECT
  School of Informatics,
  University of Edinburgh,
  Edinburgh - EH9 3JZ
  United Kingdom

  Written by: Gagarine Yaikhom

*********************************************************************/

/**
   DESCRIPTION:
   These are the internal interfaces for sending data to other tasks. */

#ifndef __ESKEL_COMPILE
#error "Please do not include 'give.h'; include 'eskel.h' instead."
#endif

#ifndef __ESKEL_GIVE_H
#define __ESKEL_GIVE_H

typedef int (*__eskel_give_t)(void *buffer, int units);
extern MPI_Request __eskel_sched_listener;
extern __eskel_give_t __eskel_give;
extern double __eskel_task_duration;
extern double __eskel_start_time;
extern int __eskel_reset_clock;
extern int __eskel_time_task;
extern int __eskel_rate_count;
extern int __eskel_reschedule_flag;

extern int __eskel_give_with_scheduling(void *buffer, int units);
extern int __eskel_give_without_scheduling(void *buffer, int units);

#endif /* __ESKEL_GIVE_H */


text:
mung is tiny web framwork with middlewares supported. the ideas mainly come from expressjs and negroni. It is much more smaller and simpler also very easy to use and extend. Any struct/type can be made to a middlewarea only by adding a function ServeHTTP(rw, r, next), then add the middleware to the mung's call statck.

## usage exapmple

	middleware1 := ...  // only ServeHTTP(rw, r, next) needed
	middleware2 := ...
	middleware3 := ...
	app := mung.New()
	app.Use(middleware1)
	app.Use(middleware2)
	app.Use(middleware3)
	app.Run(":8888")

Mung.handle is the entry of middlewares stack.

## about middlewares

the order of middleware's ServeHTTP() execution is:

	middleware1			// before next() in middleware1's ServeHTTP()
	  middleware2		// before next() in middleware2's ServeHTTP()
	    middleware3		// middleware3's ServeHTTP()
	  middleware2		// after next() in middleware2's ServeHTTP()
	middleware1			// after next() in middleware1's ServeHTTP()

Any functionality should be made to a reusable middleware inluding staics serving , router, sessions, logger, database accessing, openid/oauth and so on.


text:
'use strict';
// This is a dummy file to enable eventListener polyfill for IE8
// Do this in your first line of fluxex.js to enable polyfill:
// require('fluxex/extra/polyfill-ie8');
// our gulp task will alias it to 'fluxex/extra/polyfill-ie8-client'


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Interface ITaskStateClient
   </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Interface ITaskStateClient
   ">
    <meta name="generator" content="docfx 2.52.0.0">

    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                Toggle navigation

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

          Show / Hide Table of Contents

Interface ITaskStateClient

Monitors task progress.

Inherited Members

      BaseClients.Architecture.ICallbackClient.IsConnected

      BaseClients.Architecture.ICallbackClient.Key

      BaseClients.Architecture.ICallbackClient.Heartbeat

      BaseClients.Architecture.ICallbackClient.Connected

      BaseClients.Architecture.ICallbackClient.Disconnected

      BaseClients.Architecture.IClient.EndpointAddress

      BaseClients.Architecture.IClient.LastCaughtException

      BaseClients.Architecture.IClient.Logger

      System.IDisposable.Dispose()

Namespace: SchedulingClients

Assembly: SchedulingClients.Core.dll

Syntax

public interface ITaskStateClient : ICallbackClient, IClient, IDisposable

Events

    |
    Improve this Doc

    View Source

TaskProgressUpdated

Fired whenever a task progresses its state.

Declaration

event Action<TaskProgressDto> TaskProgressUpdated

Event Type

        Type
        Description

        System.Action<TaskProgressDto>

                    Improve this Doc

                    View Source

              Back to top

            Generated by DocFX