text:
package info.dgjones.abora.gold.be.canopy;

import info.dgjones.abora.gold.be.basic.BeEdition;
import info.dgjones.abora.gold.be.canopy.AnyRecorderFinder;
import info.dgjones.abora.gold.be.canopy.AnyRecorderPFinder;
import info.dgjones.abora.gold.be.canopy.PropFinder;
import info.dgjones.abora.gold.be.canopy.ResultRecorderPFinder;
import info.dgjones.abora.gold.be.canopy.SensorCrum;
import info.dgjones.abora.gold.be.canopy.prop.Prop;
import info.dgjones.abora.gold.be.canopy.prop.SensorProp;
import info.dgjones.abora.gold.filter.RegionDelta;
import info.dgjones.abora.gold.id.IDRegion;
import info.dgjones.abora.gold.java.AboraSupport;
import info.dgjones.abora.gold.java.missing.PropJoint;
import info.dgjones.abora.gold.java.missing.SensorPropJoint;
import info.dgjones.abora.gold.java.missing.smalltalk.Set;
import info.dgjones.abora.gold.xcvr.Rcvr;
import info.dgjones.abora.gold.xcvr.Xmtr;
import info.dgjones.abora.gold.xpp.basic.Heaper;

/**
 * Generates finders for recorders triggered by an increase in permissions
 */
public class AnyRecorderPFinder extends AnyRecorderFinder {

	protected RegionDelta myPermissionsDelta;
	protected IDRegion myPermissions;
/*
udanax-top.st:40116:
AnyRecorderFinder subclass: #AnyRecorderPFinder
	instanceVariableNames: '
		myPermissionsDelta {RegionDelta of: IDRegion}
		myPermissions {IDRegion}'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Xanadu-Be-Canopy'!
*/
/*
udanax-top.st:40122:
AnyRecorderPFinder comment:
'Generates finders for recorders triggered by an increase in permissions'!
*/
/*
udanax-top.st:40124:
(AnyRecorderPFinder getOrMakeCxxClassDescription)
	attributes: ((Set new) add: #CONCRETE; add: #COPY; add: #NOT.A.TYPE; yourself)!
*/
/*
udanax-top.st:40198:
AnyRecorderPFinder class
	instanceVariableNames: ''!
*/
/*
udanax-top.st:40201:
(AnyRecorderPFinder getOrMakeCxxClassDescription)
	attributes: ((Set new) add: #CONCRETE; add: #COPY; add: #NOT.A.TYPE; yourself)!
*/
public static void initializeClassAttributes() {
	AboraSupport.findAboraClass(AnyRecorderPFinder.class).setAttributes( new Set().add("CONCRETE").add("COPY").add("NOTATYPE"));
/*

Generated during transformation: AddMethod
*/
}
public boolean match(Prop prop) {
	if (prop instanceof SensorProp) {
		SensorProp p = (SensorProp) prop;
		return p.relevantPermissions().intersects(myPermissions);
	}
	return false;
/*
udanax-top.st:40129:AnyRecorderPFinder methodsFor: 'accessing'!
{BooleanVar} match: prop {Prop}
	prop cast: SensorProp into: [ :p |
		^p relevantPermissions intersects: myPermissions].
	^false "fodder"!
*/
}
public PropFinder nextFinder(BeEdition edition) {
	return ResultRecorderPFinder.make(edition, myPermissionsDelta, myPermissions, edition.totalEndorsements());
/*
udanax-top.st:40135:AnyRecorderPFinder methodsFor: 'accessing'!
{PropFinder} nextFinder: edition {BeEdition}
	^ResultRecorderPFinder make: edition
		with: myPermissionsDelta
		with: myPermissions
		with: edition totalEndorsements!
*/
}
public IDRegion permissions() {
	return myPermissions;
/*
udanax-top.st:40142:AnyRecorderPFinder methodsFor: 'accessing'!
{IDRegion} permissions

	^myPermissions!
*/
}
public RegionDelta permissionsDelta() {
	return myPermissionsDelta;
/*
udanax-top.st:40146:AnyRecorderPFinder methodsFor: 'accessing'!
{RegionDelta of: IDRegion} permissionsDelta

	^myPermissionsDelta!
*/
}
public AnyRecorderPFinder(int flags, RegionDelta permissionsDelta, IDRegion permissions) {
	super(flags);
	myPermissionsDelta = permissionsDelta;
	myPermissions = permissions;
/*
udanax-top.st:40152:AnyRecorderPFinder methodsFor: 'create'!
create: flags {UInt32}
	with: permissionsDelta {RegionDelta of: IDRegion}
	with: permissions {IDRegion}

	super create: flags.
	myPermissionsDelta := permissionsDelta.
	myPermissions := permissions.!
*/
}
public int actualHashForEqual() {
	return myPermissionsDelta.hashForEqual() ^ myPermissions.hashForEqual();
/*
udanax-top.st:40162:AnyRecorderPFinder methodsFor: 'testing'!
{UInt32} actualHashForEqual
	^myPermissionsDelta hashForEqual
		bitXor: myPermissions hashForEqual!
*/
}
public boolean isEqual(Heaper heaper) {
	if (heaper instanceof AnyRecorderPFinder) {
		AnyRecorderPFinder other = (AnyRecorderPFinder) heaper;
		return (myPermissionsDelta.isEqual(other.permissionsDelta())) && (myPermissions.isEqual(other.permissions()));
	}
	else {
		return false;
	}
/*
udanax-top.st:40167:AnyRecorderPFinder methodsFor: 'testing'!
{BooleanVar} isEqual: heaper {Heaper}
	heaper cast: AnyRecorderPFinder into: [ :other |
		^(myPermissionsDelta isEqual: other permissionsDelta)
			and: [myPermissions isEqual: other permissions]]
	others:
		[^false].
	^false "fodder"!
*/
}
public PropFinder oldPass(PropJoint parent) {
	if (parent instanceof SensorPropJoint) {
		SensorPropJoint p = (SensorPropJoint) parent;
		return AnyRecorderPFinder.make(myPermissionsDelta, ((IDRegion) (p.relevantPermissions().intersect(myPermissions))));
	}
	return null;
/*
udanax-top.st:40178:AnyRecorderPFinder methodsFor: 'smalltalk: suspended'!
{PropFinder} oldPass: parent {PropJoint}
	parent cast: SensorPropJoint into: [ :p |
		^AnyRecorderPFinder make: myPermissionsDelta
			with: ((p relevantPermissions intersect: myPermissions) cast: IDRegion)].
	^NULL "fodder"!
*/
}
public AnyRecorderPFinder(Rcvr receiver) {
	super(receiver);
	myPermissionsDelta = (RegionDelta) receiver.receiveHeaper();
	myPermissions = (IDRegion) receiver.receiveHeaper();
/*
udanax-top.st:40187:AnyRecorderPFinder methodsFor: 'generated:'!
create.Rcvr: receiver {Rcvr}
	super create.Rcvr: receiver.
	myPermissionsDelta _ receiver receiveHeaper.
	myPermissions _ receiver receiveHeaper.!
*/
}
public void sendSelfTo(Xmtr xmtr) {
	super.sendSelfTo(xmtr);
	xmtr.sendHeaper(myPermissionsDelta);
	xmtr.sendHeaper(myPermissions);
/*
udanax-top.st:40192:AnyRecorderPFinder methodsFor: 'generated:'!
{void} sendSelfTo: xmtr {Xmtr}
	super sendSelfTo: xmtr.
	xmtr sendHeaper: myPermissionsDelta.
	xmtr sendHeaper: myPermissions.!
*/
}
public static PropFinder make(RegionDelta permissionsDelta) {
	return make(permissionsDelta, ((IDRegion) (permissionsDelta.after().minus(permissionsDelta.before()))));
/*
udanax-top.st:40206:AnyRecorderPFinder class methodsFor: 'create'!
{PropFinder} make: permissionsDelta {RegionDelta of: IDRegion}

	^self make: permissionsDelta
		with: ((permissionsDelta after minus: permissionsDelta before) cast: IDRegion)!
*/
}
public static PropFinder make(RegionDelta permissionsDelta, IDRegion newPermissions) {
	if (newPermissions.isEmpty()) {
		return PropFinder.closedPropFinder();
	}
	return new AnyRecorderPFinder((SensorCrum.flagsFor(newPermissions, null, false)), permissionsDelta, newPermissions);
/*
udanax-top.st:40211:AnyRecorderPFinder class methodsFor: 'create'!
{PropFinder} make: permissionsDelta {RegionDelta of: IDRegion}
	with: newPermissions {IDRegion}

	newPermissions isEmpty ifTrue:
		[^PropFinder closedPropFinder].
	^self create: (SensorCrum flagsFor: newPermissions with: NULL with: false)
		with: permissionsDelta with: newPermissions.!
*/
}
public AnyRecorderPFinder() {
/*

Generated during transformation
*/
}
}


text:
require 'pushmeup'
require 'pry'

redpajama_set_name: RedPajamaGithub


text:
%% Unit TB (terabyte) 1024 gigabytes
%
% See also: TiB, tebibyte, terabyte

function t = TB

t = terabyte;


text:
var expect = require('chai').expect;
var parse = require('../');

describe('parseargs', function(){
  it(
    'should understand simple words',
    check('my string of arguments', ['my', 'string', 'of', 'arguments'])
  );

  it(
    'should understand single quote',
    check("my 'string of arguments'", ['my', 'string of arguments'])
  );

  it(
    'should understand double quote',
    check('"my string" of arguments', ['my string', 'of', 'arguments'])
  );

  it(
    'should understand escaped single quote',
    check("my 'string \\'of\\'' arguments", ['my', "string 'of'", 'arguments'])
  );

  it(
    'should understand escaped double quote',
    check('my "string \\"of\\"" arguments', ['my', 'string "of"', 'arguments'])
  );

  it(
    'should understand double quotes inside single quotted string',
    check("my 'string \"of\" arguments'", ['my', 'string "of" arguments'])
  );

  it(
    'should understand single quotes inside double quotted string',
    check('my "string \'of\' arguments"', ['my', "string 'of' arguments"])
  );

  it(
    'should not allow for a quotted string to start right after a word',
    invalid('my"string" of arguments', 'Invalid argument(s)')
  );

  it(
    'should detect unexpected EOF',
    invalid('my "string of arguments', 'Unexpected end of input')
  );

  it(
    'should detect wrongly escaped quotes',
    invalid('my \\\\"string\\\\" of arguments', 'Invalid argument(s)')
  );

  it(
    'should ignore consecutive spaces',
    check('my     string of    arguments', ['my', 'string', 'of', 'arguments'])
  );

  it(
    'should accept tabs, newlines and cartridge returns as spaces',
    check('my\tstring\nof\rarguments', ['my', 'string', 'of', 'arguments'])
  );

  it(
    'should not allow escaped spaces',
    invalid('my\\ string of arguments', 'Invalid syntax')
  );

  it(
    'should read a one char word at the end of the input',
    check('my string of arguments 0', ['my', 'string', 'of', 'arguments', '0'])
  );

  it(
    'should only accept strings',
    invalidTypes([
      1,
      2.2,
      true,
      {},
      null,
      void 0,
      function(){},
      [],
    ], 'Invalid input type')
  );

});

