text:
<?php

namespace libphonenumber\Tests\core;

use libphonenumber\NumberParseException;
use libphonenumber\PhoneNumberFormat;
use libphonenumber\PhoneNumberType;
use libphonenumber\PhoneNumberUtil;
use libphonenumber\ShortNumberCost;
use libphonenumber\ShortNumberInfo;

/**
 * Verifies all of the example numbers in the metadata are valid and of the correct type. If no
 * example number exists for a particular type, the test still passes since not all types are
 * relevant for all regions. Tests that check the XML schema will ensure that an exampleNumber
 * node is present for every phone number description.
 */
class ExampleNumbersTest extends \PHPUnit_Framework_TestCase
{

    /**
     * @var PhoneNumberUtil
     */
    private $phoneNumberUtil;
    /**
     * @var ShortNumberInfo
     */
    private $shortNumberInfo;

    public static function setUpBeforeClass()
    {
        PhoneNumberUtil::resetInstance();
        PhoneNumberUtil::getInstance();
        ShortNumberInfo::resetInstance();
    }

    public function setUp()
    {
        $this->phoneNumberUtil = PhoneNumberUtil::getInstance();
        $this->shortNumberInfo = ShortNumberInfo::getInstance();
    }

    public function regionList()
    {
        $returnList = array();

        PhoneNumberUtil::resetInstance();
        $phoneUtil = PhoneNumberUtil::getInstance();
        foreach ($phoneUtil->getSupportedRegions() as $regionCode) {
            $returnList[] = array($regionCode);
        }

        return $returnList;
    }

    public function numberTypes()
    {
        return array(
            array(PhoneNumberType::FIXED_LINE),
            array(PhoneNumberType::MOBILE),
            array(PhoneNumberType::FIXED_LINE_OR_MOBILE),
            array(PhoneNumberType::TOLL_FREE),
            array(PhoneNumberType::PREMIUM_RATE),
            array(PhoneNumberType::SHARED_COST),
            array(PhoneNumberType::VOIP),
            array(PhoneNumberType::PERSONAL_NUMBER),
            array(PhoneNumberType::PAGER),
            array(PhoneNumberType::UAN),
            array(PhoneNumberType::VOICEMAIL),
        );
    }

    /**
     * @dataProvider regionList
     */
    public function testFixedLine($region)
    {
        $fixedLineTypes = array(PhoneNumberType::FIXED_LINE, PhoneNumberType::FIXED_LINE_OR_MOBILE);
        $this->checkNumbersValidAndCorrectType(PhoneNumberType::FIXED_LINE, $fixedLineTypes, $region);
    }

    /**
     * @dataProvider regionList
     */
    public function testFixedLineOrMobile($region)
    {
        $numberTypes = array(PhoneNumberType::FIXED_LINE, PhoneNumberType::FIXED_LINE_OR_MOBILE);
        $this->checkNumbersValidAndCorrectType(PhoneNumberType::FIXED_LINE_OR_MOBILE, $numberTypes, $region);
    }

    private function checkNumbersValidAndCorrectType($exampleNumberRequestedType, $possibleExpectedTypes, $regionCode)
    {
        $exampleNumber = $this->phoneNumberUtil->getExampleNumberForType($regionCode, $exampleNumberRequestedType);
        if ($exampleNumber !== null) {
            $this->assertTrue(
                $this->phoneNumberUtil->isValidNumber($exampleNumber),
                "Failed validation for {$exampleNumber}"
            );

            // We know the number is valid, now we check the type.
            $exampleNumberType = $this->phoneNumberUtil->getNumberType($exampleNumber);
            $this->assertContains($exampleNumberType, $possibleExpectedTypes, "Wrong type for {$exampleNumber}");
        }
    }

    /**
     * @dataProvider regionList
     */
    public function testMobile($region)
    {
        $mobileTypes = array(PhoneNumberType::MOBILE, PhoneNumberType::FIXED_LINE_OR_MOBILE);
        $this->checkNumbersValidAndCorrectType(PhoneNumberType::MOBILE, $mobileTypes, $region);
    }

    /**
     * @dataProvider regionList
     */
    public function testTollFree($region)
    {
        $tollFreeTypes = array(PhoneNumberType::TOLL_FREE);
        $this->checkNumbersValidAndCorrectType(PhoneNumberType::TOLL_FREE, $tollFreeTypes, $region);
    }

    /**
     * @dataProvider regionList
     */
    public function testPremiumRate($region)
    {
        $premiumRateTypes = array(PhoneNumberType::PREMIUM_RATE);
        $this->checkNumbersValidAndCorrectType(PhoneNumberType::PREMIUM_RATE, $premiumRateTypes, $region);
    }

    /**
     * @dataProvider regionList
     */
    public function testVoip($region)
    {
        $voipTypes = array(PhoneNumberType::VOIP);
        $this->checkNumbersValidAndCorrectType(PhoneNumberType::VOIP, $voipTypes, $region);
    }

    /**
     * @dataProvider regionList
     */
    public function testPager($region)
    {
        $pagerTypes = array(PhoneNumberType::PAGER);
        $this->checkNumbersValidAndCorrectType(PhoneNumberType::PAGER, $pagerTypes, $region);
    }

    /**
     * @dataProvider regionList
     */
    public function testUan($region)
    {
        $uanTypes = array(PhoneNumberType::UAN);
        $this->checkNumbersValidAndCorrectType(PhoneNumberType::UAN, $uanTypes, $region);
    }

    /**
     * @dataProvider regionList
     */
    public function testVoicemail($region)
    {
        $voicemailTypes = array(PhoneNumberType::VOICEMAIL);
        $this->checkNumbersValidAndCorrectType(PhoneNumberType::VOICEMAIL, $voicemailTypes, $region);
    }

    /**
     * @dataProvider regionList
     */
    public function testPersonalNumber($region)
    {
        $numberTypes = array(PhoneNumberType::PERSONAL_NUMBER);
        $this->checkNumbersValidAndCorrectType(PhoneNumberType::PERSONAL_NUMBER, $numberTypes, $region);
    }

    /**
     * @dataProvider regionList
     */
    public function testSharedCost($region)
    {
        $sharedCostTypes = array(PhoneNumberType::SHARED_COST);
        $this->checkNumbersValidAndCorrectType(PhoneNumberType::SHARED_COST, $sharedCostTypes, $region);
    }

    /**
     * @dataProvider regionList
     */
    public function testCanBeInternationallyDialled($regionCode)
    {
        $exampleNumber = null;
        /** @var \libphonenumber\PhoneNumberDesc $desc */
        $desc = $this->phoneNumberUtil->getMetadataForRegion($regionCode)->getNoInternationalDialling();
        try {
            if ($desc->hasExampleNumber()) {
                $exampleNumber = $this->phoneNumberUtil->parse($desc->getExampleNumber(), $regionCode);
            }
        } catch (NumberParseException $e) {
        }

        if ($exampleNumber !== null && $this->phoneNumberUtil->canBeInternationallyDialled($exampleNumber)) {
            $this->fail("Number {$exampleNumber} should not be internationally diallable");
        }
    }

    public function shortNumberRegionList()
    {
        $returnList = array();

        PhoneNumberUtil::resetInstance();
        ShortNumberInfo::resetInstance();
        $shortNumberInfo = ShortNumberInfo::getInstance();
        foreach ($shortNumberInfo->getSupportedRegions() as $regionCode) {
            $returnList[] = array($regionCode);
        }

        return $returnList;
    }

    public function supportedGlobalNetworkCallingCodes()
    {
        $returnList = array();

        PhoneNumberUtil::resetInstance();
        $phoneUtil = PhoneNumberUtil::getInstance();
        foreach ($phoneUtil->getSupportedGlobalNetworkCallingCodes() as $callingCode) {
            $returnList[] = array($callingCode);
        }

        return $returnList;
    }

    /**
     * @dataProvider supportedGlobalNetworkCallingCodes
     */
    public function testGlobalNetworkNumbers($callingCode)
    {
        $exampleNumber = $this->phoneNumberUtil->getExampleNumberForNonGeoEntity($callingCode);
        $this->assertNotNull($exampleNumber, "No example phone number for calling code " . $callingCode);
        if (!$this->phoneNumberUtil->isValidNumber($exampleNumber)) {
            $this->fail("Failed validation for " . $exampleNumber);
        }
    }

    /**
     * @dataProvider regionList
     * @param string $regionCode
     */
    public function testEveryRegionHasAnExampleNumber($regionCode)
    {
        $exampleNumber = $this->phoneNumberUtil->getExampleNumber($regionCode);
        $this->assertNotNull($exampleNumber, "No example number found for region " . $regionCode);

        /*
         * Check the number is valid
         */

        $e164 = $this->phoneNumberUtil->format($exampleNumber, PhoneNumberFormat::E164);

        $phoneObject = $this->phoneNumberUtil->parse($e164, 'ZZ');

        $this->assertEquals($phoneObject, $exampleNumber);

        $this->assertTrue($this->phoneNumberUtil->isValidNumber($phoneObject));
        $this->assertTrue($this->phoneNumberUtil->isValidNumberForRegion($phoneObject, $regionCode));
    }

    /**
     * @dataProvider regionList
     * @param string $regionCode
     */
    public function testEveryRegionHasAnInvalidExampleNumber($regionCode)
    {
        $exampleNumber = $this->phoneNumberUtil->getInvalidExampleNumber($regionCode);
        $this->assertNotNull($exampleNumber, 'No invalid example number found for region ' . $regionCode);
    }

    /**
     * @dataProvider numberTypes
     * @param string $numberType
     */
    public function testEveryTypeHasAnExampleNumber($numberType)
    {
        $exampleNumber = $this->phoneNumberUtil->getExampleNumberForType($numberType);
        $this->assertNotNull($exampleNumber, 'No example number found for type ' . $numberType);
    }

    /**
     * @dataProvider shortNumberRegionList
     */
    public function testShortNumbersValidAndCorrectCost($regionCode)
    {
        $exampleShortNumber = $this->shortNumberInfo->getExampleShortNumber($regionCode);
        if (!$this->shortNumberInfo->isValidShortNumberForRegion(
            $this->phoneNumberUtil->parse($exampleShortNumber, $regionCode),
            $regionCode
        )
        ) {
            $this->fail(
                "Failed validation for string region_code: {$regionCode}, national_number: {$exampleShortNumber}"
            );
        }
        $phoneNumber = $this->phoneNumberUtil->parse($exampleShortNumber, $regionCode);
        if (!$this->shortNumberInfo->isValidShortNumber($phoneNumber)) {
            $this->fail("Failed validation for " . (string)$phoneNumber);
        }
    }

    public function shortRegionListAndNumberCost()
    {
        $costArray = array(
            ShortNumberCost::PREMIUM_RATE,
            ShortNumberCost::STANDARD_RATE,
            ShortNumberCost::TOLL_FREE,
            ShortNumberCost::UNKNOWN_COST
        );

        $output = array();

        foreach ($this->shortNumberRegionList() as $region) {
            foreach ($costArray as $cost) {
                $output[] = array($region[0], $cost);
            }
        }

        return $output;
    }

