text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Core.TestFramework;
using Azure.ResourceManager.CosmosDB.Models;
using NUnit.Framework;

namespace Azure.ResourceManager.CosmosDB.Tests
{
    public class SqlDatabaseTests : CosmosDBManagementClientBase
    {
        private ResourceIdentifier _databaseAccountIdentifier;
        private CosmosDBAccountResource _databaseAccount;

        private string _databaseName;

        public SqlDatabaseTests(bool isAsync) : base(isAsync)
        {
        }

        protected CosmosDBSqlDatabaseCollection SqlDatabaseContainer => _databaseAccount.GetCosmosDBSqlDatabases();

        [OneTimeSetUp]
        public async Task GlobalSetup()
        {
            _resourceGroup = await GlobalClient.GetResourceGroupResource(_resourceGroupIdentifier).GetAsync();

            _databaseAccountIdentifier = (await CreateDatabaseAccount(SessionRecording.GenerateAssetName("dbaccount-"), CosmosDBAccountKind.GlobalDocumentDB)).Id;
            await StopSessionRecordingAsync();
        }

        [OneTimeTearDown]
        public virtual void GlobalTeardown()
        {
            if (_databaseAccountIdentifier != null)
            {
                ArmClient.GetCosmosDBAccountResource(_databaseAccountIdentifier).Delete(WaitUntil.Completed);
            }
        }

        [SetUp]
        public async Task SetUp()
        {
            _databaseAccount = await ArmClient.GetCosmosDBAccountResource(_databaseAccountIdentifier).GetAsync();
        }

        [TearDown]
        public async Task TearDown()
        {
            if (await SqlDatabaseContainer.ExistsAsync(_databaseName))
            {
                var id = SqlDatabaseContainer.Id;
                id = CosmosDBSqlDatabaseResource.CreateResourceIdentifier(id.SubscriptionId, id.ResourceGroupName, id.Name, _databaseName);
                CosmosDBSqlDatabaseResource database = this.ArmClient.GetCosmosDBSqlDatabaseResource(id);
                await database.DeleteAsync(WaitUntil.Completed);
            }
        }

        [Test]
        [RecordedTest]
        public async Task SqlDatabaseCreateAndUpdate()
        {
            var database = await CreateSqlDatabase(null);
            Assert.AreEqual(_databaseName, database.Data.Resource.DatabaseName);
            // Seems bug in swagger definition
            //Assert.AreEqual(TestThroughput1, database.Data.Options.Throughput);

            bool ifExists = await SqlDatabaseContainer.ExistsAsync(_databaseName);
            Assert.True(ifExists);

            // NOT WORKING API
            //ThroughputSettingData throughtput = await database.GetMongoDBCollectionThroughputAsync();
            CosmosDBSqlDatabaseResource database2 = await SqlDatabaseContainer.GetAsync(_databaseName);
            Assert.AreEqual(_databaseName, database2.Data.Resource.DatabaseName);
            //Assert.AreEqual(TestThroughput1, database2.Data.Options.Throughput);

            VerifyDatabases(database, database2);

            var updateOptions = new CosmosDBSqlDatabaseCreateOrUpdateContent(database.Id, _databaseName, database.Data.ResourceType, null,
                new Dictionary<string, string>(),// TODO: use original tags see defect: https://github.com/Azure/autorest.csharp/issues/1590
                AzureLocation.WestUS, database.Data.Resource, new CosmosDBCreateUpdateConfig { Throughput = TestThroughput2 });

            database = (await SqlDatabaseContainer.CreateOrUpdateAsync(WaitUntil.Completed, _databaseName, updateOptions)).Value;
            Assert.AreEqual(_databaseName, database.Data.Resource.DatabaseName);
            database2 = await SqlDatabaseContainer.GetAsync(_databaseName);
            VerifyDatabases(database, database2);
        }

        [Test]
        [RecordedTest]
        public async Task SqlDatabaseList()
        {
            var database = await CreateSqlDatabase(null);

            var databases = await SqlDatabaseContainer.GetAllAsync().ToEnumerableAsync();
            Assert.That(databases, Has.Count.EqualTo(1));
            Assert.AreEqual(database.Data.Name, databases[0].Data.Name);

            VerifyDatabases(databases[0], database);
        }

        [Test]
        [RecordedTest]
        public async Task SqlDatabaseThroughput()
        {
            var database = await CreateSqlDatabase(null);
            CosmosDBSqlDatabaseThroughputSettingResource throughput = await database.GetCosmosDBSqlDatabaseThroughputSetting().GetAsync();

            Assert.AreEqual(TestThroughput1, throughput.Data.Resource.Throughput);

            CosmosDBSqlDatabaseThroughputSettingResource throughput2 = (await throughput.CreateOrUpdateAsync(WaitUntil.Completed, new ThroughputSettingsUpdateData(AzureLocation.WestUS,
                new ThroughputSettingsResourceInfo(TestThroughput2, null, null, null)))).Value;

            Assert.AreEqual(TestThroughput2, throughput2.Data.Resource.Throughput);
        }

        [Test]
        [RecordedTest]
        [Ignore("Need to diagnose The operation has not completed yet.")]
        public async Task SqlDatabaseMigrateToAutoscale()
        {
            var database = await CreateSqlDatabase(null);
            CosmosDBSqlDatabaseThroughputSettingResource throughput = await database.GetCosmosDBSqlDatabaseThroughputSetting().GetAsync();
            AssertManualThroughput(throughput.Data);

            ThroughputSettingData throughputData = (await throughput.MigrateSqlDatabaseToAutoscaleAsync(WaitUntil.Completed)).Value.Data;
            AssertAutoscale(throughputData);
        }

        [Test]
        [RecordedTest]
        [Ignore("Need to diagnose The operation has not completed yet.")]
        public async Task SqlDatabaseMigrateToManual()
        {
            var database = await CreateSqlDatabase(new AutoscaleSettings()
            {
                MaxThroughput = DefaultMaxThroughput,
            });

            CosmosDBSqlDatabaseThroughputSettingResource throughput = await database.GetCosmosDBSqlDatabaseThroughputSetting().GetAsync();
            AssertAutoscale(throughput.Data);

            ThroughputSettingData throughputData = (await throughput.MigrateSqlDatabaseToManualThroughputAsync(WaitUntil.Completed)).Value.Data;
            AssertManualThroughput(throughputData);
        }

        [Test]
        [RecordedTest]
        public async Task SqlDatabaseDelete()
        {
            var database = await CreateSqlDatabase(null);
            await database.DeleteAsync(WaitUntil.Completed);

            bool exists = await SqlDatabaseContainer.ExistsAsync(_databaseName);
            Assert.IsFalse(exists);
        }

        internal async Task<CosmosDBSqlDatabaseResource> CreateSqlDatabase(AutoscaleSettings autoscale)
        {
            _databaseName = Recording.GenerateAssetName("sql-db-");
            return await CreateSqlDatabase(_databaseName, autoscale, _databaseAccount.GetCosmosDBSqlDatabases());
        }

        internal static async Task<CosmosDBSqlDatabaseResource> CreateSqlDatabase(string name, AutoscaleSettings autoscale, CosmosDBSqlDatabaseCollection collection)
        {
            var sqlDatabaseCreateUpdateOptions = new CosmosDBSqlDatabaseCreateOrUpdateContent(AzureLocation.WestUS,
                new Models.CosmosDBSqlDatabaseResourceInfo(name))
            {
                Options = BuildDatabaseCreateUpdateOptions(TestThroughput1, autoscale),
            };
            var databaseLro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, sqlDatabaseCreateUpdateOptions);
            return databaseLro.Value;
        }

        private void VerifyDatabases(CosmosDBSqlDatabaseResource expectedValue, CosmosDBSqlDatabaseResource actualValue)
        {
            Assert.AreEqual(expectedValue.Id, actualValue.Id);
            Assert.AreEqual(expectedValue.Data.Name, actualValue.Data.Name);
            Assert.AreEqual(expectedValue.Data.Resource.DatabaseName, actualValue.Data.Resource.DatabaseName);
            Assert.AreEqual(expectedValue.Data.Resource.Rid, actualValue.Data.Resource.Rid);
            Assert.AreEqual(expectedValue.Data.Resource.Timestamp, actualValue.Data.Resource.Timestamp);
            Assert.AreEqual(expectedValue.Data.Resource.ETag, actualValue.Data.Resource.ETag);
            Assert.AreEqual(expectedValue.Data.Resource.Colls, actualValue.Data.Resource.Colls);
            Assert.AreEqual(expectedValue.Data.Resource.Users, actualValue.Data.Resource.Users);
        }
    }
}


text:
==================
Public Parameters
==================

.. toctree::
   :maxdepth: 1

   status-code.md
   error-code.md

redpajama_set_name: RedPajamaGithub


text:
import SwipeElement from "../lib/SwipeElement";
import SwipePage from "../lib/SwipePage";
import SwipeBook from "../lib/SwipeBook";

const chai = require('chai');
const assert = chai.assert;

var jsdom = require('jsdom');
const { JSDOM } = jsdom;
const { window } = new JSDOM();
const { document } = (new JSDOM('')).window;
global.document = document;
global.window = window;

global.$ = require('./jquery-2.2.3.min.js')(window);;