function check(subject, expected) {
  return function() {
    expect(parse(subject)).to.be.deep.equal(expected);
  }
}

function invalid(subject, error) {
  return function() {
    expect(function(){
      parse(subject);
    }).to.throw(error);
  }
}

function invalidTypes(types, error) {
  return function() {
    types.forEach(function(type){
      expect(function(){
        parse(type);
      }).to.throw(error);
    });
  }
}


text:
package at.kc.tugraz.sss.appstacklayout.datatypes.ret;

import at.tugraz.sss.serv.util.*;
import at.tugraz.sss.serv.datatype.*;
import at.tugraz.sss.serv.datatype.ret.SSServRetI; import at.tugraz.sss.serv.util.*;
import java.util.Map;

public class SSAppStackLayoutCreateRet extends SSServRetI{

  public SSUri stack = null;

   public String getStack() {
    return SSStrU.removeTrailingSlash(stack);
  }

  public static SSAppStackLayoutCreateRet get(
    final SSUri    stack){

    return new SSAppStackLayoutCreateRet(stack);
  }

  private SSAppStackLayoutCreateRet(
    final SSUri    stack) {

    super(SSVarNames.appStackLayoutCreate);

    this.stack = stack;
  }
}


text:
namespace QRedis
{
    class RequestPrivate : public QObject
    {
        Q_OBJECT

        public:

            QEventLoop loop;

        public Q_SLOTS:

            void quitEventLoop();
    };
}

#endif // QREDIS_REQUEST_P_H


text:
package edu.colorado.droidel.parser

abstract class ManifestEntry(val packageName : String, private val name : String) {
  def getPackageQualifiedName() : String = {
    if (name.contains(packageName) || name.indexOf('.') != -1) name
    else s"$packageName.$name"
  }

  override def toString() : String = getPackageQualifiedName
}


text:
// Copyright (c) Autofac Project. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using Autofac.Features.OwnedInstances;
using Autofac.Test.Util;

namespace Autofac.Test.Features.OwnedInstances;

public class OwnedTests
{
    [Fact]
    public void DisposingOwned_CallsDisposeOnLifetimeToken()
    {
        var lifetime = new DisposeTracker();
        var owned = new Owned<string>("unused", lifetime);
        owned.Dispose();
        Assert.True(lifetime.IsDisposed);
    }

    [Fact]
    public async Task DisposingOwnedAsynchronously_CallsDisposeOnLifetimeTokenIfAsyncDisposableNotDeclared()
    {
        var lifetime = new DisposeTracker();
        var owned = new Owned<string>("unused", lifetime);
        await owned.DisposeAsync();
        Assert.True(lifetime.IsDisposed);
    }

    [Fact]
    public async Task DisposingOwnedAsynchronously_CallsDisposeAsyncOnLifetimeTokenIfAsyncDisposableDeclared()
    {
        var lifetime = new AsyncDisposeTracker();
        var owned = new Owned<string>("unused", lifetime);
        await owned.DisposeAsync();
        Assert.True(lifetime.IsAsyncDisposed);
        Assert.False(lifetime.IsSyncDisposed);
    }

    [Fact]
    public void WhenInitialisedWithValue_ReturnsSameFromValueProperty()
    {
        var value = "Hello";
        var owned = new Owned<string>(value, new DisposeTracker());
        Assert.Same(value, owned.Value);
    }
}


text:
// ***********************************************************************
// Copyright (c) 2013 Charlie Poole, Terje Sandstrom
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ***********************************************************************

using System.Linq;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;

namespace NUnit.VisualStudio.TestAdapter
{
    using System;
    using System.Collections.Generic;

    using Microsoft.VisualStudio.TestPlatform.ObjectModel;
    using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter;

    using Core;
    using Core.Filters;
    using Util;
    using System.Runtime.Remoting;

    /// <summary>
    /// The AssemblyRunner class executes tests in a single assembly
    /// </summary>
    public class AssemblyRunner
    {
        private readonly TestRunner runner = new TestDomain();
        private readonly TestLogger logger;
        private readonly string assemblyName;

        private TestFilter nunitFilter;
        private readonly List<TestCase> loadedTestCases;
        private readonly TestConverter testConverter;
        private INUnitTestAdapter NUnitTestAdapter { get; set; }

        #region Constructors

        // This constructor is called by the others and is used directly for testing
        public AssemblyRunner(TestLogger logger, string assemblyName, INUnitTestAdapter nunitTestAdapter, bool collectSourceInformation)
        {
            this.logger = logger;
            this.assemblyName = assemblyName;
            testConverter = new TestConverter(logger, assemblyName, collectSourceInformation);
            loadedTestCases = new List<TestCase>();
            nunitFilter = TestFilter.Empty;
            NUnitTestAdapter = nunitTestAdapter;
        }

        // This constructor is used when the executor is called with a list of test cases
        public AssemblyRunner(TestLogger logger, string assemblyName, IEnumerable<TestCase> selectedTestCases, INUnitTestAdapter nunitTestAdapter, bool collectSourceInformation)
            : this(logger, assemblyName, nunitTestAdapter, collectSourceInformation)
        {
            nunitFilter = MakeTestFilter(selectedTestCases);
        }

        private readonly ITfsTestFilter tfsFilter;

        // This constructor is used when the executor is called with a list of assemblies
        public AssemblyRunner(TestLogger logger, string assemblyName, ITfsTestFilter tfsFilter, INUnitTestAdapter nunitTestAdapter, bool collectSourceInformation)
            : this(logger, assemblyName, nunitTestAdapter, collectSourceInformation)
        {
            this.tfsFilter = tfsFilter;
        }

        private static SimpleNameFilter MakeTestFilter(IEnumerable<TestCase> ptestCases)
        {
            var filter = new SimpleNameFilter();
            foreach (TestCase testCase in ptestCases)
            {
                filter.Add(testCase.FullyQualifiedName);
            }
            return filter;
        }

        #endregion

        #region Properties

        // TODO: Revise tests and remove
        public TestFilter NUnitFilter
        {
            get { return nunitFilter; }
        }

        // TODO: Revise tests and remove
        public IList<TestCase> LoadedTestCases
        {
            get { return loadedTestCases; }
        }

        // TODO: Revise tests and remove
        public TestConverter TestConverter
        {
            get { return testConverter; }
        }

        #endregion

        #region Public Methods

        public void RunAssembly(IFrameworkHandle testLog)
        {
            try
            {
#if LAUNCHDEBUGGER
            System.Diagnostics.Debugger.Launch();
#endif
                if (TryLoadAssembly())
                {
                    using (NUnitEventListener listener = new NUnitEventListener(testLog, TestConverter))
                    {
                        try
                        {
                            runner.Run(listener, NUnitFilter, true, LoggingThreshold.Off);
                        }
                        catch (NullReferenceException)
                        {
                            // this happens during the run when CancelRun is called.
                            logger.SendDebugMessage("Nullref caught");
                        }
                        finally
                        {
                            runner.Unload();
                        }
                    }
                }
                else
                {
                    logger.NoNUnit2TestsFoundIn(assemblyName);
                }
            }
            catch (BadImageFormatException)
            {
                // we skip the native c++ binaries that we don't support.
                logger.AssemblyNotSupportedWarning(assemblyName);
            }
            catch (System.IO.FileNotFoundException ex)
            {
                // Probably from the GetExportedTypes in NUnit.core, attempting to find an assembly, not a problem if it is not NUnit here
                logger.DependentAssemblyNotFoundWarning(ex.FileName, assemblyName);
            }
            catch (UnsupportedFrameworkException ex)
            {
                //The UnsupportedFrameworkException is thrown by nunit, if the assembly references the NUnit v3 framework.
                logger.SendInformationalMessage("Attempt to load assembly with unsupported test framework in " +  assemblyName);
            }
            catch (Exception ex)
            {
                logger.SendErrorMessage("Exception thrown executing tests in " + assemblyName, ex);
            }
        }

        public void CancelRun()
        {
            if (runner != null && runner.Running)
                runner.CancelRun();
        }

        // Try to load the assembly and, if successful, populate
        // the list of all loaded assemblies. As a side effect
        // of calling TestConverter.ConvertTestCase, the converter's
        // cache of all test cases is populated as well. All
        // future calls to convert a test case may now use the cache.
        private bool TryLoadAssembly()
        {
            var package = NUnitTestAdapter.CreateTestPackage(assemblyName);
            if (!runner.Load(package))
                return false;
            logger.SendMessage(TestMessageLevel.Informational,string.Format("Loading tests from {0}",package.FullName));
            AddTestCases(runner.Test);
            if (tfsFilter==null || !tfsFilter.HasTfsFilterValue)
                return true;
            var filteredTestCases = tfsFilter.CheckFilter(LoadedTestCases);
            var ptestCases = filteredTestCases as TestCase[] ?? filteredTestCases.ToArray();
            logger.SendMessage(TestMessageLevel.Informational, string.Format("TFS Filter detected: LoadedTestCases {0}, Filterered Test Cases {1}", LoadedTestCases.Count, ptestCases.Count()));
            nunitFilter = MakeTestFilter(ptestCases);
            return true;
        }

        // This method is public for testing purposes.
        // TODO: Test by actually loading an assembly and make it private
        public void AddTestCases(ITest test)
        {
            if (test.IsSuite)
                foreach (ITest child in test.Tests) AddTestCases(child);
            else
                LoadedTestCases.Add(TestConverter.ConvertTestCase(test));
        }

        #endregion
    }
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<phpunit bootstrap="./vendor/autoload.php" colors="true">

    <testsuites>
        <testsuite name="BoundedArray's test suite">
            <directory>./test</directory>
        </testsuite>
    </testsuites>

</phpunit>


text:
require_relative 'http_json_service'

class StarterService

  def language_manifest(display_name, exercise_name)
    json = get([display_name, exercise_name], __method__)
    manifest = json['manifest']
    manifest['exercise'] = exercise_name
    manifest['visible_files']['instructions'] = json['exercise']
    manifest
  end

  private

  include HttpJsonService

  def hostname
    'starter'
  end

  def port
    4527
  end

end


text: """mBuild utilities."""


text:
    <link rel="stylesheet" type="text/css" href="<?php echo e($chocolatey->hotelUrl); ?>/habbo-web/assets/css/hotel.css">

FLASH NOT INSTALLED

                        <img src="<?php echo e($chocolatey->hotelUrl); ?>/habbo-web/assets/images/get_flash_player.png"
                             alt="Get Adobe Flash player"/>


text:
/** Helios Development Group LLC, 2013 */
package com.heliosapm.utils.unsafe.collections;

/**
 *
Title: LongSortedSet

 *
Description: A managed off-heap array of unique longs, maintained in sorted order.

 *
!!  NOTE !!  :  This class is THREAD UNSAFE. Only use with one thread at a time, or used one
 * of the concurrent/synchronized versions

 *
Company: Helios Development Group LLC

 * @author Whitehead (nwhitehead AT heliosdev DOT org)
 *
org.helios.apmrouter.collections.LongSortedSet

 */
public class LongSortedSet {

