text:
"use strict";

// Tell colors module that we want colour console output
process.env.ALLOW_COLORS = true;

var async = require('async'),
	colors = require('irrelon-colors/safe'),
	Overload = require('irrelon-overload'),
	padRight,
	TB;

padRight = function padRight (str, padStr, totalLength) {
	var i;

	str = String(str);

	if (str.length >= totalLength) {
		return str;
	}

	for (i = str.length; i < totalLength; i++) {
		str = str + padStr;
	}

	return str;
};

TB = {};

TB.config = {
	noCatch: false,
	cuteMode: true
};
TB.tests = {};
TB.testResult = {};
TB.summary = {
	run: 0,
	passed: 0,
	failed: 0
};
TB.timeRecord = {
	"__startTime": 0,
	"__totalTime": 0
};
TB.timeStepRecord = {};
TB.timeStep = {};

TB.test = new Overload({
	/**
	 * Define a test by name and function.
	 * @param {String} name The name of the test, must be unique.
	 * @param {Function} codeFunc The function containing the test
	 * code that executes various assertions.
	 * @returns {*}
	 */
	'string, function': function (name, codeFunc) {
		return this.$main.call(this, '', name, {}, codeFunc);
	},

	/**
	 * Define a test by group, name and function.
	 * @param {String} group The group this test belongs to.
	 * @param {String} name The name of the test, must be unique.
	 * @param {Function} codeFunc The function containing the test
	 * code that executes various assertions.
	 * @returns {*}
	 */
	'string, string, function': function (group, name, codeFunc) {
		return this.$main.call(this, group, name, {}, codeFunc);
	},

	/**
	 * Define a test by name, options and function.
	 * @param {String} name The name of the test, must be unique.
	 * @param {Object} options The test options such as timeout and
	 * number of assertions to expect.
	 * @param {Function} codeFunc The function containing the test
	 * code that executes various assertions.
	 * @returns {*}
	 */
	'string, object, function': function (name, options, codeFunc) {
		return this.$main.call(this, '', name, options, codeFunc);
	},

	/**
	 * Define a test by group, name, options and function.
	 * @param {String} name The name of the test, must be unique.
	 * @param {String} group The group this test belongs to.
	 * @param {Object} options The test options such as timeout and
	 * number of assertions to expect.
	 * @param {Function} codeFunc The function containing the test
	 * code that executes various assertions.
	 * @returns {*}
	 */
	'string, string, object, function': function (group, name, options, codeFunc) {
		return this.$main.call(this, group, name, options, codeFunc);
	},

	'$main': function test (group, name, options, codeFunc) {
		if (!group) {
			group = 'All'
		}

		if (options && options.indent || options.indent === undefined) {
			TB.indent = "\t";
		}

		TB.tests[group] = TB.tests[group] || {};
		TB.tests[group][name] = function (callback) {
			var start,
				testEnclosure,
				testTimeout,
				timedOut = false

			TB.assertions = 0;
			TB.currentGroup = group;

			console.log(colors.cyan.bold(TB.currentGroup + ' -'), colors.green.bold(name));
			console.log('');
			console.log(TB.indent + 'RESULT\t ACTION\t LOG');
			console.log(TB.indent + '----------------------------------------------------');

			start = new Date().getTime();

			testEnclosure = function () {
				testTimeout = setTimeout(function () {
					timedOut = true;

					TB.summary.failed++;
					TB.testResult[name] = false;

					throw('TIMEOUT\t Test timed out!');
				}, options.timeout || TB.timeout);

				return codeFunc(function (err, data) {
					if (!timedOut) {
						clearTimeout(testTimeout);
						TB.timeRecord[name] = new Date().getTime() - start;

						console.log(TB.indent + '----------------------------------------------------');

						if (!err) {
							console.log(TB.indent + colors.green.bold('PASSED\t'), 'Ran ' + TB.assertions + ' assertions and took', colors.magenta.bold(TB.timeRecord[name] + ' ms'));
							console.log('');
						} else {
							console.log(TB.indent + colors.red.bold('FAILED\t'), 'Ran ' + TB.assertions + ' assertions and took', colors.magenta.bold(TB.timeRecord[name] + ' ms'));
							console.log('');
						}

						TB.summary.passed++;
						callback(err, data);
					}
				});
			};

			TB.summary.run++;

			if (TB.config.noCatch) {
				testEnclosure();
			} else {
				try {
					testEnclosure();
					TB.testResult[name] = true;
				} catch (e) {
					TB.timeRecord[name] = new Date().getTime() - start;
					console.log(TB.indent + colors.red.bold('FAILED\t', e));
					console.log(TB.indent + '----------------------------------------------------');
					console.log(TB.indent + colors.red.bold('FAILED\t'), 'Ran ' + TB.assertions + ' assertions and took', colors.magenta.bold(TB.timeRecord[name] + ' ms'));
					console.log('');

					TB.testResult[name] = false;
					TB.summary.failed++;

					setImmediate(function () {
						callback(false);
					});
				}
			}
		};

		// Check if we have a timeout for the test
		if (options && options.timeout && typeof options.timeout === 'number') {
			TB.timeout = options.timeout;
		}
	}
});

TB.time = function time (name, shouldBeLessThanMs) {
	var totalTime = 0;

	if (shouldBeLessThanMs === undefined) {
		shouldBeLessThanMs = TB.timeout;
	}

	if (TB.timeStep[name] === undefined) {
		TB.timeStep[name] = new Date().getTime();
	} else {
		TB.assertions++;
		totalTime = new Date().getTime() - TB.timeStep[name];
		TB.timeStepRecord[name] = totalTime;
		delete TB.timeStep[name];

		console.log(TB.indent + colors.green.bold('PASSED\t'), colors.green.bold('TIME\t'), colors.green.bold(name) + "\t", colors.magenta.bold(totalTime + ' ms') + colors.green(' <= ') + colors.magenta.bold(shouldBeLessThanMs + ' ms'));
		if (totalTime > shouldBeLessThanMs) {
			throw('Action took longer than maximum ' + shouldBeLessThanMs + ' ms!');
		}
	}
};

TB.expect = function (num, name) {
	if (name === undefined) {
		name = '';
	} else {
		name += ' ';
	}

	if (TB.assertions !== num) {
		throw("EXPECT\t " + name + "Expected " + num + ' assertions but ' + TB.assertions + ' were run!');
	} else {
		console.log(TB.indent + colors.green.bold('PASSED\t'), colors.green.bold('EXPECT\t'), colors.green.bold(name || ('Expected ' + num + ' assertions')));
	}
};

TB.strictEqual = function strictEqual (val1, val2, name) {
	TB.assertions++;
	if (val1 !== val2) {
		throw("STRICT\t " + name + ' expected ' + JSON.stringify(val2) + ' but got ' + JSON.stringify(val1));
	} else {
		console.log(TB.indent + colors.green.bold('PASSED\t'), colors.green.bold('STRICT\t'), colors.green.bold(name));
	}
};

TB.equal = function equal (val1, val2, name) {
	TB.assertions++;
	if (val1 != val2) {
		throw("EQUAL\t " + name + ' expected ' + JSON.stringify(val2) + ' but got ' + JSON.stringify(val1));
	} else {
		console.log(TB.indent + colors.green.bold('PASSED\t'), colors.green.bold('EQUAL\t'), colors.green.bold(name));
	}
};

TB.ok = function ok (val, name) {
	TB.assertions++;
	if (!val) {
		throw('OK\t"' + name + '" expected true but got ' + !!val);
	} else {
		console.log(TB.indent + colors.green.bold('PASSED\t'), colors.green.bold('OK\t'), colors.green.bold(name));
	}
};

TB.start = function start (groupsObj) {
	var group,
		groupEnclosure,
		groupArr = [],
		testCountTotal = 0;

	TB.assertions = 0;

	if (!TB.timeout) {
		TB.timeout = 60000; // Default 60 second timeout
	}

	if (groupsObj === undefined) {
		groupsObj = TB.tests;
	}

	// Pre-process groups and tests to count totals
	for (group in groupsObj) {
		if (groupsObj.hasOwnProperty(group)) {
			testCountTotal += Object.keys(groupsObj[group]).length;
		}
	}

	groupEnclosure = function (testsObj) {
		return function (groupFinished) {
			async.series(testsObj, function (err, results) {
				groupFinished(err);
			});
		};
	};

	// Loop groups
	for (group in groupsObj) {
		if (groupsObj.hasOwnProperty(group)) {
			if (groupsObj[group] && Object.keys(groupsObj[group]).length) {
				groupArr.push(groupEnclosure(groupsObj[group]));
			}
		}
	}

	TB.timeRecord.__startTime = new Date().getTime();

	/*if (TB.config.cuteMode) {
	 console.log("                        _     _");
	 console.log("                       ( \\---/ )");
	 console.log("                        ) . . (");
	 console.log("__________________,--._(___Y___)_,--.______________________");
	 console.log("                  `--'           `--'     ");
	 }*/

	async.series(groupArr, function (err, results) {
		var colorFunc1,
			colorFunc2;

		TB.timeRecord.__totalTime = new Date().getTime() - TB.timeRecord.__startTime;

		if (TB.summary.failed) {
			colorFunc1 = colors.red.bold;
			colorFunc2 = colors.red;
		} else {
			colorFunc1 = function (str) {
				return str;
			};
			colorFunc2 = function (str) {
				return str;
			};
		}

		if (TB.config.cuteMode) {
			if (TB.summary.failed) {
				console.log('                        _     _');
				console.log('                       ( \\---/ )   ');
				console.log('                        ( . . )');
				console.log('                 ___,--.(__Y__),--.___');
				console.log('                |   `--\'       `--\'   |');
				console.log('                | Test Bear is SAD!!! |');
				console.log('                |    _,-.     ,-._    |');
				console.log('                |___(ooO )___( Ooo)___|');
				console.log('                     `--\'     `--\' ');
			} else {
				console.log('                        _     _');
				console.log('                       ( \\---/ )   ');
				console.log('                        ( . . )');
				console.log('                 ___,--.(__Y__),--.___');
				console.log('                |   `--\'       `--\'   |');
				console.log('                | Test Bear is HAPPY! |');
				console.log('                |    _,-.     ,-._    |');
				console.log('                |___(ooO )___( Ooo)___|');
				console.log('                     `--\'     `--\' ');
			}
		}

		console.log(colorFunc1('------------------------------------------------------------'));
		console.log(colorFunc1('| Run     | Passed     | Failed     | Total Time           |'));
		console.log(colorFunc1('------------------------------------------------------------'));
		console.log(colorFunc1('| ') + colorFunc2(padRight(TB.summary.run, " ", 7) + ' | ' + padRight(TB.summary.passed, " ", 10) + ' | ' + padRight(TB.summary.failed, " ", 10) + ' | ' + padRight(TB.timeRecord.__totalTime + ' ms', " ", 20)) + colorFunc1(' |'));
		console.log(colorFunc1('------------------------------------------------------------'));

		if (TB.summary.failed) {
			setTimeout(function () {
				process.exit(1);
			}, 200);
		} else {
			setTimeout(function () {
				process.exit(0);
			}, 200);
		}
	});

	// Keep the test system alive until we explicitly exit
	setInterval(function () {}, 100000);
};