    /**
     * @dataProvider shortRegionListAndNumberCost
     * @param $regionCode
     * @param $cost
     */
    public function testShortNumberHasCorrectCost($regionCode, $cost)
    {
        $exampleShortNumber = $this->shortNumberInfo->getExampleShortNumberForCost($regionCode, $cost);
        if ($exampleShortNumber != '') {
            $phoneNumber = $this->phoneNumberUtil->parse($exampleShortNumber, $regionCode);
            $exampleShortNumberCost = $this->shortNumberInfo->getExpectedCostForRegion($phoneNumber, $regionCode);

            $this->assertEquals($cost, $exampleShortNumberCost, 'Wrong cost for ' . (string)$phoneNumber);
        }
    }

    /**
     * @dataProvider shortNumberRegionList
     */
    public function testEmergency($regionCode)
    {
        $desc = $this->shortNumberInfo->getMetadataForRegion($regionCode)->getEmergency();
        if ($desc->hasExampleNumber()) {
            $exampleNumber = $desc->getExampleNumber();
            $phoneNumber = $this->phoneNumberUtil->parse($exampleNumber, $regionCode);

            if (!$this->shortNumberInfo->isPossibleShortNumberForRegion(
                    $phoneNumber,
                    $regionCode
                ) || !$this->shortNumberInfo->isEmergencyNumber($exampleNumber, $regionCode)
            ) {
                $this->fail("Emergency example number test failed for " . $regionCode);
            } elseif ($this->shortNumberInfo->getExpectedCostForRegion(
                    $phoneNumber,
                    $regionCode
                ) !== ShortNumberCost::TOLL_FREE
            ) {
                $this->fail("Emergency example number not toll free for " . $regionCode);
            }
        }
    }

    /**
     * @dataProvider shortNumberRegionList
     * @param string $regionCode
     */
    public function testCarrierSpecificShortNumbers($regionCode)
    {
        // Test the carrier-specific tag.
        $desc = $this->shortNumberInfo->getMetadataForRegion($regionCode)->getCarrierSpecific();
        if ($desc->hasExampleNumber()) {
            $exampleNumber = $desc->getExampleNumber();
            $carrierSpecificNumber = $this->phoneNumberUtil->parse($exampleNumber, $regionCode);

            if (!$this->shortNumberInfo->isPossibleShortNumberForRegion($carrierSpecificNumber, $regionCode)
                || !$this->shortNumberInfo->isCarrierSpecificForRegion($carrierSpecificNumber, $regionCode)
            ) {
                $this->fail("Carrier-specific test failed for " . $regionCode);
            }
        }
    }

    /**
     * @dataProvider shortNumberRegionList
     * @param string $regionCode
     */
    public function testSmsServiceShortNumbers($regionCode)
    {
        $desc = $this->shortNumberInfo->getMetadataForRegion($regionCode)->getSmsServices();

        if ($desc->hasExampleNumber()) {
            $exampleNumber = $desc->getExampleNumber();
            $smsServiceNumber = $this->phoneNumberUtil->parse($exampleNumber, $regionCode);
            if (!$this->shortNumberInfo->isPossibleShortNumberForRegion($smsServiceNumber, $regionCode)
                || !$this->shortNumberInfo->isSmsServiceForRegion($smsServiceNumber, $regionCode)) {
                $this->fail('SMS service test failed for ' . $regionCode);
            }
        }
    }
}


text:
using System;
using System.Drawing;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;

#if XAMCORE_2_0
using UIKit;
using CoreGraphics;
using Foundation;
using CoreAnimation;
#else
using MonoTouch.UIKit;
using MonoTouch.CoreGraphics;
using MonoTouch.Foundation;
using MonoTouch.CoreAnimation;
#endif

using MonoTouch.Dialog.Utilities;

#if !XAMCORE_2_0
using nint = global::System.Int32;
using nuint = global::System.UInt32;
using nfloat = global::System.Single;

using CGSize = global::System.Drawing.SizeF;
using CGPoint = global::System.Drawing.PointF;
using CGRect = global::System.Drawing.RectangleF;
#endif

namespace MonoTouch.Dialog
{
	public enum RefreshViewStatus {
		ReleaseToReload,
		PullToReload,
		Loading
	}

	// This cute method will be added to UIImage.FromResource, but for old installs
	// make a copy here
	internal static class Util {
		public static UIImage FromResource (Assembly assembly, string name)
		{
			if (name == null)
				throw new ArgumentNullException ("name");
			assembly = Assembly.GetCallingAssembly ();
			var stream = assembly.GetManifestResourceStream (name);
			if (stream == null)
				return null;

			try {
				using (var data = NSData.FromStream (stream))
					return UIImage.LoadFromData (data);
			} finally {
				stream.Dispose ();
			}
		}

	}

	public class RefreshTableHeaderView : UIView {
		static UIImage arrow = Util.FromResource (null, "arrow.png");
		protected UIActivityIndicatorView Activity;
		protected UILabel LastUpdateLabel, StatusLabel;
		protected UIImageView ArrowView;

		public RefreshTableHeaderView (CGRect rect) : base (rect)
		{
			this.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;

			BackgroundColor = new UIColor (0.88f, 0.9f, 0.92f, 1);
			CreateViews ();
		}

		public virtual void CreateViews ()
		{
			LastUpdateLabel = new UILabel (){
				Font = UIFont.SystemFontOfSize (13f),
				TextColor = new UIColor (0.47f, 0.50f, 0.57f, 1),
				ShadowColor = UIColor.White,
				ShadowOffset = new CGSize (0, 1),
				BackgroundColor = this.BackgroundColor,
				Opaque = true,
				TextAlignment = UITextAlignment.Center,
				AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin
			};
			AddSubview (LastUpdateLabel);

			StatusLabel = new UILabel (){
				Font = UIFont.BoldSystemFontOfSize (14),
				TextColor = new UIColor (0.47f, 0.50f, 0.57f, 1),
				ShadowColor = LastUpdateLabel.ShadowColor,
				ShadowOffset = new CGSize (0, 1),
				BackgroundColor = this.BackgroundColor,
				Opaque = true,
				TextAlignment = UITextAlignment.Center,
				AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin
			};
			AddSubview (StatusLabel);
			SetStatus (RefreshViewStatus.PullToReload);

			ArrowView = new UIImageView (){
				ContentMode = UIViewContentMode.ScaleAspectFill,
				Image = arrow,
				AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin
			};
			ArrowView.Layer.Transform = CATransform3D.MakeRotation ((float) Math.PI, 0, 0, 1);
			AddSubview (ArrowView);

			Activity = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.Gray) {
				HidesWhenStopped = true,
				AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin
			};
			AddSubview (Activity);
		}

		public override void LayoutSubviews ()
		{
			base.LayoutSubviews ();
			var bounds = Bounds;

			LastUpdateLabel.Frame = new CGRect (0, bounds.Height - 30, bounds.Width, 20);
			StatusLabel.Frame = new CGRect (0, bounds.Height-48, bounds.Width, 20);
			ArrowView.Frame = new CGRect (20, bounds.Height - 65, 30, 55);
			Activity.Frame = new CGRect (25, bounds.Height-38, 20, 20);
		}

		RefreshViewStatus status = (RefreshViewStatus) (-1);

		public virtual void SetStatus (RefreshViewStatus status)
		{
			if (this.status == status)
				return;

			string s = "Release to refresh".GetText ();

			switch (status){
			case RefreshViewStatus.Loading:
				s = "Loading...".GetText ();
				break;

			case RefreshViewStatus.PullToReload:
				s = "Pull down to refresh...".GetText ();
				break;
			}
			StatusLabel.Text = s;
		}

		public override void Draw (CGRect rect)
		{
			var context = UIGraphics.GetCurrentContext ();
			context.DrawPath (CGPathDrawingMode.FillStroke);
			StatusLabel.TextColor.SetStroke ();
			context.BeginPath ();
			context.MoveTo (0, Bounds.Height-1);
			context.AddLineToPoint (Bounds.Width, Bounds.Height-1);
			context.StrokePath ();
		}

		public bool IsFlipped;

		public void Flip (bool animate)
		{
			UIView.BeginAnimations (null);
			UIView.SetAnimationDuration (animate ? .18f : 0);
			ArrowView.Layer.Transform = IsFlipped
				? CATransform3D.MakeRotation ((float)Math.PI, 0, 0, 1)
				: CATransform3D.MakeRotation ((float)Math.PI * 2, 0, 0, 1);

			UIView.CommitAnimations ();
			IsFlipped = !IsFlipped;
		}

		DateTime lastUpdateTime;
		public DateTime LastUpdate {
			get {
				return lastUpdateTime;
			}
			set {
				if (value == lastUpdateTime)
					return;

				lastUpdateTime = value;
				if (value == DateTime.MinValue){
					LastUpdateLabel.Text = "Last Updated: never".GetText ();
				} else
					LastUpdateLabel.Text = String.Format ("Last Updated: {0:d} {1}".GetText (), value, value.ToString("h:mm tt"));
			}
		}

		public void SetActivity (bool active)
		{
			if (active){
				Activity.StartAnimating ();
				ArrowView.Hidden = true;
				SetStatus (RefreshViewStatus.Loading);
			} else {
				Activity.StopAnimating ();
				ArrowView.Hidden = false;
			}
		}
	}

	public class SearchChangedEventArgs : EventArgs {
		public SearchChangedEventArgs (string text)
		{
			Text = text;
		}
		public string Text { get; set; }
	}
}

redpajama_set_name: RedPajamaGithub


text:
FROM phusion/baseimage

# Use baseimage's init process
CMD ["/sbin/my_init"]

# Install RabbitMQ. (https://github.com/dockerfile/rabbitmq/blob/master/Dockerfile)
RUN \
  apt-get update && \
  apt-get install -y wget make build-essential tcl8.5 gcc && \
  wget -qO - https://www.rabbitmq.com/rabbitmq-signing-key-public.asc | apt-key add - && \
  echo "deb http://www.rabbitmq.com/debian/ testing main" > /etc/apt/sources.list.d/rabbitmq.list && \
  apt-get update && \
  DEBIAN_FRONTEND=noninteractive apt-get install -y rabbitmq-server && \
  rm -rf /var/lib/apt/lists/* && \
  rabbitmq-plugins enable rabbitmq_management && \
  echo "[{rabbit, [{loopback_users, []}]}]." > /etc/rabbitmq/rabbitmq.config

RUN \
  apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 && \
  echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' > /etc/apt/sources.list.d/mongodb.list && \
  apt-get update && \
  apt-get install -y mongodb-org && \
  rm -rf /var/lib/apt/lists/*

# Define environment variables.
ENV RABBITMQ_LOG_BASE /data/log
ENV RABBITMQ_MNESIA_BASE /data/mnesia

# Define mount points.
VOLUME ["/data/db", "/data/log", "/data/mnesia"]

WORKDIR /data

ADD build/server /opt/webhooker/server
ADD depl/scripts/webhooker-start /etc/service/webhooker-server/run
ADD depl/scripts/rabbitmq-start /etc/service/rabbitmq/run
ADD depl/scripts/mongodb-start /etc/service/mongodb/run

RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

EXPOSE 80
EXPOSE 15672
EXPOSE 27017
EXPOSE 28017


text:
import {Expression} from '@angular/compiler';
import * as ts from 'typescript';

import {identifierOfNode} from '../../util/src/typescript';

export enum ImportMode {
  UseExistingImport,
  ForceNewImport,
}

export interface OwningModule {
  specifier: string;
  resolutionContext: string;
}

/**
 * A `ts.Node` plus the context in which it was discovered.
 *
 * A `Reference` is a pointer to a `ts.Node` that was extracted from the program somehow. It
 * contains not only the node itself, but the information regarding how the node was located. In
 * particular, it might track different identifiers by which the node is exposed, as well as
 * potentially a module specifier which might expose the node.
 *
 * The Angular compiler uses `Reference`s instead of `ts.Node`s when tracking classes or generating
 * imports.
 */