	/** The underlying UnsafeLongArray */
	protected final UnsafeLongArray array;

	/**
	 * Deallocates the allocated memory for this array
	 */
	public void destroy() {
		array.destroy();
	}

	/**
	 * Creates a new LongSortedSet
	 * @param array the cloned array
	 */
	protected LongSortedSet(UnsafeLongArray array) {
		this.array = array;
	}

	/**
	 * Creates a new LongSortedSet with the default initial capacity of {@link UnsafeArray#DEFAULT_CAPACITY}.
	 */
	public LongSortedSet() {
		this(UnsafeArray.DEFAULT_CAPACITY);
	}

	/**
	 * Creates a new LongSortedSet with the specified initial capacity
	 * @param initialCapacity The initial number of allocated slots
	 */
	public LongSortedSet(int initialCapacity) {
		array = UnsafeArrayBuilder.newBuilder().sorted(true).initialCapacity(initialCapacity).buildLongArray();
	}

	/**
	 * Creates a new LongSortedSet initialized with the passed values
	 * @param values The long array to initialize with
	 */
	public LongSortedSet(long[] values) {
		array = UnsafeArrayBuilder.newBuilder().sorted(true).buildLongArray(values);
	}

	/**
	 * Creates a new LongSortedSet initialized with the passed values
	 * @param values the values to copy into this new sorted set
	 */
	public LongSortedSet(LongSortedSet values) {
		array = UnsafeArrayBuilder.newBuilder().sorted(true).buildLongArray(values);
	}

	/**
	 * Inserts the each passed value into the correct slot position in the array if the value is not present in the array already
	 * @param values The values to insert
	 * @return true if any of the values were successfully added
	 */
	public boolean add(long...values) {
		return array.insertIfNotExists(values)>0;
	}

	/**
	 * Removes all the values from this array, shrinking the capacity if necessary.
	 */
	public void clear() {
		array.clear();
	}

	/**
	 * Removes all the passed values from the array
	 * @param values The values to remove from the array
	 * @return true if one or more of the values was removed
	 */
	public boolean remove(long...values) {
		return array.remove(values)>0;
	}

	/**
	 * Returns the long value at the specified array index
	 * @param index the index of the value to retrieve
	 * @return the long value at the specified array index
	 */
	public long get(int index) {
		return array.get(index);
	}

	/**
	 * Returns the number of entries in the array
	 * @return the number of entries in the array
	 */
	public int size() {
		return array.size();
	}

    /**
     * Returns this array as an array of doubles
     * @return an array of doubles
     */
	public double[] asDoubleArray() {
		return array.asDoubleArray();
	}

    /**
     * Returns this array as an array of longs
     * @return an array of longs
     */
	public long[] asLongArray() {
		return array.getArray();
	}

	/**
	 * Returns true if the passed long value is in the array
	 * @param value the long value to test for
	 * @return true if the passed long value is in the array, false otherwise
	 */
	public boolean contains(long value) {
		return array.binarySearch(value)>=0;
	}

	/**
	 * {@inheritDoc}
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return array.toString();
	}

	/**
	 * {@inheritDoc}
	 * @see java.lang.Object#clone()
	 */
	@Override
	public LongSortedSet clone() {
		return new LongSortedSet(array.clone());
	}

	/**
	 * Indicates if this set is empty
	 * @return true if this set is empty, false otherwise
	 */
	public boolean isEmpty() {
		return array.size()==0;
	}
}


text:
package com.alibaba.json.bvt.parser;

import java.util.Map;

import org.junit.Assert;

import com.alibaba.fastjson.JSON;

import junit.framework.TestCase;

public class ReadOnlyMapTest2_final_field extends TestCase {

    public void test_readOnlyNullList() throws Exception {
        String text = "{\"values\":{\"a\":{}}}";
        Entity entity = JSON.parseObject(text, Entity.class);
        Assert.assertNotNull(entity);
        Assert.assertNull(entity.values);
    }

    public static class Entity {

        public final Map<String, A> values = null;

    }