module.exports = TB;


text:
namespace NLog
{
    using System;
    using Config;

    /// <summary>
    /// Global Diagnostics Context - used for log4net compatibility.
    /// </summary>
    [Obsolete("Use GlobalDiagnosticsContext instead")]
    public static class GDC
    {
        /// <summary>
        /// Sets the Global Diagnostics Context item to the specified value.
        /// </summary>
        /// <param name="item">Item name.</param>
        /// <param name="value">Item value.</param>
        public static void Set(string item, string value)
        {
            GlobalDiagnosticsContext.Set(item, value);
        }

        /// <summary>
        /// Gets the Global Diagnostics Context named item.
        /// </summary>
        /// <param name="item">Item name.</param>
        /// <returns>The value of <paramref name="item"/>, if defined; otherwise <see cref="String.Empty"/>.</returns>
        /// <remarks>If the value isn't a <see cref="string"/> already, this call locks the <see cref="LogFactory"/> for reading the <see cref="LoggingConfiguration.DefaultCultureInfo"/> needed for converting to <see cref="string"/>. </remarks>
        public static string Get(string item)
        {
            return GlobalDiagnosticsContext.Get(item);
        }

        /// <summary>
        /// Gets the Global Diagnostics Context item.
        /// </summary>
        /// <param name="item">Item name.</param>
        /// <param name="formatProvider"><see cref="IFormatProvider"/> to use when converting the item's value to a string.</param>
        /// <returns>The value of <paramref name="item"/> as a string, if defined; otherwise <see cref="String.Empty"/>.</returns>
        /// <remarks>If <paramref name="formatProvider"/> is <c>null</c> and the value isn't a <see cref="string"/> already, this call locks the <see cref="LogFactory"/> for reading the <see cref="LoggingConfiguration.DefaultCultureInfo"/> needed for converting to <see cref="string"/>. </remarks>
        public static string Get(string item, IFormatProvider formatProvider)
        {
            return GlobalDiagnosticsContext.Get(item, formatProvider);
        }

        /// <summary>
        /// Gets the Global Diagnostics Context named item.
        /// </summary>
        /// <param name="item">Item name.</param>
        /// <returns>The value of <paramref name="item"/>, if defined; otherwise <c>null</c>.</returns>
        public static object GetObject(string item)
        {
            return GlobalDiagnosticsContext.GetObject(item);
        }

        /// <summary>
        /// Checks whether the specified item exists in the Global Diagnostics Context.
        /// </summary>
        /// <param name="item">Item name.</param>
        /// <returns>A boolean indicating whether the specified item exists in current thread GDC.</returns>
        public static bool Contains(string item)
        {
            return GlobalDiagnosticsContext.Contains(item);
        }

        /// <summary>
        /// Removes the specified item from the Global Diagnostics Context.
        /// </summary>
        /// <param name="item">Item name.</param>
        public static void Remove(string item)
        {
            GlobalDiagnosticsContext.Remove(item);
        }