export class Reference<T extends ts.Node = ts.Node> {
  /**
   * The compiler's best guess at an absolute module specifier which owns this `Reference`.
   *
   * This is usually determined by tracking the import statements which led the compiler to a given
   * node. If any of these imports are absolute, it's an indication that the node being imported
   * might come from that module.
   *
   * It is not _guaranteed_ that the node in question is exported from its `bestGuessOwningModule` -
   * that is mostly a convention that applies in certain package formats.
   *
   * If `bestGuessOwningModule` is `null`, then it's likely the node came from the current program.
   */
  readonly bestGuessOwningModule: OwningModule|null;

  private identifiers: ts.Identifier[] = [];

  /**
   * Indicates that the Reference was created synthetically, not as a result of natural value
   * resolution.
   *
   * This is used to avoid misinterpreting the Reference in certain contexts.
   */
  synthetic = false;

  private _alias: Expression|null = null;

  constructor(readonly node: T, bestGuessOwningModule: OwningModule|null = null) {
    this.bestGuessOwningModule = bestGuessOwningModule;

    const id = identifierOfNode(node);
    if (id !== null) {
      this.identifiers.push(id);
    }
  }

  /**
   * The best guess at which module specifier owns this particular reference, or `null` if there
   * isn't one.
   */
  get ownedByModuleGuess(): string|null {
    if (this.bestGuessOwningModule !== null) {
      return this.bestGuessOwningModule.specifier;
    } else {
      return null;
    }
  }

  /**
   * Whether this reference has a potential owning module or not.
   *
   * See `bestGuessOwningModule`.
   */
  get hasOwningModuleGuess(): boolean { return this.bestGuessOwningModule !== null; }

  /**
   * A name for the node, if one is available.
   *
   * This is only suited for debugging. Any actual references to this node should be made with
   * `ts.Identifier`s (see `getIdentityIn`).
   */
  get debugName(): string|null {
    const id = identifierOfNode(this.node);
    return id !== null ? id.text : null;
  }

  get alias(): Expression|null { return this._alias; }

  /**
   * Record a `ts.Identifier` by which it's valid to refer to this node, within the context of this
   * `Reference`.
   */
  addIdentifier(identifier: ts.Identifier): void { this.identifiers.push(identifier); }

  /**
   * Get a `ts.Identifier` within this `Reference` that can be used to refer within the context of a
   * given `ts.SourceFile`, if any.
   */
  getIdentityIn(context: ts.SourceFile): ts.Identifier|null {
    return this.identifiers.find(id => id.getSourceFile() === context) || null;
  }

  cloneWithAlias(alias: Expression): Reference<T> {
    const ref = new Reference(this.node, this.bestGuessOwningModule);
    ref.identifiers = [...this.identifiers];
    ref._alias = alias;
    return ref;
  }

  cloneWithNoIdentifiers(): Reference<T> {
    const ref = new Reference(this.node, this.bestGuessOwningModule);
    ref._alias = this._alias;
    ref.identifiers = [];
    return ref;
  }
}


text:
package com.example.just.businesinfo.ImageLoader;

import android.widget.ImageView;

public interface IImageLoader {
    void drawBitmap(final ImageView imageView, final String imageUrl);

    class Impl {
        public static IImageLoader newInstance() {
            return new ImageLoaderImpl();
        }
    }
}


text:
class DatasetsController < ApplicationController
  def index
    @datasets = current_account.datasets.all
  end

  def new
    @dataset = Dataset.new

    @object = @dataset
  end

  def preview
    @dataset = Dataset.new(params[:dataset])
    if @dataset.format == nil || @dataset.format.empty?
      redirect_to new_dataset_path, :flash => { :error => 'Please enter your desired data format...' }
    end

    @object = @dataset

    if params[:number_of_entities].nil? || params[:number_of_entities] == ''
      @number_of_entities = 10
    else
      @number_of_entities = params[:number_of_entities].to_i
    end

    @text = Mannequin::Text.new

    @dataset.output = ''

    @number_of_entities.times do
      @person = Mannequin::Person.new
      @address = Mannequin::Address.new
      @number = Mannequin::Number.new

      map_variables_to_data = {
        "[[name_first]]" => @person.first_name, #deprecated
        "[[first_name]]" => @person.first_name,
        "[[name_last]]" => @person.last_name, #deprecated
        "[[last_name]]" => @person.last_name,
        "[[initial]]" => @person.middle_initial,
        "[[middle_initial]]" => @person.middle_initial,
        "[[email_address]]" => @person.email_address,
        "[[street_address]]" => @address.street_address,
        "[[street_number]]" => @address.street_number,
        "[[street_name]]" => @address.street_name,
        "[[street_type]]" => @address.street_type,
        "[[city]]" => @address.city,
        "[[state]]" => @address.state,
        "[[state_code]]" => @address.state_code,
        "[[country]]" => @address.country,
        "[[number_1_digit]]" => @number.digits_1, #deprecated
        "[[number_digits_1]]" => @number.digits_1,
        "[[number_2_digit]]" => @number.digits_2, #deprecated
        "[[number_digits_2]]" => @number.digits_2,
        "[[number_3_digit]]" => @number.digits_3, #deprecated
        "[[number_digits_3]]" => @number.digits_3,
        "[[number_4_digit]]" => @number.digits_4, #deprecated
        "[[number_digits_4]]" => @number.digits_4,
        "[[number_5_digit]]" => @number.digits_5, #deprecated
        "[[number_digits_5]]" => @number.digits_5,
        "[[number_6_digit]]" => @number.digits_6, #deprecated
        "[[number_digits_6]]" => @number.digits_6,
        "[[number_7_digit]]" => @number.digits_7, #deprecated
        "[[number_digits_7]]" => @number.digits_7,
        "[[number_8_digit]]" => @number.digits_8, #deprecated
        "[[number_digits_8]]" => @number.digits_8,
        "[[number_9_digit]]" => @number.digits_9, #deprecated
        "[[number_digits_9]]" => @number.digits_9,
        "[[lipsum_1]]" => @text.lipsum_paragraphs_1, #deprecated
        "[[lipsum_paragraphs_1]]" => @text.lipsum_paragraphs_1,
        "[[lipsum_2]]" => @text.lipsum_paragraphs_2, #deprecated
        "[[lipsum_paragraphs_2]]" => @text.lipsum_paragraphs_2,
        "[[lipsum_3]]" => @text.lipsum_paragraphs_3, #deprecated
        "[[lipsum_paragraphs_3]]" => @text.lipsum_paragraphs_3,
        "[[lipsum_4]]" => @text.lipsum_paragraphs_4, #deprecated
        "[[lipsum_paragraphs_4]]" => @text.lipsum_paragraphs_4,
        "[[lipsum_5]]" => @text.lipsum_paragraphs_5, #deprecated
        "[[lipsum_paragraphs_5]]" => @text.lipsum_paragraphs_5
      }
      regular_expression = Regexp.union(map_variables_to_data.keys)

      @dataset.output << @dataset.format.gsub(regular_expression, map_variables_to_data)

      if @number_of_entities > 1
        @dataset.output << "\n\n"
      end
    end
  end

  def create
    @dataset = Dataset.new(params[:dataset])
    @dataset.account_id = current_account.id

    @object = @dataset

    if @dataset.save
      redirect_to datasets_path, :notice => 'Save successful!'
    else
      render :preview
    end
  end

  def show
    @dataset = current_account.datasets.find(params[:id])
  end

  def destroy
    @dataset = current_account.datasets.find(params[:id])
    @dataset.destroy

    respond_to do |format|
      format.html { redirect_to(datasets_url) }
    end
  end
end


text:
// Copyright 2015 Google Inc. All Rights Reserved.
//
// 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.

package dfp.axis.v201511.lineitemservice;

import com.google.api.ads.common.lib.auth.OfflineCredentials;
import com.google.api.ads.common.lib.auth.OfflineCredentials.Api;
import com.google.api.ads.dfp.axis.factory.DfpServices;
import com.google.api.ads.dfp.axis.utils.v201511.DateTimes;
import com.google.api.ads.dfp.axis.v201511.AdUnitTargeting;
import com.google.api.ads.dfp.axis.v201511.CompanionDeliveryOption;
import com.google.api.ads.dfp.axis.v201511.ContentMetadataKeyHierarchyTargeting;
import com.google.api.ads.dfp.axis.v201511.ContentTargeting;
import com.google.api.ads.dfp.axis.v201511.CostType;
import com.google.api.ads.dfp.axis.v201511.CreativePlaceholder;
import com.google.api.ads.dfp.axis.v201511.CreativeRotationType;
import com.google.api.ads.dfp.axis.v201511.EnvironmentType;
import com.google.api.ads.dfp.axis.v201511.Goal;
import com.google.api.ads.dfp.axis.v201511.GoalType;
import com.google.api.ads.dfp.axis.v201511.InventoryTargeting;
import com.google.api.ads.dfp.axis.v201511.LineItem;
import com.google.api.ads.dfp.axis.v201511.LineItemServiceInterface;
import com.google.api.ads.dfp.axis.v201511.LineItemType;
import com.google.api.ads.dfp.axis.v201511.Money;
import com.google.api.ads.dfp.axis.v201511.Size;
import com.google.api.ads.dfp.axis.v201511.StartDateTimeType;
import com.google.api.ads.dfp.axis.v201511.Targeting;
import com.google.api.ads.dfp.axis.v201511.VideoPosition;
import com.google.api.ads.dfp.axis.v201511.VideoPositionTarget;
import com.google.api.ads.dfp.axis.v201511.VideoPositionTargeting;
import com.google.api.ads.dfp.axis.v201511.VideoPositionType;
import com.google.api.ads.dfp.lib.client.DfpSession;
import com.google.api.client.auth.oauth2.Credential;

import org.joda.time.Duration;
import org.joda.time.Instant;

import java.util.Random;

/**
 * This example creates a new line item for a video environment. To determine
 * which line items exist, run GetAllLineItems.java. To determine which orders
 * exist, run GetAllOrders.java. To determine which content metadata key
 * hierarchies exist, run GetAllContentMetadataKeyHierarchies.java. To determine
 * which ad units exist, run GetAllAdUnits.java.
 *
 * Credentials and properties in {@code fromFile()} are pulled from the
 * "ads.properties" file. See README for more info.
 */
public class CreateVideoLineItems {

  // Set the ID of the order that the line item will belong to.
  private static final String ORDER_ID = "INSERT_ORDER_ID_HERE";

  // Set the ID of the ad unit that the line item will target.
  private static final String TARGETED_VIDEO_AD_UNIT_ID = "INSERT_VIDEO_AD_UNIT_ID_HERE";