    public static class A {

    }
}


text:
%%% Main function of Scale_GMM
%%% 1. Select objects that have shown up at least Threshold times
function Cell_Scale_GMM_400=ScaleGMM(Total_list)

load('Cell_Scale_GMM_WTPrior_Training_Testing.mat')
load('Cell_ObjNum_Relation_Above_Threshold.mat')
load('Cell_Scale_Raw_Training_Testing.mat')

Feature_Cell=Cell_Scale_GMM_Training_Testing;

Threshold=400;
SampleNum=Statistics_Sample_Per_Class();
% index of obj classes that have samples # above threshold
SampleNum_Threshold=find(SampleNum>=Threshold);
% object class list. Each obj havs shown up at least Threshold times
Cell_ObjInstanceNum_Above_Threshold=Cell_ObjNum_Relation_Above_Threshold(SampleNum_Threshold);
Num_Objects=size(SampleNum_Threshold,2);

Cell_Objects_Dividedby_Class=cell(Num_Objects,1);
for i=1:Num_Objects
    Cell_Objects_Dividedby_Class{i,1}=[];
end

Num_Total_Samples=size(Feature_Cell,1);
for i=1:Num_Total_Samples
    label=Feature_Cell{i,1};
    if size(find(SampleNum_Threshold==label),2)==1
        % if the feature vector is not all-zero, index of samples that are in that class
        if size(find(Feature_Cell{i,2}(SampleNum_Threshold)>0),2)>0
            Cell_Objects_Dividedby_Class{find(SampleNum_Threshold==label),1}=[Cell_Objects_Dividedby_Class{find(SampleNum_Threshold==label),1} i];
        end
    end
end

% Threshold=400;
% % indices of random selected samples
% Total_list=[];
% for i=1:Num_Objects
%     len=size(Cell_Objects_Dividedby_Class{i,1},2);
%     RanList=randperm(len);
%     IndexList=Cell_Objects_Dividedby_Class{i,1}(RanList(1:min(Threshold,len)))';
%     Total_list=[Total_list;IndexList];
%     i
% end

% at this time, the Training data is still based on 29 classes, need to
% shrink to the current class configuration
Cell_Scale_GMM_Threhold=Feature_Cell(Total_list',:);
Num_Samples=size(Cell_Scale_GMM_Threhold,1);

for i=1:Num_Samples
    Cell_Scale_GMM_Threhold{i,1}=find(SampleNum_Threshold==Cell_Scale_GMM_Threhold{i,1});
    Cell_Scale_GMM_Threhold{i,2}=Cell_Scale_GMM_Threhold{i,2}(SampleNum_Threshold);
end

Cell_Scale_GMM_400=Cell_Scale_GMM_Threhold;
save Cell_Scale_GMM_400.mat Cell_Scale_GMM_400


text:
import * as ActionTypes from '../../constant/actionTypes'
import { getTrophyList as core } from '../../utils/statistics'
declare var global

export function getTrophyList(psnid, data, forceNew) {
  return dispatch => {
    dispatch(changeLoading(true))
    const callback = notifyCallback.bind(data, dispatch)
    return core(psnid, callback, forceNew)
      .then(response => {
        dispatch(getSuccess(response))
        return response
      }).catch(err => {
        console.error('stats.js line12', err)
        dispatch(getError('ww'))
        global.toast && global.toast('网络错误 ' + err.toString(), 2000)
      })
  }
}

function notifyCallback(dispatch, {
  gameIndex,
  gameInfo,
  title
}) {
  const text = title || `正在同步 ${gameInfo.title} (${gameIndex}/${this.playerInfo.allGames})`
  dispatch(notify(text))
}

function getSuccess(argument) {
  return {
    type: ActionTypes.GET_STATS_SUCCESS,
    value: argument
  }
}

function getError(argument) {
  return {
    type: ActionTypes.GET_STATS_ERROR,
    value: argument
  }
}

function notify(argument) {
  return {
    type: ActionTypes.SET_NOTIFY,
    value: argument
  }
}

function changeLoading(argument) {
  return {
    type: ActionTypes.CHANGE_STATS_LOADING,
    value: argument
  }
}


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <link rel="stylesheet" href="http://jorix.github.com/OL-Ragbag/examples/github-pages/forkme_banner.css" type="text/css">

        <title>OpenLayers Light - Basic Popups (simplified by using "FeaturePopups")</title>
        <link rel="stylesheet" href="http://dev.openlayers.org/theme/default/style.css" type="text/css">
        <link rel="stylesheet" href="http://dev.openlayers.org/examples/style.css" type="text/css">

OpenLayers Light - Basic Popups (example simplified by using "FeaturePopups")

        View on GitHub

            light, vector, feature, popup

            A basic use case example using the OpenLayers.light version of the library.

            Shows popup info bubble when hovering over features on the map

                This example uses OpenLayers.light.js to display features and show
                popup info bubbles when the feature is hovered over.

                See the
                light-basic-FP.js source to see how this is done.


text:
require 'test/unit'
require_relative('../../../lib/wiki-that')

class FormattingGenTest < Test::Unit::TestCase
  def test_empty
    gen = WikiThat::HTMLGenerator.new('', 'wiki', 'BOB', 'sub/folder', 'media/folder')
    gen.generate
    assert_true(gen.success?, 'Generation should have succeeded')
    assert_equal('', gen.result)
  end

  def test_short
    gen = WikiThat::HTMLGenerator.new('\'', 'wiki', 'BOB', 'sub/folder', 'media/folder')
    gen.generate
    assert_true(gen.success?, 'Generation should have succeeded')
    assert_equal('
\'
', gen.result)
  end

  def test_short2
    gen = WikiThat::HTMLGenerator.new('\'\'thing\'', 'wiki', 'BOB', 'sub/folder', 'media/folder')
    gen.generate
    assert_true(gen.success?, 'Generation should have succeeded')
    assert_equal('
\'\'thing\'
', gen.result)
  end

  def test_unbalanced_right
    gen = WikiThat::HTMLGenerator.new('\'\'thing\'\'\'', 'wiki', 'BOB', 'sub/folder', 'media/folder')
    gen.generate
    assert_true(gen.success?, 'Generation should have succeeded')
    assert_equal('
thing
', gen.result)
  end

  def test_unbalanced_left
    gen = WikiThat::HTMLGenerator.new('\'\'\'thing\'\'', 'wiki', 'BOB', 'sub/folder', 'media/folder')
    gen.generate
    assert_true(gen.success?, 'Generation should have succeeded')
    assert_equal('
thing
', gen.result)
  end

  def test_italic
    gen = WikiThat::HTMLGenerator.new('\'\'italic things\'\'', 'wiki', 'BOB', 'sub/folder', 'media/folder')
    gen.generate
    assert_true(gen.success?, 'Generation should have succeeded')
    assert_equal('
italic things
', gen.result)
  end

  def test_italic_inline
    gen = WikiThat::HTMLGenerator.new('not \'\'italic things\'\' not', 'wiki', 'BOB', 'sub/folder', 'media/folder')
    gen.generate
    assert_equal('
not italic things not
', gen.result)
  end

  def test_bold
    gen = WikiThat::HTMLGenerator.new('\'\'\'bold things\'\'\'', 'wiki', 'BOB', 'sub/folder', 'media/folder')
    gen.generate
    assert_true(gen.success?, 'Generation should have succeeded')
    assert_equal('
bold things
', gen.result)
  end

  def test_bold_inline
    gen = WikiThat::HTMLGenerator.new('not \'\'\'bold things\'\'\' not', 'wiki', 'BOB', 'sub/folder', 'media/folder')
    gen.generate
    assert_true(gen.success?, 'Generation should have succeeded')
    assert_equal('
not bold things not
', gen.result)
  end

  def test_both
    gen = WikiThat::HTMLGenerator.new('\'\'\'\'\'both things\'\'\'\'\'', 'wiki', 'BOB', 'sub/folder', 'media/folder')
    gen.generate
    assert_true(gen.success?, 'Generation should have succeeded')
    assert_equal('
both things
', gen.result)
  end

  def test_both_inline
    gen = WikiThat::HTMLGenerator.new('not \'\'\'\'\'both things\'\'\'\'\' not', 'wiki', 'BOB', 'sub/folder', 'media/folder')
    gen.generate
    assert_true(gen.success?, 'Generation should have succeeded')
    assert_equal('
not both things not
', gen.result)
  end

  def test_link
    gen = WikiThat::HTMLGenerator.new('\'\'[https://example.com]\'\'', 'wiki', 'BOB', 'sub/folder', 'media/folder')
    gen.generate
    assert_true(gen.success?, 'Generation should have succeeded')
    assert_equal('

', gen.result)
  end
end


text:
package org.seqcode.projects.seqview.paintable;

import java.io.File;
import java.awt.*;
import java.util.*;

import org.seqcode.data.seqdata.SeqHit;
import org.seqcode.genome.location.Region;
import org.seqcode.gseutils.*;
import org.seqcode.projects.seqview.model.SeqDataModel;
import org.seqcode.projects.seqview.model.SeqScaleModel;
import org.seqcode.viz.DynamicAttribute;

/**
 *  Paints Sequencing data across a genomic region.
 *
 */
public abstract class SeqPainter extends RegionPaintable  {

    protected SeqDataModel model;
    protected SeqScaleModel scale;
    protected DynamicAttribute attrib;
    protected Vector<Region> totalLayoutHits = new Vector<Region>();
    protected NonOverlappingLayout<Region> totalLayout = new NonOverlappingLayout<Region>();

    protected static java.util.List configurationFields = null;
    private SeqProperties props;

    public SeqPainter(SeqDataModel model) {
        super();
        this.model = model;
        props = new SeqProperties();
        scale = new SeqScaleModel(model);
        model.addEventListener(this);
        attrib = DynamicAttribute.getGlobalAttributes();
    }
    public SeqProperties getProperties () {return props;}
    public void setProperties(SeqProperties p) {props = p;}
    public void savePropsInDir(File dir) {
        super.savePropsInDir(dir);
        saveModelPropsInDir(dir,model);
    }
    public void loadPropsInDir(File dir) {
        super.loadPropsInDir(dir);
        loadModelPropsInDir(dir,model);
    }
    public void cleanup() {
        super.cleanup();
        model.removeEventListener(this);
    }

    public void setScaleModel(SeqScaleModel s) {
        scale = s;
    }
    public SeqScaleModel getScaleModel() {return scale;}

    public java.util.List<String> configurationKeyOrder() {return configurationFields;}

    protected static int xcoord(int base, int x1, int baseStart, double scale) {
        return x1 + (int)Math.round((double)(base - baseStart) * scale);
    }

    protected int calcX(int bp, int rstart, int rend, int x1, int x2) {
        double frac = (double)(bp - rstart) / (rend - rstart);
        return x1 + (int)Math.round(frac * (double)(x2 - x1));
    }

    protected int calcY(int over, int minover, int maxover, int y1, int y2) {
        double frac = (double)(over - minover) / (double)(maxover - minover);
        return y2 - (int)Math.round(frac * (double)(y2 - y1));
    }

    protected void drawStep(Graphics2D g, int px, int py, int pover, int x, int y, int over) {
        if(over > pover) { drawStepUp(g, px, py, x, y); }
        if(over < pover) { drawStepDown(g, px, py, x, y); }
        if(over==pover) { g.drawLine(px, py, x, y); }
    }

    protected void drawStepUp(Graphics2D g, int px, int py, int x, int y) {
        g.drawLine(px, py, x, py);
        g.drawLine(x, py, x, y);
    }

    protected void drawStepDown(Graphics2D g, int px, int py, int x, int y) {
        g.drawLine(px, py, px, y);
        g.drawLine(px, y, x, y);
    }

    public synchronized void eventRegistered(EventObject e) {
        if ((e.getSource() == model) || (e.getSource() == scale) &&
            model.isReady() &&
            ((scale == null) || scale.isReady())) {
            setCanPaint(true);
            setWantsPaint(true);
            totalLayoutHits = null;
            setLayoutHits();
            notifyListeners();
        }
    }

    public void removeEventListener(Listener<EventObject> l) {
        super.removeEventListener(l);
        if (!hasListeners()) {
            model.removeEventListener(this);
        }
    }

    protected void setLayoutHits() {
        if (canPaint() && totalLayoutHits == null) {
            Iterator<SeqHit> itr = model.getResults();
            totalLayoutHits = new Vector<Region>();
            while(itr.hasNext()) {
            	SeqHit hit = itr.next();
            	totalLayoutHits.add(hit);
            }
            totalLayout.setRegions(totalLayoutHits);
        }
    }

    public void paintItem(Graphics2D g,
            int x1, int y1,
            int x2, int y2) {

        if (!canPaint()) {
            return;
        }

        if(!model.isReady()) { return; }

    	if (getProperties().Overlapping) {
    		paintOverlapping(g, x1, y1, x2, y2);
    	}
    	else {
    		paintNonOverlapping(g, x1, y1, x2, y2);
    	}
        /* draw the track label */
        int width = x2 - x1;
        int height = y2 - y1;
    	if(model.isDataError()){
    		g.setFont(attrib.getLargeLabelFont(width,height));
			g.setColor(Color.RED);
			g.drawString("ReadDB Data Error: " +getLabel(),x1 + g.getFont().getSize()*2,y1 + g.getFont().getSize()*2);
		}else if (getProperties().DrawTrackLabel) {
            g.setFont(attrib.getLargeLabelFont(width,height));
            g.setColor(Color.BLACK);
            g.drawString(getLabel(),x1,y1 + g.getFont().getSize() * 2);
        }

    }

    protected abstract void paintOverlapping(Graphics2D g,
            int x1, int y1,
            int x2, int y2);

    protected abstract void paintNonOverlapping(Graphics2D g,
            int x1, int y1,
            int x2, int y2);

}


text:
#pragma warning disable 0649

using System;
using UnityEngine;

public class AttackTask : AITask
{
    private const float MINIMUM_THRUST = 0.25f;
    private const float FOLLOW_RANGE = 50;
    private const float ANGLE_MATCH = 0.8f; //TODO: get from weapons?

    [SerializeField]
    private bool behind;

    [SerializeField]
    private bool aimCloseEnough;

    [SerializeField]
    private bool canSeeTarget;

    [SerializeField]
    private bool evasive;

    [SerializeField]
    private Targetable attackTarget;

    [SerializeField]
    private Ship attackShip;

    public static AttackTask Create(Targetable ship)
    {
        AttackTask task = CreateInstance<AttackTask>();
        task.attackTarget = ship;
        task.attackShip = ship.GetComponent<Ship>();
        return task;
    }

    public override void Update()
    {
        if (!attackTarget)
        {
            return;
        }

        canSeeTarget = TaskFollower.Ship.CanSee(attackTarget.transform.position);

        bool navigatingToTarget = false;
        if (!canSeeTarget)
        {
            /*there must be some obstacle in the way,
            let's follow the nav points directly to them
            and see if that helps */
            TaskFollower.AssignTask(NavigateTask.Create(attackTarget.transform.position));
            navigatingToTarget = true;
        }

        if (!navigatingToTarget)
        {
            //are we aiming in the same direction as the target
            var dotToForward = Vector3.Dot(TaskFollower.transform.forward, attackTarget.transform.forward);
            aimCloseEnough = dotToForward > ANGLE_MATCH;

            //is my ship behind the Target
            var TargetToMe = (TaskFollower.transform.position - attackTarget.transform.position).normalized;
            var dotToMe = Vector3.Dot(attackTarget.transform.forward, TargetToMe);
            behind = dotToMe < 0;

            Vector3 dest = attackTarget.transform.position;

            if (evasive)
            {
                //try to get behind them
                var behindOffset = attackTarget.transform.forward - (attackTarget.transform.forward * FOLLOW_RANGE);
                dest += behindOffset;
            }

            if (TaskFollower.Ship.IsCloseTo(dest))
            {
                /* we're close to where we want to be, now aim at them */
                var thrust = attackShip? Ship.EquivalentThrust(TaskFollower.Ship, attackShip) : 0;
                TaskFollower.Ship.ResetControls(thrust: thrust);
                TaskFollower.Ship.RotateToPoint(attackTarget.transform.position);
            }
            else
            {
                //keep trying to get behind them
                TaskFollower.AssignTask(NavigateTask.Create(dest));

                //don't drop the speed too much in combat to keep dodging!
                //TaskFollower.Captain.MinimumThrust = MINIMUM_THRUST;
            }

            //pew pew pew
            TaskFollower.AssignTask(FireWeaponsTask.Create());
        }
    }

    public override bool Done
    {
        get
        {
            if (!attackTarget)
            {
                //it's probably died
                return true;
            }

            return (behind || !evasive)
                && aimCloseEnough
                && canSeeTarget;
        }
    }
}


text:
.oo-ui-icon-indent {
	background-image: url("themes/mediawiki/images/icons/indent-rtl.png");
	background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/indent-rtl.svg");
	background-image:         linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/indent-rtl.svg");
	background-image:      -o-linear-gradient(transparent, transparent), url("themes/mediawiki/images/icons/indent-rtl.png");
}
.oo-ui-icon-indent-invert {
	background-image: url("themes/mediawiki/images/icons/indent-rtl-invert.png");
	background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/indent-rtl-invert.svg");
	background-image:         linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/indent-rtl-invert.svg");
	background-image:      -o-linear-gradient(transparent, transparent), url("themes/mediawiki/images/icons/indent-rtl-invert.png");
}
.oo-ui-icon-listBullet {
	background-image: url("themes/mediawiki/images/icons/listBullet-rtl.png");
	background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/listBullet-rtl.svg");
	background-image:         linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/listBullet-rtl.svg");
	background-image:      -o-linear-gradient(transparent, transparent), url("themes/mediawiki/images/icons/listBullet-rtl.png");
}
.oo-ui-icon-listBullet-invert {
	background-image: url("themes/mediawiki/images/icons/listBullet-rtl-invert.png");
	background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/listBullet-rtl-invert.svg");
	background-image:         linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/listBullet-rtl-invert.svg");
	background-image:      -o-linear-gradient(transparent, transparent), url("themes/mediawiki/images/icons/listBullet-rtl-invert.png");
}
.oo-ui-icon-listNumbered {
	background-image: url("themes/mediawiki/images/icons/listNumbered-rtl.png");
	background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/listNumbered-rtl.svg");
	background-image:         linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/listNumbered-rtl.svg");
	background-image:      -o-linear-gradient(transparent, transparent), url("themes/mediawiki/images/icons/listNumbered-rtl.png");
}
.oo-ui-icon-listNumbered-invert {
	background-image: url("themes/mediawiki/images/icons/listNumbered-rtl-invert.png");
	background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/listNumbered-rtl-invert.svg");
	background-image:         linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/listNumbered-rtl-invert.svg");
	background-image:      -o-linear-gradient(transparent, transparent), url("themes/mediawiki/images/icons/listNumbered-rtl-invert.png");
}
.oo-ui-icon-outdent {
	background-image: url("themes/mediawiki/images/icons/outdent-rtl.png");
	background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/outdent-rtl.svg");
	background-image:         linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/outdent-rtl.svg");
	background-image:      -o-linear-gradient(transparent, transparent), url("themes/mediawiki/images/icons/outdent-rtl.png");
}
.oo-ui-icon-outdent-invert {
	background-image: url("themes/mediawiki/images/icons/outdent-rtl-invert.png");
	background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/outdent-rtl-invert.svg");
	background-image:         linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/outdent-rtl-invert.svg");
	background-image:      -o-linear-gradient(transparent, transparent), url("themes/mediawiki/images/icons/outdent-rtl-invert.png");
}


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

<title>Dynamically Loading HTML in Division</title>

Dynamically Loading HTML in Division

<form method="POST">
<input type="button" name="B1" value="Hello" onclick="document.getElementById('contents').innerHTML='
Hello
'" /> (contents generated in Browser)

<input type="button" name="B2" value="Test 1" onclick="loadHtml('test1.html', 'contents')" /> (Contents from Web server)

<input type="button" name="B4" value="Amazon" onclick="document.getElementById('contents').innerHTML='<iframe src="http://www.amazon.com" width="100%" height="200" scrolling="yes" frameborder="yes"></iframe>'" /> (Contents from Web server into IFrame)

</form>

Test 1 (load with hyperlink)

Contents Display Area:

Contents to be replaced.

Load Contents in Inline Frame

Load Prof. Lixin Tao's Web site into the following inline frame:

Load Amazon's Web site into the following inline frame:


text:
using System;
using Azure.Core;

namespace Azure.ResourceManager.DeviceProvisioningServices.Models
{
    /// <summary> Description of the IoT hub. </summary>
    public partial class IotHubDefinitionDescription
    {
        /// <summary> Initializes a new instance of IotHubDefinitionDescription. </summary>
        /// <param name="connectionString"> Connection string of the IoT hub. </param>
        /// <param name="location"> ARM region of the IoT hub. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="connectionString"/> is null. </exception>
        public IotHubDefinitionDescription(string connectionString, AzureLocation location)
        {
            Argument.AssertNotNull(connectionString, nameof(connectionString));

            ConnectionString = connectionString;
            Location = location;
        }

        /// <summary> Initializes a new instance of IotHubDefinitionDescription. </summary>
        /// <param name="applyAllocationPolicy"> flag for applying allocationPolicy or not for a given iot hub. </param>
        /// <param name="allocationWeight"> weight to apply for a given iot h. </param>
        /// <param name="name"> Host name of the IoT hub. </param>
        /// <param name="connectionString"> Connection string of the IoT hub. </param>
        /// <param name="location"> ARM region of the IoT hub. </param>
        internal IotHubDefinitionDescription(bool? applyAllocationPolicy, int? allocationWeight, string name, string connectionString, AzureLocation location)
        {
            ApplyAllocationPolicy = applyAllocationPolicy;
            AllocationWeight = allocationWeight;
            Name = name;
            ConnectionString = connectionString;
            Location = location;
        }

        /// <summary> flag for applying allocationPolicy or not for a given iot hub. </summary>
        public bool? ApplyAllocationPolicy { get; set; }
        /// <summary> weight to apply for a given iot h. </summary>
        public int? AllocationWeight { get; set; }
        /// <summary> Host name of the IoT hub. </summary>
        public string Name { get; }
        /// <summary> Connection string of the IoT hub. </summary>
        public string ConnectionString { get; set; }
        /// <summary> ARM region of the IoT hub. </summary>
        public AzureLocation Location { get; set; }
    }
}


text:
SELECT
    cases.id,
    'case' as type,
    to_json(get_location(things.id)) AS location,
    to_json(cases.photos) AS photos,
    localized_texts.title AS title
FROM
    cases,
    localized_texts
WHERE
    localized_texts.language = ${language} AND
    localized_texts.thingid = id AND
    cases.hidden = false
LIMIT ${limit}
OFFSET ${offset}
;


text:
package aima.test.search.nqueens;

import junit.framework.TestCase;
import aima.basic.XYLocation;
import aima.search.nqueens.NQueensBoard;

/**
 * @author Ravi Mohan
 *
 */

public class NQueensBoardTest extends TestCase {

	NQueensBoard board;

	@Override
	public void setUp() {

		board = new NQueensBoard(8);
	}

	public void testBasics() {

		assertEquals(0, board.getNumberOfQueensOnBoard());
		board.addQueenAt(new XYLocation(0, 0));
		assertEquals(1, board.getNumberOfQueensOnBoard());
		board.addQueenAt(new XYLocation(0, 0));
		assertEquals(1, board.getNumberOfQueensOnBoard());
		board.addQueenAt(new XYLocation(1, 1));
		assertEquals(2, board.getNumberOfQueensOnBoard());
		assertTrue(board.queenExistsAt(new XYLocation(1, 1)));
		assertTrue(board.queenExistsAt(new XYLocation(0, 0)));
		board.moveQueen(new XYLocation(1, 1), new XYLocation(3, 3));
		assertTrue(board.queenExistsAt(new XYLocation(3, 3)));
		assertTrue(!(board.queenExistsAt(new XYLocation(1, 1))));
		assertEquals(2, board.getNumberOfQueensOnBoard());

	}

	public void testCornerQueenAttack1() {

		board.addQueenAt(new XYLocation(0, 0));
		assertEquals(false, board.isSquareUnderAttack(new XYLocation(0, 0))); // queen
		// on
		// square
		// not
		// included
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(1, 0)));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(7, 0)));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(0, 7)));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(1, 1)));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(2, 2)));
		assertEquals(false, board.isSquareUnderAttack(new XYLocation(2, 1)));
		assertEquals(false, board.isSquareUnderAttack(new XYLocation(1, 2)));

	}

	public void testCornerQueenAttack2() {

		board.addQueenAt(new XYLocation(7, 7));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(0, 0)));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(7, 0)));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(0, 7)));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(7, 0)));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(6, 6)));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(5, 5)));
		assertEquals(false, board.isSquareUnderAttack(new XYLocation(6, 5)));
		assertEquals(false, board.isSquareUnderAttack(new XYLocation(5, 6)));

	}

	public void testEdgeQueenAttack() {

		board.addQueenAt(new XYLocation(0, 3));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(0, 0)));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(0, 7)));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(7, 3)));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(3, 0)));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(4, 7)));

	}

	public void testAttack2() {

		board.addQueenAt(new XYLocation(7, 0));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(6, 1)));
	}

	public void testAttack3() {

		board.addQueenAt(new XYLocation(0, 0));
		assertEquals(true, board.isSquareUnderAttack(new XYLocation(0, 1)));
	}

	public void testAttack4() {

		board.addQueenAt(new XYLocation(0, 2));
		assertTrue(board.isSquareUnderAttack(new XYLocation(1, 1)));
	}

	public void testMidBoardDiagonalAttack() {

		board.addQueenAt(new XYLocation(3, 3));
		// forwardDiagonal from the queen
		assertTrue(board.isSquareUnderAttack(new XYLocation(4, 2)));
		assertTrue(board.isSquareUnderAttack(new XYLocation(4, 4)));
		// backwardDiagonal from the queen
		assertTrue(board.isSquareUnderAttack(new XYLocation(2, 2)));
		assertTrue(board.isSquareUnderAttack(new XYLocation(2, 4)));
	}

	public void testCornerDiagonalAttack() {

		board.addQueenAt(new XYLocation(0, 0));
		// forwardDiagonal from the queen
		assertTrue(board.isSquareUnderAttack(new XYLocation(1, 1)));
		board.clear();

		board.addQueenAt(new XYLocation(7, 7));
		// backwardDiagonal from the queen
		assertTrue(board.isSquareUnderAttack(new XYLocation(6, 6)));

		// assertTrue(board.isSquareUnderAttack(new XYLocation(2, 2)));
		// assertTrue(board.isSquareUnderAttack(new XYLocation(2, 4)));
	}

	public void testAttack6() {

		board.addQueenAt(new XYLocation(1, 6));
		assertTrue(board.isSquareUnderAttack(new XYLocation(0, 7)));
	}

	public void testRemoveQueen() {

		board.addQueenAt(new XYLocation(0, 0));
		assertEquals(1, board.getNumberOfQueensOnBoard());
		board.removeQueenFrom(new XYLocation(0, 0));
		assertEquals(0, board.getNumberOfQueensOnBoard());
	}

	public void testMoveQueen() {

		XYLocation from = new XYLocation(0, 0);
		XYLocation to = new XYLocation(1, 1);

		board.addQueenAt(from);
		assertEquals(1, board.getNumberOfQueensOnBoard());
		assertTrue(board.queenExistsAt(from));
		assertFalse(board.queenExistsAt(to));

		board.moveQueen(from, to);
		assertEquals(1, board.getNumberOfQueensOnBoard());
		assertFalse(board.queenExistsAt(from));
		assertTrue(board.queenExistsAt(to));
	}

	public void testMoveNonExistentQueen() {

		XYLocation from = new XYLocation(0, 0);
		XYLocation to = new XYLocation(1, 1);
		board.moveQueen(from, to);

		assertEquals(0, board.getNumberOfQueensOnBoard());

	}

	public void testRemoveNonExistentQueen() {
		board.removeQueenFrom(new XYLocation(0, 0));
		assertEquals(0, board.getNumberOfQueensOnBoard());

	}

	public void testEquality() {

		board.addQueenAt(new XYLocation(0, 0));
		NQueensBoard board2 = new NQueensBoard(8);
		board2.addQueenAt(new XYLocation(0, 0));
		assertEquals(board, board2);
		NQueensBoard board3 = new NQueensBoard(8);
		board3.addQueenAt(new XYLocation(0, 1));
		assertFalse(board.equals(board3));

	}

	public void testPrint() {

		NQueensBoard board2 = new NQueensBoard(2);
		board2.addQueenAt(new XYLocation(0, 0));
		String expected = " Q  - \n -  - \n";
		assertEquals(expected, board2.getBoardPic());

	}

	public void testDontPlaceTwoQueensOnOneSquare() {

		board.addQueenAt(new XYLocation(0, 0));
		board.addQueenAt(new XYLocation(0, 0));
		assertEquals(1, board.getNumberOfQueensOnBoard());
	}

	public void testSimpleHorizontalAttack() {
		XYLocation loc = new XYLocation(0, 0);
		board.addQueenAt(loc);
		assertEquals(0, board.getNumberOfAttacksOn(loc));
		assertEquals(1, board.getNumberOfAttacksOn(new XYLocation(1, 0)));
		assertEquals(1, board.getNumberOfAttacksOn(loc.right()));
		assertEquals(1, board.getNumberOfAttacksOn(new XYLocation(7, 0)));
	}

	public void testSimpleVerticalAttack() {
		XYLocation loc = new XYLocation(0, 0);
		board.addQueenAt(loc);
		assertEquals(0, board.getNumberOfAttacksOn(loc));
		assertEquals(1, board.getNumberOfAttacksOn(loc.down()));
		assertEquals(1, board.getNumberOfAttacksOn(new XYLocation(0, 7)));
	}

	public void testSimpleDiagonalAttack() {
		XYLocation loc = new XYLocation(3, 3);
		board.addQueenAt(loc);
		assertEquals(0, board.getNumberOfAttacksOn(loc));
		assertEquals(1, board.getNumberOfAttacksOn(loc.down().right()));
		assertEquals(1, board.getNumberOfAttacksOn(loc.down().left()));
		assertEquals(1, board.getNumberOfAttacksOn(loc.up().left()));
		assertEquals(1, board.getNumberOfAttacksOn(loc.up().right()));
		assertEquals(1, board.getNumberOfAttacksOn(new XYLocation(7, 7)));
		assertEquals(1, board.getNumberOfAttacksOn(new XYLocation(0, 0)));
		assertEquals(1, board.getNumberOfAttacksOn(new XYLocation(6, 0)));
		assertEquals(1, board.getNumberOfAttacksOn(new XYLocation(0, 6)));
	}

	public void testMultipleQueens() {
		XYLocation loc1 = new XYLocation(3, 3);
		board.addQueenAt(loc1);
		assertEquals(1, board.getNumberOfAttacksOn(loc1.right()));

		board.addQueenAt(loc1.right().right());
		assertEquals(1, board.getNumberOfAttacksOn(loc1));
		assertEquals(2, board.getNumberOfAttacksOn(loc1.right()));

		board.addQueenAt(loc1.right().down());
		assertEquals(2, board.getNumberOfAttacksOn(loc1));
		assertEquals(3, board.getNumberOfAttacksOn(loc1.right()));
		assertEquals(2, board.getNumberOfAttacksOn(loc1.right().right()));

	}

	public void testBoardDisplay() {
		board.addQueenAt(new XYLocation(0, 5));
		board.addQueenAt(new XYLocation(1, 6));
		board.addQueenAt(new XYLocation(2, 1));
		board.addQueenAt(new XYLocation(3, 3));
		board.addQueenAt(new XYLocation(4, 6));
		board.addQueenAt(new XYLocation(5, 4));
		board.addQueenAt(new XYLocation(6, 7));
		board.addQueenAt(new XYLocation(7, 7));
		assertEquals(" -  -  -  -  -  -  -  - \n"
				+ " -  -  Q  -  -  -  -  - \n" + " -  -  -  -  -  -  -  - \n"
				+ " -  -  -  Q  -  -  -  - \n" + " -  -  -  -  -  Q  -  - \n"
				+ " Q  -  -  -  -  -  -  - \n" + " -  Q  -  -  Q  -  -  - \n"
				+ " -  -  -  -  -  -  Q  Q \n", board.getBoardPic());

		assertEquals("--------\n" + "--Q-----\n" + "--------\n" + "---Q----\n"
				+ "-----Q--\n" + "Q-------\n" + "-Q--Q---\n" + "------QQ\n",
				board.toString());
	}

}