        /// <summary>
        /// Clears the content of the GDC.
        /// </summary>
        public static void Clear()
        {
            GlobalDiagnosticsContext.Clear();
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
A mini Scala utility library. Compatible with functional programming beginners.

![hamster picture](https://avatars2.githubusercontent.com/u/18599689?v=3&s=200)

Currently, Hamsters supports :

 * Validation
 * OK/KO Monads
 * Enum typeclass
 * Monad transformers
 * HLists
 * Union types

[![Travis](https://travis-ci.org/scala-hamsters/hamsters.svg?branch=master)](https://travis-ci.org/scala-hamsters/hamsters)

## Install as dependency (for Scala 2.11)

With SBT :

```scala
libraryDependencies ++= Seq(
  "io.github.scala-hamsters" %% "hamsters" % "1.1.1"
)
```

With Maven :

```xml
<dependency>
  <groupId>io.github.scala-hamsters</groupId>
  <artifactId>hamsters_2.11</artifactId>
  <version>1.0.7</version>
</dependency>
```

## Usage

### Validation and monadic OK/KO

Statements can be `OK` or `KO`. Then you can get all successes and failures.

```scala
import io.github.hamsters.Validation
import Validation._

val e1 = OK(1)
val e2 = KO("error 1")
val e3 = KO("error 2")

val validation = Validation(e1,e2, e3)
validation.hasFailures //true
val failures = validation.failures //List[String] : List("error 1", "error 2")
```

You can also use OK/KO in a monadic way if you want to stop processing at the first encountered error.

```scala
val e1: Either[String, Int] = OK(1)
val e2: Either[String, Int] = KO("nan")
val e3: Either[String, Int] = KO("nan2")

// Stop at first error
for {
  v1 <- e1
  v2 <- e2
  v3 <- e3
} yield(s"$v1-$v2-$v3") //KO("nan")
```

To automatically catch exceptions into a KO object, you can use `fromCatchable`.
By default it will give you an error message, but you can specify what to do in error cases :

```scala
def compute(x: Int):Int = 2/x

fromCatchable(compute(1)) //OK(2)
fromCatchable(compute(0)) //KO("/ by zero")

fromCatchable(compute(0), (t: Throwable) => t.getClass.getSimpleName) //KO("ArithmeticException")
```

Note : Validation relies on standard Either, Left and Right types. KO is used on the left side, OK on the right side.

###  Monad transformers

Example : combine Future and Option types then make it work in a for comprehension.
More information on why it's useful [here](http://loicdescotte.github.io/posts/scala-compose-option-future/).

#### FutureOption

```scala
def foa: Future[Option[String]] = Future(Some("a"))
def fob(a: String): Future[Option[String]] = Future(Some(a+"b"))

val composedAB: Future[Option[String]] = for {
  a <- FutureOption(foa)
  ab <- FutureOption(fob(a))
} yield ab
```

#### FutureEither

```scala
import io.github.hamsters.Validation._
import io.github.hamsters.{FutureEither, FutureOption}
import io.github.hamsters.MonadTransformers._

def fea: Future[Either[String, Int]] = Future(OK(1))
def feb(a: Int): Future[Either[String, Int]] = Future(OK(a+2))

val composedAB: Future[Either[String, Int]] = for {
  a <- FutureEither(fea)
  ab <- FutureEither(feb(a))
} yield ab
```
### Enums

This typeclass allows to use parse and name methods on enumerable types. It can be very useful if you need to serialize and deserialize your types (in Json, in a database...)

```scala
sealed trait Season
case object Winter extends Season
case object Spring extends Season
case object Summer extends Season
case object Fall extends Season

implicit val seasonEnumerable = new Enumerable[Season] {
  override def list: List[Season] = List(Winter, Spring, Summer, Fall)
}

Enumeration.name(Winter) // "winter"
Enumeration.parse[Season]("winter") // Some(Winter)
```

It is also possible to use custom namings :

```scala

implicit val seasonEnumerable = new Enumerable[Season] {
  override def list = List(Winter, Spring, Summer, Fall)

  override def name(s: Season) = {
    s match {
      case Winter => "WINTER_SEASON"
      case other => super.name(other)
    }
  }
}

Enumeration.name(Winter) // "WINTER_SEASON"
Enumeration.parse[Season]("WINTER_SEASON") // Some(Winter)
```

### HList

HLists can contain heterogeneous data types but are strongly typed. It's like tuples on steroids!
When you're manipulating data using tuples, it's common to add or subtrack some elements, but you have to make each element explicit to build a new tuple. HList simplifies this kind of task.

 * `::` is used to append elements at the beggining of an HList
 * `+` is used add element at the end of a HList
 * `++` is used to concatenate 2 Hlists
 * other operations : filter, map, foldLeft, foreach

```scala
import io.github.hamsters.{HList, HCons, HNil}
import HList._

val hlist = 2.0 :: "hi" :: HNil

val hlist1 = 2.0 :: "hi" :: HNil
val hlist2 = 1 :: HNil

val sum = hlist1 + 1
val sum2 = hlist1 ++ hlist2 // 2.0 :: (hi :: (1 : HNil))

sum2.tail // hi :: (1 : HNil)
sum2.head // 2.0 (Double)
sum2.tail.head // hi (String)

(2.0 :: "hi" :: HNil).foldLeft("")(_+_) // "2.0hi"

(2.0 :: "hi" :: HNil).map(_.toString) // "2.0" :: "hi" :: HNil

(2.0 :: "hi" :: HNil).filter {
  case s: String if s.startsWith("h") => true
  case _ => false
} //"hi" :: HNil

```

### Union types

You can define functions or methods that are able to return several types, depending on the context.

```scala
import io.github.hamsters.{Union3, Union3Type}

//json element can contain a String, a Int or a Double
val jsonUnion = new Union3Type[String, Int, Double]
import jsonUnion._

def jsonElement(x: Int): Union3[String, Int, Double] = {
  if(x == 0) "0"
  else if (x % 2 == 0) 1
  else 2.0
}
```

Then you can use pattern matching, or ask for a specifc type and retrieve an option :

```scala
jsonElement(0).get[String] // Some("0")
jsonElement(1).getOrElse("not found") // get String value or "not found" if get[String] is undefined
```

### Extensions

 * [Hlist extensions](https://github.com/scala-hamsters/hamsters-extensions/blob/master/hamsters-hlists-extensions/README.md)
 * [Twitter Utils extensions](https://github.com/scala-hamsters/hamsters-extensions/blob/master/hamsters-twitter-util/README.md)

See [hamsters-extensions](https://github.com/scala-hamsters/hamsters-extensions) for more information.

## Scaladoc

You can find the API documentation [here](http://scala-hamsters.github.io/hamsters/api).


text:
package filodb.jmh

import filodb.spark.FiloSetup
import org.apache.spark.sql.{DataFrame, SaveMode, SQLContext}
import org.apache.spark.{SparkContext, SparkException, SparkConf}

/**
 * Creates Cassandra test data for the SparkReadBenchmark.  Note that only 1 partition
 * is created for the test data, so that forces reads to be single threaded.
 * Please run this before running the SparkReadBenchmark.
 */
object CreateCassTestData extends App {
  val NumRows = 5000000

  val conf = (new SparkConf).setMaster("local[4]")
                            .setAppName("test")
                            .set("filodb.cassandra.keyspace", "filodb")
                            .set("filodb.memtable.min-free-mb", "10")
                            .set("spark.driver.memory", "3g")
                            .set("spark.executor.memory", "5g")
  val sc = new SparkContext(conf)
  val sql = new SQLContext(sc)

  case class DummyRow(data: Int, rownum: Int)

  //scalastyle:off
  val randomIntsRdd = sc.parallelize((1 to NumRows).map { n => DummyRow(util.Random.nextInt, n)})
  import sql.implicits._
  val randomDF = randomIntsRdd.toDF()
  println(s"randomDF: $randomDF")

  println("Writing random DF to FiloDB...")
  randomDF.write.format("filodb.spark").
               option("dataset", "randomInts").
               option("row_keys", "rownum").
               option("segment_key", ":round rownum 30000").
               mode(SaveMode.Overwrite).
               save()

  println("Now waiting a couple secs for writes to finish...")
  Thread sleep 5000

  println("Done!")

  sc.stop()
  FiloSetup.shutdown()
  sys.exit(0)
}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Transactions;

using CommonServiceLocator;

using Unity.Attributes;

using vm.Aspects.Facilities;
using vm.Aspects.Model.Repository;

namespace vm.Aspects.Model.EFRepository.HiLoIdentity
{
    /// <summary>
    /// Class HiLoStoreIdProvider. Implements <see cref="IStoreUniqueId{T}"/> for <see cref="EFRepositoryBase"/>
    /// using Hi-Lo generators <see cref="HiLoIdentityGenerator"/> - one for each data set.
    /// </summary>
    public sealed class HiLoStoreIdProvider : IStoreIdProvider,
        IStoreUniqueId<long>,
        IStoreUniqueId<int>,
        IStoreUniqueId<Guid>
    {
        #region Constants
        /// <summary>
        /// The default resolve name of the repository supplying the ID-s. Must have transient lifetime.
        /// </summary>
        /// <remarks>
        /// Note that the code in <see cref="GetOrCreateFreshGenerator"/> requires that the resolved repository instance must have transient lifetime, so that it is not reused by any other.
        /// </remarks>
        public const string HiLoGeneratorsRepositoryResolveName = "HiLoRepository";

        /// <summary>
        /// The default entity set name - "_".
        /// </summary>
        public const string DefaultEntitySetName = "_";

        /// <summary>
        /// The default transaction scope option: RequiresNew
        /// </summary>
        public const TransactionScopeOption DefaultTransactionScopeOption = TransactionScopeOption.RequiresNew;

        /// <summary>
        /// The default transaction timeout in number of seconds: 60sec / 30min in DEBUG mode
        /// </summary>
        public const int DefaultTransactionTimeoutSeconds
#if DEBUG
                    		= 30 * 60;
#else
                            = 60;
#endif

        /// <summary>
        /// The default transaction timeout.
        /// </summary>
        static readonly TimeSpan _defaultTransactionTimeout = new TimeSpan(0, 0, DefaultTransactionTimeoutSeconds);

        /// <summary>
        /// Specifies the default isolation level of the transactions: Serializable
        /// </summary>
        public const IsolationLevel DefaultIsolationLevel = IsolationLevel.Serializable;
        #endregion

        #region The HiLoGenerator objects and the related properties:
        /// <summary>
        /// Synchronizes the access to the generators dictionary.
        /// </summary>
        readonly object _sync = new object();
        /// <summary>
        /// The per entity set generator objects.
        /// </summary>
        readonly IDictionary<string, HiLoIdentityGenerator> _generators = new Dictionary<string, HiLoIdentityGenerator>();
        /// <summary>
        /// The generators repository factory
        /// </summary>
        readonly Func<IRepository> _generatorsRepositoryFactory;
        /// <summary>
        /// If set to <see langword="true" /> getting an ID will be done from within a new transaction scope.
        /// Especially needed when the owning repository is enlisted in external transaction: we do not want
        /// the outcomes of the two transactions to interfere each other.
        /// </summary>
        readonly bool _useTransactionScope;
        #endregion

        /// <summary>
        /// The default generators repository factory delegate.
        /// </summary>
        public static Func<IRepository> DefaultGeneratorsRepositoryFactory { get; } = () => ServiceLocator.Current.GetInstance<IRepository>(HiLoGeneratorsRepositoryResolveName);

        /// <summary>
        /// Initializes a new instance of the <see cref="HiLoStoreIdProvider" /> class.
        /// </summary>
        /// <param name="generatorsRepositoryFactory">The generators repository factory.</param>
        [InjectionConstructor]
        public HiLoStoreIdProvider(
            [Dependency(HiLoGeneratorsRepositoryResolveName)] Func<IRepository> generatorsRepositoryFactory) : this(generatorsRepositoryFactory, false)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="HiLoStoreIdProvider" /> class.
        /// </summary>
        /// <param name="generatorsRepositoryFactory">The generators repository factory.</param>
        /// <param name="useTransactionScope">If set to <see langword="true" /> getting an ID will be done from within a new transaction scope.</param>
        public HiLoStoreIdProvider(
            Func<IRepository> generatorsRepositoryFactory = null,
            bool useTransactionScope = false)
        {
            _generatorsRepositoryFactory = generatorsRepositoryFactory ?? DefaultGeneratorsRepositoryFactory;
            _useTransactionScope         = useTransactionScope;
        }

        #region IStoreIdProvider
        /// <summary>
        /// Gets a provider which generates ID sequence of type <typeparamref name="TId" />.
        /// </summary>
        /// <typeparam name="TId">The type of the generated ID-s.</typeparam>
        /// <returns>IStoreUniqueId<TId>.</returns>
        /// <exception cref="System.NotSupportedException">The store ID provider does not support generating ID-s of type +typeof(TId).FullName</exception>
        public IStoreUniqueId<TId> GetProvider<TId>() where TId : IEquatable<TId>
        {
            if (!(this is IStoreUniqueId<TId> provider))
                throw new NotSupportedException("The store ID provider does not support generating ID-s of type "+typeof(TId).FullName);

            return provider;
        }
        #endregion

        #region IStoreUniqueId<long>
        long IStoreUniqueId<long>.GetNewId<T>(
            IRepository repository)
        {
            if (repository == null)
                throw new ArgumentNullException(nameof(repository));

            if (!(repository is EFRepositoryBase efRepository))
                throw new ArgumentException("The repository must be derived from EFRepositoryBase.", nameof(repository));

            return DoGetNew<T>(efRepository);
        }

        long IStoreUniqueId<long>.GetNewId(
            Type objectsType,
            IRepository repository)
        {
            if (objectsType == null)
                throw new ArgumentNullException(nameof(objectsType));
            if (repository == null)
                throw new ArgumentNullException(nameof(repository));

            if (!(repository is EFRepositoryBase efRepository))
                throw new ArgumentException("The repository must be derived from EFRepositoryBase.", nameof(repository));

            return DoGetNew(objectsType, efRepository);
        }
        #endregion

        #region IStoreUniqueId<int>
        int IStoreUniqueId<int>.GetNewId<T>(
            IRepository repository)
        {
            if (repository == null)
                throw new ArgumentNullException(nameof(repository));

            if (!(repository is EFRepositoryBase efRepository))
                throw new ArgumentException("The repository must be derived from EFRepositoryBase.", nameof(repository));

            var id = DoGetNew<T>(efRepository);

            if (id > 0x7FFFFFFF0)
                throw new InvalidOperationException(
                    $"FATAL ERROR: the ID generator for type {typeof(T).FullName} has reached the maximum value.");

            return unchecked((int)id);
        }

        int IStoreUniqueId<int>.GetNewId(
            Type objectsType,
            IRepository repository)
        {
            if (objectsType == null)
                throw new ArgumentNullException(nameof(objectsType));
            if (repository == null)
                throw new ArgumentNullException(nameof(repository));

            if (!(repository is EFRepositoryBase efRepository))
                throw new ArgumentException("The repository must be derived from EFRepositoryBase.", nameof(repository));

            var id = DoGetNew(objectsType, efRepository);

            if (id > 0x7FFFFFFF0)
                throw new InvalidOperationException(
                    $"FATAL ERROR: the ID generator for type {objectsType.FullName} has reached the maximum value.");

            return unchecked((int)id);
        }
        #endregion

        #region IStoreUniqueId<Guid>
        Guid IStoreUniqueId<Guid>.GetNewId<T>(
            IRepository repository)
        {
            if (repository == null)
                throw new ArgumentNullException(nameof(repository));
            if (!(repository is EFRepositoryBase))
                throw new ArgumentException("The repository must be derived from EFRepositoryBase.", nameof(repository));

            return Facility.GuidGenerator.NewGuid();
        }

        Guid IStoreUniqueId<Guid>.GetNewId(
            Type objectsType,
            IRepository repository)
        {
            if (objectsType == null)
                throw new ArgumentNullException(nameof(objectsType));
            if (repository == null)
                throw new ArgumentNullException(nameof(repository));
            if (!(repository is EFRepositoryBase))
                throw new ArgumentException("The repository must be derived from EFRepositoryBase.", nameof(repository));

            return Facility.GuidGenerator.NewGuid();
        }
        #endregion

        long DoGetNew<T>(EFRepositoryBase efRepository)
        {
            if (efRepository == null)
                throw new ArgumentNullException(nameof(efRepository));

            long id = -1L;
            var entitySetName = efRepository.ObjectContext.GetEntitySetName<T>() ?? DefaultEntitySetName;

            // make sure that the _generators hash table is accessible from this thread only
            lock (_sync)
            {
                if (_generators.TryGetValue(entitySetName, out var generator))
                    id = generator.GetId();
                // if GetId returns -1, we'll need a fresh generator from the database with its own new HighValue.

                if (id == -1L)
                {
                    generator = GetOrCreateFreshGenerator(entitySetName);
                    id = generator.GetId();
                }
            }

            return id;
        }

        long DoGetNew(
            Type objectsType,
            EFRepositoryBase efRepository)
        {
            if (objectsType == null)
                throw new ArgumentNullException(nameof(objectsType));
            if (efRepository == null)
                throw new ArgumentNullException(nameof(efRepository));

            long id = -1L;
            var entitySetName = efRepository.ObjectContext.GetEntitySetName(objectsType) ?? DefaultEntitySetName;

            // make sure that the _generators hash table is accessible from this thread only
            lock (_sync)
            {
                if (_generators.TryGetValue(entitySetName, out var generator))
                    id = generator.GetId();
                // if GetId returns -1, we'll need a fresh generator from the database with its own new HighValue.

                if (id == -1L)
                {
                    generator = GetOrCreateFreshGenerator(entitySetName);
                    id = generator.GetId();
                }
            }

            return id;
        }

        [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "will do on the way back.")]
        HiLoIdentityGenerator GetOrCreateFreshGenerator(
            string entitySetName)
        {
            if (entitySetName.IsNullOrWhiteSpace())
                throw new ArgumentException("The argument cannot be null, empty string or consist of whitespace characters only.", nameof(entitySetName));

            HiLoIdentityGenerator generator;

            // Start a new, independent serializable transaction and use a repository with a *transient* lifetime manager.
            // We don't want a failed external transaction to invalidate our in-memory generators.
            TransactionScope transactionScope = null;

            // open transaction scope if requested
            if (_useTransactionScope)
                transactionScope = new TransactionScope(
                                                DefaultTransactionScopeOption,
                                                new TransactionOptions
                                                {
                                                    IsolationLevel = DefaultIsolationLevel,
                                                    Timeout        = _defaultTransactionTimeout,
                                                });

            try
            {
                using (var repository = _generatorsRepositoryFactory())
                {
                    // get a fresh generator object from the DB
                    generator = repository
                                    .Entities<HiLoIdentityGenerator>()
                                    .FirstOrDefault(g => g.EntitySetName == entitySetName)
                                    ;

                    if (generator == null)
                    {
                        // create a new generator
                        generator = repository.CreateEntity<HiLoIdentityGenerator>();
                        generator.EntitySetName = entitySetName;

                        repository.Add(generator);
                    }

                    generator.IncrementHighValue();

                    repository.CommitChanges();
                    transactionScope?.Complete();
                }

                // now the newly loaded generator owns the range from (HighValue-1)*MaxLowValue to HighValue*(MaxLowValue-1).
                // replace the old generator in the hash table with the fresh one
                _generators[entitySetName] = generator;
                return generator;
            }
            finally
            {
                if (_useTransactionScope)
                    transactionScope.Dispose();
            }
        }
    }
}


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _TimeInput = require("./TimeInput");

Object.keys(_TimeInput).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  if (key in exports && exports[key] === _TimeInput[key]) return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function get() {
      return _TimeInput[key];
    }
  });
});
//# sourceMappingURL=index.js.map


text:
exports = module.exports = function (request, path) {
    return function (body, callback) {
        request
            .post(path)
            .send(query)
            .end(function (error, res) {
                if (error) return callback(error);
                if (res.status != 201) return callback('unexpected response code: ' + res.status);
                if (!res.body) return callback('no body');

                callback(null, res.body);
            });
    };
};


text:
@interface ConfirmStateIconView : UIView

@property (nonatomic, strong) NSString *confirm;

@end


text:
//
//  Header.h
//  GCDFetchFeed
//
//  Created by DaiMing on 16/1/26.
//  Copyright © 2016年 Starming. All rights reserved.
//

#ifndef Header_h
#define Header_h

#define NetworkingFetchOneFeedCompleteNotification   @"com.starming.networking.fetch.one.feed.complete"
#define NetworkingFetchAllFeedsCompleteNotification  @"com.starming.networking.fetch.All.feeds.complete"

#endif /* Header_h */


text:
Script API v |version|
======================

Cleaning & Rendering
--------------------
It's easy to include :py:class:`~pageit.render.Pageit` in your own scripts:

.. code-block:: python

    from pageit.render import Pageit
    Pageit(path='.').clean().run()

Watching for File Changes
-------------------------
Use :py:func:`~pageit.tools.watch` to call a
callback function when files change:

.. code-block:: python

    from pageit.tools import watch
    def my_func(path):
        print path, 'has changed'

    with watch(path='.', callback=my_func) as watcher:
        watcher.loop()  # wait for CTRL+C

.. seealso:: `watchdog`_ for the cross-platform directory-watching library

.. _watchdog: http://pythonhosted.org/watchdog/

Basic HTTP Server
-----------------
Use :py:func:`~pageit.tools.serve` to serve up files on a given port:

.. code-block:: python

    from pageit.tools import serve
    serve(path='.', port=80)  # will wait until CTRL+C

.. seealso:: Python's built-in `SimpleHTTPServer`_ for serving directories

.. _SimpleHTTPServer: http://docs.python.org/2/library/simplehttpserver.html

Watching & Serving
------------------
If you want to watch and serve a path:

.. code-block:: python

    from pageit.tools import watch, serve
    with watch(path, callback) as watcher:
        serve(path, port)  # wait for CTRL+C

Python Modules
--------------
.. toctree::
  :maxdepth: 2

  api/render
  api/tools
  api/namespace


text:
<?php
/**
 * Message translations.
 *
 * This file is automatically generated by 'yii message' command.
 * It contains the localizable messages extracted from source code.
 * You may modify this file by translating the extracted messages.
 *
 * Each array element represents the translation (value) of a message (key).
 * If the value is empty, the message is considered as not translated.
 * Messages that no longer need translation will have their translations
 * enclosed between a pair of '@@' marks.
 *
 * Message string can be used with plural forms format. Check i18n section
 * of the guide for details.
 *
 * NOTE: this file must be saved in UTF-8 encoding.
 */
return [
    'Registration successful' => '',
    'Registration successful!' => 'Registracija</strong</ sėkminga!',
    'Please check your email and follow the instructions!' => 'Prašome patikrinti savo elektroninį paštą ir sekite instrukcijas!',
    'back to home' => 'atgal į pradinį puslapį',
];


text:
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * Set of functions related to applying transformations for VIEWs
 *
 * @package PhpMyAdmin
 */
if (! defined('PHPMYADMIN')) {
    exit;
}

/**
 * Get the column details of VIEW with its original references
 *
 * @param string $sql_query    SQL for original resource
 * @param array  $view_columns Columns of VIEW if defined new column names
 *
 * @return array $column_map Details of VIEW columns
 */
function PMA_getColumnMap($sql_query, $view_columns)
{

    $column_map = array();
    // Select query which give results for VIEW
    $real_source_result = $GLOBALS['dbi']->tryQuery($sql_query);

    if ($real_source_result !== false) {

        $real_source_fields_meta = $GLOBALS['dbi']->getFieldsMeta(
            $real_source_result
        );

        $nbColumns = count($view_columns);
        $nbFields = count($real_source_fields_meta);
        if ($nbFields > 0) {

            for ($i=0; $i < $nbFields; $i++) {

                $map = array();
                $map['table_name'] = $real_source_fields_meta[$i]->table;
                $map['refering_column'] = $real_source_fields_meta[$i]->name;

                if ($nbColumns > 1) {
                    $map['real_column'] = $view_columns[$i];
                }

                $column_map[] = $map;

            }

        }

    }
    unset($real_source_result);

    return $column_map;

}

/**
 * Get existing data on tranformations applyed for
 * columns in a particular table
 *
 * @param string $db Database name looking for
 *
 * @return mysqli_result Result of executed SQL query
 */
function PMA_getExistingTranformationData($db)
{
    $cfgRelation = PMA_getRelationsParam();

    // Get the existing transformation details of the same database
    // from pma__column_info table
    $pma_transformation_sql = 'SELECT * FROM '
        . PMA_Util::backquote($cfgRelation['db']) . '.'
        . PMA_Util::backquote($cfgRelation['column_info'])
        . ' WHERE `db_name` = \''
        . PMA_Util::sqlAddSlashes($db) . '\'';

    return $GLOBALS['dbi']->tryQuery($pma_transformation_sql);

}

/**
 * Get SQL query for store new transformation details of a VIEW
 *
 * @param mysqli_result $pma_tranformation_data Result set of SQL execution
 * @param array         $column_map             Details of VIEW columns
 * @param string        $view_name              Name of the VIEW
 * @param string        $db                     Database name of the VIEW
 *
 * @return string $new_transformations_sql SQL query for new tranformations
 */
function PMA_getNewTransformationDataSql(
    $pma_tranformation_data, $column_map, $view_name, $db
) {
    $cfgRelation = PMA_getRelationsParam();

    // Need to store new transformation details for VIEW
    $new_transformations_sql = 'INSERT INTO '
        . PMA_Util::backquote($cfgRelation['db']) . '.'
        . PMA_Util::backquote($cfgRelation['column_info'])
        . ' (`db_name`, `table_name`, `column_name`, `comment`, '
        . '`mimetype`, `transformation`, `transformation_options`)'
        . ' VALUES ';

    $column_count = 0;
    $add_comma = false;

    while ($data_row = $GLOBALS['dbi']->fetchAssoc($pma_tranformation_data)) {

        foreach ($column_map as $column) {

            if ($data_row['table_name'] == $column['table_name']
                && $data_row['column_name'] == $column['refering_column']
            ) {

                $new_transformations_sql .= $add_comma ? ', ' : '';

                $new_transformations_sql .= '('
                    . '\'' . $db . '\', '
                    . '\'' . $view_name . '\', '
                    . '\'';

                $new_transformations_sql .= (isset($column['real_column']))
                        ? $column['real_column']
                        : $column['refering_column'];

                $new_transformations_sql .= '\', '
                    . '\'' . $data_row['comment'] . '\', '
                    . '\'' . $data_row['mimetype'] . '\', '
                    . '\'' . $data_row['transformation'] . '\', '
                    . '\''
                    . PMA_Util::sqlAddSlashes(
                        $data_row['transformation_options']
                    )
                    . '\')';

                $add_comma = true;
                $column_count++;
                break;

            }

        }

        if ($column_count == count($column_map)) {
            break;
        }

    }

    return ($column_count > 0) ? $new_transformations_sql : '';

}

?>


text:
/**
 * Created by maluramichael on 18/08/16.
 */
export const MAIN = '#444';
export const YELLOW = 'yellow';
export const AQUA = 'aqua';
export const GOLD = 'gold';
export const GRAY = 'gray';
export const WHITE = 'white';
export const ORANGE = 'orange';
export const BLUE = 'blue';
export const RED = 'red';
export const GREEN = 'green';

// social media
export const GOOGLE = '#F03C28';
export const FACEBOOK = '#4D58B3';


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

import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import io.airlift.slice.Slice;
import io.prestosql.memory.context.AggregatedMemoryContext;
import io.prestosql.orc.checkpoint.InvalidCheckpointException;
import io.prestosql.orc.checkpoint.StreamCheckpoint;
import io.prestosql.orc.metadata.ColumnEncoding;
import io.prestosql.orc.metadata.ColumnEncoding.ColumnEncodingKind;
import io.prestosql.orc.metadata.ColumnMetadata;
import io.prestosql.orc.metadata.MetadataReader;
import io.prestosql.orc.metadata.OrcColumnId;
import io.prestosql.orc.metadata.OrcType;
import io.prestosql.orc.metadata.OrcType.OrcTypeKind;
import io.prestosql.orc.metadata.PostScript.HiveWriterVersion;
import io.prestosql.orc.metadata.RowGroupIndex;
import io.prestosql.orc.metadata.Stream;
import io.prestosql.orc.metadata.StripeFooter;
import io.prestosql.orc.metadata.StripeInformation;
import io.prestosql.orc.metadata.statistics.BloomFilter;
import io.prestosql.orc.metadata.statistics.ColumnStatistics;
import io.prestosql.orc.stream.InputStreamSource;
import io.prestosql.orc.stream.InputStreamSources;
import io.prestosql.orc.stream.OrcChunkLoader;
import io.prestosql.orc.stream.OrcDataReader;
import io.prestosql.orc.stream.OrcInputStream;
import io.prestosql.orc.stream.ValueInputStream;
import io.prestosql.orc.stream.ValueInputStreamSource;
import io.prestosql.orc.stream.ValueStreams;

import java.io.IOException;
import java.io.InputStream;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.OptionalInt;
import java.util.Set;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.ImmutableMap.toImmutableMap;
import static io.prestosql.orc.checkpoint.Checkpoints.getDictionaryStreamCheckpoint;
import static io.prestosql.orc.checkpoint.Checkpoints.getStreamCheckpoints;
import static io.prestosql.orc.metadata.ColumnEncoding.ColumnEncodingKind.DICTIONARY;
import static io.prestosql.orc.metadata.ColumnEncoding.ColumnEncodingKind.DICTIONARY_V2;
import static io.prestosql.orc.metadata.Stream.StreamKind.BLOOM_FILTER;
import static io.prestosql.orc.metadata.Stream.StreamKind.BLOOM_FILTER_UTF8;
import static io.prestosql.orc.metadata.Stream.StreamKind.DICTIONARY_COUNT;
import static io.prestosql.orc.metadata.Stream.StreamKind.DICTIONARY_DATA;
import static io.prestosql.orc.metadata.Stream.StreamKind.LENGTH;
import static io.prestosql.orc.metadata.Stream.StreamKind.ROW_INDEX;
import static io.prestosql.orc.stream.CheckpointInputStreamSource.createCheckpointStreamSource;
import static java.lang.Math.toIntExact;
import static java.util.Objects.requireNonNull;

public class StripeReader
{
    private final OrcDataSource orcDataSource;
    private final ZoneId legacyFileTimeZone;
    private final Optional<OrcDecompressor> decompressor;
    private final ColumnMetadata<OrcType> types;
    private final HiveWriterVersion hiveWriterVersion;
    private final Set<OrcColumnId> includedOrcColumnIds;
    private final OptionalInt rowsInRowGroup;
    private final OrcPredicate predicate;
    private final MetadataReader metadataReader;
    private final Optional<OrcWriteValidation> writeValidation;

    public StripeReader(
            OrcDataSource orcDataSource,
            ZoneId legacyFileTimeZone,
            Optional<OrcDecompressor> decompressor,
            ColumnMetadata<OrcType> types,
            Set<OrcColumn> readColumns,
            OptionalInt rowsInRowGroup,
            OrcPredicate predicate,
            HiveWriterVersion hiveWriterVersion,
            MetadataReader metadataReader,
            Optional<OrcWriteValidation> writeValidation)
    {
        this.orcDataSource = requireNonNull(orcDataSource, "orcDataSource is null");
        this.legacyFileTimeZone = requireNonNull(legacyFileTimeZone, "legacyFileTimeZone is null");
        this.decompressor = requireNonNull(decompressor, "decompressor is null");
        this.types = requireNonNull(types, "types is null");
        this.includedOrcColumnIds = getIncludeColumns(requireNonNull(readColumns, "readColumns is null"));
        this.rowsInRowGroup = rowsInRowGroup;
        this.predicate = requireNonNull(predicate, "predicate is null");
        this.hiveWriterVersion = requireNonNull(hiveWriterVersion, "hiveWriterVersion is null");
        this.metadataReader = requireNonNull(metadataReader, "metadataReader is null");
        this.writeValidation = requireNonNull(writeValidation, "writeValidation is null");
    }

    public Stripe readStripe(StripeInformation stripe, AggregatedMemoryContext systemMemoryUsage)
            throws IOException
    {
        // read the stripe footer
        StripeFooter stripeFooter = readStripeFooter(stripe, systemMemoryUsage);
        ColumnMetadata<ColumnEncoding> columnEncodings = stripeFooter.getColumnEncodings();
        if (writeValidation.isPresent()) {
            writeValidation.get().validateTimeZone(orcDataSource.getId(), stripeFooter.getTimeZone());
        }
        ZoneId fileTimeZone = stripeFooter.getTimeZone();

        // get streams for selected columns
        Map<StreamId, Stream> streams = new HashMap<>();
        for (Stream stream : stripeFooter.getStreams()) {
            if (includedOrcColumnIds.contains(stream.getColumnId()) && isSupportedStreamType(stream, types.get(stream.getColumnId()).getOrcTypeKind())) {
                streams.put(new StreamId(stream), stream);
            }
        }

        // handle stripes with more than one row group
        boolean invalidCheckPoint = false;
        if (rowsInRowGroup.isPresent() && stripe.getNumberOfRows() > rowsInRowGroup.getAsInt()) {
            // determine ranges of the stripe to read
            Map<StreamId, DiskRange> diskRanges = getDiskRanges(stripeFooter.getStreams());
            diskRanges = Maps.filterKeys(diskRanges, Predicates.in(streams.keySet()));

            // read the file regions
            Map<StreamId, OrcChunkLoader> streamsData = readDiskRanges(stripe.getOffset(), diskRanges, systemMemoryUsage);

            // read the bloom filter for each column
            Map<OrcColumnId, List<BloomFilter>> bloomFilterIndexes = readBloomFilterIndexes(streams, streamsData);

            // read the row index for each column
            Map<StreamId, List<RowGroupIndex>> columnIndexes = readColumnIndexes(streams, streamsData, bloomFilterIndexes);
            if (writeValidation.isPresent()) {
                writeValidation.get().validateRowGroupStatistics(orcDataSource.getId(), stripe.getOffset(), columnIndexes);
            }

            // select the row groups matching the tuple domain
            Set<Integer> selectedRowGroups = selectRowGroups(stripe, columnIndexes);

            // if all row groups are skipped, return null
            if (selectedRowGroups.isEmpty()) {
                // set accounted memory usage to zero
                systemMemoryUsage.close();
                return null;
            }

            // value streams
            Map<StreamId, ValueInputStream<?>> valueStreams = createValueStreams(streams, streamsData, columnEncodings);

            // build the dictionary streams
            InputStreamSources dictionaryStreamSources = createDictionaryStreamSources(streams, valueStreams, columnEncodings);

            // build the row groups
            try {
                List<RowGroup> rowGroups = createRowGroups(
                        stripe.getNumberOfRows(),
                        streams,
                        valueStreams,
                        columnIndexes,
                        selectedRowGroups,
                        columnEncodings);

                return new Stripe(stripe.getNumberOfRows(), fileTimeZone, columnEncodings, rowGroups, dictionaryStreamSources);
            }
            catch (InvalidCheckpointException e) {
                // The ORC file contains a corrupt checkpoint stream treat the stripe as a single row group.
                invalidCheckPoint = true;
            }
        }

        // stripe only has one row group
        ImmutableMap.Builder<StreamId, DiskRange> diskRangesBuilder = ImmutableMap.builder();
        for (Entry<StreamId, DiskRange> entry : getDiskRanges(stripeFooter.getStreams()).entrySet()) {
            StreamId streamId = entry.getKey();
            if (streams.containsKey(streamId)) {
                diskRangesBuilder.put(entry);
            }
        }
        ImmutableMap<StreamId, DiskRange> diskRanges = diskRangesBuilder.build();

        // read the file regions
        Map<StreamId, OrcChunkLoader> streamsData = readDiskRanges(stripe.getOffset(), diskRanges, systemMemoryUsage);

        long minAverageRowBytes = 0;
        for (Entry<StreamId, Stream> entry : streams.entrySet()) {
            if (entry.getKey().getStreamKind() == ROW_INDEX) {
                List<RowGroupIndex> rowGroupIndexes = metadataReader.readRowIndexes(hiveWriterVersion, new OrcInputStream(streamsData.get(entry.getKey())));
                checkState(rowGroupIndexes.size() == 1 || invalidCheckPoint, "expect a single row group or an invalid check point");
                long totalBytes = 0;
                long totalRows = 0;
                for (RowGroupIndex rowGroupIndex : rowGroupIndexes) {
                    ColumnStatistics columnStatistics = rowGroupIndex.getColumnStatistics();
                    if (columnStatistics.hasMinAverageValueSizeInBytes()) {
                        totalBytes += columnStatistics.getMinAverageValueSizeInBytes() * columnStatistics.getNumberOfValues();
                        totalRows += columnStatistics.getNumberOfValues();
                    }
                }
                if (totalRows > 0) {
                    minAverageRowBytes += totalBytes / totalRows;
                }
            }
        }

        // value streams
        Map<StreamId, ValueInputStream<?>> valueStreams = createValueStreams(streams, streamsData, columnEncodings);

        // build the dictionary streams
        InputStreamSources dictionaryStreamSources = createDictionaryStreamSources(streams, valueStreams, columnEncodings);

        // build the row group
        ImmutableMap.Builder<StreamId, InputStreamSource<?>> builder = ImmutableMap.builder();
        for (Entry<StreamId, ValueInputStream<?>> entry : valueStreams.entrySet()) {
            builder.put(entry.getKey(), new ValueInputStreamSource<>(entry.getValue()));
        }
        RowGroup rowGroup = new RowGroup(0, 0, stripe.getNumberOfRows(), minAverageRowBytes, new InputStreamSources(builder.build()));

        return new Stripe(stripe.getNumberOfRows(), fileTimeZone, columnEncodings, ImmutableList.of(rowGroup), dictionaryStreamSources);
    }

    private static boolean isSupportedStreamType(Stream stream, OrcTypeKind orcTypeKind)
    {
        if (stream.getStreamKind() == BLOOM_FILTER) {
            // non-utf8 bloom filters are not allowed for character types
            // non-utf8 bloom filters are not supported for timestamp
            switch (orcTypeKind) {
                case STRING:
                case VARCHAR:
                case CHAR:
                case TIMESTAMP:
                case TIMESTAMP_INSTANT:
                    return false;
            }
            return true;
        }
        if (stream.getStreamKind() == BLOOM_FILTER_UTF8) {
            // char types require padding for bloom filters, which is not supported
            return orcTypeKind != OrcTypeKind.CHAR;
        }
        return true;
    }

    private Map<StreamId, OrcChunkLoader> readDiskRanges(long stripeOffset, Map<StreamId, DiskRange> diskRanges, AggregatedMemoryContext systemMemoryUsage)
            throws IOException
    {
        //
        // Note: this code does not use the stream APIs to avoid any extra object allocation
        //

        // transform ranges to have an absolute offset in file
        ImmutableMap.Builder<StreamId, DiskRange> diskRangesBuilder = ImmutableMap.builder();
        for (Entry<StreamId, DiskRange> entry : diskRanges.entrySet()) {
            DiskRange diskRange = entry.getValue();
            diskRangesBuilder.put(entry.getKey(), new DiskRange(stripeOffset + diskRange.getOffset(), diskRange.getLength()));
        }
        diskRanges = diskRangesBuilder.build();

        // read ranges
        Map<StreamId, OrcDataReader> streamsData = orcDataSource.readFully(diskRanges);

        // transform streams to OrcInputStream
        ImmutableMap.Builder<StreamId, OrcChunkLoader> dataBuilder = ImmutableMap.builder();
        for (Entry<StreamId, OrcDataReader> entry : streamsData.entrySet()) {
            dataBuilder.put(entry.getKey(), OrcChunkLoader.create(entry.getValue(), decompressor, systemMemoryUsage));
        }
        return dataBuilder.build();
    }

    private Map<StreamId, ValueInputStream<?>> createValueStreams(Map<StreamId, Stream> streams, Map<StreamId, OrcChunkLoader> streamsData, ColumnMetadata<ColumnEncoding> columnEncodings)
    {
        ImmutableMap.Builder<StreamId, ValueInputStream<?>> valueStreams = ImmutableMap.builder();
        for (Entry<StreamId, Stream> entry : streams.entrySet()) {
            StreamId streamId = entry.getKey();
            Stream stream = entry.getValue();
            ColumnEncodingKind columnEncoding = columnEncodings.get(stream.getColumnId()).getColumnEncodingKind();

            // skip index and empty streams
            if (isIndexStream(stream) || stream.getLength() == 0) {
                continue;
            }

            OrcChunkLoader chunkLoader = streamsData.get(streamId);
            OrcTypeKind columnType = types.get(stream.getColumnId()).getOrcTypeKind();

            valueStreams.put(streamId, ValueStreams.createValueStreams(streamId, chunkLoader, columnType, columnEncoding));
        }
        return valueStreams.build();
    }

    private InputStreamSources createDictionaryStreamSources(Map<StreamId, Stream> streams, Map<StreamId, ValueInputStream<?>> valueStreams, ColumnMetadata<ColumnEncoding> columnEncodings)
    {
        ImmutableMap.Builder<StreamId, InputStreamSource<?>> dictionaryStreamBuilder = ImmutableMap.builder();
        for (Entry<StreamId, Stream> entry : streams.entrySet()) {
            StreamId streamId = entry.getKey();
            Stream stream = entry.getValue();
            OrcColumnId column = stream.getColumnId();

            // only process dictionary streams
            ColumnEncodingKind columnEncoding = columnEncodings.get(column).getColumnEncodingKind();
            if (!isDictionary(stream, columnEncoding)) {
                continue;
            }

            // skip streams without data
            ValueInputStream<?> valueStream = valueStreams.get(streamId);
            if (valueStream == null) {
                continue;
            }

            OrcTypeKind columnType = types.get(stream.getColumnId()).getOrcTypeKind();
            StreamCheckpoint streamCheckpoint = getDictionaryStreamCheckpoint(streamId, columnType, columnEncoding);

            InputStreamSource<?> streamSource = createCheckpointStreamSource(valueStream, streamCheckpoint);
            dictionaryStreamBuilder.put(streamId, streamSource);
        }
        return new InputStreamSources(dictionaryStreamBuilder.build());
    }

    private List<RowGroup> createRowGroups(
            int rowsInStripe,
            Map<StreamId, Stream> streams,
            Map<StreamId, ValueInputStream<?>> valueStreams,
            Map<StreamId, List<RowGroupIndex>> columnIndexes,
            Set<Integer> selectedRowGroups,
            ColumnMetadata<ColumnEncoding> encodings)
            throws InvalidCheckpointException
    {
        int rowsInRowGroup = this.rowsInRowGroup.orElseThrow(() -> new IllegalStateException("Cannot create row groups if row group info is missing"));
        ImmutableList.Builder<RowGroup> rowGroupBuilder = ImmutableList.builder();

        for (int rowGroupId : selectedRowGroups) {
            Map<StreamId, StreamCheckpoint> checkpoints = getStreamCheckpoints(includedOrcColumnIds, types, decompressor.isPresent(), rowGroupId, encodings, streams, columnIndexes);
            int rowOffset = rowGroupId * rowsInRowGroup;
            int rowsInGroup = Math.min(rowsInStripe - rowOffset, rowsInRowGroup);
            long minAverageRowBytes = columnIndexes
                    .entrySet()
                    .stream()
                    .mapToLong(e -> e.getValue()
                            .get(rowGroupId)
                            .getColumnStatistics()
                            .getMinAverageValueSizeInBytes())
                    .sum();
            rowGroupBuilder.add(createRowGroup(rowGroupId, rowOffset, rowsInGroup, minAverageRowBytes, valueStreams, checkpoints));
        }

        return rowGroupBuilder.build();
    }

    private static RowGroup createRowGroup(int groupId, int rowOffset, int rowCount, long minAverageRowBytes, Map<StreamId, ValueInputStream<?>> valueStreams, Map<StreamId, StreamCheckpoint> checkpoints)
    {
        ImmutableMap.Builder<StreamId, InputStreamSource<?>> builder = ImmutableMap.builder();
        for (Entry<StreamId, StreamCheckpoint> entry : checkpoints.entrySet()) {
            StreamId streamId = entry.getKey();
            StreamCheckpoint checkpoint = entry.getValue();

            // skip streams without data
            ValueInputStream<?> valueStream = valueStreams.get(streamId);
            if (valueStream == null) {
                continue;
            }

            builder.put(streamId, createCheckpointStreamSource(valueStream, checkpoint));
        }
        InputStreamSources rowGroupStreams = new InputStreamSources(builder.build());
        return new RowGroup(groupId, rowOffset, rowCount, minAverageRowBytes, rowGroupStreams);
    }

    private StripeFooter readStripeFooter(StripeInformation stripe, AggregatedMemoryContext systemMemoryUsage)
            throws IOException
    {
        long offset = stripe.getOffset() + stripe.getIndexLength() + stripe.getDataLength();
        int tailLength = toIntExact(stripe.getFooterLength());

        // read the footer
        Slice tailBuffer = orcDataSource.readFully(offset, tailLength);
        try (InputStream inputStream = new OrcInputStream(OrcChunkLoader.create(orcDataSource.getId(), tailBuffer, decompressor, systemMemoryUsage))) {
            return metadataReader.readStripeFooter(types, inputStream, legacyFileTimeZone);
        }
    }

    static boolean isIndexStream(Stream stream)
    {
        return stream.getStreamKind() == ROW_INDEX || stream.getStreamKind() == DICTIONARY_COUNT || stream.getStreamKind() == BLOOM_FILTER || stream.getStreamKind() == BLOOM_FILTER_UTF8;
    }

    private Map<OrcColumnId, List<BloomFilter>> readBloomFilterIndexes(Map<StreamId, Stream> streams, Map<StreamId, OrcChunkLoader> streamsData)
            throws IOException
    {
        HashMap<OrcColumnId, List<BloomFilter>> bloomFilters = new HashMap<>();
        for (Entry<StreamId, Stream> entry : streams.entrySet()) {
            Stream stream = entry.getValue();
            if (stream.getStreamKind() == BLOOM_FILTER_UTF8) {
                OrcInputStream inputStream = new OrcInputStream(streamsData.get(entry.getKey()));
                bloomFilters.put(stream.getColumnId(), metadataReader.readBloomFilterIndexes(inputStream));
            }
        }
        for (Entry<StreamId, Stream> entry : streams.entrySet()) {
            Stream stream = entry.getValue();
            if (stream.getStreamKind() == BLOOM_FILTER && !bloomFilters.containsKey(stream.getColumnId())) {
                OrcInputStream inputStream = new OrcInputStream(streamsData.get(entry.getKey()));
                bloomFilters.put(entry.getKey().getColumnId(), metadataReader.readBloomFilterIndexes(inputStream));
            }
        }
        return ImmutableMap.copyOf(bloomFilters);
    }

    private Map<StreamId, List<RowGroupIndex>> readColumnIndexes(Map<StreamId, Stream> streams, Map<StreamId, OrcChunkLoader> streamsData, Map<OrcColumnId, List<BloomFilter>> bloomFilterIndexes)
            throws IOException
    {
        ImmutableMap.Builder<StreamId, List<RowGroupIndex>> columnIndexes = ImmutableMap.builder();
        for (Entry<StreamId, Stream> entry : streams.entrySet()) {
            Stream stream = entry.getValue();
            if (stream.getStreamKind() == ROW_INDEX) {
                OrcInputStream inputStream = new OrcInputStream(streamsData.get(entry.getKey()));
                List<BloomFilter> bloomFilters = bloomFilterIndexes.get(entry.getKey().getColumnId());
                List<RowGroupIndex> rowGroupIndexes = metadataReader.readRowIndexes(hiveWriterVersion, inputStream);
                if (bloomFilters != null && !bloomFilters.isEmpty()) {
                    ImmutableList.Builder<RowGroupIndex> newRowGroupIndexes = ImmutableList.builder();
                    for (int i = 0; i < rowGroupIndexes.size(); i++) {
                        RowGroupIndex rowGroupIndex = rowGroupIndexes.get(i);
                        ColumnStatistics columnStatistics = rowGroupIndex.getColumnStatistics()
                                .withBloomFilter(bloomFilters.get(i));
                        newRowGroupIndexes.add(new RowGroupIndex(rowGroupIndex.getPositions(), columnStatistics));
                    }
                    rowGroupIndexes = newRowGroupIndexes.build();
                }
                columnIndexes.put(entry.getKey(), rowGroupIndexes);
            }
        }
        return columnIndexes.build();
    }

    private Set<Integer> selectRowGroups(StripeInformation stripe, Map<StreamId, List<RowGroupIndex>> columnIndexes)
    {
        int rowsInRowGroup = this.rowsInRowGroup.orElseThrow(() -> new IllegalStateException("Cannot create row groups if row group info is missing"));

        int rowsInStripe = stripe.getNumberOfRows();
        int groupsInStripe = ceil(rowsInStripe, rowsInRowGroup);

        ImmutableSet.Builder<Integer> selectedRowGroups = ImmutableSet.builder();
        int remainingRows = rowsInStripe;
        for (int rowGroup = 0; rowGroup < groupsInStripe; ++rowGroup) {
            int rows = Math.min(remainingRows, rowsInRowGroup);
            ColumnMetadata<ColumnStatistics> statistics = getRowGroupStatistics(types, columnIndexes, rowGroup);
            if (predicate.matches(rows, statistics)) {
                selectedRowGroups.add(rowGroup);
            }
            remainingRows -= rows;
        }
        return selectedRowGroups.build();
    }

    private static ColumnMetadata<ColumnStatistics> getRowGroupStatistics(ColumnMetadata<OrcType> types, Map<StreamId, List<RowGroupIndex>> columnIndexes, int rowGroup)
    {
        requireNonNull(columnIndexes, "columnIndexes is null");
        checkArgument(rowGroup >= 0, "rowGroup is negative");

        Map<Integer, List<RowGroupIndex>> rowGroupIndexesByColumn = columnIndexes.entrySet().stream()
                .collect(toImmutableMap(entry -> entry.getKey().getColumnId().getId(), Entry::getValue));

        List<ColumnStatistics> statistics = new ArrayList<>(types.size());
        for (int columnIndex = 0; columnIndex < types.size(); columnIndex++) {
            List<RowGroupIndex> rowGroupIndexes = rowGroupIndexesByColumn.get(columnIndex);
            if (rowGroupIndexes != null) {
                statistics.add(rowGroupIndexes.get(rowGroup).getColumnStatistics());
            }
            else {
                statistics.add(null);
            }
        }
        return new ColumnMetadata<>(statistics);
    }

    private static boolean isDictionary(Stream stream, ColumnEncodingKind columnEncoding)
    {
        return stream.getStreamKind() == DICTIONARY_DATA || (stream.getStreamKind() == LENGTH && (columnEncoding == DICTIONARY || columnEncoding == DICTIONARY_V2));
    }

    private static Map<StreamId, DiskRange> getDiskRanges(List<Stream> streams)
    {
        ImmutableMap.Builder<StreamId, DiskRange> streamDiskRanges = ImmutableMap.builder();
        long stripeOffset = 0;
        for (Stream stream : streams) {
            int streamLength = stream.getLength();
            // ignore zero byte streams
            if (streamLength > 0) {
                streamDiskRanges.put(new StreamId(stream), new DiskRange(stripeOffset, streamLength));
            }
            stripeOffset += streamLength;
        }
        return streamDiskRanges.build();
    }

    private static Set<OrcColumnId> getIncludeColumns(Set<OrcColumn> includedColumns)
    {
        Set<OrcColumnId> result = new LinkedHashSet<>();
        includeColumnsRecursive(result, includedColumns);
        return result;
    }

    private static void includeColumnsRecursive(Set<OrcColumnId> result, Collection<OrcColumn> readColumns)
    {
        for (OrcColumn column : readColumns) {
            result.add(column.getColumnId());
            includeColumnsRecursive(result, column.getNestedColumns());
        }
    }

    /**
     * Ceiling of integer division
     */
    private static int ceil(int dividend, int divisor)
    {
        return ((dividend + divisor) - 1) / divisor;
    }
}


text:
var searchData=
[
  ['debugmessagedispatchhandler',['DebugMessageDispatchHandler',['../classv8_1_1Debug.html#a91cd8aa9743e3478bc63fe73abcd557c',1,'v8::Debug']]]
];


text:
package com.alibaba.dubbo.examples.nospring.api;

public interface NoSpringService {

	public String sayHello(String name);
}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class loginModel extends CI_Model {

    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
        $this->load->database();
    }

    public function logeo($arg1) {
        return $this->db->query("SELECT
									usuarios.usuario,
									usuarios.id_nivel,
									usuarios.id_sucursal,
									usuarios.pass,
									sucursales.prefijo
								 FROM usuarios
                                    LEFT JOIN sucursales ON sucursales.id=usuarios.id_sucursal
                                 WHERE
								 	usuarios.usuario='".$this->db->escape_str($arg1)."'
									AND
									usuarios.status=1
								 LIMIT 1");
    }

    public function acceso($arg,$arg2) {
        //insertar a la base de datos
            $data_table = array(
                'usuario' => $arg,
                'ip' => $this->getRealIP(),
                'fecha' => date("Y-m-d"),
                'hora' => date('H:m:s'),
                'sucursal' => $arg2
             );
            $this->db->insert('accesos', $data_table);
    }

	public function permisos($arg1) {
        $query_result=$this->db->query("SELECT
											id_submenu
										 FROM
										 	niveles
		                                 WHERE
										 	id=".$arg1."
										 LIMIT 1")->result();
		$cadena=str_replace("*","|",$query_result[0]->id_submenu);
		return explode("|", $cadena);
    }

    function getRealIP() {
        if (isset($_SERVER["HTTP_CLIENT_IP"]))
		{
			return $_SERVER["HTTP_CLIENT_IP"];
		}
		elseif (isset($_SERVER["HTTP_X_FORWARDED_FOR"]))
		{
			return $_SERVER["HTTP_X_FORWARDED_FOR"];
		}
		elseif (isset($_SERVER["HTTP_X_FORWARDED"]))
		{
			return $_SERVER["HTTP_X_FORWARDED"];
		}
		elseif (isset($_SERVER["HTTP_FORWARDED_FOR"]))
		{
			return $_SERVER["HTTP_FORWARDED_FOR"];
		}
		elseif (isset($_SERVER["HTTP_FORWARDED"]))
		{
			return $_SERVER["HTTP_FORWARDED"];
		}
		else
		{
			return $_SERVER["REMOTE_ADDR"];
		}
    }
    /*
    public function get_mysqli() {
        $db = (array)get_instance()->db;
        return mysqli_connect('localhost', $db['username'], $db['password'], $db['database']);
    }
	*/
    function __destruct(){
        $this->db->close();
    }
}


text:
package com.workshop.rest.security;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity;

@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
            .authorizeRequests()
                .anyRequest().authenticated()
                .and().httpBasic()
                .and().csrf().disable();
    }

    @Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
        auth
            .inMemoryAuthentication()
            .withUser("user").password("user").roles("USER");
    }
}


text:
import VForm from './VForm'

/* istanbul ignore next */
VForm.install = function install (Vue) {
  Vue.component(VForm.name, VForm)
}

export default VForm


text:
<resources>
	<string name="app_name">NiconicoLiveInfoHelper</string>

	<string name="action_settings">Settings</string>
	<string name="empty_publish">No publish info</string>
	<string name="address">Mail address:</string>
	<string name="password">Password:</string>
	<string name="save_password">Save password</string>
	<string name="get_info">Get Info</string>
	<string name="err_login">Failed login\nPlease confirm your account informations</string>
	<string name="err_get">Failed to get publish status</string>
</resources>


text:
    <modal title="删除代码生成器信息">

            <button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>
            Warning! 请确定是否删除,一旦删除,数据将无法恢复!

                {{ item.title}}
                {{ item.value}}

    </modal>


text:
<meta charset="UTF-8">
<title>CrashConfig.Builder.versionStr - RichUtils</title>
<link rel="stylesheet" href="../../../../style.css">

RichUtils / pyxis.uzuki.live.richutilskt.module.crash / CrashConfig / Builder / versionStr

versionStr

var versionStr: String


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

<title>HistoryController</title>
<meta name="date" content="2016-07-02">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

sotechat.controller

Class HistoryController

java.lang.Object

sotechat.controller.HistoryController

@RestController
public class HistoryController
extends java.lang.Object

Reititys ammattilaiskayttajan historian selaamiseen liittyville pyynnoille.

Constructor Summary

Constructors

Constructor and Description

HistoryController(ValidatorService pValidatorService,
                 ChatLogger pChatLogger,
                 SessionRepo pSessionRepo)

Konstruktori.

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

java.util.List<ConvInfo>
getConversations(java.security.Principal professional,
                javax.servlet.http.HttpServletRequest req)

Client pyytaa listauksen vanhoista keskusteluistaan.

java.util.List<MsgToClient>
getMessages(java.lang.String channelId,
           javax.servlet.http.HttpServletRequest req,
           java.security.Principal pro)

Client pyytaa tietyn kanavan vanhoja viesteja.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HistoryController

@Autowired
public HistoryController(ValidatorService pValidatorService,
                                    ChatLogger pChatLogger,
                                    SessionRepo pSessionRepo)

Konstruktori.

Parameters:

pValidatorService - p

pChatLogger - p

pSessionRepo - p

Method Detail

getMessages

@RequestMapping(value="/getLogs/{channelId}",
                method=GET)
 @ResponseBody
public final java.util.List<MsgToClient> getMessages(@PathVariable(value="channelId")
                                                                                java.lang.String channelId,
                                                                                javax.servlet.http.HttpServletRequest req,
                                                                                java.security.Principal pro)

Client pyytaa tietyn kanavan vanhoja viesteja.

Parameters:

pro - Autentikaatiotiedot.

req - Pyynto.

channelId - Kanavatunnus.

Returns:

Vanhat viestit, jos clientilla oikeus niihin.
 Muuten null.

getConversations

@RequestMapping(value="/listMyConversations/",
                method=GET)
 @ResponseBody
public final java.util.List<ConvInfo> getConversations(java.security.Principal professional,
                                                                                javax.servlet.http.HttpServletRequest req)

Client pyytaa listauksen vanhoista keskusteluistaan.

Parameters:

professional - Autentikointitiedot.

req - Pyynto.

Returns:

Vanhat keskustelut, jos client autentikoitinut.
 Muuten null.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
package com.google.errorprone.bugpatterns.time;

import com.google.errorprone.CompilationTestHelper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/** Tests for {@link JodaConstructors}. */
@RunWith(JUnit4.class)
public class JodaConstructorsTest {
  private final CompilationTestHelper helper =
      CompilationTestHelper.newInstance(JodaConstructors.class, getClass());

  @Test
  public void durationStaticFactories() {
    helper
        .addSourceLines(
            "TestClass.java",
            "import org.joda.time.Duration;",
            "public class TestClass {",
            "  private static final Duration ONE_MILLI = Duration.millis(1);",
            "  private static final Duration ONE_SEC = Duration.standardSeconds(1);",
            "  private static final Duration ONE_MIN = Duration.standardMinutes(1);",
            "  private static final Duration ONE_HOUR = Duration.standardHours(1);",
            "  private static final Duration ONE_DAY = Duration.standardDays(1);",
            "}")
        .doTest();
  }

  @Test
  public void durationConstructorObject() {
    helper
        .addSourceLines(
            "TestClass.java",
            "import org.joda.time.Duration;",
            "public class TestClass {",
            "  private static final Duration ONE_MILLI = new Duration(\"1\");",
            "}")
        .doTest();
  }

  @Test
  public void durationConstructorIntInt() {
    helper
        .addSourceLines(
            "TestClass.java",
            "import org.joda.time.Duration;",
            "public class TestClass {",
            "  private static final Duration INTERVAL = new Duration(42, 48);",
            "}")
        .doTest();
  }

  @Test
  public void durationConstructorIntLong() {
    helper
        .addSourceLines(
            "TestClass.java",
            "import org.joda.time.Duration;",
            "public class TestClass {",
            "  private static final Duration INTERVAL = new Duration(42, 48L);",
            "}")
        .doTest();
  }

  @Test
  public void durationConstructorLongInt() {
    helper
        .addSourceLines(
            "TestClass.java",
            "import org.joda.time.Duration;",
            "public class TestClass {",
            "  private static final Duration INTERVAL = new Duration(42L, 48);",
            "}")
        .doTest();
  }

  @Test
  public void durationConstructorLongLong() {
    helper
        .addSourceLines(
            "TestClass.java",
            "import org.joda.time.Duration;",
            "public class TestClass {",
            "  private static final Duration INTERVAL = new Duration(42L, 48L);",
            "}")
        .doTest();
  }

  @Test
  public void durationConstructorIntPrimitive() {
    helper
        .addSourceLines(
            "TestClass.java",
            "import org.joda.time.Duration;",
            "public class TestClass {",
            "  // BUG: Diagnostic contains: Duration ONE_MILLI = Duration.millis(1);",
            "  private static final Duration ONE_MILLI = new Duration(1);",
            "}")
        .doTest();
  }

  @Test
  public void durationConstructorInteger() {
    // TODO(kak): This really should be an error too :(
    helper
        .addSourceLines(
            "TestClass.java",
            "import org.joda.time.Duration;",
            "public class TestClass {",
            "  private static final Duration ONE_MILLI = new Duration(Integer.valueOf(42));",
            "}")
        .doTest();
  }

  @Test
  public void durationConstructorLongPrimitive() {
    helper
        .addSourceLines(
            "TestClass.java",
            "import org.joda.time.Duration;",
            "public class TestClass {",
            "  // BUG: Diagnostic contains: Duration ONE_MILLI = Duration.millis(1L);",
            "  private static final Duration ONE_MILLI = new Duration(1L);",
            "}")
        .doTest();
  }

  @Test
  public void durationConstructorLongPrimitiveInsideJoda() {
    helper
        .addSourceLines(
            "TestClass.java",
            "package org.joda.time;",
            "public class TestClass {",
            "  private static final Duration ONE_MILLI = new Duration(1L);",
            "}")
        .doTest();
  }

  @Test
  public void durationConstructorLongPrimitiveNoImport() {
    helper
        .addSourceLines(
            "TestClass.java",
            "public class TestClass {",
            "  private static final org.joda.time.Duration ONE_MILLI = ",
            "      // BUG: Diagnostic contains: Did you mean 'org.joda.time.Duration.millis(1L);'",
            "      new org.joda.time.Duration(1L);",
            "}")
        .doTest();
  }

  @Test
  public void durationConstructorLong() {
    // TODO(kak): This really should be an error too :(
    helper
        .addSourceLines(
            "TestClass.java",
            "import org.joda.time.Duration;",
            "public class TestClass {",
            "  private static final Duration ONE_MILLI = new Duration(Long.valueOf(1L));",
            "}")
        .doTest();
  }

  @Test
  public void instantConstructor() {
    helper
        .addSourceLines(
            "TestClass.java",
            "import org.joda.time.Instant;",
            "public class TestClass {",
            "  // BUG: Diagnostic contains: Instant NOW = Instant.now();",
            "  private static final Instant NOW = new Instant();",
            "}")
        .doTest();
  }

  @Test
  public void instantConstructor_fqcn() {
    helper
        .addSourceLines(
            "TestClass.java",
            "public class TestClass {",
            "  // BUG: Diagnostic contains: NOW = org.joda.time.Instant.now();",
            "  private static final org.joda.time.Instant NOW = new org.joda.time.Instant();",
            "}")
        .doTest();
  }

  @Test
  public void dateTimeConstructors() {
    helper
        .addSourceLines(
            "TestClass.java",
            "import org.joda.time.Chronology;",
            "import org.joda.time.chrono.GregorianChronology;",
            "import org.joda.time.DateTime;",
            "import org.joda.time.DateTimeZone;",
            "public class TestClass {",
            "  private static final DateTimeZone NYC = DateTimeZone.forID(\"America/New_York\");",
            "  private static final Chronology GREG = GregorianChronology.getInstance();",
            "  // BUG: Diagnostic contains: DateTime NOW = DateTime.now();",
            "  private static final DateTime NOW = new DateTime();",
            "  // BUG: Diagnostic contains: DateTime NOW_NYC = DateTime.now(NYC);",
            "  private static final DateTime NOW_NYC = new DateTime(NYC);",
            "  // BUG: Diagnostic contains: DateTime NOW_GREG = DateTime.now(GREG);",
            "  private static final DateTime NOW_GREG = new DateTime(GREG);",
            "}")
        .doTest();
  }
}


text:
package events.listeners;

import events.event.InputEvent;

/**
 * Interface for an input Listener
 * @author Balazs Pete
 *
 */
public interface InputListener {

	/**
	 * Method to handle the InputEvent
	 * @param e Input event to handle
	 */
	public void handleInput(InputEvent e);

}