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

using System.Linq;
using NUnit.Framework;
using Vici.Core;

namespace Vici.Core.Test
{
    [TestFixture]
    public class BinaryExtensionsTest
    {
        [Test]
        public void ToHex()
        {
            byte[] bytes = new byte[] {0x12, 0xAB, 0xF1};

            Assert.AreEqual("12abf1", bytes.ToHex());
            Assert.AreEqual("12abf1", bytes.ToHex(false));
            Assert.AreEqual("12ABF1", bytes.ToHex(true));
        }

        [Test]
        public void BinarySerializerTest()
        {
            string x = "ABC";

            byte[] bytes = BinarySerializer.Serialize(x);

            Assert.AreEqual("ABC",BinarySerializer.Deserialize<string>(bytes));
        }
    }
}


text: console.log('again')

redpajama_set_name: RedPajamaGithub


text:
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}

{% block form_id %}create_image_form{% endblock %}
{% block form_action %}{% url 'horizon:project:images:images:createsite' %}{% endblock %}
{% block form_attrs %}enctype="multipart/form-data"{% endblock %}

{% block modal-header %}{% trans "Add Repository" %}{% endblock %}

{% block modal-body %}

    <fieldset>
    {% include "horizon/common/_form_fields.html" %}
    </fieldset>

{% trans "Description:" %}

        {% trans "Specify the Identity Service Endpoint URL for the Glint Service to use at the remote site. This can be found from the access and security tab on the remote cloud's dashboard." %}

{% endblock %}

{% block modal-footer %}
  <input class="btn btn-primary pull-right" type="submit" value="{% trans "Save" %}" />
  {% trans "Cancel" %}
{% endblock %}


text:
#ifndef __NGEN_APPLICATION_HPP
#define __NGEN_APPLICATION_HPP

#include "Ngen.Mirror.hpp"
#include "Ngen.Task.hpp"

namespace Ngen {
   /**@brief
    */
   class Application {
   public:
      Application(const string& identity) : mId(identity), mIsRunning(false), mIsPaused(false) {
      }

      void Initialize() {
         Initialized.Fire(this);
      }

      void Run(uword fps=0) {
         Initialize();

         mIsRunning = true;
         Started.Fire(this);

         while(mIsRunning) {
            if(!mIsPaused) {
               this->Update();
            }
         }

         Close();
      }

      virtual void Update() {
         Updated.Fire(this);
      }

      virtual void Close() {
         if(mIsRunning) {
            mIsRunning = false;
            Closed.Fire(this);
         }
      }

      event Started;
      event Closed;
      event Paused;
      event Updated;
      event Initialized;

   protected:
      static Application* mCurrent;

      mirror mId;
      bool mIsRunning;
      bool mIsPaused;
   };
}

#endif // __NGEN_REFLECTION_HPP


text:
fauxmongo
=========
Match MongoDB queries, apply updates and test aggregation pipelines on local documents.

Installation and Use
--------------------
```shell
$ npm install fauxmongo
```
```javascript
var fauxmongo = require ('fauxmongo');
fauxmongo.update (document, update);
fauxmongo.update (query, document, update);
var queryMatchesDoc = fauxmongo.matchQuery (document, query);
var aggregatedDocs = fauxmongo.aggregate (docs, pipeline);
// get the result set of each stage in an aggregation pipeline
var stageOutputs = fauxmongo.aggregate (docs, pipeline, true);
// recursively overwrite freshly-queried state to local object
fauxmongo.merge (update, state, query, projection);
```

Development
-----------
`fauxmongo` is developed and maintained by Kevin "Schmidty" Smith under the MIT license. If you want to
see continued development on `fauxmongo`, please help me [pay my bills!](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=PN6C2AZTS2FP8&lc=US&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)

Tests
-----
The tests require a MongoDB instance to be accessible at the default host - `127.0.0.1:27017`. The
same document is transformed by `fauxmongo` and a real database, then compared. This allows you to
test `fauxmongo` with your own database cluster before using it in production.

```shell
$ npm install fauxmongo
$ cd node_modules/fauxmongo
$ npm install
$ npm test
```

Notes
-----
Imagine you have the rather confusing document `{ foo:[ { 1:"bar" }, "bar" ] }`. What is projected
if you call `find ({ "foo.1":"bar" }, { "foo.$":1 })`? The answer is `{ foo:[ "bar" ]}` but the
question itself has a huge implication. If you permit an Array to get nontrivially long and plan to
query among its members, you must **always** query on an indexed field and **never** use a numeric
index in the query document. If your query fails to select, your seemingly safe Number index is
converted to a String and the entire Array will be searched for an Object with a property of that
name. To state the problem in code, `{ "arr.21.score":{ $gt:0.5 }}` may instead perform the query
`{ arr:{ $elemMatch:{ "21.score":{ $gt:0.5 }}}}`.

Furthermore, note that `fauxmongo` has no choice but to scan for queries involving Arrays.

`$bit` uses the upsert behavior added in MongoDB version 2.5.3. If you're curious, MongoDB **does**
permit the use of up to three bitwise operands sequentially. In both MongoDB and `fauxmongo`, they
will be executed in document order.

Contrary to the MongoDB documentation, `$pull` **never** performs exact matches on Objects. Use
`$pullAll` instead.

The documented sorting behavior for mixed Numbers and Arrays, specifically that `[ 4 ]` and  `4` are
equal for purposes of `$sort`, is a lie. Neither MongoDB nor `fauxmongo` support this behavior.

The positional operator is less powerful for projection than it ought to be. The docs stick to what
is available but do not explicit explain what is not. If you attempt a projection such as
`{ "foo.$.bar":1 }` MongoDB will return all of `foo.$` instead. The same behavior applies to a
projection such as `{ "foo.$":{ $slice:[ 5, 5 ]}}`. However, attempting to use `$elemMatch` with
the positional operator, such as `{ "foo.$":{ $elemMatch:{ $gt:10 }}}` will throw an Error with both
MongoDB and `fauxmongo`.