  // Set the custom targeting value ID representing the metadata
  // on the content to target. This would typically be from a key representing
  // a "genre" and the value representing something like "comedy". The value
  // must be from a key in a content metadata key hierarchy.
  private static final String CONTENT_CUSTOM_TARGETING_VALUE_ID =
      "INSERT_CUSTOM_TARGETING_VALUE_ID_HERE";

  public static void runExample(DfpServices dfpServices, DfpSession session, long orderId,
      String targetedVideoAdUnitId, long contentCustomTargetingValueId) throws Exception {
    // Get the LineItemService.
    LineItemServiceInterface lineItemService =
        dfpServices.get(session, LineItemServiceInterface.class);

    // Create content targeting.
    ContentMetadataKeyHierarchyTargeting contentMetadataTargeting =
        new ContentMetadataKeyHierarchyTargeting();
    contentMetadataTargeting.setCustomTargetingValueIds(
        new long[] {contentCustomTargetingValueId});

    ContentTargeting contentTargeting = new ContentTargeting();
    contentTargeting.setTargetedContentMetadata(
        new ContentMetadataKeyHierarchyTargeting[] {contentMetadataTargeting});

    // Create inventory targeting.
    InventoryTargeting inventoryTargeting = new InventoryTargeting();
    inventoryTargeting.setTargetedAdUnits(
        new AdUnitTargeting[] {new AdUnitTargeting(targetedVideoAdUnitId, true)});

    // Create video position targeting.
    VideoPosition videoPosition = new VideoPosition();
    videoPosition.setPositionType(VideoPositionType.PREROLL);
    VideoPositionTarget videoPositionTarget = new VideoPositionTarget();
    videoPositionTarget.setVideoPosition(videoPosition);
    VideoPositionTargeting videoPositionTargeting = new VideoPositionTargeting();
    videoPositionTargeting.setTargetedPositions(
        new VideoPositionTarget[] {videoPositionTarget});

    // Create targeting.
    Targeting targeting = new Targeting();
    targeting.setContentTargeting(contentTargeting);
    targeting.setInventoryTargeting(inventoryTargeting);
    targeting.setVideoPositionTargeting(videoPositionTargeting);

    // Create local line item object.
    LineItem lineItem = new LineItem();
    lineItem.setName("Video line item #" + new Random().nextInt(Integer.MAX_VALUE));
    lineItem.setOrderId(orderId);
    lineItem.setTargeting(targeting);

    // Allow the line item to be booked even if there is not enough inventory.
    lineItem.setAllowOverbook(true);

    // Set the line item type to SPONSORSHIP.
    lineItem.setLineItemType(LineItemType.SPONSORSHIP);

    // Set the environment type to video.
    lineItem.setEnvironmentType(EnvironmentType.VIDEO_PLAYER);

    // Set the creative rotation type to optimized.
    lineItem.setCreativeRotationType(CreativeRotationType.OPTIMIZED);

    // Create the master creative placeholder.
    CreativePlaceholder creativeMasterPlaceholder = new CreativePlaceholder();
    creativeMasterPlaceholder.setSize(new Size(640, 360, false));

    // Create companion creative placeholders.
    CreativePlaceholder companionCreativePlaceholder = new CreativePlaceholder();
    companionCreativePlaceholder.setSize(new Size(300, 250, false));

    // Set companion creative placeholders.
    creativeMasterPlaceholder.setCompanions(
        new CreativePlaceholder[] {companionCreativePlaceholder});

    // Set the size of creatives that can be associated with this line item.
    lineItem.setCreativePlaceholders(new CreativePlaceholder[] {creativeMasterPlaceholder});

    // Set delivery of video companions to optional.
    lineItem.setCompanionDeliveryOption(CompanionDeliveryOption.OPTIONAL);

    // Set the length of the line item to run.
    lineItem.setStartDateTimeType(StartDateTimeType.IMMEDIATELY);
    lineItem.setEndDateTime(
        DateTimes.toDateTime(Instant.now().plus(Duration.standardDays(30L)), "America/New_York"));

    // Set the cost per day to $1.
    lineItem.setCostType(CostType.CPD);
    lineItem.setCostPerUnit(new Money("USD", 1000000L));

    // Set the percentage to be 100%.
    Goal goal = new Goal();
    goal.setGoalType(GoalType.DAILY);
    goal.setUnits(100L);
    lineItem.setPrimaryGoal(goal);

    // Create the line item on the server.
    LineItem[] lineItems = lineItemService.createLineItems(new LineItem[] {lineItem});

    for (LineItem createdLineItem : lineItems) {
      System.out.printf("A video line item with ID %d and name '%s' was created.%n",
          createdLineItem.getId(), createdLineItem.getName());
    }
  }

  public static void main(String[] args) throws Exception {
    // Generate a refreshable OAuth2 credential.
    Credential oAuth2Credential = new OfflineCredentials.Builder()
        .forApi(Api.DFP)
        .fromFile()
        .build()
        .generateCredential();

    // Construct a DfpSession.
    DfpSession session = new DfpSession.Builder()
        .fromFile()
        .withOAuth2Credential(oAuth2Credential)
        .build();

    DfpServices dfpServices = new DfpServices();

    runExample(dfpServices,
        session,
        Long.parseLong(ORDER_ID),
        TARGETED_VIDEO_AD_UNIT_ID,
        Long.parseLong(CONTENT_CUSTOM_TARGETING_VALUE_ID));
  }
}


text:
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
var cors = require('cors');

var films = require('./routes/film');

var app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');

// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

app.use(cors());
// app.options('*', cors());

app.use('/films', films);

// app.options('*', cors());

// catch 404 and forward to error handler
app.use(function(req, res, next) {
  var err = new Error('Not Found');
  err.status = 404;
  next(err);
});

// error handlers

// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
  app.use(function(err, req, res, next) {
    res.status(err.status || 500);
    res.render('error', {
      message: err.message,
      error: err
    });
  });
}

// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
  res.status(err.status || 500);
  res.render('error', {
    message: err.message,
    error: {}
  });
});

mongoose.Promise = global.Promise;

mongoose.connect('mongodb://localhost/catEyeDB')
        .catch(function (err) {
          console.log(err);
        });

module.exports = app;


text:
package com.smorales.javalab.business.processor.boundary.rest.request;

public class RunnableNode {

    private String id;
    private String path;
    private boolean mainClass;
    private boolean testClass;

    public String getId() {
        return id;
    }

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

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public boolean isMainClass() {
        return mainClass;
    }

    public void setMainClass(boolean mainClass) {
        this.mainClass = mainClass;
    }

    public boolean isTestClass() {
        return testClass;
    }

    public void setTestClass(boolean testClass) {
        this.testClass = testClass;
    }

    @Override
    public String toString() {
        return "RunnableNode{" +
                "id='" + id + '\'' +
                ", path='" + path + '\'' +
                ", mainClass=" + mainClass +
                ", testClass=" + testClass +
                '}';
    }
}


text:
package com.huawei.streaming.cql.semanticanalyzer.parser.visitor;

import org.antlr.v4.runtime.misc.NotNull;

import com.huawei.streaming.cql.semanticanalyzer.parser.CQLParser;

/**
 * range milliseconds 语法遍历
 *
 */
public class RangeMilliSecondsVisitor extends AbsCQLParserBaseVisitor<String>
{
    private String context = null;

    /**
     * <默认构造函数>
     */
    public RangeMilliSecondsVisitor()
    {

    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected String defaultResult()
    {
        return context;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String visitConstIntegerValue(@NotNull CQLParser.ConstIntegerValueContext ctx)
    {
        context = ctx.getText();
        return context;
    }

}


text:
namespace NetBike.Xml.Tests.Converters.Collections
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using NetBike.Xml.Converters;
    using NetBike.Xml.Converters.Collections;

    public class XmlArrayConverterTests : XmlCollectionConverterBaseTests
    {
        protected override IXmlConverter CreateConverter()
        {
            return new XmlArrayConverter();
        }

        protected override Type GetCollectionType<TItem>()
        {
            return typeof(TItem[]);
        }

        protected override object GetCollection<T>(IEnumerable<T> values)
        {
            return values.ToArray();
        }
    }
}


text:
using Cdiscount.OpenApi.ProxyClient.Config;
using Cdiscount.OpenApi.ProxyClient.Contract.GetProduct;
using Cdiscount.OpenApi.ProxyClient.Tests.Helper;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Cdiscount.OpenApi.ProxyClient.Tests
{
    [TestClass]
    public class GetProductTests
    {
        private OpenApiClient _openApiProxyClient;

        [TestInitialize]
        public void TestInitialize()
        {
            _openApiProxyClient = new OpenApiClient(new ProxyClientConfig
            {
                ApiKey = TestsHelper.GetCdiscountOpenApiKey(),
                DebugModeEnabled = true,
                Timeout = new TimeSpan(0, 0, 5)
            });
        }

        [TestMethod]
        public async Task GetProductAsync_1ProductByProductId_OperationSuccess()
        {
            var response = await _openApiProxyClient.GetProductAsync(new GetProductRequest
            {
                ProductIdList = new List<string> {"fincpangfirrnoir"},
                Scope = new GetProductRequestScope
                {
                    Ean = true
                }
            });

            Assert.IsNotNull(response);
            Assert.IsTrue(response.OperationSuccess);
            Assert.IsTrue(string.IsNullOrEmpty(response.ErrorMessage));
            Assert.AreEqual(1, response.Products.Count);

            var product = response.Products[0];
            Assert.AreEqual("fincpangfirrnoir".ToUpper(), product.Id);
            Assert.IsFalse(string.IsNullOrEmpty(product.Ean));
        }

        [TestMethod]
        public async Task GetProductAsync_2ProductsByProductId_OperationSuccess()
        {
            var response = await _openApiProxyClient.GetProductAsync(new GetProductRequest
            {
                ProductIdList = new List<string> { "fincpangfirrnoir", "TU03" },
                Scope = new GetProductRequestScope
                {
                    Ean = true
                }
            });

            Assert.IsNotNull(response);
            Assert.IsTrue(response.OperationSuccess);
            Assert.IsTrue(string.IsNullOrEmpty(response.ErrorMessage));
            Assert.AreEqual(2, response.Products.Count);
        }

        [TestMethod]
        public void GetProduct_1ProductByProductId_OperationSuccess()
        {
            var response = _openApiProxyClient.GetProduct(new GetProductRequest
            {
                ProductIdList = new List<string> { "fincpangfirrnoir" },
                Scope = new GetProductRequestScope
                {
                    Ean = true
                }
            });

            Assert.IsNotNull(response);
            Assert.IsTrue(response.OperationSuccess);
            Assert.IsTrue(string.IsNullOrEmpty(response.ErrorMessage));
            Assert.AreEqual(1, response.Products.Count);

            var product = response.Products[0];
            Assert.AreEqual("fincpangfirrnoir".ToUpper(), product.Id);
            Assert.IsFalse(string.IsNullOrEmpty(product.Ean));
        }

        [TestMethod]
        public void GetProduct_2ProductsByProductId_OperationSuccess()
        {
            var response = _openApiProxyClient.GetProduct(new GetProductRequest
            {
                ProductIdList = new List<string> { "fincpangfirrnoir", "TU03" },
                Scope = new GetProductRequestScope
                {
                    Ean = true
                }
            });

            Assert.IsNotNull(response);
            Assert.IsTrue(response.OperationSuccess);
            Assert.IsTrue(string.IsNullOrEmpty(response.ErrorMessage));
            Assert.AreEqual(2, response.Products.Count);
        }
    }
}


text:
package $basePackageName$;

import org.osgi.service.component.annotations.*;

@Component
public class Example {