const myFunc = () => {
  return 3;
}
describe('swipe element test', function () {
  it('swipe element: image', function(){
    const info = { "img":"http://satoshi.blogs.com/swipe/hirano-manga/koma002/haikei.png" };
    const page_id = "page_id";
    const element_id = "element_id";
    const swipe_element = new SwipeElement(info, page_id, element_id);
    const html = swipe_element.html();

    assert.equal(html, "

");
  });
});

describe('swipe page test', function () {
  it('swipe element: image', function(){
    const info = {elements: [{ "img":"http://satoshi.blogs.com/swipe/hirano-manga/koma002/haikei.png" }]};
    const page_id = "page_id";
    const element_id = "element_id";

    const swipe_page = new SwipePage(info, {}, 1);
    swipe_page.loadElement();

    const html = swipe_page.getHtml();

    assert.equal(html, "

");
  });

});

describe('swipe page test', function () {
  it('swipe element: image', function(){
    const info = {elements: [{ "img":"http://satoshi.blogs.com/swipe/hirano-manga/koma002/haikei.png" }]};
    const page_id = "page_id";
    const element_id = "element_id";

    console.log(SwipeBook);
    const swipe_book = new SwipeBook(info, {}, 1);
    // swipe_book.loadElement();
    // console.log(swipe_page.getHtml());
  });

});


text:
ACCEPTED

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

#### Published in
J. Ferment. Technol. , Osaka 20: 409 (1942)

#### Original name
Circinella chinensis H. Nagan. & Kojiro, 1942

### Remarks
null


text:
  <link rel="stylesheet" type="text/css" href="foam.css" />

  <title>Issues</title>

  FOAM

 Issues

Models


text:
using System;

namespace Harness
{
    ///
    /// An attribute that can be added to a test class or text fixture class to
    /// set options for the <see cref="HarnessBase"/> class.
    ///
    /// <example>
    ///
    /// [HarnessConfig(ConfigFilePath = "HarnessConfig.json")]
    /// public class MyMongoIntegrationTests : HarnessBase
    /// {
    ///     [Fact]
    ///     public void Test()
    ///     {
    ///         // Test something...
    ///     }
    /// }
    ///
    ///
    /// [HarnessConfig(ConfigFilePath = "HarnessConfig.json", AutoRun = false)]
    /// public class MyMongoIntegrationTests : HarnessBase
    /// {
    ///     [Fact]
    ///     public void Test()
    ///     {
    ///         base.Build();
    ///
    ///         // Test something...
    ///     }
    /// }
    ///
    /// </example>
    [AttributeUsage(AttributeTargets.Class)]
    public class HarnessConfigAttribute : Attribute
    {
        ///
        /// Gets or sets the path to the Harness configuration file.
        ///
        public string ConfigFilePath { get; set; }

        ///
        /// Gets or sets a value indicating if the MongoDB setup should happen
        /// automatically or not.
        /// If set to true, the database will be put into the required state
        /// during class construction. If set to false, the BuildDatabase()
        /// method must be called.
        /// The default value is true.
        ///
        public bool AutoRun { get; set; }

        ///
        /// Initializes a new instance of the <see cref="HarnessConfigAttribute"/> class.
        ///
        public HarnessConfigAttribute()
        {
            this.ConfigFilePath = string.Empty;
            this.AutoRun = true;
        }
    }
}


text:
namespace documentapi {

ReplyMerger::ReplyMerger()
    : _error(),
      _ignored(),
      _successReply(nullptr),
      _successIndex(0)
{
}

ReplyMerger::~ReplyMerger() = default;

ReplyMerger::Result::Result(uint32_t successIdx, std::unique_ptr<mbus::Reply> generatedReply)
    : _generatedReply(std::move(generatedReply)),
      _successIdx(successIdx)
{
}

bool
ReplyMerger::Result::hasGeneratedReply() const
{
    return (bool)_generatedReply;
}

bool
ReplyMerger::Result::isSuccessful() const
{
    return !hasGeneratedReply();
}

std::unique_ptr<mbus::Reply>
ReplyMerger::Result::releaseGeneratedReply()
{
    assert(hasGeneratedReply());
    return std::move(_generatedReply);
}

uint32_t
ReplyMerger::Result::getSuccessfulReplyIndex() const
{
    assert(!hasGeneratedReply());
    return _successIdx;
}

void
ReplyMerger::merge(uint32_t idx, const mbus::Reply& r)
{
    if (r.hasErrors()) {
        mergeAllReplyErrors(r);
    } else {
        updateStateWithSuccessfulReply(idx, r);
    }
}

bool
ReplyMerger::resourceWasFound(const mbus::Reply& r)
{
    switch (r.getType()) {
    case DocumentProtocol::REPLY_REMOVEDOCUMENT:
        return static_cast<const RemoveDocumentReply&>(r).wasFound();
    case DocumentProtocol::REPLY_UPDATEDOCUMENT:
        return static_cast<const UpdateDocumentReply&>(r).wasFound();
    case DocumentProtocol::REPLY_GETDOCUMENT:
        return static_cast<const GetDocumentReply&>(r).getLastModified() != 0;
    default:
        return false;
    }
}

// Precondition: _successReply != 0
bool
ReplyMerger::replyIsBetterThanCurrent(const mbus::Reply& r) const
{
    return resourceWasFound(r) && !resourceWasFound(*_successReply);
}

void
ReplyMerger::setCurrentBestReply(uint32_t idx, const mbus::Reply& r)
{
    _successIndex = idx;
    _successReply = &r;
}

void
ReplyMerger::updateStateWithSuccessfulReply(uint32_t idx, const mbus::Reply& r)
{
    if (!_successReply || replyIsBetterThanCurrent(r)) {
        setCurrentBestReply(idx, r);
    }
}

void
ReplyMerger::mergeAllReplyErrors(const mbus::Reply& r)
{
    if (handleReplyWithOnlyIgnoredErrors(r)) {
        return;
    }
    if ( ! _error ) {
        _error = std::make_unique<mbus::EmptyReply>();
    }
    for (uint32_t i = 0; i < r.getNumErrors(); ++i) {
        _error->addError(r.getError(i));
    }
}

bool
ReplyMerger::handleReplyWithOnlyIgnoredErrors(const mbus::Reply& r)
{
    if (DocumentProtocol::hasOnlyErrorsOfType(r, DocumentProtocol::ERROR_MESSAGE_IGNORED)) {
        if ( ! _ignored) {
            _ignored = std::make_unique<mbus::EmptyReply>();
        }
        _ignored->addError(r.getError(0));
        return true;
    }
    return false;
}

bool
ReplyMerger::shouldReturnErrorReply() const
{
    if (_error) {
        return true;
    }
    return (_ignored.get() && !_successReply);
}

std::unique_ptr<mbus::Reply>
ReplyMerger::releaseGeneratedErrorReply()
{
    if (_error) {
        return std::move(_error);
    } else {
        assert(_ignored.get());
        return std::move(_ignored);
    }
}

bool
ReplyMerger::successfullyMergedAtLeastOneReply() const
{
    return (_successReply != nullptr);
}

ReplyMerger::Result
ReplyMerger::createEmptyReplyResult()
{
    return Result(0u, std::make_unique<mbus::EmptyReply>());
}

ReplyMerger::Result
ReplyMerger::mergedReply()
{
    std::unique_ptr<mbus::Reply> generated;
    if (shouldReturnErrorReply()) {
        generated = releaseGeneratedErrorReply();
    } else if (!successfullyMergedAtLeastOneReply()) {
        return createEmptyReplyResult();
    }
    return Result(_successIndex, std::move(generated));
}

} // documentapi


text:
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;

namespace EmptyKeys.UserInterface.Generator.Types
{
    /// <summary>
    /// Implements Repeat Button control generator
    /// </summary>
    public class RepeatButtonGeneratorType : ButtonGeneratorType
    {
        /// <summary>
        /// Gets the type of the xaml.
        /// </summary>
        /// <value>
        /// The type of the xaml.
        /// </value>
        public override Type XamlType
        {
            get
            {
                return typeof(RepeatButton);
            }
        }

        /// <summary>
        /// Generates code
        /// </summary>
        /// <param name="source">The dependence object</param>
        /// <param name="classType">Type of the class.</param>
        /// <param name="initMethod">The initialize method.</param>
        /// <param name="generateField"></param>
        /// <returns></returns>
        public override CodeExpression Generate(DependencyObject source, CodeTypeDeclaration classType, CodeMemberMethod initMethod, bool generateField)
        {
            CodeExpression fieldReference = base.Generate(source, classType, initMethod, generateField);
            CodeComHelper.GenerateField<int>(initMethod, fieldReference, source, RepeatButton.DelayProperty);
            CodeComHelper.GenerateField<int>(initMethod, fieldReference, source, RepeatButton.IntervalProperty);

            return fieldReference;
        }
    }
}


text:
package org.apache.olingo.client.api.data;

import java.net.URI;

/**
 * Outermost response payload wrapper.
 *
 * @param <T> the actual response payload
 */
public class ResWrap<T> {

  private final URI contextURL;
  private final String metadataETag;
  private final T payload;

  /**
   * Creates a new response payload wrapper
   *
   * @param contextURL    Context URI of the response
   * @param metadataETag  ETag of the payload
   * @param payload       Payload of the response
   */
  public ResWrap(final URI contextURL, final String metadataETag, final T payload) {
    this.contextURL = contextURL;
    this.metadataETag = metadataETag;
    this.payload = payload;
  }

  /**
   * The context URL describes the content of the payload. It consists of the canonical metadata document URL and a
   * fragment identifying the relevant portion of the metadata document.
   *

   * Request payloads generally do not require context URLs as the type of the payload can generally be determined from
   * the request URL.
   *

   * For details on how the context URL is used to describe a payload, see the relevant sections in the particular
   * format.
   *
   * @return context URL.
   */
  public URI getContextURL() {
    return contextURL;
  }

  /**
   * An ETag header MAY also be returned on a metadata document request or service document request to allow the client
   * subsequently to make a conditional request for the metadata or service document. Clients can also compare the value
   * of the ETag header returned from a metadata document request to the metadata ETag returned in a response in order
   * to verify the version of the metadata used to generate that response.
   *
   * @return metadata ETag.
   */
  public String getMetadataETag() {
    return metadataETag;
  }

  /**
   * Gets contained object.
   *
   * @return contained object.
   */
  public T getPayload() {
    return payload;
  }
}


text:
import pandas as pd

class IOManager2(object):
	"""docstring for IOManager2"""
	def __init__(self):
		super(IOManager2, self).__init__()

	def read_file(self, file_path):
		df = pd.read_csv(file_path)
		return df


text:
var message = "Hello, World!";
var e = document.getElementById("hw");
e.innerHTML = "Hello World";
e.createTextNode ("Hello World");


text:
using Twilio.TwiML;
using Twilio.TwiML.Mvc;

private static TwiMLResult AutoConnect()
{
    var twiml = new TwilioResponse();
    twiml.Say("You will now be connected to the first caller in the queue.");
    twiml.BeginDial()
          .Queue("Queue Demo")
          .EndDial();
    twiml.Redirect();
    return new TwiMLResult(twiml);
}


text:
<?php
/**
 * related page configuration object awareness trait
 */
namespace PHPagstract\Traits;

use PHPagstract\Exception;
use PHPagstract\Page\Page;

/**
 * related page configuration object awareness trait
 *
 * providing setter/getter methods for page configuration
 *
 * @package   PHPagstract
 * @author    Björn Bartels <coding@bjoernbartels.earth>
 * @link      https://gitlab.bjoernbartels.earth/php/phpagstract
 * @license   http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
 * @copyright copyright (c) 2016 Björn Bartels <coding@bjoernbartels.earth>
 */
trait ConfigurationAwareTrait
{

    /**
     * related page configuration instance
     *
     * @var PHPagstract\Page\Config\PageConfig
     */
    private $configuration = null;

    /**
     * retrieve related page configuration instance
     *
     * @return PHPagstract\Page\Config\PageConfig
     * @throws PHPagstract\Exception
     */
    public function getConfiguration()
    {
        if ($this->configuration === null && $this->throwOnError === true) {
            throw new Exception("no configuration set");
        }
        return $this->configuration;
    }

    /**
     * shortcut/alias to retrieve related page configuration instance
     *
     * @return PHPagstract\Page\Config\PageConfig
     * @see    ::getConfiguration
     */
    public function config()
    {
        return $this->getConfiguration();
    }

    /**
     * set related page configuration instance
     *
     * @param \PHPagstract\Page\Config\PageConfig $configuration
     */
    public function setConfiguration($configuration)
    {
        $this->configuration = $configuration;
    }
}


text:
package dk.bitmovers.timeregistration.client.gui.data;

import java.util.List;

import dk.bitmovers.timeregistration.client.gui.MenuManager.MenuInfo;
import dk.bitmovers.timeregistration.data.provider.WorkClockEventProvider;
import dk.bitmovers.timeregistration.model.Client;
import dk.bitmovers.timeregistration.model.ClientProject;
import dk.bitmovers.timeregistration.model.Provider;
import dk.bitmovers.timeregistration.model.ProviderAccount;
import dk.bitmovers.timeregistration.model.RegistrationEvent;
import dk.bitmovers.timeregistration.model.RegistrationItem;
import dk.bitmovers.timeregistration.model.User;

public interface DataProvider {

	public List<Client> lookupClients(User user);

	public Client lookupClient(User user, Integer clientId);

	public List<ClientProject> lookupClientProjects(User user, Client client);

	public List<Provider> lookupProviders(User user);

	public List<ProviderAccount> lookupProviderAccounts(User user, Provider provider);

	public Provider lookupProvider(User user, Integer id);

	public List<MenuInfo> getMenuItems(User user);

	public WorkClockEventProvider getWorkClockEventProvider();

	public Integer save(RegistrationItem item);

	public Integer saveRegistrationEvent(RegistrationEvent event);

	public ClientProject retrieveClientProject(Integer id);

	public ProviderAccount retrieveProviderAccount(Integer id);

	public List<RegistrationItem> lookupRegistrations(User user , Client client, Provider provider);

}


text:
<!DOCTYPE html>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

		<title>Editar Cliente</title>
		<meta charset="UTF-8">

Editar Cliente

        <form action="Cliente.html">
            Nome do Cliente:
            <input type="text" value="Cliente x"></input>
            Email:
			<input type="text" value="clientex@email.com"></input>
            <input type="submit" class="btn btn-primary" value="Salvar" />
            <input type="submit" class="btn btn-primary" value="Cancelar" />
        </form>


text: Companion app for Andromeda, a personalized Shift Tracking Tool.


text:
require.config({
    paths: {
        hello_splunk_js_view: '../app/hello-splunkjs/js/views/HelloSplunkJSView'
    }
});

require(['jquery','underscore','splunkjs/mvc', 'hello_splunk_js_view', 'splunkjs/mvc/simplexml/ready!'],
		function($, _, mvc, HelloSplunkJSView){

    // Render the view on the page
    var helloSplunkJSView = new HelloSplunkJSView({
        el: $('#placeholder_for_view')
    });

    // Render the view
    helloSplunkJSView.render();

});


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

    <title>Assert-True :: Blade :: PowerShell Testing Module</title>
	<link href="styles.css" type="text/css" rel="stylesheet" />

Topics

about_Blade

Commands

Assert-Contains

Assert-ContainsLike

Assert-ContainsNotLike

Assert-DirectoryDoesNotExist

Assert-DirectoryExists

Assert-DoesNotContain

Assert-Empty

Assert-Equal

Assert-Error

Assert-False

Assert-FileContains

Assert-FileDoesNotExist

Assert-FileExists

Assert-GreaterThan

Assert-Is

Assert-LastProcessFailed

Assert-LastProcessSucceeded

Assert-LessThan

Assert-Like

Assert-Match

Assert-NodeDoesNotExist

Assert-NodeExists

Assert-NoError

Assert-NotEmpty

Assert-NotEqual

Assert-NotNull

Assert-Null

Assert-True

New-AssertionException

New-TempDirectory

New-TempDirectoryTree

Test-NodeExists

Scripts

blade.ps1

Import-Blade.ps1

Assert-True

Asserts a condition is true.

Syntax

Assert-True [[-Condition] <Object>] [[-Message] <String>] [<CommonParameters>]

Description

Uses PowerShell's rules for determinig truthiness.  All values are true except:

0

$false

'' (i.e. [String]::Empty)

$null

@() (i.e. empty arrays)

All other values are true.

 Parameters

				Name
                Type
				Description
				Required?
				Pipeline Input
				Default Value

				Condition
				Object
				The object/value to test for truthiness.

				false
				false

				Message
				String
				A message to show if Condition isn't $true.

				false
				false

EXAMPLE 1

Assert-True $false

Demonstrates how to fail a test.

EXAMPLE 2

Assert-True (Invoke-SomethingThatShouldReturnSomething)

Demonstrates how to check that a function returns a true object/value.

EXAMPLE 3

Assert-False $true 'The fladoozle didn't dooflaple.'

Demonstrates how to use the Message parameter to describe why the assertion might have failed.


text:
package question_451;

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

public class Q491_Increasing_Subsequences {
    public List<List<Integer>> findSubsequences(int[] nums) {
        List<Integer> list = new ArrayList<>();
        Set<List<Integer>> lists = new HashSet<>();
        lists.add(list);
        return helper(nums, 0, lists);
    }

    // 2 3 4 4
    public List<List<Integer>> helper(int[] nums, int index, Set<List<Integer>> lists) {
        // base case: don't add current number  [][2]->[][2]
        Set<List<Integer>> tmp = new HashSet<>(lists);

        // add current number [][2]->[3][2,3]
        for (List<Integer> list : lists) {
            if (list.size() == 0 || nums[index] >= list.get(list.size() - 1)) {
                List<Integer> newlist = new ArrayList<>(list);
                newlist.add(nums[index]);
                tmp.add(newlist);
            }
        }

//        System.out.println(index+" : "+tmp);
        if (index < nums.length - 1) return helper(nums, index + 1, tmp);
            // remove all size<2 lists
        else {
            lists.clear();
            for (List<Integer> list : tmp)
                if (list.size() > 1) lists.add(list);
            return new ArrayList<>(lists);
        }
    }

    public static void main(String[] args) {
        int[] arr = {1, 3, 2, 1, 1};
        Q491_Increasing_Subsequences q = new Q491_Increasing_Subsequences();
        List<List<Integer>> tmp = q.findSubsequences(arr);
        System.out.println(tmp);
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Merulius affinis Jungh.

### Remarks
null


text:
<!DOCTYPE html>
<html lang="en-us">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>Audio Game</title>
  <style>
    body { margin: 0; }
    canvas { width:95%; height:95%; }
  </style>
</head>
<body>
  <!-- <button class="play">Play</button>
  <button class="stop">Stop</button> -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r71/three.min.js"></script>
  <script src="game.js"></script>
</body>
</html>


text:
---
title: "New in React v0.4: Autobind by Default"
author: Paul O'Shannessy
---

React v0.4 is very close to completion. As we finish it off, we'd like to share with you some of the major changes we've made since v0.3. This is the first of several posts we'll be making over the next week.

## What is React.autoBind?

If you take a look at most of our current examples, you'll see us using `React.autoBind` for event handlers. This is used in place of `Function.prototype.bind`. Remember that in JS, [function calls are late-bound](https://bonsaiden.github.io/JavaScript-Garden/#function.this). That means that if you simply pass a function around, the `this` used inside won't necessarily be the `this` you expect. `Function.prototype.bind` creates a new, properly bound, function so that when called, `this` is exactly what you expect it to be.

Before we launched React, we would write this:

```js{4}
React.createClass({
  onClick: function(event) {/* do something with this */},
  render: function() {
    return <button onClick={this.onClick.bind(this)} />;
  }
});
```

We wrote `React.autoBind` as a way to cache the function creation and save on memory usage. Since `render` can get called multiple times, if you used `this.onClick.bind(this)` you would actually create a new function on each pass. With React v0.3 you were able to write this instead:

```js{2,4}
React.createClass({
  onClick: React.autoBind(function(event) {/* do something with this */}),
  render: function() {
    return <button onClick={this.onClick} />;
  }
});
```

## What's Changing in v0.4?

After using `React.autoBind` for a few weeks, we realized that there were very few times that we didn't want that behavior. So we made it the default! Now all methods defined within `React.createClass` will already be bound to the correct instance.

Starting with v0.4 you can just write this:

```js{2,4}
React.createClass({
  onClick: function(event) {/* do something with this */},
  render: function() {
    return <button onClick={this.onClick} />;
  }
});
```

For v0.4 we will simply be making `React.autoBind` a no-op — it will just return the function you pass to it. Most likely you won't have to change your code to account for this change, though we encourage you to update. We'll publish a migration guide documenting this and other changes that come along with React v0.4.


text:
<?hh // strict

namespace Md\CatHacks\Types;

interface Tuple
{
	public function getArity(): int;
}


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

import {LocaleManagerBase, LocaleManager} from "jec-commons-node";
import {GlassCatError} from "../exceptions/GlassCatError";
import {GlassCatErrorCode} from "../exceptions/GlassCatErrorCode";

/**
 * The GlassCatLocaleManager singleton allows to manage the
 * internationalization context for a GlassCat container.
 */
export class GlassCatLocaleManager {

  //////////////////////////////////////////////////////////////////////////////
  // Constructor function
  //////////////////////////////////////////////////////////////////////////////

  /**
   * Creates a new GlassCatLocaleManager instance.
   */
  constructor() {
    const isInstanciated:boolean = GlassCatLocaleManager.INSTANCE !== null;
    let msg:string = null;
    if(GlassCatLocaleManager._locked || isInstanciated) {
      if(isInstanciated && GlassCatLocaleManager.INSTANCE.isInitialized()) {
        msg = GlassCatLocaleManager.getInstance().get(
          "errors.singleton", "GlassCatLocaleManager"
        );
      } else {
        msg = "You cannot create a GlassCatLocaleManager instance; " +
              "use getInstance() instead.";
      }
      throw new GlassCatError(GlassCatErrorCode.SINGLETON_ERROR, msg);
    }
    GlassCatLocaleManager._locked = true;
  }

  //////////////////////////////////////////////////////////////////////////////
  // Singleton managment
  //////////////////////////////////////////////////////////////////////////////

  /**
   * Prevents LocaleManager illegal instanciations.
   */
  private static _locked:boolean = true;

  /**
   * The LocaleManager singleton instance reference.
   */
  private static INSTANCE:LocaleManager = null;

  /**
   * Returns a reference to the GlassCatLocaleManager singleton.
   *
   * @return {LocaleManager} a reference to the LocaleManager
   *                         singleton.
   */
  public static getInstance():LocaleManager {
    if(GlassCatLocaleManager.INSTANCE === null) {
      GlassCatLocaleManager._locked = false;
      GlassCatLocaleManager.INSTANCE = new LocaleManagerBase();
    }
    return GlassCatLocaleManager.INSTANCE;
  }
}


text:
class SampleGameResultService implements IGameResultService {
	checkResult(game: Game): GameResult {
		var hasWinner = false;
		var winner = Marker.Empty;
		var isTie = false;

		if (this.checkForColumnWinner(game.board, Marker.X) || this.checkForRowWinner(game.board, Marker.X) || this.checkForDiaginalWinner(game.board, Marker.X)) {
			hasWinner = true;
			winner = Marker.X;
		}

		if (this.checkForColumnWinner(game.board, Marker.O) || this.checkForRowWinner(game.board, Marker.O) || this.checkForDiaginalWinner(game.board, Marker.O)) {
			hasWinner = true;
			winner = Marker.O;
		}

		if (!hasWinner && !this.hasEmptySpace(game.board)) {
			isTie = true;
		}

		return new GameResult(isTie, hasWinner, winner);
	}

	private hasEmptySpace(board: Marker[][]) {
		for (var row = 0; row < 3; row++) {
			for (var col = 0; col < 3; col++) {
				if (board[col][row] == Marker.Empty) return true;
			}
		}
		return false;
	}

	private checkForColumnWinner(board: Marker[][], markerToCheckFor: Marker): boolean {
		for (var col = 0; col < 3; col++) {
			var matchs = 0;
			for (var row = 0; row < 3; row++) {
				if (markerToCheckFor == board[col][row]) matchs++;
				if (matchs == 3) return true;
			}
		}
		return false;
	}

	private checkForRowWinner(board: Marker[][], markerToCheckFor: Marker): boolean {
		for (var row = 0; row < 3; row++) {
			var matchs = 0;
			for (var col = 0; col < 3; col++) {
				if (markerToCheckFor == board[col][row]) matchs++;
				if (matchs == 3) return true;
			}
		}
		return false;
	}

	private checkForDiaginalWinner(board: Marker[][], markerToCheckFor: Marker): boolean {
		if (board[0][0] == markerToCheckFor && board[1][1] == markerToCheckFor && board[2][2] == markerToCheckFor) return true;
		if (board[0][2] == markerToCheckFor && board[1][1] == markerToCheckFor && board[2][0] == markerToCheckFor) return true;
		return false;
	}
}


text:
namespace chromeos {

class MockIMECandidateWindowHandler
    : public IBusPanelCandidateWindowHandlerInterface {
 public:
  struct UpdateLookupTableArg {
    IBusLookupTable lookup_table;
    bool is_visible;
  };

  struct UpdateAuxiliaryTextArg {
    std::string text;
    bool is_visible;
  };

  MockIMECandidateWindowHandler();
  virtual ~MockIMECandidateWindowHandler();

  // IBusPanelCandidateWindowHandlerInterface override.
  virtual void UpdateLookupTable(const IBusLookupTable& table,
                                 bool visible) OVERRIDE;
  virtual void HideLookupTable() OVERRIDE;
  virtual void UpdateAuxiliaryText(const std::string& text,
                                   bool visible) OVERRIDE;
  virtual void HideAuxiliaryText() OVERRIDE;
  virtual void UpdatePreeditText(const std::string& text, uint32 cursor_pos,
                                 bool visible) OVERRIDE;
  virtual void HidePreeditText() OVERRIDE;
  virtual void SetCursorLocation(const ibus::Rect& cursor_location,
                                 const ibus::Rect& composition_head) OVERRIDE;

  int set_cursor_location_call_count() const {
    return set_cursor_location_call_count_;
  }

  int update_lookup_table_call_count() const {
    return update_lookup_table_call_count_;
  }

  int update_auxiliary_text_call_count() const {
    return update_auxiliary_text_call_count_;
  }

  const UpdateLookupTableArg& last_update_lookup_table_arg() {
    return last_update_lookup_table_arg_;
  }

  const UpdateAuxiliaryTextArg& last_update_auxiliary_text_arg() {
    return last_update_auxiliary_text_arg_;
  }

  // Resets all call count.
  void Reset();

 private:
  int set_cursor_location_call_count_;
  int update_lookup_table_call_count_;
  int update_auxiliary_text_call_count_;
  UpdateLookupTableArg last_update_lookup_table_arg_;
  UpdateAuxiliaryTextArg last_update_auxiliary_text_arg_;
};

}  // namespace chromeos

#endif  // CHROMEOS_IME_MOCK_IME_CANDIDATE_WINDOW_HANDLER_H_


text:
"use strict";
debugger;

let target = {sports: "스포츠", music: "음악"};
let newProxy = new Proxy(target, {
  deleteProperty(target, key) {
    return delete target[key];
  }
});

console.log(delete newProxy.sports);
console.log(delete newProxy.dummy);

Object.seal(target);
let desc = Object.getOwnPropertyDescriptor(target, "music");
if (desc.configurable){
  console.log(delete newProxy.music);
} else {
  console.log("삭제 불가");
};

let dummy;


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

package com.cloudera.impala;

import com.google.common.collect.Lists;

import java.util.HashMap;
import java.util.List;

import org.apache.hadoop.hive.ql.exec.UDF;
import org.apache.hadoop.hive.serde2.io.ByteWritable;
import org.apache.hadoop.hive.serde2.io.DoubleWritable;
import org.apache.hadoop.hive.serde2.io.ShortWritable;
import org.apache.hadoop.hive.serde2.io.TimestampWritable;
import org.apache.hadoop.io.BooleanWritable;
import org.apache.hadoop.io.BytesWritable;
import org.apache.hadoop.io.FloatWritable;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;

/**
 * A bunch of incompatible Java UDFs for testing. Impala shouldn't load
 * the function since none of the signatures are compatible.
 *
 * The jar for this file can be built by running "mvn clean package" in
 * tests/test-hive-udfs. This is run in testdata/bin/create-load-data.sh, and
 * copied to HDFS in testdata/bin/copy-udfs-uda.sh.
 */
public class IncompatibleUdfTest extends UDF {
  public IncompatibleUdfTest() {
  }

  public IntWritable evaluate(List<String> list) {
    if (list == null) return null;
    return new IntWritable(list.size());
  }
  public IntWritable evaluate(HashMap<String,String> m) {
    if (m == null) return null;
    return new IntWritable(m.size());
  }
  public LongWritable evaluate(LongWritable a, List<IntWritable> b) {
    if (a == null) return null;
    return new LongWritable(a.get());
  }
  public List<Text> evaluate(Text a) {
    if (a == null) return null;
    return Lists.newArrayList(a);
  }
  public Object evaluate(Object a, Object b, Object c) {
    return null;
  }
  public IntWritable evaluate(Object a) {
    return null;
  }
}


text:
package integration

import (
	"net/http"
	"net/http/httptest"
	"testing"

	kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
	klatest "github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/api/rest"
	kv1beta1 "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta1"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver"
	kclient "github.com/GoogleCloudPlatform/kubernetes/pkg/client"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/master"
	namespaceetcd "github.com/GoogleCloudPlatform/kubernetes/pkg/registry/namespace/etcd"
	"github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/admission/admit"

	"github.com/openshift/origin/pkg/api/latest"
	"github.com/openshift/origin/pkg/api/v1beta1"
	"github.com/openshift/origin/pkg/client"
	projectapi "github.com/openshift/origin/pkg/project/api"
	projectregistry "github.com/openshift/origin/pkg/project/registry/project"
	testutil "github.com/openshift/origin/test/util"
)

func init() {
	testutil.RequireEtcd()
}

// TestProjectIsNamespace verifies that a project is a namespace, and a namespace is a project
func TestProjectIsNamespace(t *testing.T) {
	testutil.DeleteAllEtcdKeys()
	etcdClient := testutil.NewEtcdClient()
	etcdHelper, err := master.NewEtcdHelper(etcdClient, "")
	if err != nil {
		t.Fatalf("Unexpected error: %v", err)
	}

	// create a kube and its client
	kubeInterfaces, _ := klatest.InterfacesFor(klatest.Version)
	namespaceStorage, _, _ := namespaceetcd.NewStorage(etcdHelper)
	kubeStorage := map[string]rest.Storage{
		"namespaces": namespaceStorage,
	}

	osMux := http.NewServeMux()
	server := httptest.NewServer(osMux)
	defer server.Close()
	handlerContainer := master.NewHandlerContainer(osMux)

	version := &apiserver.APIGroupVersion{
		Root:    "/api",
		Version: "v1beta1",

		Storage: kubeStorage,
		Codec:   kv1beta1.Codec,

		Mapper: klatest.RESTMapper,

		Creater: kapi.Scheme,
		Typer:   kapi.Scheme,
		Linker:  kubeInterfaces.MetadataAccessor,

		Admit:   admit.NewAlwaysAdmit(),
		Context: kapi.NewRequestContextMapper(),
	}
	if err := version.InstallREST(handlerContainer); err != nil {
		t.Fatalf("unable to install REST: %v", err)
	}

	kubeClient, err := kclient.New(&kclient.Config{Host: server.URL})
	if err != nil {
		t.Fatalf("Unexpected error: %v", err)
	}

	// create an origin
	originInterfaces, _ := latest.InterfacesFor(latest.Version)
	originStorage := map[string]rest.Storage{
		"projects": projectregistry.NewREST(kubeClient.Namespaces(), nil),
	}
	osVersion := &apiserver.APIGroupVersion{
		Root:    "/osapi",
		Version: "v1beta1",

		Storage: originStorage,
		Codec:   v1beta1.Codec,

		Mapper: latest.RESTMapper,

		Creater: kapi.Scheme,
		Typer:   kapi.Scheme,
		Linker:  originInterfaces.MetadataAccessor,

		Admit:   admit.NewAlwaysAdmit(),
		Context: kapi.NewRequestContextMapper(),
	}
	if err := osVersion.InstallREST(handlerContainer); err != nil {
		t.Fatalf("unable to install REST: %v", err)
	}

	originClient, err := client.New(&kclient.Config{Host: server.URL})
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}

	// create a namespace
	namespace := &kapi.Namespace{
		ObjectMeta: kapi.ObjectMeta{Name: "integration-test"},
	}
	namespaceResult, err := kubeClient.Namespaces().Create(namespace)
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}

	// now try to get the project with the same name and ensure it is our namespace
	project, err := originClient.Projects().Get(namespaceResult.Name)
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}
	if project.Name != namespace.Name {
		t.Fatalf("Project name did not match namespace name, project %v, namespace %v", project.Name, namespace.Name)
	}

	// now create a project
	project = &projectapi.Project{
		ObjectMeta:  kapi.ObjectMeta{Name: "new-project"},
		DisplayName: "Hello World",
	}
	projectResult, err := originClient.Projects().Create(project)
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}

	// now get the namespace for that project
	namespace, err = kubeClient.Namespaces().Get(projectResult.Name)
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}
	if project.Name != namespace.Name {
		t.Fatalf("Project name did not match namespace name, project %v, namespace %v", project.Name, namespace.Name)
	}
	if project.DisplayName != namespace.Annotations["displayname"] {
		t.Fatalf("Project display name did not match namespace annotation, project %v, namespace %v", project.DisplayName, namespace.Annotations["displayname"])
	}

}