There is an additional caveat to query selection when multiple sources exist for a positional
operator. For example, when searching for the document
`{ able:[ { able:1, baker:2 }, { able:2, baker:1 } ]}` with the query
`{ 'able.able':{ $gt:1 }, 'able.baker':{ $gt:1 }}` and projection `{ 'able.$':true }` you will get
`{ able:[ { able:1, baker:2 }]}` however with the query ``{ 'able.able':{ $gt:1 }, 'able.baker':2 }`
you will get `{ able:[ { able:2, baker:1 }]}`. Although it is not in the official docs, a query
document containing operators has a higher priority than a simple value query when locating the
positional operator.

Limitations
-----------
###Update Limitations
 * Ignores the `$setOnInsert` operator (because `fauxmongo` only understands updates, not insertion)
 * Does not support the deprecated operator `$pushAll`. Use `$push:{ $each:[ ...` instead.
 * `$currentDate` does not support the Timestamp date format. It just sets a `Date` to the path, period.

###Query Limitations
 * Does not support Geospatial Indexing.
 * Does not support text search.
 * Does not support `$where`.

LICENSE
-------
The MIT License (MIT)

Copyright (c) 2015 Kevin "Schmidty" Smith

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


text:
extern crate tikv_alloc;
#[macro_use]
extern crate lazy_static;

macro_rules! define_error_codes {
    ($prefix:literal,
        $($name:ident => ($suffix:literal, $description:literal, $workaround:literal)),+
    ) => {
        use crate::ErrorCode;
        $(pub const $name: ErrorCode = ErrorCode {
            code: concat!($prefix, $suffix),
            description: $description,
            workaround: $workaround,
        };)+
        lazy_static! {
           pub static ref ALL_ERROR_CODES: Vec<ErrorCode> = vec![$($name,)+];
        }
    };
}

pub const UNKNOWN: ErrorCode = ErrorCode {
    code: "KV:Unknown",
    description: "",
    workaround: "",
};

pub mod codec;
pub mod coprocessor;
pub mod encryption;
pub mod engine;
pub mod pd;
pub mod raft;
pub mod raftstore;
pub mod sst_importer;
pub mod storage;

use std::fmt::{self, Display, Formatter};

#[derive(PartialEq, Eq, Debug, Clone, Copy)]
pub struct ErrorCode {
    pub code: &'static str,
    pub description: &'static str,
    pub workaround: &'static str,
}

impl Display for ErrorCode {
    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
        write!(f, "{}", self.code)
    }
}

pub trait ErrorCodeExt {
    fn error_code(&self) -> ErrorCode;
}

impl<T> ErrorCodeExt for T {
    default fn error_code(&self) -> ErrorCode {
        UNKNOWN
    }
}

#[cfg(test)]
mod tests {
    #[test]
    fn test_define_error_code() {
        define_error_codes!(
            "KV:Raftstore:",

            ENTRY_TOO_LARGE => ("EntryTooLarge", "", ""),
            NOT_LEADER => ("NotLeader", "", "")
        );

        assert_eq!(
            ENTRY_TOO_LARGE,
            ErrorCode {
                code: "KV:Raftstore:EntryTooLarge",
                description: "",
                workaround: "",
            }
        );
        assert_eq!(
            NOT_LEADER,
            ErrorCode {
                code: "KV:Raftstore:NotLeader",
                description: "",
                workaround: "",
            }
        );
    }
}


text:
package venom

import (
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"
	"sort"
	"strings"

	"github.com/hashicorp/hcl"
	"github.com/pkg/errors"
	log "github.com/sirupsen/logrus"
	"gopkg.in/yaml.v2"
)

func getFilesPath(path []string, exclude []string) (filePaths []string, err error) {
	var fpathsExcluded []string

	if len(exclude) > 0 {
		for _, p := range exclude {
			pe, err := filepath.Glob(p)
			if err != nil {
				return nil, errors.Wrapf(err, "error reading files in path %q", path)
			}

			fpathsExcluded = append(fpathsExcluded, pe...)
		}
	}

	for _, p := range path {
		p = strings.TrimSpace(p)

		// no need to check err on os.stat.
		// if we put ./test/*.yml, it will fail and it's normal
		fileInfo, _ := os.Stat(p)
		if fileInfo != nil && fileInfo.IsDir() {
			p = p + string(os.PathSeparator) + "*.yml"
		}

		fpaths, err := filepath.Glob(p)
		if err != nil {
			log.Errorf("Error reading files on path:%s :%s", path, err)
			return nil, errors.Wrapf(err, "error reading files on path %q", path)
		}

		for _, fp := range fpaths {
			toExclude := false
			for _, te := range fpathsExcluded {
				if te == fp {
					toExclude = true
					break
				}
			}

			if !toExclude {
				switch ext := filepath.Ext(fp); ext {
				case ".hcl", ".yml", ".yaml":
					filePaths = append(filePaths, fp)
				}
			}
		}
	}

	sort.Strings(filePaths)
	return filePaths, nil
}

func (v *Venom) readFiles(filesPath []string) (err error) {
	for _, f := range filesPath {
		log.Info("Reading ", f)
		dat, err := ioutil.ReadFile(f)
		if err != nil {
			return fmt.Errorf("Error while reading file %s err:%s", f, err)
		}

		ts := TestSuite{}
		ts.Templater = newTemplater(v.variables)
		ts.Package = f

		// Apply templater unitl there is no more modifications
		// it permits to include testcase from env
		_, out := ts.Templater.apply(dat)
		for i := 0; i < 10; i++ {
			_, tmp := ts.Templater.apply(out)
			if string(tmp) == string(out) {
				break
			}
			out = tmp
		}

		switch ext := filepath.Ext(f); ext {
		case ".hcl":
			err = hcl.Unmarshal(out, &ts)
		case ".yaml", ".yml":
			err = yaml.Unmarshal(out, &ts)
		default:
			return fmt.Errorf("unsupported test suite file extension: %q", ext)
		}
		if err != nil {
			log.Info("Skipping invalid venom testsuite ", f)
			continue
		}

		ts.ShortName = ts.Name
		ts.Name += " [" + f + "]"
		ts.Filename = f

		if ts.Version != "" && !strings.HasPrefix(ts.Version, "1") {
			ts.WorkDir, err = filepath.Abs(filepath.Dir(f))
			if err != nil {
				return fmt.Errorf("Unable to get testsuite's working directory err:%s", err)
			}
		} else {
			ts.WorkDir, err = os.Getwd()
			if err != nil {
				return fmt.Errorf("Unable to get current working directory err:%s", err)
			}
		}

		nSteps := 0
		for _, tc := range ts.TestCases {
			nSteps += len(tc.TestSteps)
			if len(tc.Skipped) >= 1 {
				ts.Skipped += len(tc.Skipped)
			}
		}
		ts.Total = len(ts.TestCases)

		v.testsuites = append(v.testsuites, ts)
	}
	return nil
}


text:
package com.itude.mobile.mobbl.core.util;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;

import com.google.common.primitives.Bytes;

/**
 *
 */
public final class ByteUtil
{

  private static final Logger LOG = Logger.getLogger(ByteUtil.class);

  private ByteUtil()
  {
  }

  static public byte[] encodeBytes(byte[] bytes, String encodingType)
  {

    byte[] result = null;

    //According to the information on Microsoft's and the Unicode Consortium's websites, positions 81, 8D, 8F, 90, and 9D are unused
    if (encodingType.equals("windows-1252"))
    {
      List<Byte> stripped = new ArrayList<Byte>(bytes.length);

      for (byte b : bytes)
      {
        if (b == (byte) 0x81)
        {
          stripped.add((byte) -62);
          stripped.add((byte) -127);
        }
        else if (b == (byte) 0x8D)
        {
          stripped.add((byte) -62);
          stripped.add((byte) -115);
        }
        else if (b == (byte) 0x8F)
        {
          stripped.add((byte) -62);
          stripped.add((byte) -113);
        }
        else if (b == (byte) 0x90)
        {
          stripped.add((byte) -62);
          stripped.add((byte) -112);
        }
        else if (b == (byte) 0x9D)
        {
          stripped.add((byte) -62);
          stripped.add((byte) -99);
        }
        else
        {
          String resultString = encodeBytesToString(new byte[]{b}, encodingType);
          byte[] encodedBytes = null;
          try
          {

            encodedBytes = resultString.getBytes("UTF-8");
          }
          catch (UnsupportedEncodingException e)
          {
            LOG.warn("unable is encode bytes with type " + encodingType);
            encodedBytes = resultString.getBytes();
          }

          for (byte stringbyte : encodedBytes)
          {
            stripped.add(stringbyte);
          }
        }
      }
      result = Bytes.toArray(stripped);
    }
    else
    {
      String resultString = encodeBytesToString(bytes, encodingType);
      //
      try
      {
        result = resultString.getBytes("UTF-8");
      }
      catch (UnsupportedEncodingException e)
      {
        LOG.warn("unable is encode bytes with type " + encodingType);
        result = resultString.getBytes();
      }
    }
    return result;
  }

  static public String encodeBytesToString(byte[] bytes, String encodingType)
  {
    String result = "";
    try
    {
      result = new String(bytes, encodingType);
    }
    catch (UnsupportedEncodingException e)
    {
      LOG.warn("unable is encode bytes with type " + encodingType);
    }
    return result;
  }

}


text:
package ch.javasoft.math.operator;

/**
 * The BooleanUnaryOperator performs an operation on a single
 * operand and returns a boolean output. A typical operator of this kind is
 * comparison of a value with a constant, for instance with zero or one.
 *
 * @type T	input type of the operation
 * @type A	array type of operand
 */
public interface BooleanUnaryOperator<T, A> extends ConvertingUnaryOperator<T, A, Boolean, boolean[]> {
	/**
	 * Performs the unary operation ⊕ on an operand and returns the
	 * result:
	 *

	 *   return = ⊕ ( operand )
	 *

	 *
	 * @param operand	the operand to operate on
	 * @return the result of the unary operation
	 */
	boolean booleanOperate(T operand);

	/**
	 * Performs the unary operation ⊕ on a vector element and returns the
	 * result:
	 *

	 *   return = ⊕ ( src[srcIndex] )
	 *

	 *
	 * @param src		the operand array
	 * @param srcIndex	the index in the operand's array
	 */
	boolean booleanOperate(A src, int srcIndex);

	/**
	 * Constants identifying standard operators of this kind
	 */
	static enum Id {
		/**
		 * Operator returning {@code true} if the operand is zero, that is,
		 * {@code x == 0} for an operand {@code x}.
		 */
		isZero,
		/**
		 * Operator returning {@code true} if the operand is non zero, that is,
		 * {@code x != 0} for an operand {@code x}.
		 */
		isNonZero,
		/**
		 * Operator returning {@code true} if the operand is one, that is,
		 * {@code x == 1} for an operand {@code x}.
		 */
		isOne,
		/**
		 * Operator returning {@code true} if the operand is positive, that is,
		 * {@code x > 0} for an operand {@code x}.
		 */
		isPositive,
		/**
		 * Operator returning {@code true} if the operand is negative, that is,
		 * {@code x < 0} for an operand {@code x}.
		 */
		isNegative,
		/**
		 * Operator returning {@code true} if the operand is non positive, that
		 * is, {@code x <= 0} for an operand {@code x}.
		 */
		isNonPositive,
		/**
		 * Operator returning {@code true} if the operand is non negative, that
		 * is, {@code x >= 0} for an operand {@code x}.
		 */
		isNonNegative
	}

}


text:
package com.github.rvesse.airline.annotations.help;

import static java.lang.annotation.ElementType.TYPE;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
 * Annotation that provides a discussion section for a commands help
 *
 * @author rvesse
 *
 */
@Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
@Target({ TYPE })
@Documented
public @interface Discussion {

    /**
     * An array of paragraphs of text that provides an extended discussion on
     * the behaviour of the command. Discussion typically goes into much greater
     * detail about exact behaviour of commands particularly where complex
     * commands may behave differently depending on the option combinations
     * used.
     *
     * @return Command discussion
     */
    public String[]paragraphs() default {};
}


text:
#include <aws/gamelift/model/GetInstanceAccessResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>

#include <utility>

using namespace Aws::GameLift::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;

GetInstanceAccessResult::GetInstanceAccessResult()
{
}

GetInstanceAccessResult::GetInstanceAccessResult(const AmazonWebServiceResult<JsonValue>& result)
{
  *this = result;
}

GetInstanceAccessResult& GetInstanceAccessResult::operator =(const AmazonWebServiceResult<JsonValue>& result)
{
  const JsonValue& jsonValue = result.GetPayload();
  if(jsonValue.ValueExists("InstanceAccess"))
  {
    m_instanceAccess = jsonValue.GetObject("InstanceAccess");

  }

  return *this;
}


text:
<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>
  <groupId>se.atg.catchcrud</groupId>
  <artifactId>se.atg.catchcrud.parent</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>
  <modules>
  	<module>se.atg.catchcrud.server</module>
  	<module>se.atg.catchcrud.client</module>
  </modules>
</project>


text:
@interface PodsDummy_Pods_Gooey_Effect : NSObject
@end
@implementation PodsDummy_Pods_Gooey_Effect
@end


text:
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>

<link href="doc-style.css" type="text/css" rel="StyleSheet">

Managed Object Types	Data Object Types	All Properties	All Methods

Enum -
						DatastoreSummaryMaintenanceModeState

Since

vSphere API 5.0

Enum Description

         Defines the current maintenance mode state of the datastore.

Enum Constants

Name	Description

enteringMaintenance
      Started entering maintenance mode, but not finished.
 This could happen when waiting for user input or for
 long-running vmotions to complete.

inMaintenance
      Successfully entered maintenance mode.

normal
      Default state.

Show WSDL type definition

<textarea cols="20" rows="10" name="wsdl-textarea" wrap="off" readonly="1" id="wsdl-textarea">         <simpleType xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="DatastoreSummaryMaintenanceModeState">
            <restriction base="xsd:string">
               <enumeration value="normal"/>
               <enumeration value="enteringMaintenance"/>
               <enumeration value="inMaintenance"/>
            </restriction>
         </simpleType></textarea>

Top of page

Managed Object Types	Data Object Types	All Properties	All Methods


text:
package com.antarescraft.kloudy.hologuiapi.guicomponents;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;

import org.bukkit.entity.Player;

import com.antarescraft.kloudy.hologuiapi.HoloGUIApi;
import com.antarescraft.kloudy.hologuiapi.PlayerData;
import com.antarescraft.kloudy.hologuiapi.guicomponentproperties.LabelComponentProperties;
import com.antarescraft.kloudy.hologuiapi.playerguicomponents.PlayerGUITextComponent;
import com.antarescraft.kloudy.hologuiapi.util.HoloGUIPlaceholders;
import com.antarescraft.kloudy.plugincore.config.ConfigObject;
import com.antarescraft.kloudy.plugincore.config.PassthroughParams;
import com.antarescraft.kloudy.plugincore.config.annotations.ConfigElement;
import com.antarescraft.kloudy.plugincore.config.annotations.ConfigProperty;

import me.clip.placeholderapi.PlaceholderAPI;

/*
 * Represents text on a GUI
 */
public class LabelComponent extends GUIComponent implements ConfigObject
{
	@ConfigElement
	@ConfigProperty(key = "")
	private LabelComponentProperties properties;

	private HashSet<Integer> scrollingLines = new HashSet<Integer>();

	private String formatCode = "";

	private LabelComponent(){}

	private void parseLineScroll()
	{
		scrollingLines.clear();

		String[] linesArray = new String[properties.getLines().size()];
		for(int i = 0; i < properties.getLines().size(); i++)
		{
			String str = properties.getLines().get(i);
			str = str.replaceAll("§", "&");

			if(str.startsWith("%scroll%"))
			{
				str = str.replace("%scroll%", "");
				scrollingLines.add(i);
			}

			linesArray[i] = str;
		}

		properties.setLines(new ArrayList<String>(Arrays.asList(linesArray)));
	}

	public void setLines(ArrayList<String> lines)
	{
		properties.setLines(lines);

		parseLineScroll();
	}

	@Override
	public PlayerGUITextComponent initPlayerGUIComponent(Player player)
	{
		return new PlayerGUITextComponent(player, this, updateComponentLines(player));
	}

	@Override
	public void updateIncrement()
	{
		String[] linesArray = new String[properties.getLines().size()];
		String currentFormatting = "";
		for(int i = 0; i < properties.getLines().size(); i++)
		{
			String str = properties.getLines().get(i);

			if(scrollingLines.contains(i))
			{
				if(str.matches("&[a|b|c|d|e|f|0|1|2|3|4|5|6|7|8|9|k|l|m|n|o|r].*"))
				{
					//shift the two format characters
					str = shiftString(str);

					if(str.startsWith("r"))//hit a reset character, reset currentFormatting
					{
						currentFormatting = "";
					}
					else
					{
						currentFormatting = "&" + str.charAt(0);
					}

					str = shiftString(str);

					if(str.matches("&[a|b|c|d|e|f|0|1|2|3|4|5|6|7|8|9|k|l|m|n|o|r].*"))//there could be two formatting codes in a row
					{
						str = shiftString(str);

						if(str.startsWith("r"))//hit a reset character, reset currentFormatting
						{
							currentFormatting = "";
						}
						else
						{
							currentFormatting  += "&" + str.charAt(0);
						}

						formatCode = currentFormatting;

						str = shiftString(str);
					}
				}

				if(str.matches("%.+%.*"))//line starts with a placeholder. Shift the entire placeholder
				{
					str = shiftString(str);//shift the beginning '%'
					char c = str.charAt(0);
					while(c != '%')
					{
						str = shiftString(str);
						c = str.charAt(0);
					}
					str = shiftString(str);//shifting ending '%'
				}
				else//line doens't start with a placeholder, shift the character
				{
					str = shiftString(str);
				}
			}

			linesArray[i] = str;
		}

		properties.setLines(new ArrayList<String>(Arrays.asList(linesArray)));
	}

	@Override
	public String[] updateComponentLines(Player player)
	{
		String[] componentLines = new String[properties.getLines().size()];
		for(int i = 0; i < properties.getLines().size(); i++)
		{
			String str = properties.getLines().get(i);

			str = HoloGUIPlaceholders.setHoloGUIPlaceholders(plugin, str, player);
			if(HoloGUIApi.hasPlaceholderAPI)
			{
				str = PlaceholderAPI.setPlaceholders(player, formatCode + str);
			}

			PlayerData playerData = PlayerData.getPlayerData(player);
			if(playerData != null) str = HoloGUIPlaceholders.setModelPlaceholders(plugin, playerData.getPlayerGUIPageModel(), str);

			componentLines[i] = str;
		}

		return componentLines;
	}

	/**
	 * shifts a string to the left and wraps the first character to the end
	 */
	private String shiftString(String input)
	{
		String str = input;
		char firstCharacter = str.charAt(0);
		str = str.substring(1);
		str += Character.toString(firstCharacter);

		return str;
	}

	@Override
	public double getLineHeight()
	{
		return (1 / properties.getDistance()) * 0.21;
	}

	@Override
	public void configParseComplete(PassthroughParams params)
	{
		super.configParseComplete(params);

		parseLineScroll();
	}

	@Override
	public LabelComponentProperties getProperties()
	{
		return properties;
	}
}


text:
package fr.minibilles.basics.boost;

import fr.minibilles.basics.serializer.Boost;
import fr.minibilles.basics.serializer.BoostObject;
import fr.minibilles.basics.serializer.BoostUtil;
import fr.minibilles.basics.serializer.JBoost;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;

/**
 * A simple object serialized in a {@link Boost} stream.
 * @author Jean-Charles Roger
 */
public class PersonV1 implements BoostObject {

	private final String name;
	private String phoneNumber;
	private List<PersonV1> children = new ArrayList<PersonV1>();

	protected PersonV1(Boost boost) {
		boost.register(this);
		name = boost.readString();
		phoneNumber = boost.readString();
		children.addAll(BoostUtil.readObjectList(boost, PersonV1.class));
	}

	public PersonV1(String name) {
		this.name = name;
	}

	public void writeToBoost(Boost boost) {
		boost.writeString(name);
		boost.writeString(phoneNumber);
		BoostUtil.writeObjectCollection(boost, children);
	}

	@Override
	public String toString() {
		StringBuilder string = new StringBuilder();
		string.append(name);
		if ( phoneNumber != null ) {
			string.append("(");
			string.append(phoneNumber);
			string.append(")");
		}
		string.append(" children ");
		string.append(children);
		return string.toString();
	}

	public static void main(String[] args) throws FileNotFoundException {
		final String brianFilename = "test/boost/brianV1.person";

		JBoost boost = new JBoost("Person", 1);
		boost.initializeWriting(new FileOutputStream(brianFilename));
		boost.writeObject(createBrian());
		boost.close();

		boost.initializeReading(new FileInputStream(brianFilename));
		PersonV1 brian = boost.readObject(PersonV1.class);
		boost.close();

		System.out.println("Read: " + brian);
	}

	public static PersonV1 createBrian() {
		PersonV1 brian = new PersonV1("Brian");
		brian.phoneNumber = "0000-00-000";

		PersonV1 terry = new PersonV1("Terry");
		brian.children.add(terry);

		PersonV1 wanda = new PersonV1("Wanda");
		brian.children.add(wanda);

		return brian;
	}

}


text:
// Generated, do not edit by hand.

/**
 ** \file ast/nary.hh
 ** \brief Declaration of ast::Nary.
 */

#ifndef AST_NARY_HH
# define AST_NARY_HH

# include <ast/exp.hh>
# include <ast/exps-type.hh>
#include <ast/flavor.hh>

namespace ast
{

/// A list of \c Exp.
  class URBI_SDK_API Nary : public Exp
  {
  public:
    /// A completely empty Nary node.
    Nary();

    /// Drop the children.
    void clear();

    /// Are there any children?
    virtual bool empty() const;

    /// Is there just one child?
    virtual bool single() const;

    /// Push a new expression, creating a Statement node.
    void push_back(rExp e, flavor_type f = flavor_none);

    /// Sets the flavor of the last child.
    void back_flavor_set(flavor_type k, const loc& l);

    /// Sets the flavor of the last child without modifying location.
    void back_flavor_set(flavor_type k);

    /// Get the flavor of the last child.
    flavor_type back_flavor_get() const;

    /// Drop the last children.
    void pop_back();

    /// Splice the content of \a rhs at the back this list.
    void splice_back(rNary rhs);

 private:
    /// Return the last child if there is one of the right type.
    template <typename T>
    libport::intrusive_ptr<T> back();

    /// Return the last child if there is one of the right type.
    template <typename T>
    libport::intrusive_ptr<const T> back() const;

    /// Adjust the whole location.
    void location_adjust();

    /** \name Ctor & dtor.
     ** \{ */
  public:
    /// Construct a Nary node.
    Nary (const loc& location);
    /// Destroy a Nary node.
    virtual ~Nary ();
    /** \} */

    /// \name Visitors entry point.
    /// \{ */
  public:
    /// Accept a const visitor \a v.
    virtual void accept (ConstVisitor& v) const;
    /// Accept a non-const visitor \a v.
    virtual void accept (Visitor& v);
    /// Evaluate the node in AST interpreter \a r.
    virtual urbi::object::rObject
    eval (runner::Job& r) const;
    /// Return the node type
    virtual std::string node_type() const;
    /// \}

#if defined ENABLE_SERIALIZATION
    /// \name Serialization.
    /// \{ */
  public:
    template <typename T>
    Nary(libport::serialize::ISerializer<T>& ser);
    template <typename T>
    void
    serialize(libport::serialize::OSerializer<T>& ser) const;
    /// \}
#endif

    /** \name Accessors.
     ** \{ */
  public:
    /// Return subtrees possibly qualified to be background.
    const exps_type& children_get () const;
    /// Return subtrees possibly qualified to be background.
    exps_type& children_get ();
    /// Set subtrees possibly qualified to be background.
    void children_set (exps_type*);
    /** \} */

  protected:
    /// Subtrees possibly qualified to be background.
    exps_type* children_;
  };

} // namespace ast

# include <ast/nary.hxx>

#endif // !AST_NARY_HH


text:
(function() {

var checkVersion = Dagaz.Model.checkVersion;

Dagaz.Model.checkVersion = function(design, name, value) {
  if (name != "labyrinth-extension") {
     checkVersion(design, name, value);
  }
}

var addSlide = function(design, board, pos, dir, positions) {
  var p = design.navigate(board.player, pos, dir);
  while (p !== null) {
      if (board.getPiece(p) !== null) return;
      if (_.indexOf(positions, p) < 0) {
          positions.push(p);
      }
      p = design.navigate(board.player, p, dir);
  }
}

var addStep = function(design, board, pos, dir, positions) {
  var p = design.navigate(board.player, pos, dir);
  if (p === null) return;
  if (board.getPiece(p) !== null) return;
  if (_.indexOf(positions, p) < 0) {
      positions.push(p);
  }
}

var animate = function(design, view, pos, src, dst, move) {
  var p = view.root.findAndLocate(pos);
  var s = view.root.findAndLocate(src);
  var d = view.root.findAndLocate(dst);
  if ((s === null) || (d === null)) return;
  var dx = ((d.x - s.x) / Dagaz.View.STEP_CNT) | 0; var x = s.x;
  var dy = ((d.y - s.y) / Dagaz.View.STEP_CNT) | 0; var y = s.y;
  for (var i = 0; i < Dagaz.View.STEP_CNT; i++) {
      x += dx; y += dy;
      move.hints.push({
           x: x - p.x,
           y: y - p.y
      });
  }
}

var CheckInvariants = Dagaz.Model.CheckInvariants;

Dagaz.Model.CheckInvariants = function(board) {
  var design = Dagaz.Model.design;
  var view   = Dagaz.Controller.app.view;
  var moves  = [];
  _.each(board.moves, function(move) {
      if (!move.isSimpleMove()) return;
      var pos = move.actions[0][1][0];
      var piece = board.getPiece(pos);
      if (piece === null) return;
      if (piece.player != board.player) return;
      _.each(design.allPositions(), function(p) {
          if (p === pos) return;
          var piece = board.getPiece(p);
          if (piece === null) return;
          if (piece.player != board.player) return;
          if (piece.type != 0) return;
          var positions = [];
          if (_.indexOf([1, 4], move.mode) >= 0) {
              addSlide(design, board, p,  8, positions);
              addSlide(design, board, p,  9, positions);
              addSlide(design, board, p, 10, positions);
              addSlide(design, board, p, 11, positions);
          }
          if (_.indexOf([3, 4], move.mode) >= 0) {
              addSlide(design, board, p, 12, positions);
              addSlide(design, board, p, 13, positions);
              addSlide(design, board, p, 14, positions);
              addSlide(design, board, p, 15, positions);
          }
          if (move.mode == 2) {
              addStep(design, board, p, 16, positions);
              addStep(design, board, p, 17, positions);
              addStep(design, board, p, 18, positions);
              addStep(design, board, p, 19, positions);
              addStep(design, board, p, 20, positions);
              addStep(design, board, p, 21, positions);
              addStep(design, board, p, 22, positions);
              addStep(design, board, p, 23, positions);
          }
          if (move.mode == 5) {
              addStep(design, board, p,  8, positions);
              addStep(design, board, p,  9, positions);
              addStep(design, board, p, 10, positions);
              addStep(design, board, p, 11, positions);
              addStep(design, board, p, 12, positions);
              addStep(design, board, p, 13, positions);
              addStep(design, board, p, 14, positions);
              addStep(design, board, p, 15, positions);
          }
          _.each(positions, function(q) {
              var m = Dagaz.Model.createMove(move.mode);
              m.movePiece(move.actions[0][0][0], q, move.actions[0][2][0]);
              m.hints = [];
              animate(design, view, move.actions[0][0][0], move.actions[0][0][0], move.actions[0][1][0], m);
              animate(design, view, move.actions[0][0][0], p, q, m);
              moves.push(m);
          });
      });
      move.failed = true;
  });
  _.each(moves, function(move) {
      board.moves.push(move);
  });
  CheckInvariants(board);
}

})();


text:
import requests
import datetime
import re
import os
import logging
from urllib.parse import urljoin

from .lib import convert_timeout_to_second

logger = logging.getLogger(__name__)
GITHUB_API_BASE = "https://api.github.com/"

class GitHubAPIException(Exception):
    pass

class Notifier:
    def __init__(self, *args, repo, timeout="0s", saved={}, **kwargs):
        token = kwargs.get("token", None) or \
                os.environ.get("NVCHECKER_GITHUB_TOKEN", None)

        if token is None:
            raise GitHubAPIException("Need a token")

        timeout_seconds = convert_timeout_to_second(timeout)
        now = datetime.datetime.now()
        self.deadline = now - datetime.timedelta(seconds=timeout_seconds)

        self.session = requests.Session()
        self.session.headers.update({'Authorization': "token %s" % token})

        self.repo = repo
        self.record = saved.copy()

        url = urljoin(GITHUB_API_BASE, "repos/%s/issues?state=open" % repo)
        req = self.session.get(url)
        issue_list = req.json()

        if not isinstance(issue_list, list):
            raise GitHubAPIException("Failed to get issue list of %s" % repo)

        regex = re.compile("out\W*of\W*date", re.I)
        self.odtitles = []
        for issue in issue_list:
            title = issue['title']
            if regex.search(title):
                self.odtitles.append(title)

    def send(self, pac, outtime):
        if outtime > self.deadline:
            return False

        objhash = pac.info
        if self.record.get(pac.name) == objhash:
            logger.info("%r has been marked out-of-date in GitHub", pac.name)
            return False

        regex = re.compile("(\s|^)%s(\s|$)" % pac.name)
        for title in self.odtitles:
            if regex.search(title):
                logger.info("%r has been marked out-of-date in GitHub",
                            pac.name)
                return False

        url = urljoin(GITHUB_API_BASE, "repos/%s/issues" % self.repo)
        data = {
            "title": "%s is out-of-date" % pac.name,
            "body": "Local version: %s\n"
                    "Remote version: %s"
                    % (pac.local_version, pac.remote_version)}
        req = self.session.post(url, json=data)

        if "title" in req.json():
            logger.info("new issue: %r", data["title"])
            self.record[pac.name] = objhash
            return True

    def finish(self):
        return self.record


text:
package org.neo4j.talend;

import org.apache.commons.lang3.StringUtils;
import org.neo4j.graphdb.DynamicLabel;
import org.neo4j.graphdb.Label;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

public class Neo4jBatchInserterNode extends Neo4jBatchInserterAbstract {

    /**
     * Field name where to find the list of label
     */
    private String labelsField;

    /**
     * Batch index name
     */
    private String batchIndexName;

    /**
     * Name of the field on wich we create the batch index
     */
    private String batchIndexFieldName;

    /**
     * If true, when we create a node we also save the field with its value.
     * It is usefull to put it at false if this field is just a technical one for the import.
     */
    private Boolean insertIndexFieldName;

    /**
     * Constructor
     *
     * @param batchDb              Batch inserter database
     * @param labelsField          Field name where to find labels
     * @param batchIndexName       Batch index name
     * @param batchIndexFieldName  Batch index field name
     * @param insertIndexFieldName If we have to save the index field
     * @param indexCacheSize       Size of the cache index
     * @throws IOException
     */
    public Neo4jBatchInserterNode(Neo4jBatchDatabase batchDb, String labelsField, String batchIndexName, String batchIndexFieldName, Boolean insertIndexFieldName, Integer indexCacheSize) throws IOException {
        super(batchDb);

        // Check required component properties
        if (StringUtils.isEmpty(batchIndexName)) {
            throw new RuntimeException("batchIndexName must be defined !!!");
        }
        if (StringUtils.isEmpty(batchIndexFieldName)) {
            throw new RuntimeException("batchIndexFieldName field must be defined !!!");
        }
        if (indexCacheSize == null) {
            throw new RuntimeException("Index cache size must be defined !!!");
        }

        // Setting class value
        this.batchIndexName = batchIndexName;
        this.batchIndexFieldName = batchIndexFieldName;
        this.labelsField = labelsField;
        this.insertIndexFieldName = insertIndexFieldName;

        // Create the batch index
        this.batchDb.createBatchIndex(batchIndexName, indexCacheSize);
    }

    /**
     * Insert a node.
     *
     * @param incoming   Talend object
     * @param columnList Attributes list of the Talend object
     */
    public void create(Object incoming, List<String> columnList) {
        try {
            // Construct the property map
            Map<String, Object> properties = constructMapFromObject(incoming, columnList);

            // Import ID
            Object importId = this.getObjectProperty(incoming, this.batchIndexFieldName);

            // Label list
            Label[] labels = this.computeLabels(incoming);

            // Remove none necessary fields (importId, & label)
            if (StringUtils.isNotEmpty(this.labelsField)) {
                properties.remove(this.labelsField);
            }
            if (!this.insertIndexFieldName) {
                properties.remove(this.batchIndexFieldName);
            }

            // If the node exist, we update it, otherwise we create it
            Long id = this.batchDb.findNodeInBatchIndex(batchIndexName, importId);
            if (id != null) {

                // update properties
                Map<String, Object> props = this.batchDb.getInserter().getNodeProperties(id);
                props.putAll(properties);
                this.batchDb.getInserter().setNodeProperties(id, props);

                // update labels
                List<Label> labelList = new ArrayList<>(Arrays.asList(labels));
                for (Label lab : this.batchDb.getInserter().getNodeLabels(id)) {
                    labelList.add(lab);
                }
                Label[] mergeLabels = labelList.toArray(new Label[labelList.size()]);
                this.batchDb.getInserter().setNodeLabels(id, mergeLabels);

            } else {
                // Create the node
                long nodeId = this.batchDb.getInserter().createNode(properties, labels);

                // Save the node into the index
                this.batchDb.indexNodeInBatchIndex(batchIndexName, nodeId, importId);
            }

        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }

    /**
     * Finish the process.
     */
    public void finish() {
        this.batchDb.flushBatchIndex(batchIndexName);
    }

    protected Label[] computeLabels(Object incoming) throws IllegalAccessException {
        Label[] labels = new Label[0];

        if (StringUtils.isNotEmpty(this.labelsField)) {

            String labelList = (String) this.getObjectProperty(incoming, this.labelsField);

            if (StringUtils.isNotEmpty(labelList)) {
                String[] labelTab = labelList.split(";");
                labels = new Label[labelTab.length];
                for (int i = 0; i < labelTab.length; i++) {
                    labels[i] = DynamicLabel.label(labelTab[i]);
                }
            }
        }

        return labels;
    }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Inferno.BurnApi.Business;
using Inferno.BurnApi.Domain.Enums;

namespace Inferno.BurnApi.ServiceModels
{
    public class FireDangerResponse
    {
        public bool IsSafe { get; set; }
        public double? ClosestFireInKm { get; set; }
        public double? HeadingDegrees { get; set; }
        public string HeadingString { get; set; }
        public Domain.FireReport FireReport { get; set; }
    }
}


text:
from __future__ import unicode_literals

import django.core.validators
from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('timetables', '0001_initial'),
    ]

    operations = [
        migrations.AlterField(
            model_name='course',
            name='name',
            field=models.CharField(help_text='Example: appetizer, main course, dessert', max_length=150),
        ),
        migrations.AlterField(
            model_name='course',
            name='sequence_order',
            field=models.PositiveSmallIntegerField(help_text='The numerical order of the dishes for a meal option. E.g, 1 for appetizer, 2 for main course', unique=True),
        ),
        migrations.AlterField(
            model_name='timetable',
            name='cycle_length',
            field=models.PositiveSmallIntegerField(help_text='Number of days in which the menu timetable is repeated after a period of time. E.g, A cycle length of 14 days (2 weeks) including the inactive weekdays like weekends after which the food schedule is repeated.', validators=[django.core.validators.MinValueValidator(1)]),
        ),
        migrations.AlterField(
            model_name='timetable',
            name='ref_cycle_date',
            field=models.DateField(help_text='The reference date in time with which cycle day for any other following date can be computed. E.g, 1 if today is Sunday as first day of the cycle length. No need to always update this except the cycle changes.'),
        ),
        migrations.AlterField(
            model_name='timetable',
            name='ref_cycle_day',
            field=models.PositiveSmallIntegerField(help_text='The reference day (numerical value) in time with which cycle day for any other following date can be computed. E.g, 1 if today is Sunday as first day of the cycle length. No need to always update this except the cycle changes.', validators=[django.core.validators.MinValueValidator(1)]),
        ),
    ]


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using Sitecore.Syndication;

namespace Score.ContentSearch.Algolia.Abstract
{
    /// <summary>
    /// Convertds Fields to Tags
    /// </summary>
    public interface ITagsProcessor
    {
        void ProcessDocument(JObject doc);
    }
}


text:
namespace Problem_2.Students_and_workers.Humans
{
    using System;

    public abstract class Human
    {
        private string firstName;
        private string lastName;

        public Human(string firstName, string lastName)
        {
            this.FirstName = firstName;
            this.LastName = lastName;
        }

        public string FirstName
        {
            get
            {
                return this.firstName;
            }
            private set
            {
                CheckIfNullOrEmpty(value, "The first name cannot be null or empty!");
                this.firstName = value;
            }
        }
        public string LastName
        {
            get
            {
                return this.lastName;
            }
            private set
            {
                CheckIfNullOrEmpty(value, "The last name cannot be null or empty!");
                this.lastName = value;
            }
        }

        private static void CheckIfNullOrEmpty(string value, string message)
        {
            if (string.IsNullOrEmpty(value))
            {
                throw new ArgumentNullException(message);
            }
        }

        public override string ToString()
        {
            return this.FirstName + " " + this.LastName;
        }
    }
}


text:
/*!
 *
 * Event / Animation cycle manager
 *
 * var MyController = function () {};
 * MyController.prototype = new Controller();
 *
 * @Controller
 * @author: kitajchuk
 *
 *
 */
(function ( window, undefined ) {

"use strict";

// Private animation functions
var raf = window.requestAnimationFrame,
    caf = window.cancelAnimationFrame;

/**
 *
 * Event / Animation cycle manager
 * @constructor Controller
 * @requires raf
 * @memberof! <global>
 *
 */
var Controller = function () {
    return this.init.apply( this, arguments );
};

Controller.prototype = {
    constructor: Controller,

    /**
     *
     * Controller constructor method
     * @memberof Controller
     * @method Controller.init
     *
     */
    init: function () {
        /**
         *
         * Controller event handlers object
         * @memberof Controller
         * @member _handlers
         * @private
         *
         */
        this._handlers = {};

        /**
         *
         * Controller unique ID
         * @memberof Controller
         * @member _uid
         * @private
         *
         */
        this._uid = 0;

        /**
         *
         * Started iteration flag
         * @memberof Controller
         * @member _started
         * @private
         *
         */
        this._started = false;

        /**
         *
         * Paused flag
         * @memberof Controller
         * @member _paused
         * @private
         *
         */
        this._paused = false;

        /**
         *
         * Timeout reference
         * @memberof Controller
         * @member _cycle
         * @private
         *
         */
        this._cycle = null;
    },

    /**
     *
     * Controller go method to start frames
     * @memberof Controller
     * @method go
     *
     */
    go: function ( fn ) {
        if ( this._started && this._cycle ) {
            return this;
        }

        this._started = true;

        var self = this,
            anim = function () {
                self._cycle = raf( anim );

                if ( self._started ) {
                    if ( typeof fn === "function" ) {
                        fn();
                    }
                }
            };

        anim();
    },

    /**
     *
     * Pause the cycle
     * @memberof Controller
     * @method pause
     *
     */
    pause: function () {
        this._paused = true;

        return this;
    },

    /**
     *
     * Play the cycle
     * @memberof Controller
     * @method play
     *
     */
    play: function () {
        this._paused = false;

        return this;
    },

    /**
     *
     * Stop the cycle
     * @memberof Controller
     * @method stop
     *
     */
    stop: function () {
        caf( this._cycle );

        this._paused = false;
        this._started = false;
        this._cycle = null;

        return this;
    },

    /**
     *
     * Controller add event handler
     * @memberof Controller
     * @method on
     * @param {string} event the event to listen for
     * @param {function} handler the handler to call
     *
     */
    on: function ( event, handler ) {
        var events = event.split( " " );

        // One unique ID per handler
        handler._jsControllerID = this.getUID();

        for ( var i = events.length; i--; ) {
            if ( typeof handler === "function" ) {
                if ( !this._handlers[ events[ i ] ] ) {
                    this._handlers[ events[ i ] ] = [];
                }

                // Handler can be stored with multiple events
                this._handlers[ events[ i ] ].push( handler );
            }
        }

        return this;
    },

    /**
     *
     * Controller remove event handler
     * @memberof Controller
     * @method off
     * @param {string} event the event to remove handler for
     * @param {function} handler the handler to remove
     *
     */
    off: function ( event, handler ) {
        if ( !this._handlers[ event ] ) {
            return this;
        }

        // Remove a single handler
        if ( handler ) {
            this._off( event, handler );

        // Remove all handlers for event
        } else {
            this._offed( event );
        }

        return this;
    },

    /**
     *
     * Controller fire an event
     * @memberof Controller
     * @method fire
     * @param {string} event the event to fire
     *
     */
    fire: function ( event ) {
        if ( !this._handlers[ event ] ) {
            return this;
        }

        var args = [].slice.call( arguments, 1 );

        for ( var i = this._handlers[ event ].length; i--; ) {
            this._handlers[ event ][ i ].apply( this, args );
        }

        return this;
    },

    /**
     *
     * Get a unique ID
     * @memberof Controller
     * @method getUID
     * @returns number
     *
     */
    getUID: function () {
        this._uid = (this._uid + 1);

        return this._uid;
    },

    /**
     *
     * Controller internal off method assumes event AND handler are good
     * @memberof Controller
     * @method _off
     * @param {string} event the event to remove handler for
     * @param {function} handler the handler to remove
     * @private
     *
     */
    _off: function ( event, handler ) {
        for ( var i = 0, len = this._handlers[ event ].length; i < len; i++ ) {
            if ( handler._jsControllerID === this._handlers[ event ][ i ]._jsControllerID ) {
                this._handlers[ event ].splice( i, 1 );

                break;
            }
        }
    },

    /**
     *
     * Controller completely remove all handlers and an event type
     * @memberof Controller
     * @method _offed
     * @param {string} event the event to remove handler for
     * @private
     *
     */
    _offed: function ( event ) {
        for ( var i = this._handlers[ event ].length; i--; ) {
            this._handlers[ event ][ i ] = null;
        }

        delete this._handlers[ event ];
    }
};

// Expose
window.Controller = Controller;

})( window );
/*!
 *
 * Window resize / orientationchange event controller
 *
 * @ResizeController
 * @author: kitajchuk
 *
 *
 */
(function ( Controller ) {

"use strict";

// Break on no Controller
if ( !Controller ) {
    throw new Error( "ResizeController Class requires Controller Class" );
}

// Current window viewport
var _currentView = {
        width: null,
        height: null,
        orient: null
    },

    // Singleton
    _instance = null;

/**
 *
 * Window resize / orientationchange event controller
 * @constructor ResizeController
 * @augments Controller
 * @requires Controller
 * @memberof! <global>
 *
 * @fires resize
 * @fires resizedown
 * @fires resizeup
 * @fires orientationchange
 * @fires orientationportrait
 * @fires orientationlandscape
 *
 */
var ResizeController = function () {
    // Singleton
    if ( !_instance ) {
        _instance = this;

        // Call on parent cycle
        this.go(function () {
            var currentView = _instance.getViewport(),
                isStill = (currentView.width === _currentView.width && currentView.height === _currentView.height),
                isResize = (currentView.width !== _currentView.width || currentView.height !== _currentView.height),
                isResizeUp = (currentView.width > _currentView.width || currentView.height > _currentView.height),
                isResizeDown = (currentView.width < _currentView.width || currentView.height < _currentView.height),
                isOrientation = (currentView.orient !== _currentView.orient),
                isOrientationPortrait = (currentView.orient !== _currentView.orient && currentView.orient !== 90),
                isOrientationLandscape = (currentView.orient !== _currentView.orient && currentView.orient === 90);

            // Fire blanket resize event
            if ( isResize ) {
                /**
                 *
                 * @event resize
                 *
                 */
                _instance.fire( "resize" );
            }

            // Fire resizeup and resizedown
            if ( isResizeDown ) {
                /**
                 *
                 * @event resizedown
                 *
                 */
                _instance.fire( "resizedown" );

            } else if ( isResizeUp ) {
                /**
                 *
                 * @event resizeup
                 *
                 */
                _instance.fire( "resizeup" );
            }

            // Fire blanket orientationchange event
            if ( isOrientation ) {
                /**
                 *
                 * @event orientationchange
                 *
                 */
                _instance.fire( "orientationchange" );
            }

            // Fire orientationportrait and orientationlandscape
            if ( isOrientationPortrait ) {
                /**
                 *
                 * @event orientationportrait
                 *
                 */
                _instance.fire( "orientationportrait" );

            } else if ( isOrientationLandscape ) {
                /**
                 *
                 * @event orientationlandscape
                 *
                 */
                _instance.fire( "orientationlandscape" );
            }

            _currentView = currentView;
        });
    }

    return _instance;
};

ResizeController.prototype = new Controller();

/**
 *
 * Returns the current window viewport specs
 * @memberof ResizeController
 * @method getViewport
 * @returns object
 *
 */
ResizeController.prototype.getViewport = function () {
    return {
        width: window.innerWidth,
        height: window.innerHeight,
        orient: ("orientation" in window) ? Math.abs( window.orientation ) : null
    };
};

// Expose
window.ResizeController = ResizeController;

})( (window.Controller || window.funpack.Controller) );


text:
const stringMiddlePattern = /^(?=.)[^"'\\]+?(?:(?!.)|(?=["'\\]))/;

// Match one escape sequence, including the backslash.
export const escapeSequencePattern = /^\\(?:[`'"\\bfnrt]|0(?![0-9])|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|(?=.)[^ux0-9])/;

// Match one ES5 line continuation (backslash + line terminator).
export const lineContinuationPattern = /^\\(?:\r\n|[\u000A\u000D\u2028\u2029])/;

// Helper for defining getDoubleQuotedString and getSingleQuotedString.
export default function(okQuote) {
  return function(parser) {
    let literal = '"';
    let done = false;
    let next;

    while (!done) {
      next =
        parser.matchPattern(stringMiddlePattern) ||
        parser.matchPattern(escapeSequencePattern) ||
        parser.matchString(okQuote);
      if (next) {
        if (next === `"`) {
          literal += `\\"`;
        } else if (next === `\\'`) {
          literal += `'`;
        } else {
          literal += next;
        }
      } else {
        next = parser.matchPattern(lineContinuationPattern);
        if (next) {
          // convert \(newline-like) into a \u escape, which is allowed in JSON
          literal += '\\u' + ('000' + next.charCodeAt(1).toString(16)).slice(-4);
        } else {
          done = true;
        }
      }
    }

    literal += '"';

    // use JSON.parse to interpret escapes
    return JSON.parse(literal);
  };
}


text:
using MoreMountains.CorgiEngine;
using ProgressionSystem.Scripts.Variables;
using UnityEngine;

namespace ProgressionSystem.Scripts.Links
{
    public class WalkSpeedLink : MonoBehaviour
    {
        [SerializeField] private FloatVariable WalkSpeed;
        private CharacterHorizontalMovement _movement;

        private void Awake() { _movement = GetComponent<CharacterHorizontalMovement>(); }

        private void UpdateWalkSpeed()
        {
            _movement.WalkSpeed = WalkSpeed.Value;
            _movement.ResetHorizontalSpeed();
        }
        private void OnEnable()
        {
            UpdateWalkSpeed();
            WalkSpeed.Changed += UpdateWalkSpeed;
        }

        private void OnDisable()
        {
            WalkSpeed.Changed -= UpdateWalkSpeed;
        }
    }
}


text:
({
	handleKeyboardEvent : function(component, event) {
		alert('keyboard event!');
	}
})


text:
#include <assert.h>
#include <errno.h>

#include <arch.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <denver.h>
#include <lib/mmio.h>

#include <mce_private.h>
#include <platform_def.h>
#include <t194_nvg.h>
#include <tegra_private.h>

#define	ID_AFR0_EL1_CACHE_OPS_SHIFT	U(12)
#define	ID_AFR0_EL1_CACHE_OPS_MASK	U(0xF)
/*
 * Reports the major and minor version of this interface.
 *
 * NVGDATA[0:31]: SW(R) Minor Version
 * NVGDATA[32:63]: SW(R) Major Version
 */
uint64_t nvg_get_version(void)
{
	nvg_set_request((uint64_t)TEGRA_NVG_CHANNEL_VERSION);

	return (uint64_t)nvg_get_result();
}

/*
 * Set the expected wake time in TSC ticks for the next low-power state the
 * core enters.
 *
 * NVGDATA[0:31]: SW(RW), WAKE_TIME
 */
void nvg_set_wake_time(uint32_t wake_time)
{
	/* time (TSC ticks) until the core is expected to get a wake event */
	nvg_set_request_data((uint64_t)TEGRA_NVG_CHANNEL_WAKE_TIME, (uint64_t)wake_time);
}

/*
 * This request allows updating of CLUSTER_CSTATE, CCPLEX_CSTATE and
 * SYSTEM_CSTATE values.
 *
 * NVGDATA[0:2]: SW(RW), CLUSTER_CSTATE
 * NVGDATA[7]: SW(W), update cluster flag
 * NVGDATA[8:10]: SW(RW), CG_CSTATE
 * NVGDATA[15]: SW(W), update ccplex flag
 * NVGDATA[16:19]: SW(RW), SYSTEM_CSTATE
 * NVGDATA[23]: SW(W), update system flag
 * NVGDATA[31]: SW(W), update wake mask flag
 * NVGDATA[32:63]: SW(RW), WAKE_MASK
 */
void nvg_update_cstate_info(uint32_t cluster, uint32_t ccplex,
		uint32_t system, uint32_t wake_mask, uint8_t update_wake_mask)
{
	uint64_t val = 0;

	/* update CLUSTER_CSTATE? */
	if (cluster != 0U) {
		val |= ((uint64_t)cluster & CLUSTER_CSTATE_MASK) |
				CLUSTER_CSTATE_UPDATE_BIT;
	}

	/* update CCPLEX_CSTATE? */
	if (ccplex != 0U) {
		val |= (((uint64_t)ccplex & CCPLEX_CSTATE_MASK) << CCPLEX_CSTATE_SHIFT) |
				CCPLEX_CSTATE_UPDATE_BIT;
	}

	/* update SYSTEM_CSTATE? */
	if (system != 0U) {
		val |= (((uint64_t)system & SYSTEM_CSTATE_MASK) << SYSTEM_CSTATE_SHIFT) |
				SYSTEM_CSTATE_UPDATE_BIT;
	}

	/* update wake mask value? */
	if (update_wake_mask != 0U) {
		val |= CSTATE_WAKE_MASK_UPDATE_BIT;
	}

	/* set the wake mask */
	val |= ((uint64_t)wake_mask & CSTATE_WAKE_MASK_CLEAR) << CSTATE_WAKE_MASK_SHIFT;

	/* set the updated cstate info */
	nvg_set_request_data((uint64_t)TEGRA_NVG_CHANNEL_CSTATE_INFO, val);
}

/*
 * Return a non-zero value if the CCPLEX is able to enter SC7
 *
 * NVGDATA[0]: SW(R), Is allowed result
 */
int32_t nvg_is_sc7_allowed(void)
{
	/* issue command to check if SC7 is allowed */
	nvg_set_request((uint64_t)TEGRA_NVG_CHANNEL_IS_SC7_ALLOWED);

	/* 1 = SC7 allowed, 0 = SC7 not allowed */
	return (int32_t)nvg_get_result();
}

/*
 * Wake an offlined logical core. Note that a core is offlined by entering
 * a C-state where the WAKE_MASK is all 0.
 *
 * NVGDATA[0:3]: SW(W) logical core to online
 */
int32_t nvg_online_core(uint32_t core)
{
	int32_t ret = 0;

	/* sanity check the core ID value */
	if (core > (uint32_t)PLATFORM_CORE_COUNT) {
		ERROR("%s: unknown core id (%d)\n", __func__, core);
		ret = -EINVAL;
	} else {
		/* get a core online */
		nvg_set_request_data((uint64_t)TEGRA_NVG_CHANNEL_ONLINE_CORE,
					(uint64_t)core & MCE_CORE_ID_MASK);
	}

	return ret;
}

/*
 * MC GSC (General Security Carveout) register values are expected to be
 * changed by TrustZone ARM code after boot.
 *
 * NVGDATA[0:15] SW(R) GSC enun
 */
int32_t nvg_update_ccplex_gsc(uint32_t gsc_idx)
{
	int32_t ret = 0;

	/* sanity check GSC ID */
	if (gsc_idx > (uint32_t)TEGRA_NVG_CHANNEL_UPDATE_GSC_VPR) {
		ERROR("%s: unknown gsc_idx (%u)\n", __func__, gsc_idx);
		ret = -EINVAL;
	} else {
		nvg_set_request_data((uint64_t)TEGRA_NVG_CHANNEL_UPDATE_CCPLEX_GSC,
				     (uint64_t)gsc_idx);
	}

	return ret;
}

/*
 * Cache clean and invalidate, clear TR-bit operation for all CCPLEX caches.
 */
int32_t nvg_roc_clean_cache_trbits(void)
{
	int32_t ret = 0;

	/* check if cache flush through mts is supported */
	if (((read_id_afr0_el1() >> ID_AFR0_EL1_CACHE_OPS_SHIFT) &
			ID_AFR0_EL1_CACHE_OPS_MASK) == 1U) {
		if (nvg_cache_inval_all() == 0U) {
			ERROR("%s: failed\n", __func__);
			ret = -ENODEV;
		}
	} else {
		ret = -ENOTSUP;
	}

	return ret;
}

/*
 * Set the power state for a core
 */
int32_t nvg_enter_cstate(uint32_t state, uint32_t wake_time)
{
	int32_t ret = 0;
	uint64_t val = 0ULL;

	/* check for allowed power state */
	if ((state != (uint32_t)TEGRA_NVG_CORE_C0) &&
		(state != (uint32_t)TEGRA_NVG_CORE_C1) &&
	    (state != (uint32_t)TEGRA_NVG_CORE_C6) &&
		(state != (uint32_t)TEGRA_NVG_CORE_C7))
	{
		ERROR("%s: unknown cstate (%u)\n", __func__, state);
		ret = -EINVAL;
	} else {
		/* time (TSC ticks) until the core is expected to get a wake event */
		nvg_set_wake_time(wake_time);

		/* set the core cstate */
		val = read_actlr_el1() & ~ACTLR_EL1_PMSTATE_MASK;
		write_actlr_el1(val | (uint64_t)state);
	}

	return ret;
}

#if ENABLE_STRICT_CHECKING_MODE
/*
 * Enable strict checking mode
 *
 * NVGDATA[3] strict_check ON + lock
 */
void nvg_enable_strict_checking_mode(void)
{
	uint64_t params = (uint64_t)(STRICT_CHECKING_ENABLED_SET |
				     STRICT_CHECKING_LOCKED_SET);

	nvg_set_request_data((uint64_t)TEGRA_NVG_CHANNEL_SECURITY_CONFIG, params);
}

void nvg_verify_strict_checking_mode(void)
{
	uint64_t params = (uint64_t)(STRICT_CHECKING_ENABLED_SET |
				     STRICT_CHECKING_LOCKED_SET);

	nvg_set_request((uint64_t)TEGRA_NVG_CHANNEL_SECURITY_CONFIG);
	assert(params == (uint64_t)nvg_get_result());
}
#endif

/*
 * Request a reboot
 *
 * NVGDATA[0]: reboot command
 */
void nvg_system_reboot(void)
{
	/* issue command for reboot */
	nvg_set_request_data((uint64_t)TEGRA_NVG_CHANNEL_SHUTDOWN,
			     (uint64_t)TEGRA_NVG_REBOOT);
}

/*
 * Request a shutdown
 *
 * NVGDATA[0]: shutdown command
 */
void nvg_system_shutdown(void)
{
	/* issue command for shutdown */
	nvg_set_request_data((uint64_t)TEGRA_NVG_CHANNEL_SHUTDOWN,
			     (uint64_t)TEGRA_NVG_SHUTDOWN);
}

/*
 * Request to clear CCPLEX->HSM correctable error signal.
 * NVGDATA[1]: A write of 1 clears the CCPLEX->HSM correctable error signal,
 *             A write of 0 has no effect.
 */
void nvg_clear_hsm_corr_status(void)
{
	nvg_hsm_error_ctrl_channel_t status = { .bits = { .corr = 1U, }, };

	nvg_set_request_data((uint64_t)TEGRA_NVG_CHANNEL_HSM_ERROR_CTRL, status.flat);
}


text:
/* Shaking animation*/
@-webkit-keyframes spaceboots {
	0% { -webkit-transform: translate(2px, 1px) rotate(0deg); }
	10% { -webkit-transform: translate(-1px, -2px) rotate(-5deg); }
	20% { -webkit-transform: translate(-3px, 0px) rotate(5deg); }
	30% { -webkit-transform: translate(0px, 2px) rotate(0deg); }
	40% { -webkit-transform: translate(1px, -1px) rotate(5deg); }
	50% { -webkit-transform: translate(-1px, 2px) rotate(-5deg); }
	60% { -webkit-transform: translate(-3px, 1px) rotate(0deg); }
	70% { -webkit-transform: translate(2px, 1px) rotate(-5deg); }
	80% { -webkit-transform: translate(-1px, -1px) rotate(5deg); }
	90% { -webkit-transform: translate(2px, 2px) rotate(0deg); }
	100% { -webkit-transform: translate(1px, -2px) rotate(-5deg); }
}
.shake-it-baby{-webkit-animation-name: spaceboots;-webkit-animation-duration: 0.02s;-webkit-transform-origin:50% 50%;-webkit-animation-iteration-count: infinite;-webkit-animation-timing-function: linear;}


text:
package com.example.diary.opiekun;

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

import com.example.diary.*;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;

public class OpiekunKomunikatorMojeActivity extends Activity {

	List<Map<String, String>> getRozmowy=null, getUserN=null;
	String idUser="", rozmowca="", nazwaOdbiorcy="";
	Intent i;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_opiekun_komunikator_moje);
		TextView info = (TextView) findViewById(R.id.info);

		idUser = getIntent().getExtras().getString("idUser");

		// stad do okna rozmowy OpiekunKomunikatorMojeRozmowaActivity
		getRozmowy = Utilities.query(this, "getRozmowy", idUser);

		if(getRozmowy.isEmpty()){
			info.setText("Nie prowadzi�e� jeszcze\n�adnych rozm�w");
		}
		else {
			TableLayout nowe = (TableLayout) findViewById(R.id.tabelka);
			nowe.setStretchAllColumns(true);
			nowe.setColumnShrinkable(1, true);
			nowe.setColumnShrinkable(0, true);
			nowe.bringToFront();

			TableRow tr = new TableRow(this);
			TextView tv = new TextView(this);
			tv.setText("Data");
			tr.addView(tv);
			TextView tv1 = new TextView(this);
			tv1.setText("Rozm�wca");
			tr.addView(tv1);
			nowe.addView(tr);

			ArrayList<String> listaOdbiorcow = new ArrayList<String>();
			for(int a=0;a<getRozmowy.size();a++){
				if(getRozmowy.get(a).get("id_odbiorcy").equals(idUser)){
					rozmowca = getRozmowy.get(a).get("id_nadawcy");
				}
				else rozmowca =  getRozmowy.get(a).get("id_odbiorcy");
				if(listaOdbiorcow.contains(rozmowca)){

				}

				else{
					listaOdbiorcow.add(rozmowca);
					TableRow tr2 = new TableRow(this);
					TextView tv3 = new TextView(this);
					tv3.setText(getRozmowy.get(a).get("data"));
					tr2.addView(tv3);
					TextView tv4 = new TextView(this);
					getUserN = Utilities.query(this, "getUserN",rozmowca);
					nazwaOdbiorcy = getUserN.get(0).get("nazwa");
					tv4.setText(nazwaOdbiorcy);
					tr2.addView(tv4);
					tr2.setOnClickListener(new OnClickListener() {

						@Override
						public void onClick(View v) {
							i = new Intent (OpiekunKomunikatorMojeActivity.this, OpiekunKomunikatorRozmowaActivity.class);
							i.putExtra("idOdbiorcy", rozmowca);
							i.putExtra("odbiorca", nazwaOdbiorcy);
							Bundle b = getIntent().getExtras();
							i.putExtras(b);
							startActivity(i);
							finish();
						}
					});
					nowe.addView(tr2);
				}
			}
		}
	}
}