	// TODO: class provided by template

}


text:
@import RevenueCat;

@implementation RCStoreProductDiscountAPI

+ (void)checkAPI {
    RCStoreProductDiscount *discount;

    NSString *offerIdentifier = discount.offerIdentifier;
    NSString *currencyCode = discount.currencyCode;
    NSDecimalNumber *price = discount.price;
    NSString *localizedPriceString = discount.localizedPriceString;
    RCPaymentMode paymentMode = discount.paymentMode;
    RCSubscriptionPeriod *period = discount.subscriptionPeriod;

    NSLog(
          offerIdentifier,
          currencyCode,
          price,
          localizedPriceString,
          paymentMode,
          period
    );
}

+ (void)checkPaymentModeEnum {
    RCPaymentMode paymentMode = RCPaymentModePayAsYouGo;

    switch (paymentMode) {
        case RCPaymentModePayAsYouGo:
        case RCPaymentModePayUpFront:
        case RCPaymentModeFreeTrial:
            break;
    }
}

+ (void)checkTypeEnum {
    RCDiscountType paymentMode = RCDiscountTypeIntroductory;

    switch (paymentMode) {
        case RCDiscountTypeIntroductory:
        case RCDiscountTypePromotional:
            break;
    }
}

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfOutputConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <OutputConfiguration>
    <commentVariableName>true</commentVariableName>
    <commentCharVisualizer>true</commentCharVisualizer>
    <commentCharDescriptor>true</commentCharDescriptor>
    <commentStyle>C</commentStyle>
    <bmpVisualizerChar>#</bmpVisualizerChar>
    <rotation>RotateZero</rotation>
    <flipHorizontal>false</flipHorizontal>
    <flipVertical>false</flipVertical>
    <paddingRemovalHorizontal>Fixed</paddingRemovalHorizontal>
    <paddingRemovalVertical>Tighest</paddingRemovalVertical>
    <lineWrap>AtColumn</lineWrap>
    <bitLayout>RowMajor</bitLayout>
    <byteOrder>LsbFirst</byteOrder>
    <byteFormat>Hex</byteFormat>
    <byteLeadingString>0x</byteLeadingString>
    <generateLookupArray>true</generateLookupArray>
    <descCharWidth>DisplayInBits</descCharWidth>
    <descCharHeight>DontDisplay</descCharHeight>
    <descFontHeight>DisplayInBits</descFontHeight>
    <generateLookupBlocks>false</generateLookupBlocks>
    <lookupBlocksNewAfterCharCount>80</lookupBlocksNewAfterCharCount>
    <descImgWidth>DisplayInBytes</descImgWidth>
    <descImgHeight>DisplayInBits</descImgHeight>
    <generateSpaceCharacterBitmap>true</generateSpaceCharacterBitmap>
    <spaceGenerationPixels>2</spaceGenerationPixels>
    <varNfBitmaps>const unsigned char {0}Bitmaps</varNfBitmaps>
    <varNfCharInfo>const FONT_CHAR_INFO {0}Descriptors</varNfCharInfo>
    <varNfFontInfo>const FONT_INFO {0}</varNfFontInfo>
    <varNfWidth>const unsigned char {0}Width</varNfWidth>
    <varNfHeight>const unsigned char {0}Height</varNfHeight>
    <displayName>guilib</displayName>
  </OutputConfiguration>
</ArrayOfOutputConfiguration>


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

		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<title>TrAP Parent 1.3 Reference Package com.ericsson.research.trap.impl</title>
		<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" />

        	com.ericsson.research.trap.impl

Classes

            	AutoconfigurationDisabledException

            	ClientTrapEndpoint

            	EndpointKeepaliveTask

            	HashedWeakReference

            	ListenerTrapEndpoint

            	NullAuthentication

            	NullDelegate

            	PeerInfo

            	RecoveryHeartbeat

            	ServerTrapEndpoint

            	TrapChannelImpl

            	TrapConfigurationImpl

            	TrapCustomConfiguration

            	TrapEndpointImpl

            	TrapImplDebugPrinter

            	TrapMessageImpl

            	TrapObjectMessage

            	TrapPeerImpl

            	WeakEndpointReference


text:
using namespace zen;

using util::zLog;
using util::LogMode;

using util::zXMLParser;

zXMLParser::zXMLParser() : m_Log(zLog::GetEngineLog())
{
    m_XMLTree.clear();
}

zXMLParser::~zXMLParser()
{
    this->ClearTree();
}

bool zXMLParser::LoadFromFile(const string_t& filename)
{
    std::ifstream file(filename);

    if(!file)
    {
        m_Log   << m_Log.SetMode(LogMode::ZEN_ERROR)
                << m_Log.SetSystem("XML Parser")
                << "Failed to open '" << filename << "'."
                << zLog::endl;

        return false;
    }

    this->ClearTree();
    int retval = this->ParseTree(file, 0, nullptr);
    return (retval == 0);
}

bool zXMLParser::LoadFromString(const char** data)
{
    if(data != nullptr) this->ClearTree();
    return (this->ParseTree(data, 0, nullptr) == 0);
}

void zXMLParser::ClearTree()
{
    auto i = m_XMLTree.begin();

    while(i != m_XMLTree.end())
    {
        delete *i;
        i = m_XMLTree.erase(i);
    }

    m_XMLTree.clear();
}

void zXMLParser::ShowXMLError(const uint32_t line_no, const string_t& line,
                              const string_t& reason)
{
    zLog& Log = zLog::GetEngineLog();

    Log << Log.SetMode(LogMode::ZEN_ERROR)
        << Log.SetSystem("XML Parser")
        << "Malformed XML on line " << line_no
        << ": " << line << " (" << reason << ") "
        << zLog::endl;
}

/// @see zen::asset::zAssetManager::Find
const util::XMLNode* const zXMLParser::FindNode(const string_t& name) const
{
    // Fastest way to loop (see Zenderer docs).
    auto i = m_XMLTree.cbegin(), j = m_XMLTree.cend();

    // Hashed string comparisons in Zenderer.
    uint32_t hash = util::string_hash(name);

    for( ; i != j; ++i)
    {
        uint32_t comp = util::string_hash((*i)->name);
        if(comp == hash) return (*i);
    }

    return nullptr;
}

// Identical to non-const.
util::XMLNode* zXMLParser::FindNode(const string_t& name)
{
    // Fastest way to loop (see Zenderer docs).
    auto i = m_XMLTree.cbegin(), j = m_XMLTree.cend();

    // Hashed string comparisons might be marginally faster.
    uint32_t hash = util::string_hash(name);

    for( ; i != j; ++i)
    {
        uint32_t comp = util::string_hash((*i)->name);
        if(comp == hash) return (*i);
    }

    return nullptr;
}

int zXMLParser::ParseTree(const char** str, const int index,
                          util::XMLNode* parent)
{
    int i = index;

    while(str != nullptr && str[i] != nullptr)
    {
        // CreateNode() is responsible for increasing the list index.
        i = this->CreateNode(string_t(str[i]), parent, i,
                [str, this](const int i, XMLNode* pNode) -> int {
                    return this->ParseTree(str, i, pNode);
            }
        );

        // Some error occurred here, so we move back up
        // through the recursion stack.
        if(i < 0) return i;
    }

    return -1;
}

int zXMLParser::ParseTree(std::ifstream& file, const int index,
                          util::XMLNode* parent)
{
    string_t line;
    int i = index;

    while(std::getline(file, line))
    {
        i = this->CreateNode(line, parent, i,
                [&file, this](const int idex, XMLNode* pNode) -> int {
                    return this->ParseTree(file, idex, pNode);
            }
        );

        if(i == 0)
        {
            m_XMLTree.push_back(parent);
            i++;
        }
        else if(i < 0) break;
    }

    return i;
}

int zXMLParser::CreateNode(const string_t& line,
                           util::XMLNode* parent, int i,
                           std::function<int(const size_t,
                                             util::XMLNode*)> callback)
{
    // Check for blank lines and comments.
    if(line.empty() || (line.find("<!-- ") != string_t::npos &&
                        line.find(" -->")  != string_t::npos))
    {
        // Next line plz.
        return ++i;
    }

    // Some sort of start tag?
    else if(line.find('<') != string_t::npos)
    {
        // If there's a beginning bracket, make sure there's an end bracket.
        if(line.find('>') == string_t::npos)
        {
            this->ShowXMLError(i + 1, line, "missing closing bracket");
            return -1;
        }

        else if(line.find("/>") != string_t::npos)
        {
            this->ShowXMLError(i + 1, line, "single-line tags forbidden");
            return -1;
        }

        // If it's not an end tag, parse it and recurse on it.
        else if(line.find("</") == string_t::npos)
        {
            XMLNode* pNode  = new XMLNode;
            pNode->parent   = parent;
            pNode->children.clear();

            if(parent != nullptr) parent->children.push_back(pNode);

            // Parse the tag name (e.g. 'test' from <test>).
            const size_t index = line.find('<');
            const size_t end   = line.find(' ', index);
            const size_t end2  = line.find('>', index);

            // No closing tag or empty tag ('<>')
            if(end == end2 || end2 == index + 1)
            {
                ShowXMLError(i + 1, line, "invalid XML tag");
                delete pNode;
                return -1;
            }

            pNode->name = line.substr(index + 1, math::min<size_t>(end, end2)-1);

            util::stripl(pNode->name);
            util::stript(pNode->name);

            // Parse any options in the tag.
            if(end != string_t::npos &&
               line.find('=', index) != string_t::npos)
            {
                size_t last = end;

                for( ; ; )
                {
                    size_t start    = last + 1;
                    size_t keyindex = line.find('=', start);

                    // No more options?
                    if(keyindex == string_t::npos) break;

                    size_t valstart = line.find('"', keyindex);
                    size_t valend   = line.find('"', valstart + 1);

                    // Check if we have both characters.
                    // Offset the start so we skip the first " character in substr().
                    if(valstart++ == string_t::npos || valend == string_t::npos)
                    {
                        ShowXMLError(i + 1, line, "missing closing quote");

                        // Attempt to save by ending option at tag end.
                        valend = line.find('>', index);
                    }

                    string_t key = line.substr(start, keyindex - start);
                    string_t val = line.substr(valstart, valend - valstart);

                    util::stripl(key);
                    util::stript(key);

                    pNode->options[key] = val;
                    last = valend + 1;
                }
            }

            m_XMLTree.push_back(pNode);

            // Error so pass it along.
            if((i = callback(i + 1, pNode)) == -1)
                return i;

            // No error so next line.
            else return ++i;
        }

        // End of node
        else if(line.find("</") != string_t::npos)
        {
            // Next line plz.
            return ++i;
        }
    }

    // Non-XML line, so we just add it to the node's content.
    else
    {
        if(parent != nullptr) parent->content += line;
        return ++i;
    }

    return -1;
}


text:
package org.apereo.cas.audit.spi;

import org.apache.commons.lang3.StringUtils;
import org.apereo.inspektr.audit.spi.support.ReturnValueAsStringResourceResolver;
import org.aspectj.lang.JoinPoint;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.i18n.LocaleContextHolder;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;

/**
 * This is {@link MessageBundleAwareResourceResolver}.
 *
 * @author Misagh Moayyed
 * @since 5.0.0
 */
public class MessageBundleAwareResourceResolver extends ReturnValueAsStringResourceResolver {