text:
package com.agimatec.validation.jsr303.groups;

import javax.validation.GroupSequence;

/**
 * Description:

 * User: roman

 * Date: 09.04.2009

 * Time: 09:33:52

 * Copyright: Agimatec GmbH
 */
@GroupSequence( value = CyclicGroupSequence1.class)
public interface CyclicGroupSequence2 {

}


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

    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Best Practices - Zend Framework Manual</title>

                    Advanced

Zend_Search_Lucene

                        Programmer's Reference Guide

Zend_Serializer

Best Practices

Field names

            There are no limitations for field names in Zend_Search_Lucene.

            Nevertheless it's a good idea not to use 'id' and
            'score' names to avoid ambiguity in QueryHit
            properties names.

            The Zend_Search_Lucene_Search_QueryHit id
            and score properties always refer to internal Lucene document id
            and hit score. If
            the indexed document has the same stored fields, you have to use the
             getDocument() method to access them:

$hits = $index->find($query);

foreach ($hits as $hit) {

    // Get 'title' document field

    $title = $hit->title;

    // Get 'contents' document field

    $contents = $hit->contents;

    // Get internal Lucene document id

    $id = $hit->id;

    // Get query hit score

    $score = $hit->score;

    // Get 'id' document field

    $docId = $hit->getDocument()->id;

    // Get 'score' document field

    $docId = $hit->getDocument()->score;

    // Another way to get 'title' document field

    $title = $hit->getDocument()->title;

}