text:
~~~
someKey: value
~~~
# Header

Content


text:
template <template <typename ...> class Container>
void test_set() {
  struct KeyBase { };
  struct KeyDerived;  // derives from KeyBase, but incomplete at this point

  // Name the type but don't instantiate it.
  using C = Container<KeyDerived*, std::hash<KeyBase*>, std::equal_to<KeyBase*>>;

  // Instantiate it but don't ODR use any members.
  typename C::value_type dummy; (void)dummy;

  // Complete the types.
  struct KeyDerived : KeyBase { };

  C c; // ODR use it, which should be OK
}

template <template <typename ...> class Container>
void test_map() {
  struct Value { };
  struct KeyBase { };
  struct KeyDerived;
  using C = Container<KeyDerived*, Value, std::hash<KeyBase*>, std::equal_to<KeyBase*>>;
  typename C::value_type dummy; (void)dummy;
  struct KeyDerived : KeyBase { };
  C c;
}

int main(int, char**) {
  // expected-no-diagnostics
  test_set<std::unordered_set>();
  test_set<std::unordered_multiset>();
  test_map<std::unordered_map>();
  test_map<std::unordered_multimap>();

  return 0;
}


text:
package com.xu.dao;

import com.xu.entity.Customer;

public interface ForgetPwdActivateDao {

	public Customer findByCode(String code);

}


text:
package org.qifu.base.exception;

import org.apache.log4j.Logger;

public class AuthorityException extends BaseSysException {
	private static final long serialVersionUID = -614499870511694834L;
	protected Logger logger=Logger.getLogger(ControllerException.class);

	public AuthorityException(String message) {
		super(message);
	}

}