    @Autowired
    private ApplicationContext context;

    @Override
    public String[] resolveFrom(final JoinPoint joinPoint, final Exception e) {
        final String[] resolved = super.resolveFrom(joinPoint, e);
        return resolveMessagesFromBundleOrDefault(resolved, e);
    }

    private String[] resolveMessagesFromBundleOrDefault(final String[] resolved, final Exception e) {
        final Locale locale = LocaleContextHolder.getLocale();
        final Set<String> resolvedMessages = new HashSet<>(resolved.length);
        Arrays.stream(resolved).forEach(key -> {
            String defaultKey = e.getClass().getSimpleName();
            defaultKey = StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(defaultKey), "_").toUpperCase();
            final String msg = this.context.getMessage(key, null, defaultKey, locale);
            resolvedMessages.add(msg);
        });
        return resolvedMessages.toArray(new String[] {});
    }
}


text:
.class final Lo/Hf;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Ljava/util/Iterator;

# annotations
.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;Ljava/util/Iterator<TT;>;"
    }
.end annotation

# instance fields
.field ˊ:Ljava/util/Iterator;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Iterator<+TT;>;"
        }
    .end annotation
.end field

.field ˋ:Ljava/util/Iterator;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Iterator<+TT;>;"
        }
    .end annotation
.end field

.field final synthetic ˎ:Ljava/util/Iterator;

# direct methods
.method constructor <init>(Ljava/util/Iterator;)V
    .locals 1

    .line 532
    iput-object p1, p0, Lo/Hf;->ˎ:Ljava/util/Iterator;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 533
    invoke-static {}, Lo/GV;->ˊ()Lo/LE;

    move-result-object v0

    iput-object v0, p0, Lo/Hf;->ˊ:Ljava/util/Iterator;

    return-void
.end method

# virtual methods
.method public hasNext()Z
    .locals 2

    .line 547
    :goto_0
    iget-object v0, p0, Lo/Hf;->ˊ:Ljava/util/Iterator;

    invoke-static {v0}, Lo/Bk;->ˊ(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Iterator;

    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    move v1, v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lo/Hf;->ˎ:Ljava/util/Iterator;

    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 548
    iget-object v0, p0, Lo/Hf;->ˎ:Ljava/util/Iterator;

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Iterator;

    iput-object v0, p0, Lo/Hf;->ˊ:Ljava/util/Iterator;

    goto :goto_0

    .line 550
    :cond_0
    return v1
.end method

.method public next()Ljava/lang/Object;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()TT;"
        }
    .end annotation

    .line 554
    invoke-virtual {p0}, Lo/Hf;->hasNext()Z

    move-result v0

    if-nez v0, :cond_0

    .line 555
    new-instance v0, Ljava/util/NoSuchElementException;

    invoke-direct {v0}, Ljava/util/NoSuchElementException;-><init>()V

    throw v0

    .line 557
    :cond_0
    iget-object v0, p0, Lo/Hf;->ˊ:Ljava/util/Iterator;

    iput-object v0, p0, Lo/Hf;->ˋ:Ljava/util/Iterator;

    .line 558
    iget-object v0, p0, Lo/Hf;->ˊ:Ljava/util/Iterator;

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method

.method public remove()V
    .locals 1

    .line 562
    iget-object v0, p0, Lo/Hf;->ˋ:Ljava/util/Iterator;

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    invoke-static {v0}, Lo/DP;->ˊ(Z)V

    .line 563
    iget-object v0, p0, Lo/Hf;->ˋ:Ljava/util/Iterator;

    invoke-interface {v0}, Ljava/util/Iterator;->remove()V

    .line 564
    const/4 v0, 0x0

    iput-object v0, p0, Lo/Hf;->ˋ:Ljava/util/Iterator;

    .line 565
    return-void
.end method


text:
package com.cloud.netapp.dao;

import java.util.List;

import javax.ejb.Local;

import org.apache.log4j.Logger;

import com.cloud.netapp.NetappVolumeVO;
import com.cloud.utils.db.Filter;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;

@Local(value={VolumeDao.class})
public class VolumeDaoImpl extends GenericDaoBase<NetappVolumeVO, Long> implements VolumeDao {
    private static final Logger s_logger = Logger.getLogger(VolumeDaoImpl.class);

    protected final SearchBuilder<NetappVolumeVO> NetappVolumeSearch;
    protected final SearchBuilder<NetappVolumeVO> NetappListVolumeSearch;
    protected final SearchBuilder<NetappVolumeVO> NetappRoundRobinMarkerSearch;

    @Override
    public NetappVolumeVO findVolume(String ipAddress, String aggregateName, String volumeName) {
        SearchCriteria<NetappVolumeVO> sc = NetappVolumeSearch.create();
        sc.setParameters("ipAddress", ipAddress);
        sc.setParameters("aggregateName", aggregateName);
        sc.setParameters("volumeName", volumeName);

        List<NetappVolumeVO>volList = listBy(sc);

        return(volList.size()==0?null:volList.get(0));
    }

	protected VolumeDaoImpl() {
        NetappVolumeSearch = createSearchBuilder();
        NetappVolumeSearch.and("ipAddress", NetappVolumeSearch.entity().getIpAddress(), SearchCriteria.Op.EQ);
        NetappVolumeSearch.and("aggregateName", NetappVolumeSearch.entity().getAggregateName(), SearchCriteria.Op.EQ);
        NetappVolumeSearch.and("volumeName", NetappVolumeSearch.entity().getVolumeName(), SearchCriteria.Op.EQ);
        NetappVolumeSearch.done();

        NetappListVolumeSearch = createSearchBuilder();
        NetappListVolumeSearch.and("poolName", NetappListVolumeSearch.entity().getPoolName(), SearchCriteria.Op.EQ);
        NetappListVolumeSearch.done();

        NetappRoundRobinMarkerSearch = createSearchBuilder();
        NetappRoundRobinMarkerSearch.and("roundRobinMarker", NetappRoundRobinMarkerSearch.entity().getRoundRobinMarker(), SearchCriteria.Op.EQ);
        NetappRoundRobinMarkerSearch.and("poolName", NetappRoundRobinMarkerSearch.entity().getPoolName(), SearchCriteria.Op.EQ);
        NetappRoundRobinMarkerSearch.done();
	}

    @Override
    public List<NetappVolumeVO> listVolumes(String poolName) {
        SearchCriteria<NetappVolumeVO> sc = NetappListVolumeSearch.create();
        sc.setParameters("poolName", poolName);
        return listBy(sc);
    }

    @Override
    public NetappVolumeVO returnRoundRobinMarkerInPool(String poolName, int roundRobinMarker) {
        SearchCriteria<NetappVolumeVO> sc = NetappRoundRobinMarkerSearch.create();
        sc.setParameters("roundRobinMarker", roundRobinMarker);
        sc.setParameters("poolName", poolName);

        List<NetappVolumeVO> marker = listBy(sc);

        if(marker.size()>0)
        	return marker.get(0);
        else
        	return null;
    }

    @Override
    public List<NetappVolumeVO> listVolumesAscending(String poolName)
    {
        Filter searchFilter = new Filter(NetappVolumeVO.class, "id", Boolean.TRUE, Long.valueOf(0), Long.valueOf(10000));

        SearchCriteria<NetappVolumeVO> sc = NetappListVolumeSearch.create();
        sc.setParameters("poolName", poolName);

        return listBy(sc, searchFilter);
    }

}


text:
define([
	'app',
	'jquery',
	'services/hostgroups',
	'factories/hostgroup',
	'factories/host'
], function(app, $) {
	app.registerController('HostsCtrl', ['$scope', '$state', 'hostgroups', 'Host', function($scope, $state, hostgroups, Host) {

		$scope.hostgroups = hostgroups;

		hostgroups.get($scope.playbook, function () {
		});

		$scope.add = function () {
			$('#addHostGroup').modal('show');
		}

		$scope.showAddHost = function (hostgroup) {
			if (hostgroup.showingAdd) {
				hostgroup.showingAdd = false;
			} else {
				hostgroup.showingAdd = true;
				hostgroup.newHost = new Host();
			}
		}

		$scope.deleteHostGroup = function (hostgroup) {
			hostgroup.delete($scope.playbook);

			hostgroups.get($scope.playbook, function () {
			});
		}

		$scope.deleteHost = function (hostgroup, host) {
			host.delete($scope.playbook, hostgroup);
			hostgroup.getHosts($scope.playbook);
		}

		$scope.addHost = function (hostgroup) {
			hostgroup.newHost.add($scope.playbook, hostgroup);
			hostgroup.getHosts($scope.playbook);

			$scope.showAddHost(hostgroup);
		}
	}]);

	app.registerController('AddHostGroupCtrl', ['$scope', 'HostGroup', 'hostgroups', function($scope, HostGroup, hostgroups) {
		$scope.hostgroup = new HostGroup();

		$scope.add = function () {
			$('#addHostGroup').modal('hide');

			$scope.hostgroup.add($scope.playbook);

			hostgroups.get($scope.playbook, function () {
			});
		}
	}]);
});


text:
<?php

namespace JustBundle\Repository;