text:
local QuestID = 9
local Quest = Quests[QuestID]

Quest.Texts = {
	["Accepted"] = "Sammel 50 Pfandflaschen und gebe sie dem Obdachlosen!",
	["Finished"] = "Kehre zum Obdachlosen zur\\ueck!"
}

for k,v in ipairs(Quest:getPeds(2)) do
	addEventHandler("onElementClicked", v,
		function(button, state, thePlayer)
			if (button == "left") and (state == "down") then
				if (getDistanceBetweenElements3D(v,thePlayer) < 5) then
					local QuestState = thePlayer:isQuestActive(Quest)
					if (QuestState and not(QuestState == "Finished")) then
						if (thePlayer:getInventory():removeItem(Items[2], 50)) then
							thePlayer:refreshInventory()
							Quest:playerFinish(thePlayer)
						else
							thePlayer:showInfoBox("error", "Du besitzt zu wenig Pfandflaschen!")
						end
					end
				end
			end
		end
	)
end

Quest.playerReachedRequirements =
	function(thePlayer, bOutput)
		if ( thePlayer:isQuestFinished(Quests[8]) ) then
			return true
		end
		return false
	end

Quest.getTaskPosition =
	function()
		--Should return int, dim, x, y, z
		return 0, 0, 1487.4013671875, -1699.23046875, 14.046875
	end