Indexing performance

            Indexing performance is a compromise between used resources, indexing time and index
            quality.

            Index quality is completely determined by number of index segments.

            Each index segment is entirely independent portion of data. So indexes containing more
            segments need more memory and time for searching.

            Index optimization is a process of merging several segments into a new one. A fully
            optimized index contains only one segment.

            Full index optimization may be performed with the  optimize()
            method:

$index = Zend_Search_Lucene::open($indexPath);

$index->optimize();

            Index optimization works with data streams and doesn't take a lot of memory but does
            require processor resources and time.

            Lucene index segments are not updatable by their nature (the update operation requires
            the segment file to be completely rewritten). So adding new document(s) to an index
            always generates a new segment. This, in turn, decreases index quality.

            An index auto-optimization process is performed after each segment generation and
            consists of merging partial segments.

            There are three options to control the behavior of auto-optimization (see Index optimization
            section):

                        MaxBufferedDocs is the number of documents that can be
                        buffered in memory before a new segment is generated and written to the hard
                        drive.

                        MaxMergeDocs is the maximum number of documents merged
                        by auto-optimization process into a new segment.

                        MergeFactor determines how often auto-optimization is
                        performed.

Note:

                    All these options are Zend_Search_Lucene object
                    properties- not index properties. They affect only current
                    Zend_Search_Lucene object behavior and may vary for
                    different scripts.

            MaxBufferedDocs doesn't have any effect if you index only one
            document per script execution. On the other hand, it's very important for batch
            indexing. Greater values increase indexing performance, but also require more memory.

            There is simply no way to calculate the best value for the
            MaxBufferedDocs parameter because it depends on average document
            size, the analyzer in use and allowed memory.

            A good way to find the right value is to perform several tests with the largest document
            you expect to be added to the index

            [1]

                     memory_get_usage() memory_get_peak_usage()

            . It's a best practice not to use more than a half of the allowed memory.

            MaxMergeDocs limits the segment size (in terms of documents). It
            therefore also limits auto-optimization time by guaranteeing that the
             addDocument() method is not executed more than a certain number
            of times. This is very important for interactive applications.

            Lowering the MaxMergeDocs parameter also may improve batch indexing
            performance. Index auto-optimization is an iterative process and is performed from
            bottom up. Small segments are merged into larger segment, which are in turn merged into
            even larger segments and so on. Full index optimization is achieved when only one large
            segment file remains.

            Small segments generally decrease index quality. Many small segments may also trigger
            the "Too many open files" error determined by OS limitations

            [2]

                    Zend_Search_Lucene
            .

            in general, background index optimization should be performed for interactive indexing
            mode and MaxMergeDocs shouldn't be too low for batch indexing.

            MergeFactor affects auto-optimization frequency. Lower values
            increase the quality of unoptimized indexes. Larger values increase indexing
            performance, but also increase the number of merged segments. This again may trigger the
            "Too many open files" error.

            MergeFactor groups index segments by their size:

Not greater than MaxBufferedDocs.

                        Greater than MaxBufferedDocs, but not greater than
                        MaxBufferedDocs*MergeFactor.

                        Greater than
                        MaxBufferedDocs*MergeFactor, but
                        not greater than
                        MaxBufferedDocs*MergeFactor*MergeFactor.

...

            Zend_Search_Lucene checks during each
             addDocument() call to see if merging any segments may move the
            newly created segment into the next group. If yes, then merging is performed.

            So an index with N groups may contain MaxBufferedDocs +
            (N-1)*MergeFactor segments and contains at least
            MaxBufferedDocs*MergeFactor(N-1)
            documents.

            This gives good approximation for the number of segments in the index:

            NumberOfSegments <= MaxBufferedDocs +
            MergeFactor*log
            MergeFactor
            (NumberOfDocuments/MaxBufferedDocs)

            MaxBufferedDocs is determined by allowed memory. This allows for
            the appropriate merge factor to get a reasonable number of segments.

            Tuning the MergeFactor parameter is more effective for batch
            indexing performance than MaxMergeDocs. But it's also more
            course-grained. So use the estimation above for tuning MergeFactor,
            then play with MaxMergeDocs to get best batch indexing performance.

Index during Shut Down

            The Zend_Search_Lucene instance performs some work at exit time
            if any documents were added to the index but not written to a new segment.

            It also may trigger an auto-optimization process.

            The index object is automatically closed when it, and all returned QueryHit objects, go
            out of scope.

            If index object is stored in global variable than it's closed only at the end of script
            execution

            [3]
                <acronym class="acronym">PHP</acronym>
            .

            <acronym class="acronym">PHP</acronym> exception processing is also shut down at this moment.

            It doesn't prevent normal index shutdown process, but may prevent accurate error
            diagnostic if any error occurs during shutdown.

            There are two ways with which you may avoid this problem.

            The first is to force going out of scope:

$index = Zend_Search_Lucene::open($indexPath);

...

unset($index);

            And the second is to perform a commit operation before the end of script execution:

$index = Zend_Search_Lucene::open($indexPath);

$index->commit();

            This possibility is also described in the "Advanced. Using index as static
                property" section.

Retrieving documents by unique id

            It's a common practice to store some unique document id in the index. Examples include
            url, path, or database id.

            Zend_Search_Lucene provides a  termDocs()
            method for retrieving documents containing specified terms.

            This is more efficient than using the  find() method:

// Retrieving documents with find() method using a query string

$query = $idFieldName . ':' . $docId;

$hits  = $index->find($query);

foreach ($hits as $hit) {

    $title    = $hit->title;

    $contents = $hit->contents;

    ...

}

...

// Retrieving documents with find() method using the query API

$term = new Zend_Search_Lucene_Index_Term($docId, $idFieldName);

$query = new Zend_Search_Lucene_Search_Query_Term($term);

$hits  = $index->find($query);

foreach ($hits as $hit) {

    $title    = $hit->title;

    $contents = $hit->contents;

    ...

}

...

// Retrieving documents with termDocs() method

$term = new Zend_Search_Lucene_Index_Term($docId, $idFieldName);

$docIds  = $index->termDocs($term);