/**
 * StudentTypeRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class StudentTypeRepository extends \Doctrine\ORM\EntityRepository
{
}


text:
<?php

namespace Danack\Console\Tests\Command;

use Danack\Console\Tester\CommandTester;
use Danack\Console\Application;
use Danack\Console\Command\ParsedCommand;
use Auryn\Provider;

class ListCommandTest extends \PHPUnit_Framework_TestCase
{
    public function testExecuteListsCommands()
    {
        $application = new Application();
        $commandTester = new CommandTester($command = $application->get('list'));
        $parsedCommand = $commandTester->execute(array('command' => $command->getName()), array('decorated' => false));

        /** @var $parsedCommand ParsedCommand */
        $injector = new \Auryn\Provider;
        $injector->execute($parsedCommand->getCallable());

        $this->assertRegExp('/help   Displays help for a command/', $commandTester->getDisplay(), '->execute() returns a list of available commands');
    }

    public function testExecuteListsCommandsWithXmlOption()
    {
        $application = new Application();
        $commandTester = new CommandTester($command = $application->get('list'));
        $parsedCommand = $commandTester->execute(array('command' => $command->getName(), '--format' => 'xml'));

        $provider = new Provider();
        $provider->execute($parsedCommand->getCallable(), []);

        $this->assertRegExp('/<command id="list" name="list">/', $commandTester->getDisplay(), '->execute() returns a list of available commands in XML if --xml is passed');
    }

    public function testExecuteListsCommandsWithRawOption()
    {
        $application = new Application();
        $commandTester = new CommandTester($command = $application->get('list'));
        $parsedCommand = $commandTester->execute(array('command' => $command->getName(), '--raw' => true));
        $provider = new Provider();
        $provider->execute($parsedCommand->getCallable(), []);

        $output = <<<EOF
help   Displays help for a command
list   Lists commands

EOF;

        $this->assertEquals($output, $commandTester->getDisplay(true));
    }

    public function testExecuteListsCommandsWithNamespaceArgument()
    {

        require_once realpath(__DIR__.'/../Fixtures/FooCommand.php');
        $application = new Application();
        $application->add(new \FooCommand());
        $commandTester = new CommandTester($command = $application->get('list'));
        $parsedCommand = $commandTester->execute(
            array('command' => $command->getName(),
                'namespace' => 'foo', '--raw' => true)
        );

        /** @var $parsedCommand ParsedCommand */
        $injector = new \Auryn\Provider;
        $injector->execute($parsedCommand->getCallable());

        $output = <<<EOF
foo:bar   The foo:bar command

EOF;

        $this->assertEquals($output, $commandTester->getDisplay(true));
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" level="3" version="1">
  <model>
    <listOfCompartments>
      <compartment id="c" constant="false"/>
    </listOfCompartments>
    <listOfSpecies>
      <species id="s" compartment="c" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
    </listOfSpecies>
    <listOfParameters>
      <parameter id="y" constant="false"/>
      <parameter id="q" constant="true"/>
      <parameter id="z" constant="false"/>
      <parameter id="p" constant="false"/>
    </listOfParameters>
    <listOfInitialAssignments>
      <initialAssignment symbol="z">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
            <plus/>
            <ci> y </ci>
            <ci> q </ci>
          </apply>
        </math>
      </initialAssignment>
    </listOfInitialAssignments>
  </model>
</sbml>


text:
package org.apache.struts2.config;

import com.opensymphony.xwork2.LocalizedTextProvider;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsInternalTestCase;

import java.util.Iterator;
import java.util.Locale;

/**
 * Unit test for {@link SettingsTest}.
 *
 */
public class SettingsTest extends StrutsInternalTestCase {

    public void testSettings() {
        Settings settings = new DefaultSettings();

        assertEquals("12345", settings.get(StrutsConstants.STRUTS_MULTIPART_MAXSIZE));
        assertEquals("\temp", settings.get(StrutsConstants.STRUTS_MULTIPART_SAVEDIR));

        assertEquals("test,org/apache/struts2/othertest", settings.get( StrutsConstants.STRUTS_CUSTOM_PROPERTIES));
        assertEquals("testvalue", settings.get("testkey"));
        assertEquals("othertestvalue", settings.get("othertestkey"));

        int count = getKeyCount(settings);
        assertEquals(12, count);
    }

    public void testDefaultResourceBundlesLoaded() {
        Settings settings = new DefaultSettings();

        LocalizedTextProvider localizedTextProvider = container.getInstance(LocalizedTextProvider.class);

        assertEquals("testmessages,testmessages2", settings.get(StrutsConstants.STRUTS_CUSTOM_I18N_RESOURCES));
        assertEquals("This is a test message", localizedTextProvider.findDefaultText("default.testmessage", Locale.getDefault()));
        assertEquals("This is another test message", localizedTextProvider.findDefaultText("default.testmessage2", Locale.getDefault()));
    }

    public void testSetSettings() {
        Settings settings = new TestSettings();

        String keyName = "a.long.property.key.name";
        assertEquals(keyName, settings.get(keyName));
        assertEquals(2, getKeyCount(settings));
    }

    private int getKeyCount(Settings settings) {
        int count = 0;
        Iterator keyNames = settings.list();

        while (keyNames.hasNext()) {
            keyNames.next();
            count++;
        }

        return count;
    }
}


text:
require 'rails helper'

  feature 'upload your own receipe' do
   scienaro 'uploading your own receipe'do
    visit   '/upload_your_own_receipe' do

      within('#upload your own receipe') do
        fill_in 'content', :with => 'receipe name'
        fill_in 'picture', :with => 'picture'
        click on upload
       end
     end
    end
  end


text:
package learner.snippets;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class CanvasDrawingExample {
	public static void main(String[] args) {
		// Create Display and Shell
		Display display = new Display();
		Shell shell = new Shell(display);
		// Set Shell layout
		shell.setLayout(new FillLayout());

		// Create Canvas and add PaintListener
		final Canvas canvas = new Canvas(shell, SWT.NONE);

		canvas.addPaintListener(new PaintListener() {
			public void paintControl(PaintEvent e) {
				Rectangle clientArea = canvas.getClientArea();
				e.gc.setBackground(display.getSystemColor(SWT.COLOR_CYAN));
				e.gc.fillOval(0, 0, clientArea.width, clientArea.height);
			}
		});

		// Open the Shell and main loop
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		display.dispose();
	}
}


text:
#  Autorelease values

## JERRYX_AR_VALUE_T

**Summary**

Macro for `const jerry_value_t` for which jerry_release_value() is
automatically called when the variable goes out of scope.

*Note*: The macro depends on compiler support. For GCC and LLVM/clang, the macro is implemented
using the `__cleanup__` variable attribute. For other compilers, no support has been added yet.

**Example**

[doctest]: # (test="compile")

```c
#include "jerryscript.h"
#include "jerryscript-ext/autorelease.h"

static void
foo (bool enable)
{
  JERRYX_AR_VALUE_T bar = jerry_create_string ((const jerry_char_t *) "...");

  if (enable)
  {
    JERRYX_AR_VALUE_T baz = jerry_get_global_object ();

    /* bar and baz can now be used. */

    /*
     * jerry_release_value (baz) and jerry_release_value (bar) is called automatically before
     * returning, because `baz` and `bar` go out of scope.
     */
    return;
  }

  /*
   * jerry_release_value (bar) is called automatically when the function returns,
   * because `bar` goes out of scope.
   */
}
```

**See also**

- [jerry_value_t](../docs/02.API-REFERENCE.md#jerry_value_t)
- [jerry_acquire_value](../docs/02.API-REFERENCE.md#jerry_acquire_value)
- [jerry_release_value](../docs/02.API-REFERENCE.md#jerry_release_value)


text:
#ifndef BB_CORELOG_H
#define BB_CORELOG_H

#include <stdint.h>
#include <cstdarg>

namespace bigball
{

#define BB_LOG(CategoryName, Verbosity, Format, ...) \
{ \
	BBLog::Print(__FILE__, __LINE__, #CategoryName, BBLog::Verbosity, Format, ##__VA_ARGS__ ); \
}

class BIGBALL_API BBLog
{
public:

	enum Type
	{
		Log,
		Warn,
		Error,
	};

    static void Print( char const* File, int Line, char const* Category, Type type, char const* Format, ... );

};

} /* namespace bigball */

#endif // BB_CORELOG_H


text:
"""add part_rosetta table

Revision ID: 7463268309ab
Revises: c4c88519fb71
Create Date: 2020-08-19 22:15:42.200290+00:00

"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "7463268309ab"
down_revision = "c4c88519fb71"
branch_labels = None
depends_on = None

def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "part_rosetta",
        sa.Column("hpn", sa.String(length=64), nullable=False),
        sa.Column("syspn", sa.String(length=64), nullable=False),
        sa.Column("start_gpstime", sa.BigInteger(), nullable=False),
        sa.Column("stop_gpstime", sa.BigInteger(), nullable=True),
        sa.PrimaryKeyConstraint("syspn", "start_gpstime"),
    )
    # ### end Alembic commands ###

def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("part_rosetta")
    # ### end Alembic commands ###


text:
using FlatBuffers;
using FlatBuffers.Schema;
using Mokap.Schemas.RecorderMessages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Media.Media3D;
using BodyFrameDataMsg = Mokap.Schemas.RecorderMessages.BodyFrameData;
using BodyMsg = Mokap.Schemas.RecorderMessages.Body;
using HandMsg = Mokap.Schemas.RecorderMessages.Hand;
using JointMsg = Mokap.Schemas.RecorderMessages.Joint;

namespace Mokap.Data
{

    [Serializable]
    sealed class BodyFrameData
    {
        public TimeSpan RelativeTime;

        public Body[] Bodies;

        public static BodyFrameData Deserialize(BodyFrameDataMsg message)
        {
            var frame = new BodyFrameData()
            {
                RelativeTime = new TimeSpan(message.RelativeTime),
                Bodies = new Body[message.BodiesLength],
            };

            for (int i = 0; i < message.BodiesLength; i++)
            {
                frame.Bodies[i] = Body.Deserialize(message.GetBodies(i));
            }

            return frame;
        }

        public byte[] Serialize()
        {
            var fbb = new FlatBufferBuilder(1024);

            var bodies = Array.ConvertAll(Bodies, body => body.Serialize(fbb));
            var msg = BodyFrameDataMsg.CreateBodyFrameData(fbb,
                    RelativeTime.Ticks,
                    BodyFrameDataMsg.CreateBodiesVector(fbb, bodies));
            fbb.Finish(msg.Value);

            return fbb.ToProtocolMessage(MessageIds.BodyFrameData);
        }

        [Serializable]
        public sealed class Body
        {
            public ulong TrackingId;

            public bool IsTracked;

            public bool IsRestricted;

            public FrameEdges ClippedEdges;

            public Hand HandLeft;

            public Hand HandRight;

            public Dictionary<JointType, Joint> Joints;

            public static Body Deserialize(BodyMsg message)
            {
                var body = new Body()
                {
                    TrackingId = message.TrackingId,
                    IsTracked = message.IsTracked,
                    IsRestricted = message.IsRestricted,
                    ClippedEdges = message.ClippedEdges,

                    HandLeft = Hand.Deserialize(message.HandLeft),
                    HandRight = Hand.Deserialize(message.HandRight),

                    Joints = new Dictionary<JointType, Joint>(),
                };

                for (int i = 0; i < message.JointsLength; i++)
                {
                    var joint = Joint.Deserialize(message.GetJoints(i));

                    body.Joints.Add(joint.Type, joint);
                }

                return body;
            }

            public Offset<BodyMsg> Serialize(FlatBufferBuilder fbb)
            {
                var joints = Joints.Values.Select(joint => joint.Serialize(fbb)).ToArray();

                return BodyMsg.CreateBody(fbb,
                        TrackingId, IsTracked, IsTracked, ClippedEdges,
                        HandLeft.Serialize(fbb), HandRight.Serialize(fbb),
                        BodyMsg.CreateJointsVector(fbb, joints));
            }
        }

        [Serializable]
        public sealed class Hand
        {
            public TrackingConfidence Confidence;

            public HandState State;

            public static Hand Deserialize(HandMsg message)
            {
                return new Hand()
                {
                    State = message.State,
                    Confidence = message.Confidence,
                };
            }

            public Offset<HandMsg> Serialize(FlatBufferBuilder fbb)
            {
                return HandMsg.CreateHand(fbb, Confidence, State);
            }
        }

        [Serializable]
        public sealed class Joint
        {
            public JointType Type;

            public TrackingState State;

            public Point Position2D;

            public Vector3D Position3D;

            public Quaternion Rotation;

            public static Joint Deserialize(JointMsg message)
            {
                return new Joint()
                {
                    Type = message.Type,
                    State = message.State,
                    Position2D = new Point(message.Position2D.X, message.Position2D.Y),
                    Position3D = new Vector3D(message.Position3D.X, message.Position3D.Y, message.Position3D.Z),
                    Rotation = new Quaternion(message.Rotation.X, message.Rotation.Y, message.Rotation.Z, message.Rotation.W),
                };
            }

            public Offset<JointMsg> Serialize(FlatBufferBuilder fbb)
            {
                var position2D = Vector2.CreateVector2(fbb, Position2D.X, Position2D.Y);
                var position3D = Vector3.CreateVector3(fbb, Position3D.X, Position3D.Y, Position3D.Z);
                var rotation = Vector4.CreateVector4(fbb, Rotation.X, Rotation.Y, Rotation.Z, Rotation.W);

                return JointMsg.CreateJoint(fbb, Type, State, position2D, position3D, rotation);
            }
        }
    }
}


text:
package org.ovirt.engine.ui.common.widget.label;

import org.ovirt.engine.ui.common.CommonApplicationConstants;
import org.ovirt.engine.ui.common.gin.AssetProvider;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class NoItemsLabel extends Composite {
    interface WidgetUiBinder extends UiBinder<Widget, NoItemsLabel> {
        WidgetUiBinder uiBinder = GWT.create(WidgetUiBinder.class);
    }

    private static final CommonApplicationConstants constants = AssetProvider.getConstants();

    @UiField
    Label label;

    public NoItemsLabel() {
        super();
        initWidget(WidgetUiBinder.uiBinder.createAndBindUi(this));
        label.setText(constants.noItemsToDisplay());
    }
}


text:
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2016 ArangoDB GmbH, Cologne, Germany
///
/// 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.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Jan Christoph Uhde
/// @author Ewout Prangsma
////////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef ARANGO_CXX_DRIVER_CONNECTION
#define ARANGO_CXX_DRIVER_CONNECTION

#include "loop.h"
#include "message.h"
#include "types.h"

#include <memory>
#include <string>

namespace arangodb { namespace fuerte { inline namespace v1 {
// Connection is the base class for a connection between a client
// and a server.
// Different protocols (HTTP, VST) are implemented in derived classes.
class Connection : public std::enable_shared_from_this<Connection> {
  friend class ConnectionBuilder;

 public:
  virtual ~Connection();

  ///  Connection state
  ///  Disconnected <---------+
  ///  +                      |
  ///  |  +-------------------+--> Failed
  ///  |  |                   |
  ///  v  +                   +
  ///  Connecting +-----> Connected
  enum class State {
    Disconnected = 0,
    Connecting = 1,
    Connected = 2,
    Failed = 3  /// canceled or broken permanently (i.e. bad authentication)
  };

  /// @brief Send a request to the server and wait into a response it received.
  std::unique_ptr<Response> sendRequest(std::unique_ptr<Request> r);

  /// @brief Send a request to the server and wait into a response it received.
  /// @param r request that is copied
  std::unique_ptr<Response> sendRequest(Request const& r) {
    auto copy = std::make_unique<Request>(r);
    return sendRequest(std::move(copy));
  }

  /// @brief Send a request to the server and return immediately.
  /// When a response is received or an error occurs, the corresponding
  /// callbackis called. The callback is executed on a specific
  /// IO-Thread for this connection.
  virtual MessageID sendRequest(std::unique_ptr<Request> r,
                                RequestCallback cb) = 0;

  /// @brief Send a request to the server and return immediately.
  /// When a response is received or an error occurs, the corresponding
  /// callbackis called. The callback is executed on a specific
  /// IO-Thread for this connection.
  MessageID sendRequest(Request const& r, RequestCallback cb) {
    auto copy = std::make_unique<Request>(r);
    return sendRequest(std::move(copy), cb);
  }

  /// @brief Return the number of requests that have not yet finished.
  virtual std::size_t requestsLeft() const = 0;

  /// @brief connection state
  virtual State state() const = 0;

  /// @brief cancel the connection, unusable afterwards
  virtual void cancel() = 0;

  /// @brief endpoint we are connected to
  std::string endpoint() const;

 protected:
  Connection(detail::ConnectionConfiguration const& conf) : _config(conf) {}

  /// @brief Activate the connection.
  virtual void startConnection() = 0;

  // Invoke the configured ConnectionFailureCallback (if any)
  void onFailure(Error errorCode, const std::string& errorMessage) {
    if (_config._onFailure) {
      try {
        _config._onFailure(errorCode, errorMessage);
      } catch(...) {}
    }
  }

  const detail::ConnectionConfiguration _config;
};

/** The connection Builder is a class that allows the easy configuration of
 *  connections. We decided to use the builder pattern because the connections
 *  have too many options to put them all in a single constructor. When you have
 *  passed all your options call connect() in order to receive a shared_ptr to a
 *  connection. Remember to use the "->" operator to access the connections
 *  members.
 */
class ConnectionBuilder {
 public:
  inline std::string host() const { return _conf._host; }
  inline std::string port() const { return _conf._port; }

  /// @brief takes url in the form (http|vst)[s]://(ip|hostname):port
  /// also supports the syntax "http+tcp://", "http+unix://" etc
  ConnectionBuilder& endpoint(std::string const& spec);

  /// @brief get the normalized endpoint
  std::string normalizedEndpoint() const;

  // Create an connection and start opening it.
  std::shared_ptr<Connection> connect(EventLoopService& eventLoopService);

  /// @brief idle connection timeout (60s default)
  inline std::chrono::milliseconds idleTimeout() const {
    return _conf._idleTimeout;
  }
  /// @brief set the idle connection timeout (60s default)
  ConnectionBuilder& idleTimeout(std::chrono::milliseconds t) {
    _conf._idleTimeout = t;
    return *this;
  }

  // Set the authentication type of the connection
  inline AuthenticationType authenticationType() const {
    return _conf._authenticationType;
  }
  ConnectionBuilder& authenticationType(AuthenticationType t) {
    _conf._authenticationType = t;
    return *this;
  }
  // Set the username of the connection
  inline std::string user() const { return _conf._user; }
  ConnectionBuilder& user(std::string const& u) {
    _conf._user = u;
    return *this;
  }
  // Set the password of the connection
  inline std::string password() const { return _conf._password; }
  ConnectionBuilder& password(std::string const& p) {
    _conf._password = p;
    return *this;
  }

  // Set the jwt token of the connection
  inline std::string jwtToken() const { return _conf._jwtToken; }
  ConnectionBuilder& jwtToken(std::string const& t) {
    _conf._jwtToken = t;
    return *this;
  }
  // Set the maximum size for chunks (VST only)
  /*inline std::size_t maxChunkSize() const { return _conf._maxChunkSize; }
  ConnectionBuilder& maxChunkSize(std::size_t c) {
    _conf._maxChunkSize = c;
    return *this;
  }*/

  /// @brief tcp, ssl or unix
  inline SocketType socketType() const { return _conf._socketType; }
  /// @brief protocol typr
  inline ProtocolType protocolType() const { return _conf._protocolType; }
  void protocolType(ProtocolType pt) { _conf._protocolType = pt; }

  // Set the VST version to use (VST only)
  inline vst::VSTVersion vstVersion() const { return _conf._vstVersion; }
  ConnectionBuilder& vstVersion(vst::VSTVersion c) {
    _conf._vstVersion = c;
    return *this;
  }

  /// @brief should we verify the SSL host
  inline bool verifyHost() const { return _conf._verifyHost; }
  ConnectionBuilder& verifyHost(bool b) {
    _conf._verifyHost = b;
    return *this;
  }

  // Set a callback for connection failures that are not request specific.
  ConnectionBuilder& onFailure(ConnectionFailureCallback c) {
    _conf._onFailure = c;
    return *this;
  }

 private:
  detail::ConnectionConfiguration _conf;
};
}}}  // namespace arangodb::fuerte::v1
#endif


text:
package org.develnext.jphp.core.compiler.jvm.node;

import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;

import java.util.ArrayList;

public class ClassNodeImpl extends ClassNode {

    public ClassNodeImpl() {
        super(Opcodes.ASM5);
        version = Opcodes.V1_6; // todo: available to switch this value
        this.interfaces = new ArrayList();
        this.visibleAnnotations = new ArrayList();
    }
}


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>ui.research (MyPaint 1.0-SNAPSHOT API)</title>
<meta name="date" content="2017-04-27">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

ui.research

Classes

KeyGuy

MouseGuy

NewWindow

PaintPanel

SidePanel


text:
namespace DataShare.Tests.ScenarioTests
{
    using System;
    using System.Net;
    using System.Threading.Tasks;
    using Microsoft.Azure.Management.DataShare;
    using Microsoft.Azure.Management.DataShare.Models;
    using Microsoft.Rest.Azure;
    using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
    using Xunit;

    public class ShareScenarioTests : ScenarioTestBase<ShareScenarioTests>
    {
        internal static async Task CreateAsync(
            DataShareManagementClient client,
            string resourceGroupName,
            string accountName,
            string shareName,
            Share expectedShare)
        {
            AzureOperationResponse<Share> createResponse =
                await client.Shares.CreateWithHttpMessagesAsync(
                    resourceGroupName,
                    accountName,
                    shareName,
                    expectedShare);
            ShareScenarioTests.ValidateShare(createResponse.Body, shareName);
            Assert.Equal(HttpStatusCode.Created, createResponse.Response.StatusCode);
        }

        private static void ValidateShare(Share actualShare, string expectedShareName)
        {
            Assert.Equal(expectedShareName, actualShare.Name);
            Assert.Equal("Succeeded", actualShare.ProvisioningState);
        }

        internal static async Task Delete(
            DataShareManagementClient client,
            string resourceGroupName,
            string accountName,
            string shareName)
        {
            AzureOperationResponse<OperationResponse> deleteResponse =
                await client.Shares.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, shareName);
            Assert.Equal(HttpStatusCode.OK, deleteResponse.Response.StatusCode);

            deleteResponse = await client.Shares.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, shareName);
            Assert.Equal(HttpStatusCode.NoContent, deleteResponse.Response.StatusCode);
        }

        internal static Share GetShare()
        {
            return new Share( shareKind: "CopyBased");
        }
    }
}


text:
<annotation>
<folder>back_pack</folder>
<filename>back_pack_2_view_1_pose_13_lit_1_gray.jpg</filename>
<source>
<database>photorealistic	rendering</database>
</source>
<size>
<width>640</width>
<height>480</height>
<depth>3</depth>
</size>
<segmented>0</segmented>
<object>
<name>back_pack</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>225</xmin>
<ymin>161</ymin>
<xmax>416</xmax>
<ymax>344</ymax>
</bndbox>
</object>
</annotation>


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">CaptivePortalLogin</string>
    <string name="action_use_network">Use this network as is</string>
    <string name="action_do_not_use_network">Do not use this network</string>
    <string name="action_remove_saved_logins" translatable="false">Remove saved logins</string>
    <string name="action_bar_label">Configure Autologin</string>
    <string name="ssl_error_warning">The network you’re trying to join has security issues.</string>
    <string name="ssl_error_example">For example, the login page may not belong to the organization shown.</string>
    <string name="ssl_error_continue">Continue anyway via browser</string>

</resources>