Quest.onAccept =
	function(thePlayer)
		outputChatBox("Obdachloser: Oh Junge, Super!", thePlayer, 255,255,255)
		return true
	end

Quest.onResume =
	function(thePlayer)
		return true
	end

Quest.onProgress =
	function(thePlayer)
		return true
	end

Quest.onFinish =
	function(thePlayer)
		outputChatBox("Obdachloser: Danke, jetzt hol ich mir erstmal Sprunk!", thePlayer, 255,255,255)
		return true
	end

Quest.onAbort =
	function(thePlayer)
		local QuestState = thePlayer:isQuestActive(Quest)
		if (QuestState and (QuestState == "Finished")) then
			thePlayer:getInventory():addItem(Items[2], 50)
			thePlayer:refreshInventory()
		end
		return true
	end

--outputDebugString("Loaded Questscript: server/Classes/Quest/Scripts/"..tostring(QuestID)..".lua")


text:
<?php

namespace Application\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * MlaArticles
 *
 * @ORM\Table(name="mla_articles", indexes={@ORM\Index(name="mla_articles_FK1_idx", columns={"created_by"})})
 * @ORM\Entity
 */
class MlaArticles
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="article_tag", type="string", length=60, nullable=true)
     */
    private $articleTag;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=150, nullable=false)
     */
    private $name;

    /**
     * @var string
     *
     * @ORM\Column(name="name_local", type="string", length=150, nullable=true)
     */
    private $nameLocal;

    /**
     * @var string
     *
     * @ORM\Column(name="description", type="text", length=65535, nullable=true)
     */
    private $description;

    /**
     * @var string
     *
     * @ORM\Column(name="keywords", type="string", length=255, nullable=true)
     */
    private $keywords;

    /**
     * @var string
     *
     * @ORM\Column(name="type", type="string", length=100, nullable=false)
     */
    private $type = 'Stocked Product';

    /**
     * @var string
     *
     * @ORM\Column(name="unit", type="string", length=50, nullable=true)
     */
    private $unit;

    /**
     * @var string
     *
     * @ORM\Column(name="code", type="string", length=150, nullable=true)
     */
    private $code;

    /**
     * @var string
     *
     * @ORM\Column(name="barcode", type="string", length=150, nullable=true)
     */
    private $barcode;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="created_on", type="datetime", nullable=false)
     */
    private $createdOn = 'CURRENT_TIMESTAMP';

    /**
     * @var string
     *
     * @ORM\Column(name="visibility", type="string", length=45, nullable=true)
     */
    private $visibility = 'Private';

    /**
     * @var string
     *
     * @ORM\Column(name="status", type="string", length=45, nullable=true)
     */
    private $status = 'Actived';

    /**
     * @var string
     *
     * @ORM\Column(name="remarks", type="text", length=65535, nullable=true)
     */
    private $remarks;

    /**
     * @var boolean
     *
     * @ORM\Column(name="is_fixed_asset", type="boolean", nullable=true)
     */
    private $isFixedAsset;

    /**
     * @var \Application\Entity\MlaUsers
     *
     * @ORM\ManyToOne(targetEntity="Application\Entity\MlaUsers")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="created_by", referencedColumnName="id")
     * })
     */
    private $createdBy;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set articleTag
     *
     * @param string $articleTag
     *
     * @return MlaArticles
     */
    public function setArticleTag($articleTag)
    {
        $this->articleTag = $articleTag;

        return $this;
    }

    /**
     * Get articleTag
     *
     * @return string
     */
    public function getArticleTag()
    {
        return $this->articleTag;
    }

    /**
     * Set name
     *
     * @param string $name
     *
     * @return MlaArticles
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set nameLocal
     *
     * @param string $nameLocal
     *
     * @return MlaArticles
     */
    public function setNameLocal($nameLocal)
    {
        $this->nameLocal = $nameLocal;

        return $this;
    }

    /**
     * Get nameLocal
     *
     * @return string
     */
    public function getNameLocal()
    {
        return $this->nameLocal;
    }

    /**
     * Set description
     *
     * @param string $description
     *
     * @return MlaArticles
     */
    public function setDescription($description)
    {
        $this->description = $description;

        return $this;
    }

    /**
     * Get description
     *
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Set keywords
     *
     * @param string $keywords
     *
     * @return MlaArticles
     */
    public function setKeywords($keywords)
    {
        $this->keywords = $keywords;

        return $this;
    }

    /**
     * Get keywords
     *
     * @return string
     */
    public function getKeywords()
    {
        return $this->keywords;
    }

    /**
     * Set type
     *
     * @param string $type
     *
     * @return MlaArticles
     */
    public function setType($type)
    {
        $this->type = $type;

        return $this;
    }

    /**
     * Get type
     *
     * @return string
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Set unit
     *
     * @param string $unit
     *
     * @return MlaArticles
     */
    public function setUnit($unit)
    {
        $this->unit = $unit;

        return $this;
    }

    /**
     * Get unit
     *
     * @return string
     */
    public function getUnit()
    {
        return $this->unit;
    }

    /**
     * Set code
     *
     * @param string $code
     *
     * @return MlaArticles
     */
    public function setCode($code)
    {
        $this->code = $code;

        return $this;
    }

    /**
     * Get code
     *
     * @return string
     */
    public function getCode()
    {
        return $this->code;
    }

    /**
     * Set barcode
     *
     * @param string $barcode
     *
     * @return MlaArticles
     */
    public function setBarcode($barcode)
    {
        $this->barcode = $barcode;

        return $this;
    }

    /**
     * Get barcode
     *
     * @return string
     */
    public function getBarcode()
    {
        return $this->barcode;
    }

    /**
     * Set createdOn
     *
     * @param \DateTime $createdOn
     *
     * @return MlaArticles
     */
    public function setCreatedOn($createdOn)
    {
        $this->createdOn = $createdOn;

        return $this;
    }

    /**
     * Get createdOn
     *
     * @return \DateTime
     */
    public function getCreatedOn()
    {
        return $this->createdOn;
    }

    /**
     * Set visibility
     *
     * @param string $visibility
     *
     * @return MlaArticles
     */
    public function setVisibility($visibility)
    {
        $this->visibility = $visibility;

        return $this;
    }

    /**
     * Get visibility
     *
     * @return string
     */
    public function getVisibility()
    {
        return $this->visibility;
    }

    /**
     * Set status
     *
     * @param string $status
     *
     * @return MlaArticles
     */
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }

    /**
     * Get status
     *
     * @return string
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Set remarks
     *
     * @param string $remarks
     *
     * @return MlaArticles
     */
    public function setRemarks($remarks)
    {
        $this->remarks = $remarks;

        return $this;
    }

    /**
     * Get remarks
     *
     * @return string
     */
    public function getRemarks()
    {
        return $this->remarks;
    }

    /**
     * Set isFixedAsset
     *
     * @param boolean $isFixedAsset
     *
     * @return MlaArticles
     */
    public function setIsFixedAsset($isFixedAsset)
    {
        $this->isFixedAsset = $isFixedAsset;

        return $this;
    }

    /**
     * Get isFixedAsset
     *
     * @return boolean
     */
    public function getIsFixedAsset()
    {
        return $this->isFixedAsset;
    }

    /**
     * Set createdBy
     *
     * @param \Application\Entity\MlaUsers $createdBy
     *
     * @return MlaArticles
     */
    public function setCreatedBy(\Application\Entity\MlaUsers $createdBy = null)
    {
        $this->createdBy = $createdBy;

        return $this;
    }

    /**
     * Get createdBy
     *
     * @return \Application\Entity\MlaUsers
     */
    public function getCreatedBy()
    {
        return $this->createdBy;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>ml.dmlc</groupId>
        <artifactId>xgboost-jvm_2.12</artifactId>
        <version>2.0.0-SNAPSHOT</version>
    </parent>
    <artifactId>xgboost4j-flink_2.12</artifactId>
    <version>2.0.0-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <skipAssembly>false</skipAssembly>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <packaging>jar</packaging>
    <dependencies>
        <dependency>
            <groupId>ml.dmlc</groupId>
            <artifactId>xgboost4j_${scala.binary.version}</artifactId>
            <version>2.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-scala_${scala.binary.version}</artifactId>
            <version>${flink.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-clients_${scala.binary.version}</artifactId>
            <version>${flink.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-ml_${scala.binary.version}</artifactId>
            <version>${flink.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-common</artifactId>
            <version>3.2.4</version>
        </dependency>
    </dependencies>

</project>


text:
// Generated from /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/rt.jar
#include <java/util/regex/Pattern_SingleI.hpp>

extern void unimplemented_(const char16_t* name);
java::util::regex::Pattern_SingleI::Pattern_SingleI(const ::default_init_tag&)
    : super(*static_cast< ::default_init_tag* >(0))
{
    clinit();
}

java::util::regex::Pattern_SingleI::Pattern_SingleI(int32_t lower, int32_t upper)
    : Pattern_SingleI(*static_cast< ::default_init_tag* >(0))
{
    ctor(lower, upper);
}

void ::java::util::regex::Pattern_SingleI::ctor(int32_t lower, int32_t upper)
{ /* stub */
    /* super::ctor(); */
    unimplemented_(u"void ::java::util::regex::Pattern_SingleI::ctor(int32_t lower, int32_t upper)");
}

bool java::util::regex::Pattern_SingleI::isSatisfiedBy(int32_t ch)
{ /* stub */
    unimplemented_(u"bool java::util::regex::Pattern_SingleI::isSatisfiedBy(int32_t ch)");
    return 0;
}

extern java::lang::Class *class_(const char16_t *c, int n);

java::lang::Class* java::util::regex::Pattern_SingleI::class_()
{
    static ::java::lang::Class* c = ::class_(u"java.util.regex.Pattern.SingleI", 31);
    return c;
}

java::lang::Class* java::util::regex::Pattern_SingleI::getClass0()
{
    return class_();
}


text:
<?php

namespace Core\DomainBundle\Controller;

use Sonata\AdminBundle\Controller\CRUDController as Controller;

class DomainAdminController extends Controller
{
}

?>


text:
package com.janela.mobile.ui.roboactivities;

import roboguice.RoboGuice;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;

public abstract class RoboSupportFragment extends Fragment {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        RoboGuice.getInjector(getActivity()).injectMembersWithoutViews(this);
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        RoboGuice.getInjector(getActivity()).injectViewMembers(this);
    }
}


text:
const mongoose = require('mongoose');
const Schema   = mongoose.Schema;

const newsSchema = new Schema({
    date: Number,
    BR  : Schema.Types.Mixed,
    CN  : Schema.Types.Mixed,
    DE  : Schema.Types.Mixed,
    FR  : Schema.Types.Mixed,
    HK  : Schema.Types.Mixed,
    IN  : Schema.Types.Mixed,
    JP  : Schema.Types.Mixed,
    KR  : Schema.Types.Mixed,
    RU  : Schema.Types.Mixed,
    TW  : Schema.Types.Mixed,
    US  : Schema.Types.Mixed,
});

module.exports = {
    News: mongoose.model('News', newsSchema),
};


text:
<navbar></navbar>
<div class="user-login-page">
  <user-login></user-login>
</div>


text:
import {
  AUTH_USER,
  SIGNUP_SUCCESS,
  UNAUTH_USER
} from '../constants';

function usersReducer(state = false, action) {
  switch (action.type) {
    case SIGNUP_SUCCESS:
    case AUTH_USER:
      return { ...state, authenticated: true };
    case UNAUTH_USER:
      return { ...state, authenticated: false };
    default:
      return state;
  }
}

export default usersReducer;


text:
date: 2021-03-14T16:28:11-04:00
description: "The most basic forms of machine: Levers, pulleys, wheels, inclined planes, screws, and wedges"
tags: [ "mechanical-engineering" ]
title: "Simple Machines"
---

# Simple Machines

**Simple machines** are the most basic forms of machines. Though [physics](physics.md) only recognizes the lever and the inclined plane as the basis for all machines, [mechanical engineers](mechanical-engineering.md) tend to think in terms of six simple machines: the [lever](levers.md), the block and tackle (pulley), the wheel and axel, the inclined plane, the screw, and the wedge.


text:
<template name="register">

  {{> modalCGU}}

            <form id="register-form" action="action">

              <input name="email" id="account-email" type="email" value="" placeholder="Email" class="form-control" required/>
              <input name="password" id="account-password" type="password" value="" placeholder="Password" class="form-control" required/>

              <input name="cgu" id="account-cgu" type="checkbox"/>
                I agree to the terms and conditions

              <input class="disabled" type="submit" id="create-account" value="Create"/>
            </form>

</template>

<template name="modalCGU">

                <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

Terms & privacy

                {{#markdown}}
                  {{getCGU}}
                {{/markdown}}

                <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>

</template>


text:
/**
 * @fileoverview Rule to flag use of function declaration identifiers as variables.
 * @author Ian Christian Myers
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../shared/types').Rule} */
module.exports = {
    meta: {
        type: "problem",

        docs: {
            description: "Disallow reassigning `function` declarations",
            recommended: true,
            url: "https://eslint.org/docs/rules/no-func-assign"
        },

        schema: [],

        messages: {
            isAFunction: "'{{name}}' is a function."
        }
    },

    create(context) {

        /**
         * Reports a reference if is non initializer and writable.
         * @param {References} references Collection of reference to check.
         * @returns {void}
         */
        function checkReference(references) {
            astUtils.getModifyingReferences(references).forEach(reference => {
                context.report({
                    node: reference.identifier,
                    messageId: "isAFunction",
                    data: {
                        name: reference.identifier.name
                    }
                });
            });
        }

        /**
         * Finds and reports references that are non initializer and writable.
         * @param {Variable} variable A variable to check.
         * @returns {void}
         */
        function checkVariable(variable) {
            if (variable.defs[0].type === "FunctionName") {
                checkReference(variable.references);
            }
        }

        /**
         * Checks parameters of a given function node.
         * @param {ASTNode} node A function node to check.
         * @returns {void}
         */
        function checkForFunction(node) {
            context.getDeclaredVariables(node).forEach(checkVariable);
        }

        return {
            FunctionDeclaration: checkForFunction,
            FunctionExpression: checkForFunction
        };
    }
};


text:
(function($) {
	"use strict";

	$(function() {
		var F = $.fluidbox = {

			/** Working set */
			_currentCollection: {},
			_currentIndex: null,
			_currentOptions: {},
			_instance: {},

			/** States */
			_isLoading: false,
			_isOpening: false,
			_isClosing: false,
			_isAnimated: false,
			_isDraggable: false,

			/** Support libs */
			_hasModernizr: false,
			_hasHammer: false,

			/** Quick access variables for layout */
			_overlay: {},
			_viewport: {},
			_outer: {},
			_inner: {},
			_loading: {},
			_title: {},

			/** Animation classes */
			_animClasses: "animated flash bounce shake tada swing wobble wiggle pulse flip flipInX flipOutX flipInY flipOutY fadeIn fadeInUp fadeInDown fadeInLeft fadeInRight fadeInUpBig fadeInDownBig fadeInLeftBig fadeInRightBig fadeOut fadeOutUp fadeOutDown fadeOutLeft fadeOutRight fadeOutUpBig fadeOutDownBig fadeOutLeftBig fadeOutRightBig bounceIn bounceInDown bounceInUp bounceInLeft bounceInRight bounceOut bounceOutDown bounceOutUp bounceOutLeft bounceOutRight rotateIn rotateInDownLeft rotateInDownRight rotateInUpLeft rotateInUpRight rotateOut rotateOutDownLeft rotateOutDownRight rotateOutUpLeft rotateOutUpRight lightSpeedIn lightSpeedOut hinge rollIn rollOut",

			/** Animation end events */
			_transEndEventNames: 'webkitAnimationEnd animationend oanimationend MSAnimationEnd',

			/** Default options */
			defaults: {
				resize: true,
				preload: true,
				touch: true,
				animated: true,
				padding: 50,
				templates: {
					inner: '

',
					outer: '

',
					overlay: '

',
					loading: '

',
					title: '

',
					buttons: {
						close: '

',
						next: '

',
						prev: '

'
					}
				},
				positions: {
					buttons: {
						close: 'outer',
						next: 'inner',
						prev: 'inner'
					},
					title: 'inner'
				},
				keys: {
					next: [39, 40],
					prev: [37, 38],
					close: [27]
				},
				animations: {
					open: 'fadeIn',
					close: 'fadeOut',
					next: {
						'in': 'fadeInRight',
						'out': 'fadeOutLeft'
					},
					prev: {
						'in': 'fadeInLeft',
						'out': 'fadeOutRight'
					}
				}
			},

			/** Injects necessary html templates for the overlay */
			_createOverlay: function() {
				$(F._instance).triggerHandler("fluidboxBeforeCreate");

				// Outer (containing inner)
				if($('#fluidbox-outer').length === 0) {
					$('body').append(F._currentOptions.templates.outer);
					$('#fluidbox-outer').html(F._currentOptions.templates.inner);
				}

				// Overlay
				if($('#fluidbox-overlay').length === 0) {
					$('body').append(F._currentOptions.templates.overlay);
				}

				// Loading
				if($('#fluidbox-loading').length === 0) {
					$('body').append(F._currentOptions.templates.loading);
				}

				// Title
				if($('#fluidbox-title').length === 0 && F._currentOptions.positions.title !== false) {
					$('#fluidbox-'+ F._currentOptions.positions.title).append(F._currentOptions.templates.title);
				}

				// Navigation buttons
				if(F._currentOptions.positions.buttons.close !== false && $('#fluidbox-btn-close').length === 0) {
					$('#fluidbox-'+ F._currentOptions.positions.buttons.close).append(F._currentOptions.templates.buttons.close);
				}

				if(F._currentCollection.length > 1) {
					if(F._currentOptions.positions.buttons.next !== false && $('#fluidbox-btn-next').length === 0) {
						$('#fluidbox-'+ F._currentOptions.positions.buttons.next).append(F._currentOptions.templates.buttons.next);
					}
					if(F._currentOptions.positions.buttons.prev !== false && $('#fluidbox-btn-prev').length === 0) {
						$('#fluidbox-'+ F._currentOptions.positions.buttons.prev).append(F._currentOptions.templates.buttons.prev);
					}
				}

				// Helper vars
				F._overlay = $('#fluidbox-overlay');
				F._outer = $('#fluidbox-outer');
				F._inner = $('#fluidbox-inner');
				F._loading = $('#fluidbox-loading');
				F._title = $('#fluidbox-title');

				// Set helper CSS classes
				if(F._isTouch) {
					F._outer.addClass('touch');
				}

				$(F._instance).triggerHandler("fluidboxAfterCreate");
			},

			/** Clean up bound events */
			_unbindEvents: function() {
				// Unbind window events
				$(document).unbind('keydown.fluidbox');
				$(window).unbind('resize.fluidbox');

				// Unbind overlay
				F._overlay.unbind('click');

				// Unbind navigation buttons
				$('#fluidbox-btn-close').unbind('click');
				$('#fluidbox-btn-next').unbind('click');
				$('#fluidbox-btn-prev').unbind('click');
			},

			/** Bind events */
			_bindEvents: function() {
				$(F._instance).triggerHandler("fluidboxBeforeBind");

				// Key events
				$(document).bind('keydown.fluidbox', function(e) {
					if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey) {
						if ($.inArray(e.which, F._currentOptions.keys.close) > -1) {
							F.close();
							e.preventDefault();
						} else if (F._currentCollection.length > 1 && $.inArray(e.which, F._currentOptions.keys.next) > -1) {
							F.next();
							e.preventDefault();
						} else if (F._currentCollection.length > 1 && $.inArray(e.which, F._currentOptions.keys.prev) > -1) {
							F.prev();
							e.preventDefault();
						}
					}
				});

				// Overlay
				F._overlay.click(function() { F.close(); });

				// Buttons
				$('#fluidbox-btn-close').click(function() { F.close(); });
				$('#fluidbox-btn-next').click(function() { F.next(); });
				$('#fluidbox-btn-prev').click(function() { F.prev(); });

				// Scale to full-size and enable dragging
				if(!F._isTouch) {
					F._outer.dblclick(function() {
						if(F._isDraggable === true) {
							F._isDraggable = false;
						} else {
							F._isDraggable = true;
						}

						F.resize();
					});
				}

				// Smart resize
				if(F._currentOptions.resize) {
					$(window).bind("resize.fluidbox", F.resize);
				}

				// Animation events
				if(F._isAnimated !== false) {
					F._bindAnimationEvents();
				}

				// Touch events
				if(F._isTouch) {
					F._bindTouchEvents();
				}

				$(F._instance).triggerHandler("fluidboxAfterBind");
			},

			/** Bind CSS3 animation events */
			_bindAnimationEvents: function() {
				if(F._isAnimated === false) {
					return;
				}

				// Animation completed event
				$(document).bind(F._transEndEventNames, function(e) {
					$(e.target).removeClass(F._animClasses).removeClass('opening closing');

					// Loading
					if($(e.target).is(F._loading)) {
						if(!F._isLoading) {
							F._loading.hide();
						}
					}

					// Overlay
					if($(e.target).is(F._overlay)) {
						if(F._isClosing) {
							F._overlay.remove();
							F._inner.remove();
							F._outer.remove();
							F._loading.remove();

							$('body').css({ overflow: '' });

							$(document).unbind(F._transEndEventNames);
						}
					}

					// Outer
					if($(e.target).is(F._outer)) {
						if(F._isClosing) {
							F._outer.remove();
						}
					}

					// Outer ghost (out-animation ghost)
					if($(e.target).hasClass('fluidbox-outer-ghost')) {
						$(e.target).remove();
					}
				});
			},

			/** Bind touch events */
			_bindTouchEvents: function() {
				F._outer.hammer({
					drag: true,
					transform: true,
					swipe: true,
					tap: true,
					hold: false
				});

				// Drag
				F._outer.bind('dragstart', function(e) {
					e.preventDefault();
					F._outer.data('currentX', parseInt(F._outer.css('left'), 10));
					F._outer.data('currentY', parseInt(F._outer.css('top'), 10));
				});

				F._outer.bind('drag', function(e) {
					if(F._isDraggable) {
						e.preventDefault();

						F._outer.css({
							'left': Math.round(F._outer.data('currentX') + e.gesture.deltaX),
							'top':  Math.round(F._outer.data('currentY') + e.gesture.deltaY)
						});
					}
				});

				F._outer.bind('dragend', function(e) {
					e.preventDefault();
					F._outer.removeData('currentX');
					F._outer.removeData('currentY');
				});

				// Double tap (return to normal size)
				F._outer.bind('doubletap', function(e) {
					F._isDraggable = !F._isDraggable;
					F.resize();
				});

				// Transform (pinch zoom)
				F._outer.bind('transformstart', function(e) {
					F._outer.data('currentX', parseInt(F._outer.css('left'), 10));
					F._outer.data('currentY', parseInt(F._outer.css('top'), 10));
					F._outer.data('currentWidth', F._outer.width());
					F._outer.data('currentHeight', F._outer.height());
					F._isDraggable = true;
				});

				F._outer.bind('transform', function(e) {
					var newWidth = Math.round(F._outer.data('currentWidth') * e.gesture.scale),
						newHeight = Math.round(F._outer.data('currentHeight') * e.gesture.scale);

					F._outer.css({
						'width': newWidth,
						'left': Math.round(F._outer.data('currentX') + ((F._outer.data('currentWidth') - newWidth) / 2) + e.gesture.deltaX),
						'top': Math.round(F._outer.data('currentY') + ((F._outer.data('currentHeight') - newHeight) / 2) + e.gesture.deltaY)
					});
				});

				F._outer.bind('transformend', function(e) {
					F._outer.removeData('currentWidth');
					F._outer.removeData('currentX');
					F._outer.removeData('currentY');
				});

				// Swipe
				F._outer.bind('swipe', function(e) {
					if(!F._isDraggable) {
						if(e.gesture.direction === "left") {
							F.next();
						}
						else if(e.gesture.direction === "right") {
							F.prev();
						}
					}
				});
			},

			/**
			 * Show or hide loading animation
			 * @param bool loading Set true if loading (show), false for not loading (hide)
			 */
			_showLoading: function(loading) {
				F._isLoading = loading;
				F._loading.removeClass(F._animClasses);

				if(F._isLoading) {
					if(F._isAnimated !== false) {
						F._loading.removeClass(F._animClasses).addClass('animated fadeIn');
						F._loading.show();
					} else {
						F._loading.show();
					}
				} else {
					if(F._isAnimated !== false) {
						F._loading.removeClass(F._animClasses).addClass('animated fadeOut');
					} else {
						F._loading.hide();
					}
				}
			},

			/** Preload collection */
			_preloadCollection: function() {
				var i = 0, img;
				for(i = 0; i < F._currentCollection.length; i = i + 1) {
					img = new Image();
					img.src = $(F._currentCollection[i]).attr('href');
				}
			},

			/**
			 * Initialize and show Fluidbox overlay
			 * @constructs
			 */
			open: function(collection, options, instance) {
				F._currentCollection = collection;
				F._instance = instance;

				// Merge options with defaults
				F._currentOptions = $.extend(true, {}, F.defaults, options);
				F._currentIndex = F._currentOptions.index;

				// Set opening / Closing
				F._isOpening = true;
				F._isClosing = false;

				// Check support libs
				F._hasHammer = typeof Hammer === 'function';
				F._hasModernizr = typeof Modernizr === 'function';

				// Check touch support and option
				F._isTouch = F._currentOptions.touch;
				if(F._isTouch && (!F._hasHammer || (F._hasModernizr && !Modernizr.touch))) {
					F._isTouch = false;
					console.log('Touch support not detected or not available (missing hammer.js?), touch disabled.');
				}

				// Check animation support
				F._isAnimated = F._currentOptions.animated;
				if(F._isAnimated && F._hasModernizr && !Modernizr.csstransitions) {
					F._isAnimated = false;
					console.log('CSS3 transition support not detected or not available, animations disabled.');
				}

				var fluidboxBeforeOpenEvent = $.Event('fluidboxBeforeOpen');
				$(F._instance).triggerHandler(fluidboxBeforeOpenEvent);

				if(fluidboxBeforeOpenEvent.isDefaultPrevented()) {
					return;
				}

				// Add overlay
				F._createOverlay();

				// Show overlay
				if(F._isAnimated !== false) {
					F._overlay.removeClass(F._animClasses).addClass('animated fadeIn opening');
					F._overlay.show();
				} else {
					F._overlay.show();
				}

				// Save current scroll position (firefox 'unwanted feature')
				var scrollX = document.body.scrollLeft + document.documentElement.scrollLeft,
					scrollY = document.body.scrollTop + document.documentElement.scrollTop;

				// Disable overflow on HTML
				$('body').css({ overflow: 'hidden' });

				// Restore scroll position
				window.scrollTo(scrollX, scrollY);

				// Show image
				F.show(F._currentIndex, 'open');

				// Bind events
				F._bindEvents();

				// Preload
				if(F._currentOptions.preload) {
					F._preloadCollection();
				}

				$(F._instance).triggerHandler("fluidboxAfterOpen");
			},

			/** Close overlay and unbind events */
			close: function() {
				$(F._instance).triggerHandler("fluidboxBeforeClose");

				// Set closing
				F._isClosing = true;

				// Unset draggable
				F._isDraggable = false;

				// Animate overlay and loading image
				if(F._isAnimated !== false) {
					F._overlay.removeClass(F._animClasses).addClass('animated fadeOut closing');
				} else {
					F._overlay.hide();
				}

				// Animate image or loading image
				if(F._isLoading === false) {
					if(F._isAnimated !== false) {
						F._outer.removeClass(F._animClasses).addClass('animated ' + $(F._outer).data('animation').close + ' closing');
					} else {
						F._outer.hide();
					}
				}
				else {
					F._showLoading(false);
					F._outer.hide();
				}

				F._unbindEvents();

				$(F._instance).triggerHandler("fluidboxAfterClose");
			},

			/**
			 * Show next image in collection (if available)
			 */
			next: function() {
				if(F._currentCollection.length <= 1 || F._isDraggable || F._isLoading) {
					return;
				}

				F.show(F._currentIndex === F._currentCollection.length - 1 ? 0 : F._currentIndex + 1, 'next');
			},

			/**
			 * Show previous image in collection (if available)
			 */
			prev: function() {
				if(F._currentCollection.length <= 1 || F._isDraggable || F._isLoading) {
					return;
				}

				F.show(F._currentIndex === 0 ? F._currentCollection.length - 1 : F._currentIndex - 1, 'prev');
			},

			/**
			 * Show image by index in collection (if available else show first image)
			 * @param int index Index of image to show from collection
			 * @param string direction Optional direction parameter (next | prev | open)
			 */
			show: function(index, direction) {
                if(F._isLoading) {
                    return;
                }

				if(index === 'undefined' || index < 0 || index > F._currentCollection.length) {
					index = 0;
				}

				// Determine direction
				if(!direction) {
					if(index > F._currentIndex || index < F._currentIndex) {
						direction = index > F._currentIndex ? 'next' : 'prev';
					}
					else {
						direction = 'open';
					}
				}

				// Set current index
				F._currentIndex = index;

				// Set variables
				var currentElement = F._currentCollection[index],
					currentImage = new Image(),
					oldOuter = $(F._outer).clone(true);

				// Fade out previous item
				if(direction !== 'open' && !F._isLoading) {
					$(F._instance).triggerHandler("fluidboxBeforeHide");

					$(F._outer).removeClass(F._animClasses);
					$(F._outer).hide();

					$(oldOuter).removeAttr('id');
					$(oldOuter).addClass('fluidbox-outer-ghost');
					$(oldOuter).removeClass(F._animClasses);

					$('body').append(oldOuter);

					// Animate
					if(F._isAnimated !== false) {
						if(direction === 'prev') {
							$(oldOuter).addClass('animated ' + $(oldOuter).data('animation').prev.out);
						}
						else if(direction === 'next') {
							$(oldOuter).addClass('animated ' + $(oldOuter).data('animation').next.out);
						}

						$(oldOuter).show();
					} else {
						$(oldOuter).remove();
					}

					$(F._instance).triggerHandler("fluidboxAfterHide");
				}

				// Reset title
				F._title.replaceWith(F._currentOptions.templates.title);
				F._title = $('#fluidbox-title');

				// Reset inner body
				F._inner.children('img').first().remove();

				// Preload image and show when loaded
				currentImage.onload = function() {

					// Set current image data
					var eventData = { index: index, target: currentElement, direction: direction, image: this, title: $(currentElement).attr('title'), animation: $.extend(true, {}, F._currentOptions.animations, $(currentElement).data('animation')) };

					// Trigger callback
					$(F._instance).triggerHandler("fluidboxBeforeShow", eventData);

					// Set animation options for current item
					$(F._outer).data('animation', $.extend(true, {}, F.defaults.animations, eventData.animation));

					// Replace image and animate
					F._inner.append('');

					// Set title
					F._title.append(eventData.title);

					// Animate
					if(F._isAnimated !== false) {
						if(direction === 'open') {
							F._outer.removeClass(F._animClasses).addClass('animated ' + $(F._outer).data('animation').open + ' opening');
						}
						else if(direction === 'prev') {
							F._outer.removeClass(F._animClasses).addClass('animated ' + $(F._outer).data('animation').prev['in']);
						}
						else if(direction === 'next') {
							F._outer.removeClass(F._animClasses).addClass('animated ' + $(F._outer).data('animation').next['in']);
						}

						F._outer.show();
					} else {
						F._outer.show();
					}

					// Hide loading
					F._showLoading(false);

					// Resize image
					if(F._currentOptions.resize) {
						F.resize();
					}

					$(F._instance).triggerHandler("fluidboxAfterShow", eventData);
				};

				currentImage.src = $(currentElement).attr('href');

				// Show loading indicator
				F._showLoading(true);
			},

			/** Resize the overlay */
			resize: function() {
				var origWidth = 0, origHeight = 0,
					winWidth = 0, winHeight = 0,
					vpWidth = 0, vpHeight = 0,
					newWidth = 0, newHeight = 0,
					iRatio = 0;

				origWidth = $(F._inner).children('img').attr('width');
				origHeight = $(F._inner).children('img').attr('height');

				winWidth = $(window).width();
				winHeight = $(window).height();

				vpWidth = winWidth - F._currentOptions.padding;
				vpHeight = winHeight - F._currentOptions.padding;

				if((origWidth > vpWidth || origHeight > vpHeight) && !F._isDraggable) {
					iRatio = Math.min(vpWidth / origWidth, vpHeight / origHeight);
					newWidth = Math.round((origWidth * iRatio));
					newHeight = Math.round((origHeight * iRatio));
					F._outer.css({
						'width': newWidth,
						'left': Math.round((F._currentOptions.padding / 2) + ((vpWidth - newWidth) / 2)),
						'top': Math.round((F._currentOptions.padding / 2) + ((vpHeight - newHeight) / 2))
					});
				} else {
					F._outer.css({
						'width': origWidth,
						'left': Math.round((winWidth - origWidth) / 2),
						'top': Math.round((winHeight - origHeight) / 2)
					});
				}
			}
		};

		$.fn.fluidbox = function(options) {
			var that = $(this);
			options = options || {};

			this.click(function(e) {
				e.preventDefault();

				var collection = [ this ];

				// Filter current collection on "rel" attribute
				if($(this).attr('rel')) {
					collection = that.filter('[rel="'+ $(this).attr('rel') +'"]');
					// Set opening index
					options.index = collection.index(this);
				} else {
					options.index = 0;
				}

				$.fluidbox.open(collection, options, $(that));
			});

			return $(this);
		};

	});
})(jQuery);


text:
<component name="CopyrightManager">
  <settings default="Apache V2.0">
    <module2copyright>
      <element module="All" copyright="Apache V2.0" />
    </module2copyright>
  </settings>
</component>


text:
package com.baidubce.services.cnap.model.application;

public class WorkloadType {

    public static final int SIMPLE_APPLICATION = 1;
    public static final int MICROSERVICE_APPLICATION = 4;

}


text: This is just a learning excersise not supposed to be production quality


text:
package com.jraska.vsb.or1.schedule.summary;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;

public class SummaryItemTest {
  //region Constants

  public static final double DELTA = 0.00001;

  //endregion

  //region Test methods

  @Test
  public void testMinValue() throws Exception {
    SummaryItem summaryItem = getTestSummaryItem();

    assertThat(summaryItem.getBestMakespan(), equalTo(2));
  }

  @Test
  public void testMaxValue() throws Exception {
    SummaryItem summaryItem = getTestSummaryItem();

    assertThat(summaryItem.getWorstMakespan(), equalTo(9));
  }

  @Test
  public void testMeanValue() throws Exception {
    SummaryItem summaryItem = getTestSummaryItem();

    assertEquals(summaryItem.getMakespanMean(), 5.33333, DELTA);
  }

  @Test
  public void testStandardDeviation() throws Exception {
    SummaryItem summaryItem = getTestSummaryItem();

    assertEquals(summaryItem.getStandardDeviation(), 2.56038, DELTA);
  }

  //endregion

  //region Methods

  public static SummaryItem getTestSummaryItem() {
    int[] makespans = {3, 4, 6, 8, 9, 2};
    long[] durations = {45, 167, 128, 121, 89, 25};

    List<SingleRunSummary> singleRunSummaries = new ArrayList<SingleRunSummary>();
    for (int i = 0; i < makespans.length; i++) {
      singleRunSummaries.add(new SingleRunSummary(makespans[i], durations[i]));
    }

    return new SummaryItem("Test", 10, singleRunSummaries);
  }

  //endregion
}


text:
package models

import (
	"encoding/json"
	"errors"
	"fmt"
	"strings"
)

const (
	SLACK_COLOR string = "#dd4b39"
)

type Slack struct {
	Domain  string `json:"domain"`
	Token   string `json:"token"`
	Channel string `json:"channel"`
}

type SlackPayload struct {
	Channel     string            `json:"channel"`
	Text        string            `json:"text"`
	Username    string            `json:"username"`
	IconUrl     string            `json:"icon_url"`
	UnfurlLinks int               `json:"unfurl_links"`
	LinkNames   int               `json:"link_names"`
	Attachments []SlackAttachment `json:"attachments"`
}

type SlackAttachment struct {
	Color string `json:"color"`
	Text  string `json:"text"`
}

func GetSlackURL(domain string, token string) string {
	return fmt.Sprintf(
		"https://%s.slack.com/services/hooks/incoming-webhook?token=%s",
		domain,
		token,
	)
}

func (p SlackPayload) GetJSONPayload() ([]byte, error) {
	data, err := json.Marshal(p)
	if err != nil {
		return []byte{}, err
	}
	return data, nil
}

func GetSlackPayload(p *Payload, meta string) (*SlackPayload, error) {
	slack := &Slack{}
	slackPayload := &SlackPayload{}
	if err := json.Unmarshal([]byte(meta), &slack); err != nil {
		return slackPayload, errors.New("GetSlackPayload meta json:" + err.Error())
	}

	// TODO: handle different payload types: push, new branch, delete branch etc.
	// when they are added to gogs. Only handles push now
	return getSlackPushPayload(p, slack)
}

func getSlackPushPayload(p *Payload, slack *Slack) (*SlackPayload, error) {
	// n new commits
	refSplit := strings.Split(p.Ref, "/")
	branchName := refSplit[len(refSplit)-1]
	var commitString string

	if len(p.Commits) == 1 {
		commitString = "1 new commit"
		if p.CompareUrl != "" {
			commitString = SlackLinkFormatter(p.CompareUrl, commitString)
		}
	} else {
		commitString = fmt.Sprintf("%d new commits", len(p.Commits))
		if p.CompareUrl != "" {
			commitString = SlackLinkFormatter(p.CompareUrl, commitString)
		}
	}

	repoLink := SlackLinkFormatter(p.Repo.Url, p.Repo.Name)
	branchLink := SlackLinkFormatter(p.Repo.Url+"/src/"+branchName, branchName)
	text := fmt.Sprintf("[%s:%s] %s pushed by %s", repoLink, branchLink, commitString, p.Pusher.Name)
	var attachmentText string

	// for each commit, generate attachment text
	for i, commit := range p.Commits {
		attachmentText += fmt.Sprintf("%s: %s - %s", SlackLinkFormatter(commit.Url, commit.Id[:7]), SlackTextFormatter(commit.Message), SlackTextFormatter(commit.Author.Name))
		// add linebreak to each commit but the last
		if i < len(p.Commits)-1 {
			attachmentText += "\n"
		}
	}

	slackAttachments := []SlackAttachment{{Color: SLACK_COLOR, Text: attachmentText}}

	return &SlackPayload{
		Channel:     slack.Channel,
		Text:        text,
		Username:    "gogs",
		IconUrl:     "https://raw.githubusercontent.com/gogits/gogs/master/public/img/favicon.png",
		UnfurlLinks: 0,
		LinkNames:   0,
		Attachments: slackAttachments,
	}, nil
}

// see: https://api.slack.com/docs/formatting
func SlackTextFormatter(s string) string {
	// take only first line of commit
	first := strings.Split(s, "\n")[0]
	// replace & < >
	first = strings.Replace(first, "&", "&", -1)
	first = strings.Replace(first, "<", "<", -1)
	first = strings.Replace(first, ">", ">", -1)
	return first
}

func SlackLinkFormatter(url string, text string) string {
	return fmt.Sprintf("<%s|%s>", url, SlackTextFormatter(text))
}


text:
package pes6j.datablocks;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.ConnectException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
import java.util.Calendar;
import java.util.Date;

public class Util {

	static final byte[] xorMatrix = { (byte) 0xA6, (byte) 0x77, (byte) 0x95, (byte) 0x7c };

	public static int strlen(byte[] data, int offset) {
		int len = 0;
		for (int i = offset; i < data.length; i++) {
			if (data[i] == 0x00)
				break;
			len++;
		}
		return (len);
	}

	public static long getTimeOfToday( ) {
		Calendar cal = Calendar.getInstance();
		cal.setTime( new Date() );
		cal.set( Calendar.HOUR_OF_DAY, 0 );
		cal.set( Calendar.MINUTE, 0 );
		cal.set( Calendar.SECOND, 0 );
		return( cal.getTimeInMillis() );
	}

	public static int word2Int(byte h, byte l) {
		int firstByte = (0x000000FF & (h));
		int secondByte = (0x000000FF & (l));
		return ((firstByte << 8 | secondByte));
	}

	public static byte[] int2Word(int val) {
		byte[] ret = new byte[2];

		int firstByte = (0x0000FF00 & val) >> 8;
		int secondByte = (0x000000FF & val);
		ret[0] = (byte) firstByte;
		ret[1] = (byte) secondByte;
		return (ret);
	}

	public static byte[] long2Word(long val) {
		byte[] ret = new byte[4];
		int firstByte = (int) (val & 0xFF000000L) >> 24;
		int secondByte = (int) (val & 0x00FF0000L) >> 16;
		int thirdByte = (int) (val & 0x0000FF00L) >> 8;
		int fourthByte = (int) (val & 0x000000FFL);

		ret[0] = (byte) firstByte;
		ret[1] = (byte) secondByte;
		ret[2] = (byte) thirdByte;
		ret[3] = (byte) fourthByte;

		return (ret);
	}

	public static long word2Long(byte h1, byte l1, byte h2, byte l2) {
		int firstByte = (0x000000FF & (h1));
		int secondByte = (0x000000FF & (l1));
		int thirdByte = (0x000000FF & (h2));
		int fourthByte = (0x000000FF & (l2));

		return (((firstByte << 24 | secondByte << 16 | thirdByte << 8 | fourthByte)) & 0xFFFFFFFFL);

	}

	public static String toJavaHex(byte in[], int len) {

		byte ch = 0x00;
		int i = 0;

		if (in == null || in.length <= 0)
			return null;

		String pseudo[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
				"A", "B", "C", "D", "E", "F" };

		StringBuffer out = new StringBuffer(len * 12);

		while (i < len) {
			ch = (byte) (in[i] & 0xF0); // Strip off high nibble
			ch = (byte) (ch >>> 4);
			// shift the bits down
			ch = (byte) (ch & 0x0F);
			// must do this is high order bit is on!
			out.append("(byte)0x");
			out.append(pseudo[ch]); // convert the nibble to a String
			// Character

			ch = (byte) (in[i] & 0x0F); // Strip off low nibble
			out.append(pseudo[ch]); // convert the nibble to a String
			// Character
			out.append(", ");
			i++;
		}

		String rslt = new String(out);

		return rslt;

	}

	public static String toHex(byte in[]) {

		byte ch = 0x00;
		int i = 0;

		if (in == null || in.length <= 0)
			return null;

		String pseudo[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
				"A", "B", "C", "D", "E", "F" };

		StringBuffer out = new StringBuffer(in.length * 3);

		while (i < in.length) {
			ch = (byte) (in[i] & 0xF0); // Strip off high nibble
			ch = (byte) (ch >>> 4);
			// shift the bits down
			ch = (byte) (ch & 0x0F);
			// must do this is high order bit is on!
			out.append(pseudo[ch]); // convert the nibble to a String
			// Character

			ch = (byte) (in[i] & 0x0F); // Strip off low nibble
			out.append(pseudo[ch]); // convert the nibble to a String
			// Character
			out.append(" ");
			i++;
		}

		String rslt = new String(out);

		return rslt;
	}

	public static byte[] konamiEncode(byte asc[]) {
		return (konamiEncode(asc, 0));
	}

	public static byte[] konamiMaskIt(byte asc[], int maskIdx) {
		byte[] ret = new byte[asc.length];
		byte[] xorMatrix = { (byte) 0xA6, (byte) 0x77, (byte) 0x95, (byte) 0x7c };

		int xorIdx = maskIdx;

		for (int i = 0; i < asc.length; i++) {
			ret[i] = (byte) (asc[i] ^ xorMatrix[xorIdx++]);
			if (xorIdx > 3)
				xorIdx = 0;
		}

		return (ret);
	}

	public static byte[] konamiEncode(byte asc[], int maskIdx) {
		byte[] ret = new byte[asc.length];
		byte[] header = new byte[24];

		/*
		 * Hay una cabecera de 24 bytes iniciales, aparentemente los bytes en
		 * posiciones 2y3 forman un short que dice cuanto va a medir la cadena
		 * siguiente En la cadena siguiente los 6 bytes iniciales parecen datos
		 * de algún tipo antes del texto
		 */

		/*
		 * Leemos la cabecera primero
		 */
		int xorIdx;
		int i = 0;
		while (i < asc.length) {
			xorIdx = maskIdx;
			int pos = i;
			int j = 0;
			for (; i < pos + 24; i++) {
				ret[i] = (byte) (asc[i] ^ xorMatrix[xorIdx++]);
				header[j++] = asc[i];
				if (xorIdx > 3)
					xorIdx = 0;
			}

			int firstByte = (0x000000FF & (header[2]));
			int secondByte = (0x000000FF & (header[3]));

			long tamano = (firstByte << 8 | secondByte);

			pos = i;

			for (; i < (pos + tamano); i++) {
				if (i == asc.length) {
//					System.out.println("pues la longitud real era: "
//							+ asc.length + " y yo me quiero ir a: "
//							+ (pos + tamano));
					break;
				}
				ret[i] = (byte) (asc[i] ^ xorMatrix[xorIdx++]);
				if (xorIdx > 3)
					xorIdx = 0;
			}
		}

		return (ret);
	}

//	public static byte[] konamiDecode(byte kon[], int len) {
//		byte[] ret = new byte[len];
//		int xorIdx = 0;
//
//		for (int i = 0; i < len; i++) {
//			ret[i] = (byte) (kon[i] ^ xorMatrix[xorIdx++]);
//			if (xorIdx > 3)
//				xorIdx = 0;
//		}
//		return( ret );
//	}

	public static byte[] konamiDecode(byte kon[], int len) {
		byte[] ret = new byte[len];
		byte[] header = new byte[24];

		/*
		 * Hay una cabecera de 24 bytes iniciales, aparentemente los bytes en
		 * posiciones 2y3 forman un short que dice cuanto va a medir la cadena
		 * siguiente En la cadena siguiente los 6 bytes iniciales parecen datos
		 * de alg�n tipo antes del texto
		 */

		/*
		 * Leemos la cabecera primero
		 */
		int xorIdx;
		int i = 0;
		while (i < len) {
			xorIdx = 0;
			int pos = i;
			int j = 0;

			/*
			 * Broken message, we can't fully decode it
			 */
			if( len < pos + 24 ) return( null );

			for (; i < pos + 24; i++) {
				ret[i] = (byte) (kon[i] ^ xorMatrix[xorIdx++]);
				header[j++] = ret[i];
				if (xorIdx > 3)
					xorIdx = 0;
			}

			/*
			 * Broken message, we can't fully decode it
			 */
			if( j < 24 ) return( null );

			int tamano = word2Int(header[2], header[3]);

			pos = i;

			for (; i < (pos + tamano); i++) {
				/*
				 * The message is incomplete, we can't fully decode it
				 */
				if (i == len) {
					return( null );
				}
				ret[i] = (byte) (kon[i] ^ xorMatrix[xorIdx++]);
				if (xorIdx > 3)
					xorIdx = 0;
			}
		}

		return (ret);
	}

	public static byte[] konamiDecode(byte kon[]) {
		return (konamiDecode(kon, kon.length));
	}

	public static boolean byteArrayCompare(byte a1[], byte a2[], int len) {
		for (int i = 0; i < len; i++) {
			if (a1[i] != a2[i])
				return false;
		}
		return true;
	}

	public static byte[] streamRead(InputStream in) throws IOException {
		byte buf[] = new byte[4096];
		int len = in.read(buf);

		if (len == -1)
			return null;

		byte ret[] = new byte[len];
		System.arraycopy(buf, 0, ret, 0, len);
		return (ret);
	}

	public static byte[] streamRead(SocketChannel in) throws IOException {
		ByteBuffer buf = ByteBuffer.allocate(4096);
		//byte buf[] = new byte[4096];
		int len = in.read(buf);

		if (len == -1)
			return null;

		byte ret[] = new byte[len];
		buf.get(ret);
		//System.arraycopy(buf, 0, ret, 0, len);
		return (ret);
	}

	public static byte[] streamReadDecoded(InputStream in) throws IOException {
		byte[] enc = streamRead(in);
		if (enc == null)
			return null;
		byte[] dec = konamiDecode(enc);
		return (dec);
	}

	public static byte[] streamReadDecoded(SocketChannel in) throws IOException {
		byte[] enc = streamRead(in);
		if (enc == null)
			return null;
		byte[] dec = konamiDecode(enc);
		return (dec);
	}

	public static void streamWriteEncoded(OutputStream out, byte[] data)
			throws IOException {
		out.write(konamiEncode(data));
		out.flush();
	}

	public static int streamWriteEncoded(SocketChannel out, byte[] data)
			throws IOException {
		//ByteBuffer buf = ByteBuffer.wrap( data );
		//int max_packet_len = 1024;

		return( out.write(ByteBuffer.wrap(konamiEncode(data))) );
	}

	public static String fetchURLContents( String url ) {
		URL u;
		try {
			u = new URL(url);
			HttpURLConnection uc = (HttpURLConnection)u.openConnection();
	        BufferedReader in = new BufferedReader(new InputStreamReader(uc
					.getInputStream()));
			String s;
			uc.setConnectTimeout(1000);
			uc.setReadTimeout(1000);
	        in = new BufferedReader(new InputStreamReader(uc
					.getInputStream()));
	        String ret = new String();
			while( (s = in.readLine()) != null ) {
				if( ret.length() > 0 ) ret += "\n";
				ret += s;
			}
			return( ret );
		} catch(ConnectException ex ) {
			//System.out.println("Connect exception");
		} catch(MalformedURLException ex ) {
		} catch(IOException ex) {
		} catch(Exception ex ) {
		}
		return( null );
	}
}