foreach ($docIds as $id) {

    $doc = $index->getDocument($id);

    $title    = $doc->title;

    $contents = $doc->contents;

    ...

}

Memory Usage

            Zend_Search_Lucene is a relatively memory-intensive module.

            It uses memory to cache some information and optimize searching and indexing
            performance.

            The memory required differs for different modes.

            The terms dictionary index is loaded during the search. It's actually each
            128th

            [4]
                Zend_Search_Lucene<acronym class="acronym">API</acronym>

            term of the full dictionary.

            Thus memory usage is increased if you have a high number of unique terms. This may
            happen if you use untokenized phrases as a field values or index a large volume of
            non-text information.

            An unoptimized index consists of several segments. It also increases memory usage.
            Segments are independent, so each segment contains its own terms dictionary and terms
            dictionary index. If an index consists of N segments it may
            increase memory usage by N times in worst case. Perform index
            optimization to merge all segments into one to avoid such memory consumption.

            Indexing uses the same memory as searching plus memory for buffering documents. The
            amount of memory used may be managed with MaxBufferedDocs
            parameter.

            Index optimization (full or partial) uses stream-style data processing and doesn't
            require a lot of memory.

Encoding

            Zend_Search_Lucene works with UTF-8 strings internally. So all
            strings returned by Zend_Search_Lucene are UTF-8 encoded.

            You shouldn't be concerned with encoding if you work with pure <acronym class="acronym">ASCII</acronym>
            data, but you should be careful if this is not the case.

            Wrong encoding may cause error notices at the encoding conversion time or loss of data.

            Zend_Search_Lucene offers a wide range of encoding possibilities
            for indexed documents and parsed queries.

            Encoding may be explicitly specified as an optional parameter of field creation methods:

$doc = new Zend_Search_Lucene_Document();

$doc->addField(Zend_Search_Lucene_Field::Text('title',

                                              $title,

                                              'iso-8859-1'));

$doc->addField(Zend_Search_Lucene_Field::UnStored('contents',

                                                  $contents,

                                                  'utf-8'));

            This is the best way to avoid ambiguity in the encoding used.

            If optional encoding parameter is omitted, then the current locale is used. The current
            locale may contain character encoding data in addition to the language specification:

setlocale(LC_ALL, 'fr_FR');

...

setlocale(LC_ALL, 'de_DE.iso-8859-1');

...

setlocale(LC_ALL, 'ru_RU.UTF-8');

...

            The same approach is used to set query string encoding.

            If encoding is not specified, then the current locale is used to determine the encoding.

            Encoding may be passed as an optional parameter, if the query is parsed explicitly
            before search:

$query =

    Zend_Search_Lucene_Search_QueryParser::parse($queryStr, 'iso-8859-5');

$hits = $index->find($query);

...

            The default encoding may also be specified with
             setDefaultEncoding() method:

Zend_Search_Lucene_Search_QueryParser::setDefaultEncoding('iso-8859-1');

$hits = $index->find($queryStr);

...

            The empty string implies 'current locale'.

            If the correct encoding is specified it can be correctly processed by analyzer. The
            actual behavior depends on which analyzer is used. See the Character Set documentation section for
            details.

Index maintenance

            It should be clear that Zend_Search_Lucene as well as any other
            Lucene implementation does not comprise a "database".

            Indexes should not be used for data storage. They do not provide partial backup/restore
            functionality, journaling, logging, transactions and many other features associated with
            database management systems.

            Nevertheless, Zend_Search_Lucene attempts to keep indexes in a
            consistent state at all times.

            Index backup and restoration should be performed by copying the contents of the index
            folder.

            If index corruption occurs for any reason, the corrupted index should be restored or
            completely rebuilt.

            So it's a good idea to backup large indexes and store changelogs to perform manual
            restoration and roll-forward operations if necessary. This practice dramatically reduces
            index restoration time.

[1] and
                     may be used to control memory
                    usage.

[2] keeps each segment file opened to
                    improve search performance.

[3]
                    This also may occur if the index or QueryHit instances are referred to in some
                    cyclical data structures, because  garbage collects
                    objects with cyclic references only at the end of script execution.

[4]
                    The Lucene file format allows you to configure this number, but
                     doesn't expose this in its
                    . Nevertheless you still have the ability to configure
                    this value if the index is prepared with another Lucene implementation.

                    Advanced

Zend_Search_Lucene

                        Programmer's Reference Guide

Zend_Serializer

Programmer's Reference Guide

Programmer's Reference Guide

Zend Framework Reference

Zend_Search_Lucene

概述

建立索引

搜索索引

Query Language

查询类型

字符集

扩展性

与 Java Lucene 的互操作性

Advanced

Best Practices


text:
package com.interest.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.interest.common.search.SearchBean;
import com.interest.dao.BaseDao;
import com.interest.dao.BbsCategoryDao;
import com.interest.entity.TBbsCategory;

@Service
public class BbsCategoryService extends BaseService<TBbsCategory>{
	@Autowired
	private BbsCategoryDao bbsCategoryDao;

	@Deprecated
	public List<TBbsCategory> findNewsList(String time, int page, int rows){
		SearchBean searchBean = new SearchBean();
		List<TBbsCategory> categoryList = bbsCategoryDao.findList(searchBean);
		return categoryList;
	}

	public List<TBbsCategory> findNewsListEx(SearchBean searchBean, int index, int rows){
		List<TBbsCategory> categoryList = bbsCategoryDao.findListEx(searchBean, index, rows);
		return categoryList;
	}

	public List<TBbsCategory> findAll() {
		return bbsCategoryDao.findAll();
	}

	public TBbsCategory findById(String id){
		return bbsCategoryDao.findById(id);
	}

//	@Transactional
	public int minusOneById(String id){
		return bbsCategoryDao.minusOneById(id);
	}

	@Override
	protected BaseDao<TBbsCategory> getDao() {
		return bbsCategoryDao;
	}

}


text:
Title of the project

Description of the project dapibus, tellus ac cursus commodo, mauesris condime ntum nibh, ut fermentum...

Title of the project

Description of the project dapibus, tellus ac cursus commodo, mauesris condime ntum nibh, ut fermentum...

Title of the project

Description of the project dapibus, tellus ac cursus commodo, mauesris condime ntum nibh, ut fermentum...

Title of the project

Description of the project dapibus, tellus ac cursus commodo, mauesris condime ntum nibh, ut fermentum...


text:
import {Component, animate, state, style, transition, trigger} from '@angular/core';
@Component({
  selector: 'my-expando',
  styles: [`
    .toggle-container {
      background-color:white;
      border:10px solid black;
      width:200px;
      text-align:center;
      line-height:100px;
      font-size:50px;
      box-sizing:border-box;
      overflow:hidden;
    }
  `],
  animations: [trigger('openClose',
    [
      state('collapsed', style({height: '0px', color: 'maroon', borderColor: 'maroon'})),
      state('void', style({opacity: '0', height: '0px', color: 'maroon', borderColor: 'maroon', transform: 'translateX(-100%)'})),
      state('expanded', style({height: '*', borderColor: 'green', color: 'green'})),
      transition('collapsed <=> expanded',
        [animate(100, style({height: '250px'})), animate(200)]),
      transition('void => collapsed',
        [animate(1000, style({transform: 'translateX(0) scale(1)', opacity: '1'})), animate(200)]),

    ])
  ],
  template: `
    <button (click)="expand()">Open</button>
    <button (click)="collapse()">Closed</button>

      Look at this box

  `
})
export class MyExpandoCmp {
  stateExpression: string;
  constructor() { this.collapse(); }
  expand() { this.stateExpression = 'expanded'; }
  collapse() { this.stateExpression = 'collapsed'; }
}


text:
<tool id="Extract_features1" name="Extract features">
  <description> from GFF file</description>
  <command interpreter="python">extract_GFF_Features.py $input1 $out_file1 ${column_choice.col} ${column_choice.feature}</command>
  <inputs>
    <param format="gff" name="input1" type="data" label="Select GFF data"/>
    <conditional name="column_choice">
      <param name="col" type="select" label="From">
        <option value="0" selected="true">Column 1 / Sequence name</option>
        <option value="1">Column 2 / Source</option>
        <option value="2">Column 3 / Feature</option>
        <option value="6">Column 7 / Strand</option>
        <option value="7">Column 8 / Frame</option>
      </param>
      <when value="0">
        <param name="feature" type="select" multiple="true" label="Extract features" help="Multi-select list - hold the appropriate key while clicking to select multiple columns">
          <options from_dataset="input1">
            <column name="name" index="0"/>
            <column name="value" index="0"/>
            <filter type="unique_value" name="unique" column="0"/>
          </options>
        </param>
      </when>
      <when value="1">
        <param name="feature" type="select" multiple="true" label="Extract features" help="Multi-select list - hold the appropriate key while clicking to select multiple columns">
          <options from_dataset="input1">
            <column name="name" index="1"/>
            <column name="value" index="1"/>
            <filter type="unique_value" name="unique" column="1"/>
          </options>
        </param>
      </when>
      <when value="2">
        <param name="feature" type="select" multiple="true" label="Extract features" help="Multi-select list - hold the appropriate key while clicking to select multiple columns">
          <options from_dataset="input1">
            <column name="name" index="2"/>
            <column name="value" index="2"/>
            <filter type="unique_value" name="unique" column="2"/>
          </options>
        </param>
      </when>
      <when value="6">
        <param name="feature" type="select" multiple="true" label="Extract features" help="Multi-select list - hold the appropriate key while clicking to select multiple columns">
          <options from_dataset="input1">
            <column name="name" index="6"/>
            <column name="value" index="6"/>
            <filter type="unique_value" name="unique" column="6"/>
          </options>
        </param>
      </when>
      <when value="7">
        <param name="feature" type="select" multiple="true" label="Extract features" help="Multi-select list - hold the appropriate key while clicking to select multiple columns">
          <options from_dataset="input1">
            <column name="name" index="7"/>
            <column name="value" index="7"/>
            <filter type="unique_value" name="unique" column="7"/>
          </options>
        </param>
      </when>
    </conditional>
  </inputs>
  <outputs>
    <data format="gff" name="out_file1" />
  </outputs>
  <tests>
    <test>
      <param name="input1" value="5.gff"/>
      <param name="col" value="0" />
      <param name="feature" value="chr5,chr6,chr7,chr8" />
      <output name="out_file1" file="Extract_features1_out.gff"/>
    </test>
  </tests>
  <help>

**What it does**

This tool extracts selected features from GFF data.

-----

**Example**

Selecting **promoter** from the following GFF data::

    chr22  GeneA  enhancer  10000000  10001000  500  +  .  TGA
    chr22  GeneA  promoter  10010000  10010100  900  +  .  TGA
    chr22  GeneB  promoter  10020000  10025000  400  -  .  TGB
    chr22  GeneB  CCDS2220  10030000  10065000  800  -  .  TGB

will produce the following output::

    chr22  GeneA  promoter  10010000  10010100  900  +  .  TGA
    chr22  GeneB  promoter  10020000  10025000  400  -  .  TGB

----

.. class:: infomark

**About formats**

**GFF format** General Feature Format is a format for describing genes and other features associated with DNA, RNA and Protein sequences. GFF lines have nine tab-separated fields::

    1. seqname - Must be a chromosome or scaffold.
    2. source - The program that generated this feature.
    3. feature - The name of this type of feature. Some examples of standard feature types are "CDS", "start_codon", "stop_codon", and "exon".
    4. start - The starting position of the feature in the sequence. The first base is numbered 1.
    5. end - The ending position of the feature (inclusive).
    6. score - A score between 0 and 1000. If there is no score value, enter ".".
    7. strand - Valid entries include '+', '-', or '.' (for don't know/care).
    8. frame - If the feature is a coding exon, frame should be a number between 0-2 that represents the reading frame of the first base. If the feature is not a coding exon, the value should be '.'.
    9. group - All lines with the same group are linked together into a single item.

  </help>
</tool>


text:
chromeMyAdmin.controller("EditColumnDialogController", function(
    $scope,
    Events,
    mySQLClientService,
    $q,
    targetObjectService,
    typeService,
    mySQLQueryService,
    sqlExpressionService
) {
    "use strict";

    var onShowDialog = function(table, columnDefs, columnStructure) {
        resetErrorMessage();
        $scope.selectedTable = table;
        $scope.originalColumnDefs = columnDefs;
        $scope.originalColumnStructure = columnStructure;
        $scope.columnName = columnStructure.Field;
        var type = columnStructure.Type;
        $scope.type = getTypeName(type);
        var length;
        if ($scope.type === "SET" || $scope.type === "ENUM") {
            $scope.length = null;
            $scope.setEnumValues = getSetEnumValues(type);
        } else {
            length = getColumnLength(type);
            if (length) {
                $scope.length = Number(length);
            } else {
                $scope.length = null;
            }
            $scope.setEnumValues = [];
        }
        $scope.setEnumValue = "";
        $scope.unsigned = isUnsignedType(type);
        $scope.zerofill = isZerofillType(type);
        var collation = columnStructure.Collation;
        $scope.binary = isBinaryType(collation);
        $scope.allowNull = isNullType(columnStructure.Null);
        $scope.defaultValue = columnStructure.Default;
        $scope.extra = getExtra(columnStructure.Extra);
        $scope.key = getKey(columnStructure.Key);
        $scope.comment = columnStructure.Comment;
        $("#editColumnDialog").modal("show");
        var characterSet = getCharacterSet(collation);
        loadDatabaseData(characterSet, collation);
    };

    var getCharacterSet = function(collation) {
        if (collation) {
            var idx = collation.indexOf("_");
            if (idx !== -1) {
                return collation.substring(0, idx);
            } else {
                return collation;
            }
        } else {
            return null;
        }
    };

    var getKey = function(key) {
        if (key === "PRI") {
            return "PRIMARY";
        } else if (key === "MUL") {
            return "INDEX";
        } else if (key === "UNI") {
            return "UNIQUE";
        } else {
            return null;
        }
    };

    var getExtra = function(extra) {
        if (extra) {
            return extra.toUpperCase();
        } else {
            return "NONE";
        }
    };

    var getColumnLength = function(type) {
        var s = type.indexOf("(");
        if (s !== -1) {
            return type.substring(s + 1, type.indexOf(")"));
        } else {
            return null;
        }
    };

    var getSetEnumValues = function(type) {
        var idx = type.indexOf("(");
        var s = type.substring(idx + 1, type.indexOf(")"));
        var result = [];
        angular.forEach(s.split(","), function(value) {
            result.push(value.substring(1, value.length - 1));
        }, result);
        return result;
    };

    var isUnsignedType = function(type) {
        return type.indexOf("unsigned") !== -1;
    };

    var isZerofillType = function(type) {
        return type.indexOf("zerofill") !== -1;
    };

    var isBinaryType = function(collation) {
        return collation && (collation.indexOf("bin") !== -1);
    };

    var isNullType = function(nullValue) {
        return nullValue === "YES";
    };

    var getTypeName = function(type) {
        var result = "";
        var b = type.indexOf("(");
        var s = type.indexOf(" ");
        if (b !== -1) {
            result = type.substring(0, b);
        } else if (s !== -1) {
            result = type.substring(0, s);
        } else {
            result = type;
        }
        return result.toUpperCase();
    };

    var assignEventHandlers = function() {
        $scope.$on(Events.SHOW_EDIT_COLUMN_DIALOG, function(event, data) {
            var table = data.table;
            var columnDefs = data.columnDefs;
            var columnStructure = data.columnStructure;
            onShowDialog(table, columnDefs, columnStructure);
        });
    };

    var setupItems = function() {
        $scope.types = typeService.getTypes();
        $scope.type = "VARCHAR";
        $scope.extras = ["NONE", "AUTO_INCREMENT",
                         "ON UPDATE CURRENT_TIMESTAMP", "SERIAL DEFAULT VALUE"];
        $scope.extra = "NONE";
        $scope.keys = ["PRIMARY", "INDEX", "UNIQUE"];
        $scope.key = "PRIMARY";
    };

    var loadDatabaseData = function(characterSet, collation) {
        mySQLQueryService.showCharacterSet().then(function(result) {
            $scope.characterSets = result.resultsetRows;
            if (characterSet) {
                $scope.characterSet = characterSet;
            } else {
                $scope.characterSet = "utf8";
            }
            return mySQLQueryService.showCollations();
        }).then(function(result) {
            $scope.collations = result.resultsetRows;
            if (collation) {
                $scope.collation = collation;
            } else {
                $scope.collation = "utf8_general_ci";
            }
        }, function(reason) {
            $scope.fatalErrorOccurred(reason);
        });
    };

    var resetErrorMessage = function() {
        $scope.errorMessage = "";
    };

    $scope.isErrorMessageVisible = function() {
        return $scope.errorMessage.length > 0;
    };

    $scope.initialize = function() {
        resetErrorMessage();
        assignEventHandlers();
        setupItems();
    };

    $scope.editColumn = function() {
        if ($scope.type === "SET" || $scope.type === "ENUM") {
            if ($scope.setEnumValues.length === 0) {
                $scope.errorMessage = "SET/ENUM type column must have one or more values.";
                return;
            }
        }
        var sql = "ALTER TABLE `" + $scope.selectedTable.name + "` ";
        sql += "CHANGE COLUMN `" + $scope.originalColumnStructure.Field + "` `";
        sql += sqlExpressionService.replaceValue($scope.columnName) + "` ";
        sql += $scope.type;
        if ($scope.length) {
            sql += "(" + $scope.length + ")";
        }
        if ($scope.type === "SET" || $scope.type === "ENUM") {
            sql += "(" + sqlExpressionService.createStringArray($scope.setEnumValues) + ")";
        }
        sql += " ";
        if (typeService.isString($scope.type)) {
            sql += "CHARACTER SET " + $scope.characterSet + " ";
            sql += "COLLATE " + $scope.collation + " ";
            if ($scope.binary) {
                sql += "BINARY ";
            }
        } else if (typeService.isNumeric($scope.type)) {
            if ($scope.unsigned) {
                sql += "UNSIGNED ";
            }
            if ($scope.zerofill) {
                sql += "ZEROFILL ";
            }
        }
        if (!$scope.allowNull) {
            sql += "NOT NULL ";
        } else if ($scope.type == 'TIMESTAMP' && $scope.allowNull) {
            sql += "NULL ";
        }
        if ($scope.defaultValue) {
            if (typeService.isNumeric($scope.type)
                || $scope.type == 'TIMESTAMP' && $scope.defaultValue == "CURRENT_TIMESTAMP"
            ) {
                sql += "DEFAULT " + $scope.defaultValue + " ";
            } else {
                sql += "DEFAULT '" + sqlExpressionService.replaceValue($scope.defaultValue) + "' ";
            }
        }
        if ($scope.comment) {
            sql += "COMMENT '" + sqlExpressionService.replaceValue($scope.comment) + "' ";
        }
        if ($scope.extra !== "NONE") {
            sql += $scope.extra;
            if ($scope.extra === "AUTO_INCREMENT") {
                if ($scope.key === "PRIMARY") {
                    sql += " PRIMARY KEY";
                } else {
                    sql += ", ADD " + $scope.key + " (`" + $scope.columnName + "`)";
                }
            }
        }
        mySQLClientService.query(sql).then(function(result) {
            if (result.hasResultsetRows) {
                $scope.fatalErrorOccurred("Editing column failed.");
            } else {
                $("#editColumnDialog").modal("hide");
                targetObjectService.reSelectTable();
            }
        }, function(reason) {
            var errorMessage = "[Error code:" + reason.errorCode;
            errorMessage += " SQL state:" + reason.sqlState;
            errorMessage += "] ";
            errorMessage += reason.errorMessage;
            $scope.errorMessage = errorMessage;
        });
    };

    $scope.isNotNumericTypeSelected = function() {
        return !typeService.isNumeric($scope.type);
    };

    $scope.isNotStringTypeSelected = function() {
        return !typeService.isString($scope.type);
    };

    $scope.isKeyDisabled = function() {
        return $scope.extra !== "AUTO_INCREMENT";
    };

    $scope.addSetEnumValue = function() {
        if ($scope.setEnumValue && $scope.setEnumValues.indexOf($scope.setEnumValue) === -1) {
            $scope.setEnumValues.push($scope.setEnumValue);
        }
        $scope.setEnumValue = "";
    };

    $scope.deleteSetEnumValue = function(value) {
        var index = $scope.setEnumValues.indexOf(value);
        if (index !== -1) {
            $scope.setEnumValues.splice(index, 1);
        }
    };

});


text:
<BroadcastMonitor>
  <updated>2015-08-01T13:42:00</updated>
  <stationName>Radio 6</stationName>
  <Current>
    <startTime>2015-08-01T13:42:00</startTime>
    <itemId>1000080481:0</itemId>
    <titleId>216089791</titleId>
    <itemCode>05268</itemCode>
    <itemReference></itemReference>
    <titleName>Get Lucky</titleName>
    <artistName>Daft Punk feat. Pharrell & Nile Rodgers</artistName>
    <albumName></albumName>
    <CategoryCode>736</CategoryCode>
    <CategoryName>SOUL</CategoryName>
    <itemDuration>246</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Current>
  <Next>
    <startTime>2015-08-01T13:45:10</startTime>
    <itemId>1000080481:1240590</itemId>
    <titleId>190165948</titleId>
    <itemCode>JKX0360-0002</itemCode>
    <itemReference>JKX0360-0002</itemReference>
    <titleName>Your Love Is King</titleName>
    <artistName>Sade</artistName>
    <albumName></albumName>
    <CategoryCode>736</CategoryCode>
    <CategoryName>SOUL</CategoryName>
    <itemDuration>221</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Next>
</BroadcastMonitor>


text:
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [1.2.2] - [2016-06-01]
- [TASK] FIXED the symfony compenents versions

## [1.2.1] - [2016-05-20]
- [TASK] FIXED warning if key is not set

## [1.2.0] - [2016-05-20]
- [TASK] ADDED some 404 test data
- [TASK] FIXED several bugs and added the ttfb option

## [1.1.0] - [2016-05-20]
- [TASK] ADDED some improvements