text:
package tscfg.example

final case class ScalaIssue124aCfg(
  example : ScalaIssue124aCfg.Example
)
object ScalaIssue124aCfg {
  final case class Shared(
    c : java.lang.String,
    d : scala.Int
  )
  object Shared {
    def apply(c: com.typesafe.config.Config, parentPath: java.lang.String, $tsCfgValidator: $TsCfgValidator): ScalaIssue124aCfg.Shared = {
      ScalaIssue124aCfg.Shared(
        c = $_reqStr(parentPath, c, "c", $tsCfgValidator),
        d = $_reqInt(parentPath, c, "d", $tsCfgValidator)
      )
    }
    private def $_reqInt(parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, $tsCfgValidator: $TsCfgValidator): scala.Int = {
      if (c == null) 0
      else try c.getInt(path)
      catch {
        case e:com.typesafe.config.ConfigException =>
          $tsCfgValidator.addBadPath(parentPath + path, e)
          0
      }
    }

    private def $_reqStr(parentPath: java.lang.String, c: com.typesafe.config.Config, path: java.lang.String, $tsCfgValidator: $TsCfgValidator): java.lang.String = {
      if (c == null) null
      else try c.getString(path)
      catch {
        case e:com.typesafe.config.ConfigException =>
          $tsCfgValidator.addBadPath(parentPath + path, e)
          null
      }
    }

  }

  final case class Example(
    a : scala.Option[ScalaIssue124aCfg.Shared],
    b : scala.Option[scala.List[ScalaIssue124aCfg.Shared]]
  )
  object Example {
    def apply(c: com.typesafe.config.Config, parentPath: java.lang.String, $tsCfgValidator: $TsCfgValidator): ScalaIssue124aCfg.Example = {
      ScalaIssue124aCfg.Example(
        a = if(c.hasPathOrNull("a")) scala.Some(ScalaIssue124aCfg.Shared(c.getConfig("a"), parentPath + "a.", $tsCfgValidator)) else None,
        b = if(c.hasPathOrNull("b")) scala.Some($_LScalaIssue124aCfg_Shared(c.getList("b"), parentPath, $tsCfgValidator)) else None
      )
    }
    private def $_LScalaIssue124aCfg_Shared(cl:com.typesafe.config.ConfigList, parentPath: java.lang.String, $tsCfgValidator: $TsCfgValidator): scala.List[ScalaIssue124aCfg.Shared] = {
      import scala.jdk.CollectionConverters._
      cl.asScala.map(cv => ScalaIssue124aCfg.Shared(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig, parentPath, $tsCfgValidator)).toList
    }
  }

  def apply(c: com.typesafe.config.Config): ScalaIssue124aCfg = {
    val $tsCfgValidator: $TsCfgValidator = new $TsCfgValidator()
    val parentPath: java.lang.String = ""
    val $result = ScalaIssue124aCfg(
      example = ScalaIssue124aCfg.Example(if(c.hasPathOrNull("example")) c.getConfig("example") else com.typesafe.config.ConfigFactory.parseString("example{}"), parentPath + "example.", $tsCfgValidator)
    )
    $tsCfgValidator.validate()
    $result
  }
  final class $TsCfgValidator {
    private val badPaths = scala.collection.mutable.ArrayBuffer[java.lang.String]()

    def addBadPath(path: java.lang.String, e: com.typesafe.config.ConfigException): Unit = {
      badPaths += s"'$path': ${e.getClass.getName}(${e.getMessage})"
    }

    def addInvalidEnumValue(path: java.lang.String, value: java.lang.String, enumName: java.lang.String): Unit = {
      badPaths += s"'$path': invalid value $value for enumeration $enumName"
    }

    def validate(): Unit = {
      if (badPaths.nonEmpty) {
        throw new com.typesafe.config.ConfigException(
          badPaths.mkString("Invalid configuration:\n    ", "\n    ", "")
        ){}
      }
    }
  }
}


text:
<?php

?>

TEC

X

        <img id="tecImage" src="<?=base_url()?>js/HorseMusketTEC.jpg">

redpajama_set_name: RedPajamaGithub


text:
package org.corundummc.listeners.results;

public class EventResult {
    public boolean cancelled;
    public String server_message;

    public EventResult() {
        this(false, null);
    }

    public EventResult(boolean cancelled) {
        this(cancelled, null);
    }

    public EventResult(String server_message) {
        this(false, server_message);
    }

    public EventResult(boolean cancelled, String server_message) {
        this.cancelled = cancelled;
        this.server_message = server_message;
    }

    public void cancel() {
        cancelled = true;
    }

    public boolean isCancelled() {
        return cancelled;
    }

    public String getServerMessage() {
        return server_message;
    }

    public void setCancellation(boolean cancelled) {
        this.cancelled = cancelled;
    }

    public void setServerMessage(String server_message) {
        this.server_message = server_message;
    }

    public void toggleCancellation() {
        cancelled = !cancelled;
    }

    public void uncancel() {
        cancelled = false;
    }
}


text:
/*!
 * SINQ.js.
 * Script Integrated Query.
 *
 * @author Ygor Henrique S. Randes <rick.ygor@live.com>
 * @license MIT
 */

var sinq = require('./lib/sinq.js')

module.exports = function(){
  if(!Array.prototype.where){
    Array.prototype.where = sinq.where
  }

  if(!Array.prototype.groupBy){
    Array.prototype.groupBy = sinq.groupBy
  }

  if(!Array.prototype.orderBy){
    Array.prototype.orderBy = sinq.orderBy
  }

  if(!Array.prototype.orderByDescending){
    Array.prototype.orderByDescending = sinq.orderByDescending
  }

  if(!Array.prototype.select){
    Array.prototype.select = sinq.select
  }

  if(!Array.prototype.first){
    Array.prototype.first = sinq.first
  }

  if(!Array.prototype.last){
    Array.prototype.last = sinq.last
  }

  if(!Array.prototype.all){
    Array.prototype.all = sinq.all
  }

  if(!Array.prototype.contains){
    Array.prototype.contains = sinq.contains
  }

  if(!Array.prototype.range){
    Array.prototype.range = sinq.range
  }

  if(!Array.prototype.repeat){
    Array.prototype.repeat = sinq.repeat
  }

  if(!Array.prototype.distinct){
    Array.prototype.distinct = sinq.distinct
  }

  if(!Array.prototype.intersect){
    Array.prototype.intersect = sinq.intersect
  }

  if(!Array.prototype.union){
    Array.prototype.union = sinq.union
  }

  if(!Array.prototype.except){
    Array.prototype.except = sinq.except
  }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Pegler & Fiard, Kew Bull. 33: 623 (1979)

#### Original name
Lactarius murinipes Pegler

### Remarks
null


text:
Variable mass two-body problem
==============================

Introduction/History
--------------------
Mention important/relevant works here:
- Gylden, Mestschersky
- Hadjidemetriou
- Veras

Terminology
-----------

N-Body problem
2-Body Problem
Kepler Problem (2-Body problem with M >> m)

Variable Mass 2-Body Problem
Variable Mass 2-Body Problem (with M >> m)

Variable-mass correction to Newton's 2nd Law of Motion
------------------------------------------------------

Derivation of variable-mass equation of motion.

Equations of motion
-------------------

Hadjidemetriou (1963) showed that in the case of isotropic mass-loss,
the angular momentum h of the orbiting body is conserved and equal to:

.. math::
   :label: conservation_angular_momentum

   h = \sqrt{ G\mu a (1-e^2) } = \text{constant}

where :math:`\mu` is the total mass of the system, :math:`a` the
semi-major axis and :math:`e` the eccentricity.

.. note::

   Todo, include derivation of :eq:`conservation_angular_momentum`?

Furthermore, he showed that for a variable mass two-body system, the
evolution of the orbital elements :math:`a \, e \,\omega \,f` is governed by the
following equations of motion:

.. math::
   :label: sma_evolution

   \frac{da}{dt} = -\frac{a(1+e^2+2e\cos f)}{1-e^2}\frac{1}{\mu}\frac{d\mu}{dt}

.. math::
   :label: eccentricity_evolution

   \frac{de}{dt} = -(e+\cos f) \frac{1}{\mu}\frac{d\mu}{dt}

.. math::
   :label: argument_of_periapsis_evolution

   \frac{d \omega}{dt} = -\frac{\sin f}{e} \frac{1}{\mu}\frac{d\mu}{dt}

.. math::
   :label: true_anomaly_evolution

   \frac{df}{dt} = \frac{\sin f}{e} \frac{1}{\mu}\frac{d\mu}{dt} + \frac{n(1+e \cos f)^2}{(1-e^2)^{3/2}}

Definition of adiabaticity
--------------------------

Veras(2011) quantify the degree of adiabaticity with a dimensionless
mass-loss index :math:`\Psi`:

.. math::
   :label: definition_mass_loss_index

   \Psi \equiv \frac{\alpha}{n \mu}

where :math:`n` is the mean motion of the orbit and :math:`\alpha=-\frac{d\mu}{dt}` the
constant mass-loss rate.

Since the mean motion is equal to:

.. math::
   :label: definition_mean_motion

   n \equiv \frac{2\pi}{P} = G^{1/2} \mu^{1/2} a^{-3/2}

one can derive the equation that governs the evolution of the mean motion by
taking the time derivative of :eq:`definition_mean_motion` and subsituting
back in :eq:`sma_evolution` which then yields:

.. math::
   :label: mean_motion_evolution

   \frac{dn}{dt} = \frac{n(2+e^2+3e\cos f)}{1-e^2} \frac{1}{\mu}\frac{d\mu}{dt}

Then by taking the time derivative of :eq:`definition_mass_loss_index` and substituting
equation :eq:`mean_motion_evolution` back in, the equation that governs
the evolution of :math:`\Psi` is obtained:

.. math::
   :label: mass_loss_index_evolution

   \frac{d\Psi}{dt} = -3\Psi \frac{1+e\cos f}{1-e^2} \frac{1}{\mu}\frac{d\mu}{dt}

.. note::

   The adiabaticity increases monotonically for a monotonically decreasing mass.

Adiabatic evolution of the semi-major-axis
------------------------------------------
By imposing that the evolution of a two-body system is well in the adiabatic regime
and that the mass-loss rate :math:`-\frac{d\mu}{dt} = \alpha` is constant,
an approximate solution of the evolution of semi-major-axis can be found.

The evolution of a variable mass binary system is considered adiabatic if the mass-loss
time-scale is much greater than the planetary orbital time-scale.

Since the mass-loss time-scale is of the order :math:`\frac{\alpha}{\mu}` and the
orbital time-scale is of the order :math:`P = \frac{2\pi}{n}`, the evolution
is considered adiabatic if:

.. math::
    \frac{\alpha}{\mu} >> P

or equivalently, if :math:`\Psi << 1`.

Imposing that the evolution is adiabatic, does not make equation :eq:`sma_evolution` any
easier to solve. If however, one assumes the eccentricity to be constant if the system evolves
adiabatically, another equation of motion can be derived from
:eq:`conservation_angular_momentum` by taking its time-derivative.

.. math::
   \frac{dh^2}{dt} = 0 &= G (1-e^2) \frac{d(\mu a)}{dt} \\
                       &= a \frac{d\mu}{dt} + \mu \frac{da}{dt}

which yields the equation:

.. math::
   :label: sma_evolution_adiabatic

   \frac{da}{dt} = -\frac{a}{\mu} \frac{d\mu}{dt}

Solving equation :eq:`sma_evolution_adiabatic` then gives:

.. math::
   \int_0^t \frac{1}{a}\frac{da}{dt} &= -\int_0^t \frac{1}{\mu}\frac{d\mu}{dt} \\
   \ln \left( \frac{a(t)}{a_0} \right) &= \ln \left( \left( \frac{\mu(t)}{\mu_0} \right)^{-1} \right) \\
   a(t) &= a_0 \left( \frac{\mu(t)}{\mu_0} \right)^{-1}

which gives the adiabatic evolution of the semi-major-axis as stated in Veras(2011)
for a constant mass-loss prescription:

.. math::
   a(t)_{\text{adiabatic}} = a_0 \left( \frac{\mu_0 - \alpha t}{\mu_0} \right)^{-1}


text:
require "spec_helper"

describe Mongoid::Relations::Builders::Referenced::In do

  let(:base) do
    stub
  end

  describe "#build" do

    let(:criteria) do
      Person.where(:_id => object_id)
    end

    let(:metadata) do
      stub(
        :klass => Person,
        :name => :person,
        :foreign_key => "person_id",
        :criteria => criteria
      )
    end

    let(:builder) do
      described_class.new(base, metadata, object)
    end

    context "when provided an id" do

      context "when the object is an object id" do

        let(:object_id) do
          BSON::ObjectId.new
        end

        let(:object) do
          object_id
        end

        let(:person) do
          stub
        end

        before do
          criteria.expects(:first).returns(person)
        end

        let!(:document) do
          builder.build
        end

        it "sets the document" do
          document.should eq(person)
        end
      end

      context "when the object is an integer" do

        let(:object_id) { 666 }

        let(:object) do
          object_id
        end

        let(:person) do
          stub
        end

        before do
          criteria.expects(:first).returns(person)
        end

        let!(:document) do
          builder.build
        end

        it "sets the document" do
          document.should eq(person)
        end
      end
    end

    context "when provided a object" do

      let(:object) do
        Person.new
      end

      let(:document) do
        builder.build
      end

      it "returns the object" do
        document.should eq(object)
      end
    end
  end

  describe "#build" do

    let(:game) do
      Game.new
    end

    context "when no document found in the database" do

      context "when the id is nil" do

        it "returns nil" do
          game.person.should be_nil
        end
      end

      context "when the id is incorrect" do

        before do
          game.person_id = BSON::ObjectId.new
        end

        it "returns nil" do
          game.person.should be_nil
        end
      end
    end

    context "when the document is persisted" do

      before do
        Mongoid.identity_map_enabled = true
      end

      let!(:person) do
        Person.create
      end

      let(:game) do
        Game.new(:person_id => person.id)
      end

      after do
        Mongoid.identity_map_enabled = false
      end

      it "returns the document" do
        game.person.should eq(person)
      end

      it "gets the document from the identity map" do
        game.person.should equal(person)
      end
    end

    context 'setting an associated document to nil' do
      let(:person) { Person.create }
      let(:game) { Game.create(:person => person) }

      before do
        game.person = nil
        game.save
      end

      it 'sets the person_id to nil' do
        game.person_id.should be_nil
      end

      it 'does not delete the person' do
        Person.find(person.id).should eq(person)
      end
    end
  end

  describe '#substitute' do
    let(:person) { Person.create }
    let(:game) { Game.create(:person => person) }

    context 'setting an associated document to nil' do
      before do
        game.person = nil
      end

      it 'sets the person_id to nil' do
        game.person_id.should be_nil
      end

      it 'does not delete the person' do
        Person.find(person.id).should eq(person)
      end
    end

    context 'setting an associated document to nil' do
      let(:other_person) { Person.create }
      before do
        game.person = other_person
      end

      it 'sets the person_id to nil' do
        game.person_id.should eq(other_person.id)
      end

      it 'does not delete the person' do
        Person.find(person.id).should eq(person)
      end
    end
  end
end


text:
using System.Collections.Generic;
using System.Reflection;

namespace WebOnDiet.Framework.Configuration
{
	public class AspNetAppConfiguration : IConfiguration
	{
		readonly List<Assembly> _routesAssemblies = new List<Assembly>();
		public void AddRoutesAssembly(Assembly routesAssembly)
		{
			_routesAssemblies.Add(routesAssembly);
		}

		public IEnumerable<Assembly> RouteAssemblies { get { return _routesAssemblies; } }
	}
}


text:
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Blink
{
    public delegate TContext BlinkDbFactoryMethod<TContext>() where TContext : DbContext;
}


text:
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController

	# Handles the callback hash from Facebook for authentification.
	# It finds or creates the user in the Database and starts a new session.
	# Also a flash message will be set for success or fails
	#
	# Author: Roman C. Podolski - podolski@hm.edu
	def facebook
		# You need to implement the method below in your model (e.g. app/models/user.rb)
		@user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user)

		if @user.persisted?
		  sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated
		  set_flash_message(:notice, :success, :kind => 'Facebook') if is_navigational_format?
		else
		  session["devise.facebook_data"] = request.env["omniauth.auth"]
		  redirect_to new_user_registration_url
		end
  	end

	# Handles the callback hash from Google for authentification.
	# It finds or creates the user in the Database and starts a new session.
	# Also a flash message will be set for success or fails
	#
	# Author: Roman C. Podolski - podolski@hm.edu
	def google
      # You need to implement the method below in your model (e.g. app/models/user.rb)
      @user = User.find_for_google_oauth2(request.env["omniauth.auth"], current_user)

      if @user.persisted?
        flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Google"
        sign_in_and_redirect @user, :event => :authentication
      else
        session["devise.google_data"] = request.env["omniauth.auth"]
        redirect_to new_user_registration_url
      end
  	end

  	# Handles the callback hash from Github for authentification.
	# It finds or creates the user in the Database and starts a new session.
	# Also a flash message will be set for success or fails
	#
	# Author: Roman C. Podolski - podolski@hm.edu
  	def github
  		@user = User.find_for_github_oauth(request.env["omniauth.auth"], current_user)

		if @user.persisted?
			logger.debug "USER PERSISTED"
		  sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated
		  set_flash_message(:notice, :success, :kind => 'Github') if is_navigational_format?
		else
			logger.debug "SMTH WENT WRONG"
		  session["devise.github_data"] = request.env["omniauth.auth"]
		  redirect_to new_user_registration_url
		end
  	end

end


text:
#include "ir/ir.h"

namespace IR {

const cstring ParserState::accept = "accept";
const cstring ParserState::reject = "reject";
const cstring ParserState::start = "start";
const cstring ParserState::verify = "verify";

const cstring TableProperties::actionsPropertyName = "actions";
const cstring TableProperties::keyPropertyName = "key";
const cstring TableProperties::defaultActionPropertyName = "default_action";
const cstring TableProperties::entriesPropertyName = "entries";
const cstring TableProperties::sizePropertyName = "size";
const cstring IApply::applyMethodName = "apply";
const cstring P4Program::main = "main";
const cstring Type_Error::error = "error";

int IR::Declaration::nextId = 0;
int IR::This::nextId = 0;

const Type_Method* P4Control::getConstructorMethodType() const {
    return new Type_Method(getTypeParameters(), type, constructorParams);
}

const Type_Method* P4Parser::getConstructorMethodType() const {
    return new Type_Method(getTypeParameters(), type, constructorParams);
}

const Type_Method* Type_Package::getConstructorMethodType() const {
    return new Type_Method(getTypeParameters(), this, constructorParams);
}

Util::Enumerator<const IR::IDeclaration*>* IGeneralNamespace::getDeclsByName(cstring name) const {
    std::function<bool(const IDeclaration*)> filter =
            [name](const IDeclaration* d)
            { CHECK_NULL(d); return name == d->getName().name; };
    return getDeclarations()->where(filter);
}

Util::Enumerator<const IDeclaration*>* INestedNamespace::getDeclarations() const {
    Util::Enumerator<const IDeclaration*>* rv = nullptr;
    for (auto nested : getNestedNamespaces()) {
        if (nested) {
            if (rv)
                rv = rv->concat(nested->getDeclarations());
            else
                rv = nested->getDeclarations(); } }
    return rv ? rv : new Util::EmptyEnumerator<const IDeclaration*>;
}

bool IFunctional::callMatches(const Vector<Argument> *arguments) const {
    auto paramList = getParameters()->parameters;
    std::map<cstring, const IR::Parameter*> paramNames;
    for (auto param : paramList)
        paramNames.emplace(param->name.name, param);

    size_t index = 0;
    for (auto arg : *arguments) {
        if (paramNames.size() == 0)
            // Too many arguments
            return false;
        cstring argName = arg->name;
        if (argName.isNullOrEmpty())
            argName = paramList.at(index)->name.name;

        auto it = paramNames.find(argName);
        if (it == paramNames.end())
            // Argument name does not match a parameter
            return false;
        else
            paramNames.erase(it);
        index++;
    }
    // Check if all remaining parameters have default values
    // or are optional.
    for (auto it : paramNames) {
        auto param = it.second;
        if (!param->isOptional() && !param->defaultValue)
            return false;
    }
    return true;
}

void IGeneralNamespace::checkDuplicateDeclarations() const {
    std::unordered_map<cstring, ID> seen;
    for (auto decl : *getDeclarations()) {
        IR::ID name = decl->getName();
        auto f = seen.find(name.name);
        if (f != seen.end()) {
            ::error(ErrorType::ERR_DUPLICATE,
                    "Duplicate declaration of %1%: previous declaration at %2%",
                    name, f->second.srcInfo);
        }
        seen.emplace(name.name, name);
    }
}

void P4Parser::checkDuplicates() const {
    for (auto decl : states) {
        auto prev = parserLocals.getDeclaration(decl->getName().name);
        if (prev != nullptr)
            ::error(ErrorType::ERR_DUPLICATE,
                    "State %1% has same name as %2%", decl, prev);
    }
}

bool Type_Stack::sizeKnown() const { return size->is<Constant>(); }

unsigned Type_Stack::getSize() const {
    if (!sizeKnown())
        BUG("%1%: Size not yet known", size);
    auto cst = size->to<IR::Constant>();
    if (!cst->fitsInt()) {
        ::error(ErrorType::ERR_OVERLIMIT, "Index too large: %1%", cst);
        return 0;
    }
    int size = cst->asInt();
    if (size <= 0)
        ::error(ErrorType::ERR_OVERLIMIT, "Illegal array size: %1%", cst);
    return static_cast<unsigned>(size);
}

const Method* Type_Extern::lookupMethod(IR::ID name, const Vector<Argument>* arguments) const {
    const Method* result = nullptr;
    bool reported = false;
    for (auto m : methods) {
        if (m->name != name) continue;
        if (m->callMatches(arguments)) {
            if (result == nullptr) {
                result = m;
            } else {
                ::error(ErrorType::ERR_DUPLICATE, "Ambiguous method %1%", name);
                if (!reported) {
                    ::error(ErrorType::ERR_DUPLICATE, "Candidate is %1%", result);
                    reported = true;
                }
                ::error(ErrorType::ERR_DUPLICATE, "Candidate is %1%", m);
                return nullptr;
            }
        }
    }
    return result;
}

const Type_Method*
Type_Parser::getApplyMethodType() const {
    return new Type_Method(applyParams);
}

const Type_Method*
Type_Control::getApplyMethodType() const {
    return new Type_Method(applyParams);
}

const IR::Path* ActionListElement::getPath() const {
    auto expr = expression;
    if (expr->is<IR::MethodCallExpression>())
        expr = expr->to<IR::MethodCallExpression>()->method;
    if (expr->is<IR::PathExpression>())
        return expr->to<IR::PathExpression>()->path;
    BUG("%1%: unexpected expression", expression);
}

const Type_Method*
P4Table::getApplyMethodType() const {
    // Synthesize a new type for the return
    auto actions = properties->getProperty(IR::TableProperties::actionsPropertyName);
    if (actions == nullptr) {
        ::error(ErrorType::ERR_INVALID, "%1%: table does not contain a list of actions", this);
        return nullptr;
    }
    if (!actions->value->is<IR::ActionList>())
        BUG("Action property is not an IR::ActionList, but %1%",
            actions);
    auto alv = actions->value->to<IR::ActionList>();
    auto hit = new IR::StructField(IR::Type_Table::hit, IR::Type_Boolean::get());
    auto miss = new IR::StructField(IR::Type_Table::miss, IR::Type_Boolean::get());
    auto label = new IR::StructField(IR::Type_Table::action_run, new IR::Type_ActionEnum(alv));
    auto rettype = new IR::Type_Struct(ID(name), { hit, miss, label });
    auto applyMethod = new IR::Type_Method(rettype, new IR::ParameterList());
    return applyMethod;
}

const Type_Method* Type_Table::getApplyMethodType() const
{ return table->getApplyMethodType(); }

void Block::setValue(const Node* node, const CompileTimeValue* value) {
    CHECK_NULL(node);
    auto it = constantValue.find(node);
    if (it != constantValue.end())
        BUG_CHECK(value->equiv(*constantValue[node]),
                      "%1% already set in %2% to %3%, not %4%",
                  node, this, value, constantValue[node]);
    else
        constantValue[node] = value;
}

void InstantiatedBlock::instantiate(std::vector<const CompileTimeValue*> *args) {
    CHECK_NULL(args);
    auto it = args->begin();
    for (auto p : *getConstructorParameters()->getEnumerator()) {
        if (it == args->end()) {
            BUG_CHECK(p->isOptional(), "Missing nonoptional arg %s", p);
            continue; }
        LOG1("Set " << p << " to " << *it << " in " << id);
        setValue(p, *it);
        ++it;
    }
}

const IR::CompileTimeValue* InstantiatedBlock::getParameterValue(cstring paramName) const {
    auto param = getConstructorParameters()->getDeclByName(paramName);
    BUG_CHECK(param != nullptr, "No parameter named %1%", paramName);
    BUG_CHECK(param->is<IR::Parameter>(), "No parameter named %1%", paramName);
    return getValue(param->getNode());
}

const IR::CompileTimeValue*
InstantiatedBlock::findParameterValue(cstring paramName) const {
    auto* param = getConstructorParameters()->getDeclByName(paramName);
    if (!param) return nullptr;
    if (!param->is<IR::Parameter>()) return nullptr;
    return getValue(param->getNode());
}

Util::Enumerator<const IDeclaration*>* P4Program::getDeclarations() const {
    return objects.getEnumerator()
            ->as<const IDeclaration*>()
            ->where([](const IDeclaration* d) { return d != nullptr; });
}

const IR::PackageBlock* ToplevelBlock::getMain() const {
    auto program = getProgram();
    auto mainDecls = program->getDeclsByName(IR::P4Program::main)->toVector();
    if (mainDecls->size() == 0) {
        ::warning(ErrorType::WARN_MISSING,
                  "Program does not contain a `%s' module", IR::P4Program::main);
        return nullptr;
    }
    auto main = mainDecls->at(0);
    if (mainDecls->size() > 1) {
        ::error(ErrorType::ERR_DUPLICATE, "Program has multiple `%s' instances: %1%, %2%",
                IR::P4Program::main, main->getNode(), mainDecls->at(1)->getNode());
        return nullptr;
    }
    if (!main->is<IR::Declaration_Instance>()) {
        ::error(ErrorType::ERR_INVALID, "%1$: must be a package declaration", main->getNode());
        return nullptr;
    }
    auto block = getValue(main->getNode());
    if (block == nullptr)
        return nullptr;
    BUG_CHECK(block->is<IR::PackageBlock>(), "%1%: toplevel block is not a package", block);
    return block->to<IR::PackageBlock>();
}

}  // namespace IR


text:
<?php

/**
 * opAuthMailAddress actions.
 *
 * @package    OpenPNE
 * @subpackage opAuthMailAddressPlugin
 * @author     Kousuke Ebihara <ebihara@tejimaya.com>
 * @author     Shogo Kawahara <kawahara@tejimaya.net>
 */
class opAuthMailAddressActions extends sfActions
{
 /**
  * Executes register
  *
  * @param sfWebRequest A request object
  */
  public function executeRegister(sfWebRequest $request)
  {
    if ($this->getRoute()->getMember())
    {
      $this->forward('opAuthMailAddress', 'login');
    }

    $adapter = new opAuthAdapterMailAddress('MailAddress');
    if ($adapter->getAuthConfig('invite_mode') < 2)
    {
      return sfView::NONE;
    }

    $message = $request->getMailMessage();

    $this->form = new opRequestRegisterURLForm(null, array('authMode' => 'MailAddress'));
    $this->form->bind(array('mail_address' => $message->from));
    if ($this->form->isValid())
    {
      $this->form->sendMail();
    }

    return sfView::NONE;
  }

 /**
  * Executes login
  *
  * @param sfWebRequest A request object
  */
  public function executeLogin(sfWebRequest $request)
  {
    if (!$this->getRoute()->getMember())
    {
      $this->forward('opAuthMailAddress', 'register');
    }
  }
}


text:
package org.infobip.mobile.messaging.api.appinstance;

public class UserCustomEventAtts {

    public static final String properties = "properties";
    public static final String definitionId = "definitionId";
    public static final String eventDate = "eventDate";
}


text:
const TextEntity = {
    textEntityOptions: {
        text: 'TextEntity',
        align: 'center',
        baseline: 'middle',
        font: '18px monospace',
        color: 'black'
    },

    drawText(ctx) {
        ctx.save();
        ctx.textAlign = this.textEntityOptions.align;
        ctx.textBaseline = this.textEntityOptions.baseline;
        ctx.font = this.textEntityOptions.font;
        ctx.fillStyle = this.textEntityOptions.color;
        ctx.fillText(this.textEntityOptions.text, this.pos.x, this.pos.y);
        ctx.restore();
    }
};

export default TextEntity;


text:
package org.jbpm.workbench.common.client.filters.active;

import javax.enterprise.context.Dependent;
import javax.inject.Inject;
import javax.inject.Named;

import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyDownEvent;
import elemental2.dom.Event;
import elemental2.dom.HTMLButtonElement;
import elemental2.dom.HTMLDivElement;
import elemental2.dom.HTMLElement;
import elemental2.dom.HTMLInputElement;
import org.jboss.errai.common.client.api.elemental2.IsElement;
import org.jboss.errai.ui.shared.api.annotations.DataField;
import org.jboss.errai.ui.shared.api.annotations.EventHandler;
import org.jboss.errai.ui.shared.api.annotations.ForEvent;
import org.jboss.errai.ui.shared.api.annotations.Templated;
import org.uberfire.mvp.Command;
import org.uberfire.mvp.ParameterizedCommand;

@Templated
@Dependent
public class SaveFilterPopoverView implements IsElement {

    @Inject
    @DataField("content")
    HTMLDivElement content;

    @Inject
    @DataField("input-group")
    HTMLDivElement inputGroup;

    @Inject
    @DataField("save")
    HTMLButtonElement save;

    @Inject
    @DataField("cancel")
    HTMLButtonElement cancel;

    @Inject
    @DataField("name")
    HTMLInputElement filterName;

    @Inject
    @DataField("error")
    @Named("span")
    HTMLElement error;

    private Command cancelCallback;

    private ParameterizedCommand<String> saveCallback;

    public void setCancelCallback(final Command cancelCallback) {
        this.cancelCallback = cancelCallback;
    }

    public void setSaveCallback(final ParameterizedCommand<String> saveCallback) {
        this.saveCallback = saveCallback;
    }

    @Override
    public HTMLElement getElement() {
        return content;
    }

    @EventHandler("save")
    public void onSave(@ForEvent("click") Event e) {
        if (saveCallback != null) {
            saveCallback.execute(filterName.value);
        }
    }

    @EventHandler("name")
    public void onKeyPressEvent(final KeyDownEvent e) {
        if (e.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
            e.preventDefault();
            onSave(null);
        }
    }

    public void onOpen() {
        filterName.value = "";
        error.textContent = "";
        inputGroup.classList.remove("has-error");
    }

    public void onShow() {
        filterName.focus();
    }

    public void setError(final String message) {
        error.textContent = message;
        inputGroup.classList.add("has-error");
    }

    @EventHandler("cancel")
    public void onCancel(@ForEvent("click") Event e) {
        if (cancelCallback != null) {
            cancelCallback.execute();
        }
    }
}


text:
var request = require("request-promise-native");
var url = require("url");
var server = process.env.SERVER || "http://localhost:3000/";
function makeRequest(path, options) {
  options = options || {};

  options.uri = url.resolve(server, path);
  options.timeout = 1000 * 60 * 2; // 2 Minutes
  return request(options);
}

module.exports = {
  get: makeRequest,
  jar: request.jar
};


text:
<?php

/**
 * @file
 * Contains \Drupal\system\Tests\Entity\ContentEntityChangedTest.
 */

namespace Drupal\system\Tests\Entity;

use Drupal\entity_test\Entity\EntityTestMulChanged;
use Drupal\entity_test\Entity\EntityTestMulRevChanged;
use Drupal\language\Entity\ConfigurableLanguage;

/**
 * Tests basic EntityChangedInterface functionality.
 *
 * @group Entity
 */
class ContentEntityChangedTest extends EntityUnitTestBase {

  /**
   * Modules to enable.
   *
   * @var array
   */
  public static $modules = ['language', 'user', 'system', 'field', 'text', 'filter', 'entity_test'];

  /**
   * The EntityTestMulChanged entity type storage.
   *
   * @var \Drupal\Core\Entity\EntityStorageInterface
   */
  protected $mulChangedStorage;

  /**
   * The EntityTestMulRevChanged entity type storage.
   *
   * @var \Drupal\Core\Entity\EntityStorageInterface
   */
  protected $mulRevChangedStorage;

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();

    // Enable an additional language.
    ConfigurableLanguage::createFromLangcode('de')->save();
    ConfigurableLanguage::createFromLangcode('fr')->save();

    $this->installEntitySchema('entity_test_mul_changed');
    $this->installEntitySchema('entity_test_mulrev_changed');

    $this->mulChangedStorage = $this->entityManager->getStorage('entity_test_mul_changed');
    $this->mulRevChangedStorage = $this->entityManager->getStorage('entity_test_mulrev_changed');
  }

  /**
   * Tests basic EntityChangedInterface functionality.
   */
  public function testChanged() {
    $user1 = $this->createUser();
    $user2 = $this->createUser();

    // Create a test entity.
    $entity = EntityTestMulChanged::create(array(
      'name' => $this->randomString(),
      'user_id' => $user1->id(),
      'language' => 'en',
    ));
    $entity->save();

    $this->assertTrue(
      $entity->getChangedTime() >= REQUEST_TIME,
      'Changed time of original language is valid.'
    );

    // We can't assert equality here because the created time is set to the
    // request time, while instances of ChangedTestItem use the current
    // timestamp every time. Therefor we check if the changed timestamp is
    // between the created time and now.
    $this->assertTrue(
      ($entity->getChangedTime() >= $entity->get('created')->value) &&
      (($entity->getChangedTime() - $entity->get('created')->value) <= time() - REQUEST_TIME),
      'Changed and created time of original language can be assumed to be identical.'
    );

    $this->assertEqual(
      $entity->getChangedTime(), $entity->getChangedTimeAcrossTranslations(),
      'Changed time of original language is the same as changed time across all translations.'
    );

    $changed_en = $entity->getChangedTime();

    /** @var \Drupal\entity_test\Entity\EntityTestMulRevChanged $german */
    $german = $entity->addTranslation('de');

    $entity->save();

    $this->assertEqual(
      $entity->getChangedTime(), $changed_en,
      'Changed time of original language did not change.'
    );

    $this->assertTrue(
      $german->getChangedTime() > $entity->getChangedTime(),
      'Changed time of the German translation is newer then the original language.'
    );

    $this->assertEqual(
      $german->getChangedTime(), $entity->getChangedTimeAcrossTranslations(),
      'Changed time of the German translation is the newest time across all translations.'
    );

    $changed_de = $german->getChangedTime();

    $entity->save();

    $this->assertEqual(
      $entity->getChangedTime(), $changed_en,
      'Changed time of original language did not change.'
    );

    $this->assertEqual(
      $german->getChangedTime(), $changed_de,
      'Changed time of the German translation did not change.'
    );

    $entity->setOwner($user2);

    $entity->save();

    $this->assertTrue(
      $entity->getChangedTime() > $changed_en,
      'Changed time of original language did change.'
    );

    $this->assertEqual(
      $german->getChangedTime(), $changed_de,
      'Changed time of the German translation did not change.'
    );

    $this->assertTrue(
      $entity->getChangedTime() > $german->getChangedTime(),
      'Changed time of original language is newer then the German translation.'
    );

    $this->assertEqual(
      $entity->getChangedTime(), $entity->getChangedTimeAcrossTranslations(),
      'Changed time of the original language is the newest time across all translations.'
    );

    $changed_en = $entity->getChangedTime();

    // Save entity without any changes.
    $entity->save();

    $this->assertEqual(
      $entity->getChangedTime(), $changed_en,
      'Changed time of original language did not change.'
    );

    $this->assertEqual(
      $german->getChangedTime(), $changed_de,
      'Changed time of the German translation did not change.'
    );

    // At this point the changed time of the original language (en) is newer
    // than the changed time of the German translation. Now test that entity
    // queries work as expected.
    $query = $this->mulChangedStorage->getQuery();
    $ids = $query->condition('changed', $changed_en)->execute();

    $this->assertEqual(
      reset($ids), $entity->id(),
      'Entity query can access changed time of original language.'
    );

    $query = $this->mulChangedStorage->getQuery();
    $ids = $query->condition('changed', $changed_en, '=', 'en')->execute();

    $this->assertEqual(
      reset($ids), $entity->id(),
      'Entity query can access changed time of original language by setting the original language as condition.'
    );

    $query = $this->mulChangedStorage->getQuery();
    $ids = $query->condition('changed', $changed_de, '=', 'en')->execute();

    $this->assertFalse(
      $ids,
      'There\'s no original entity stored having the changed time of the German translation.'
    );

    $query = $this->mulChangedStorage->getQuery();
    $ids = $query->condition('changed', $changed_en)->condition('default_langcode', '1')->execute();

    $this->assertEqual(
      reset($ids), $entity->id(),
      'Entity query can access changed time of default language.'
    );

    $query = $this->mulChangedStorage->getQuery();
    $ids = $query->condition('changed', $changed_de)->condition('default_langcode', '1')->execute();

    $this->assertFalse(
      $ids,
      'There\'s no entity stored using the default language having the changed time of the German translation.'
    );

    $query = $this->mulChangedStorage->getQuery();
    $ids = $query->condition('changed', $changed_de)->execute();

    $this->assertEqual(
      reset($ids), $entity->id(),
      'Entity query can access changed time of the German translation.'
    );

    $query = $this->mulChangedStorage->getQuery();
    $ids = $query->condition('changed', $changed_de, '=', 'de')->execute();

    $this->assertEqual(
      reset($ids), $entity->id(),
      'Entity query can access changed time of the German translation.'
    );

    $query = $this->mulChangedStorage->getQuery();
    $ids = $query->condition('changed', $changed_en, '=', 'de')->execute();

    $this->assertFalse(
      $ids,
      'There\'s no German translation stored having the changed time of the original language.'
    );

    $query = $this->mulChangedStorage->getQuery();
    $ids = $query->condition('changed', $changed_de, '>')->execute();

    $this->assertEqual(
      reset($ids), $entity->id(),
      'Entity query can access changed time regardless of translation.'
    );

    $query = $this->mulChangedStorage->getQuery();
    $ids = $query->condition('changed', $changed_en, '<')->execute();

    $this->assertEqual(
      reset($ids), $entity->id(),
      'Entity query can access changed time regardless of translation.'
    );

    $query = $this->mulChangedStorage->getQuery();
    $ids = $query->condition('changed', 0, '>')->execute();

    $this->assertEqual(
      reset($ids), $entity->id(),
      'Entity query can access changed time regardless of translation.'
    );

    $query = $this->mulChangedStorage->getQuery();
    $ids = $query->condition('changed', $changed_en, '>')->execute();

    $this->assertFalse(
      $ids,
      'Entity query can access changed time regardless of translation.'
    );
  }

  /**
   * Tests revisionable EntityChangedInterface functionality.
   */
  public function testRevisionChanged() {
    $user1 = $this->createUser();
    $user2 = $this->createUser();

    // Create a test entity.
    $entity = EntityTestMulRevChanged::create(array(
      'name' => $this->randomString(),
      'user_id' => $user1->id(),
      'language' => 'en',
    ));
    $entity->save();

    $this->assertTrue(
      $entity->getChangedTime() >= REQUEST_TIME,
      'Changed time of original language is valid.'
    );

    // We can't assert equality here because the created time is set to the
    // request time while instances of ChangedTestItem use the current
    // timestamp every time.
    $this->assertTrue(
      ($entity->getChangedTime() >= $entity->get('created')->value) &&
      (($entity->getChangedTime() - $entity->get('created')->value) <= time() - REQUEST_TIME),
      'Changed and created time of original language can be assumed to be identical.'
    );

    $this->assertEqual(
      $entity->getChangedTime(), $entity->getChangedTimeAcrossTranslations(),
      'Changed time of original language is the same as changed time across all translations.'
    );

    $this->assertTrue(
      $this->getRevisionTranslationAffectedFlag($entity),
      'Changed flag of original language is set for a new entity.'
    );

    $changed_en = $entity->getChangedTime();

    $entity->setNewRevision();
    // Save entity without any changes but create new revision.
    $entity->save();
    // A new revision without any changes should not set a new changed time.
    $this->assertEqual(
      $entity->getChangedTime(), $changed_en,
      'Changed time of original language did not change.'
    );

    $this->assertFalse(
      $this->getRevisionTranslationAffectedFlag($entity),
      'Changed flag of original language is not set for new revision without changes.'
    );

    $entity->setNewRevision();
    $entity->setOwner($user2);
    $entity->save();

    $this->assertTrue(
      $entity->getChangedTime() > $changed_en,
      'Changed time of original language has been updated by new revision.'
    );

    $this->assertTrue(
      $this->getRevisionTranslationAffectedFlag($entity),
      'Changed flag of original language is set for new revision with changes.'
    );

    $changed_en = $entity->getChangedTime();

    /** @var \Drupal\entity_test\Entity\EntityTestMulRevChanged $german */
    $german = $entity->addTranslation('de');

    $entity->save();

    $this->assertEqual(
      $entity->getChangedTime(), $changed_en,
      'Changed time of original language did not change.'
    );

    $this->assertTrue(
      $german->getChangedTime() > $entity->getChangedTime(),
      'Changed time of the German translation is newer then the original language.'
    );

    $this->assertEqual(
      $german->getChangedTime(), $entity->getChangedTimeAcrossTranslations(),
      'Changed time of the German translation is the newest time across all translations.'
    );

    $this->assertTrue(
      $this->getRevisionTranslationAffectedFlag($entity),
      'Changed flag of original language is not reset by adding a new translation.'
    );

    $this->assertTrue(
      $this->getRevisionTranslationAffectedFlag($german),
      'Changed flag of German translation is set when adding the translation.'
    );

    $changed_de = $german->getChangedTime();

    $entity->setNewRevision();
    // Save entity without any changes but create new revision.
    $entity->save();

    $this->assertEqual(
      $entity->getChangedTime(), $changed_en,
      'Changed time of original language did not change.'
    );

    $this->assertEqual(
      $german->getChangedTime(), $changed_de,
      'Changed time of the German translation did not change.'
    );

    $this->assertFalse(
      $this->getRevisionTranslationAffectedFlag($entity),
      'Changed flag of original language is not set for new revision without changes.'
    );

    $this->assertFalse(
      $this->getRevisionTranslationAffectedFlag($german),
      'Changed flag of the German translation is not set for new revision without changes.'
    );

    $entity->setNewRevision();
    $german->setOwner($user2);
    $entity->save();

    $this->assertEqual(
      $entity->getChangedTime(), $changed_en,
      'Changed time of original language did not change.'
    );

    $this->assertTrue(
      $german->getChangedTime() > $changed_de,
      'Changed time of the German translation did change.'
    );

    $this->assertEqual(
      $german->getChangedTime(), $entity->getChangedTimeAcrossTranslations(),
      'Changed time of the German translation is the newest time across all translations.'
    );

    $this->assertFalse(
      $this->getRevisionTranslationAffectedFlag($entity),
      'Changed flag of original language is not set when changing the German Translation.'
    );

    $this->assertTrue(
      $this->getRevisionTranslationAffectedFlag($german),
      'Changed flag of German translation is set when changing the German translation.'
    );

    $french = $entity->addTranslation('fr');

    $entity->setNewRevision();
    $entity->save();

    $this->assertEqual(
      $entity->getChangedTime(), $changed_en,
      'Changed time of original language did not change.'
    );

    $this->assertTrue(
      $french->getChangedTime() > $entity->getChangedTime(),
      'Changed time of the French translation is newer then the original language.'
    );

    $this->assertTrue(
      $french->getChangedTime() > $entity->getChangedTime(),
      'Changed time of the French translation is newer then the German translation.'
    );

    $this->assertEqual(
      $french->getChangedTime(), $entity->getChangedTimeAcrossTranslations(),
      'Changed time of the French translation is the newest time across all translations.'
    );

    $this->assertFalse(
      $this->getRevisionTranslationAffectedFlag($entity),
      'Changed flag of original language is reset by adding a new translation and a new revision.'
    );

    $this->assertFalse(
      $this->getRevisionTranslationAffectedFlag($german),
      'Changed flag of German translation is reset by adding a new translation and a new revision.'
    );

    $this->assertTrue(
      $this->getRevisionTranslationAffectedFlag($french),
      'Changed flag of French translation is set when adding the translation and a new revision.'
    );

    $entity->removeTranslation('fr');

    $entity->setNewRevision();
    $entity->save();

    // This block simulates exactly the flow of a node form submission of a new
    // translation and a new revision.
    $form_entity_builder_entity = EntityTestMulRevChanged::load($entity->id());
    // ContentTranslationController::prepareTranslation().
    $form_entity_builder_entity = $form_entity_builder_entity->addTranslation('fr', $form_entity_builder_entity->toArray());
    // EntityForm::buildEntity() during form submit.
    $form_entity_builder_clone = clone $form_entity_builder_entity;
    // NodeForm::submitForm().
    $form_entity_builder_clone->setNewRevision();
    // EntityForm::save().
    $form_entity_builder_clone->save();

    // The assertion fails unless https://www.drupal.org/node/2513094 is
    // committed.
    $this->assertFalse(
      $this->getRevisionTranslationAffectedFlag($entity),
      'Changed flag of original language is reset by adding a new translation and a new revision.'
    );

    $this->assertFalse(
      $this->getRevisionTranslationAffectedFlag($german),
      'Changed flag of German translation is reset by adding a new translation and a new revision.'
    );

    $this->assertTrue(
      $this->getRevisionTranslationAffectedFlag($french),
      'Changed flag of French translation is set when adding the translation and a new revision.'
    );

    $german->setOwner($user1);
    $german->setRevisionTranslationAffected(FALSE);
    $entity->save();

    $this->assertFalse(
      $this->getRevisionTranslationAffectedFlag($german),
      'German translation changed but the changed flag is reset manually.'
    );

    $entity->setNewRevision();
    $german->setRevisionTranslationAffected(TRUE);
    $entity->save();

    $this->assertTrue(
      $this->getRevisionTranslationAffectedFlag($german),
      'German translation is not changed and a new revision is created but the changed flag is set manually.'
    );

    $german->setOwner($user2);
    $entity->setNewRevision();
    $german->setRevisionTranslationAffected(FALSE);
    $entity->save();

    $this->assertFalse(
      $this->getRevisionTranslationAffectedFlag($german),
      'German translation changed and a new revision is created but the changed flag is reset manually.'
    );

  }

  /**
   * Retrieves the revision translation affected flag value.
   *
   * @param \Drupal\entity_test\Entity\EntityTestMulRevChanged $entity
   *   The entity object to be checked.
   *
   * @return bool
   *   The flag value.
   */
  protected function getRevisionTranslationAffectedFlag(EntityTestMulRevChanged $entity) {
    $query = $this->mulRevChangedStorage->getQuery();
    $ids = $query->condition('revision_translation_affected', 1, '=', $entity->language()->getId())->execute();
    $id = reset($ids);
    return (bool) ($id == $entity->id());
  }

}


text:
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="Content-Security-Policy" content="default-src * data: gap: content: https://ssl.gstatic.com; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'">
    <script src="components/loader.js"></script>
    <link rel="stylesheet" href="components/loader.css">
    <link rel="stylesheet" href="css/style.css">
    <script>
    </script>
</head>
<body>
aaaaaa
	<br />aaaああああ
    tettestaaaaaaawoegaw
aaaa    aaaaThis is a template for Monaca app.
</body>
</html>


text:
> Get the path to the user home directory

## Install

```
$ npm install --global user-home-cli
```

## Usage

```
$ user-home --help

  Example
    $ user-home
    /Users/sindresorhus
```


text:
namespace MLocati.ServicesControl
{
    public abstract class ServiceConfig
    {
        public readonly string ServiceName;
        protected ServiceConfig(string serviceName)
        {
            this.ServiceName = serviceName;
        }
    }

    public class SystemServiceConfig : ServiceConfig
    {
        public SystemServiceConfig(string serviceName)
            : base(serviceName)
        {
        }

    }

    public class ServiceLikeServiceConfig : ServiceConfig
    {
        public readonly string Executable;
        public readonly string CurrentDirectory;
        public readonly string Arguments;
        public ServiceLikeServiceConfig(string serviceName, string executable, string currentDirectory, string arguments)
            : base(serviceName)
        {
            this.Executable = executable;
            this.CurrentDirectory = currentDirectory;
            this.Arguments = arguments;
        }
    }
}


text:
Object.isFunction = function(obj) {
	return typeof object == "function";
};


text:
module SomeTest where

import Syntax
import Something

import qualified PrintingTest as PT

someGoal  = tree $ fresh ["q0", "q1"] (call "sum" [V "q0", C "some" [V "q1"]])
someGoal' = tree $ fresh ["q0"]       (call "sum" [V "q0", C "some" [C "s" [C "s" [C "o" []]]]])

test  = PT.runTestSimplified "sum"       someGoal
test' = PT.runTestSimplified "biggerSum" someGoal'


text:
module.exports = function (arg1, arg2) {
  arg1 = arg1 || '';
  arg2 = arg2 || '';

  this.push('module1' + arg1 + arg2);

  return Promise.resolve();
};

module.exports.entry = function (arg1, arg2) {
  arg1 = arg1 || '';
  arg2 = arg2 || '';

  this.push('module1.entry' + arg1 + arg2);

  return Promise.resolve();
};

module.exports.error = function () {
  return Promise.reject('this is an error');
};


text:
package com.reactnativenavigation.views;

import android.view.ViewGroup;
import android.view.ViewTreeObserver;

public class ScrollDirectionListener implements ViewTreeObserver.OnScrollChangedListener {
    public enum Direction {
        Up, Down
    }

    public interface OnScrollChanged {
        void onScrollChanged(Direction direction);
    }

    private final ViewGroup view;
    private OnScrollChanged onChanged;
    private int lastScrollY = -1;

    public ScrollDirectionListener(ViewGroup view, OnScrollChanged onChanged) {
        this.view = view;
        this.onChanged = onChanged;
    }

    @Override
    public void onScrollChanged() {
        if (!view.getViewTreeObserver().isAlive()) {
            return;
        }

        final int scrollY = view.getScrollY();
        if (isScrollPositionChanged(scrollY) && !isTopOverscroll(scrollY) && !isBottomOverscroll(scrollY)) {
            onChanged.onScrollChanged(getScrollDirection(scrollY));
            lastScrollY = scrollY;
        }
    }

    private Direction getScrollDirection(int scrollY) {
        return scrollY > lastScrollY ? Direction.Down : Direction.Up;
    }

    private boolean isBottomOverscroll(int scrollY) {
        return scrollY >= (view.getChildAt(0).getHeight() - view.getHeight());
    }

    private boolean isTopOverscroll(int scrollY) {
        return scrollY <= 0;
    }

    private boolean isScrollPositionChanged(int scrollY) {
        return scrollY != lastScrollY;
    }

}


text:
var indexStepInit = 100;
var indexStep = indexStepInit;
var currentIndexMin = 0;
var currentIndexMax = indexStep;
var scrollEnd = false;
var totalData = 0;

var timeout = null;

function startSearch(indexMin, indexMax){
    console.log("startSearch", indexMin, indexMax, indexStep);

    console.log("loadingData", loadingData);
    if(loadingData) return;
    loadingData = true;

    console.log("loadingData true");
    indexStep = indexStepInit;

    var name = $('#searchBarText').val();
    //var locality = $('#searchBarPostalCode').val();
    //inseeCommunexion = locality;

    //if(communexionActivated)
    //$(".lbl-scope-list").html(" " + cityNameCommunexion.toLowerCase() + ", " + cpCommunexion);

    if(typeof indexMin == "undefined") indexMin = 0;
    if(typeof indexMax == "undefined") indexMax = indexStep;

    currentIndexMin = indexMin;
    currentIndexMax = indexMax;

    if(indexMin == 0 && indexMax == indexStep) {
      totalData = 0;
      mapElements = new Array();
    }
    else{ if(scrollEnd) return; }

    //name = name.replace(/[^\w\s']/gi, '');
    ///locality = locality.replace(/[^\w\s']/gi, '');

    //verification si c'est un nombre
    //if(!isNaN(parseInt(locality))){
    //    if(locality.length == 0 || locality.length > 5) locality = "";
    //}

    if(name.length>=3 || name.length == 0){
      var locality = "";
      if(communexionActivated){
        if(typeof(cityInseeCommunexion) != "undefined"){
			if(levelCommunexion == 1) locality = cpCommunexion;
			if(levelCommunexion == 2) locality = inseeCommunexion;
		}else{
			if(levelCommunexion == 1) locality = inseeCommunexion;
			if(levelCommunexion == 2) locality = cpCommunexion;
		}
        if(levelCommunexion == 3) locality = cpCommunexion.substr(0, 2);
        if(levelCommunexion == 4) locality = inseeCommunexion;
        if(levelCommunexion == 5) locality = "";
      }
      autoCompleteSearch(name, locality, indexMin, indexMax);
    }else{

    }
}

function addSearchType(type){
  var index = searchType.indexOf(type);
  if (index == -1) {
    searchType.push(type);
    $(".search_"+type).removeClass("fa-circle-o");
    $(".search_"+type).addClass("fa-check-circle-o");
  }
}
function removeSearchType(type){
  var index = searchType.indexOf(type);
  if (index > -1) {
    searchType.splice(index, 1);
    $(".search_"+type).removeClass("fa-check-circle-o");
    $(".search_"+type).addClass("fa-circle-o");
  }
}

var loadingData = false;
var mapElements = new Array();
function autoCompleteSearch(name, locality, indexMin, indexMax){
    if(typeof(cityInseeCommunexion) != "undefined"){
	    var levelCommunexionName = { 1 : "CODE_POSTAL_INSEE",
	                             2 : "INSEE",
	                             3 : "DEPARTEMENT",
	                             4 : "REGION"
	                           };
	}else{
		var levelCommunexionName = { 1 : "INSEE",
	                             2 : "CODE_POSTAL_INSEE",
	                             3 : "DEPARTEMENT",
	                             4 : "REGION"
	                           };
	}
    console.log("levelCommunexionName", levelCommunexionName[levelCommunexion]);
    var data = {"name" : name, "locality" : locality, "searchType" : searchType, "searchBy" : levelCommunexionName[levelCommunexion],
                "indexMin" : indexMin, "indexMax" : indexMax  };

    str = "";
    $(".btn-start-search").html(str);
    $(".btn-start-search").addClass("bg-azure");
    $(".btn-start-search").removeClass("bg-dark");
    //$("#dropdown_search").css({"display" : "inline" });

    if(indexMin > 0)
    $("#btnShowMoreResult").html(" Recherche en cours ...");
    else
    $("#dropdown_search").html(" Recherche en cours ...");

    if(isMapEnd)
        $.blockUI({
          message : "
 Communexion en cours ...
"
        });

    $(".responsive-calendar").hide();

    $.ajax({
      type: "POST",
          url: baseUrl+"/" + moduleId + "/search/globalautocomplete",
          data: data,
          dataType: "json",
          error: function (data){
             console.log("error"); console.dir(data);
          },
          success: function(data){
            if(!data){ toastr.error(data.content); }
            else
            {
              var countData = 0;
              $.each(data, function(i, v) { if(v.length!=0){ countData++; } });

              totalData += countData;

              str = "";
              var city, postalCode = "";

              //parcours la liste des résultats de la recherche
              $.each(data, function(i, o) {
                  var typeIco = i;
                  var ico = mapIconTop["default"];
                  var color = mapColorIconTop["default"];

                  mapElements.push(o);

                  typeIco = o.type;
                  ico = ("undefined" != typeof mapIconTop[typeIco]) ? mapIconTop[typeIco] : mapIconTop["default"];
                  color = ("undefined" != typeof mapColorIconTop[typeIco]) ? mapColorIconTop[typeIco] : mapColorIconTop["default"];

                  htmlIco ="";
                  if("undefined" != typeof o.profilThumbImageUrl && o.profilThumbImageUrl != ""){
                    var htmlIco= ""
                  }

                  city="";

                  var postalCode = o.cp
                  if (o.address != null) {
                    city = o.address.addressLocality;
                    postalCode = o.cp ? o.cp : o.address.postalCode ? o.address.postalCode : "";
                  }

                  //console.dir(o);
                  var id = getObjectId(o);
                  var insee = o.insee ? o.insee : "";
                  type = o.type;
                  if(type=="citoyen") type = "person";
                  var url = "javascript:"; //baseUrl+'/'+moduleId+ "/default/simple#" + o.type + ".detail.id." + id;
                  var onclick = 'loadByHash("#' + type + '.detail.id.' + id + '");';
                  var onclickCp = "";
                  var target = " target='_blank'";
                  var dataId = "";
                  if(type == "city"){
                    url = "javascript:"; //#main-col-search";
                    onclick = 'setScopeValue($(this))'; //"'+o.name.replace("'", "\'")+'");';
                    onclickCp = 'setScopeValue($(this));';
                    target = "";
                    dataId = o.name; //.replace("'", "\'");
                  }

                  var tags = "";
                  if(typeof o.tags != "undefined" && o.tags != null){
                    $.each(o.tags, function(key, value){
                      if(value != "")
                      tags +=   "#" + value + "";
                    });
                  }

                  var name = typeof o.name != "undefined" ? o.name : "";
                  var postalCode = (typeof o.address != "undefined" &&
                            typeof o.address.postalCode != "undefined") ? o.address.postalCode : "";

                  if(postalCode == "") postalCode = typeof o.cp != "undefined" ? o.cp : "";
                  var cityName = (typeof o.address != "undefined" &&
                          typeof o.address.addressLocality != "undefined") ? o.address.addressLocality : "";

                  var fullLocality = postalCode + " " + cityName;

                  var description = (typeof o.shortDescription != "undefined" &&
                            o.shortDescription != null) ? o.shortDescription : "";
                  if(description == "") description = (typeof o.description != "undefined" &&
                                     o.description != null) ? o.description : "";

                  var startDate = (typeof o.startDate != "undefined") ? "Du "+dateToStr(o.startDate, "fr", true, true) : null;
                  var endDate   = (typeof o.endDate   != "undefined") ? "Au "+dateToStr(o.endDate, "fr", true, true)   : null;

                  //template principal
                  str += "
";
                    str += "
";
                      if(userId != null){
                        isFollowed=false;
                        if(typeof o.isFollowed != "undefined" )
                          isFollowed=true;
                        if(type!="city" && id != userId)
                        str += ""+
                                  ""+ //fa-bookmark fa-rotate-270
                                "";
                      }
                      str += tags;

                    str += "
";

                    str += "
";
                    str += "" + htmlIco + "";
                    str += "
";
                     target = "";
                    str += "
";
                      str += "" + name + "";
                      if(fullLocality != "" && fullLocality != " ")
                      str += " " + fullLocality + "";
                      if(startDate != null)
                      str += " " + startDate + "";
                      if(endDate != null)
                      str += " " + endDate + "";
                      if(description != "")
                      str += "
" + description + "
";
                    str += "
";

                  str += "
";
              }); //end each

              if(str == "") {
				  $.unblockUI();
	              showMap(false);

                  $(".btn-start-search").html("");
                  if(indexMin == 0){
                    //ajout du footer
                    var msg = "Aucun résultat";
                    if(name == "" && locality == "") msg = "

 Préciser votre recherche pour plus de résultats ...
";
                    str += '
';
                    str += "
"+msg+"
";
                    str += "
";
                    $("#dropdown_search").html(str);
                    $("#searchBarText").focus();
                  }
              }
              else
              {
                //ajout du footer
                str += '
';
                str += "
" + totalData + " résultats
";
                str += '<button class="btn btn-default" id="btnShowMoreResult"> Afficher plus de résultat
';
                str += "
";

                //si on n'est pas sur une première recherche (chargement de la suite des résultat)
                if(indexMin > 0){
                  //on supprime l'ancien bouton "afficher plus de résultat"
                  $("#btnShowMoreResult").remove();
                  //on supprimer le footer (avec nb résultats)
                  $("#footerDropdown").remove();

                  //on calcul la valeur du nouveau scrollTop
                  var heightContainer = $(".my-main-container")[0].scrollHeight - 180;
                  //on affiche le résultat à l'écran
                  $("#dropdown_search").append(str);
                  //on scroll pour afficher le premier résultat de la dernière recherche
                  $(".my-main-container").animate({"scrollTop" : heightContainer}, 1700);
                  //$(".my-main-container").scrollTop(heightContainer);

                //si on est sur une première recherche
                }else{
                  //on affiche le résultat à l'écran
                  $("#dropdown_search").html(str);
                  //on scroll pour coller le haut de l'arbre au menuTop
                  //$(".my-main-container").scrollTop(95);
                }
                //remet l'icon "loupe" du bouton search
                $(".btn-start-search").html("");
                $.unblockUI();
				        showMap(false);

                //affiche la dropdown
                //$("#dropdown_search").css({"display" : "inline" });

                //active le chargement de la suite des résultat au survol du bouton "afficher plus de résultats"
                //(au cas où le scroll n'ait pas lancé le chargement comme prévu)
                $("#btnShowMoreResult").mouseenter(function(){
                  // if(!loadingData){
                  //   startSearch(indexMin+indexStep, indexMax+indexStep);
                  //   $("#btnShowMoreResult").mouseenter(function(){});
                  // }
                });

                //initialise les boutons pour garder une entité dans Mon répertoire (boutons links)
                initBtnLink();

              } //end else (str=="")

              //signal que le chargement est terminé
              console.log("loadingData false");
              loadingData = false;

              //quand la recherche est terminé, on remet la couleur normal du bouton search
              $(".btn-start-search").removeClass("bg-azure");
            }
			 $('.tooltips').tooltip();
            console.log("scrollEnd ? ", scrollEnd, indexMax, countData , indexMin);
            //si le nombre de résultat obtenu est inférieur au indexStep => tous les éléments ont été chargé et affiché
            if(indexMax - countData > indexMin){
              $("#btnShowMoreResult").remove();
              scrollEnd = true;
            }else{
              scrollEnd = false;
            }

            showResultInCalendar(mapElements);
            //affiche les éléments sur la carte
            Sig.showMapElements(Sig.map, mapElements);
          }
    });

  }

  function addEventOnSearch() {
    $('.searchEntry').off().on("click", function(){

      //toastr.success($("#dropdown_search").position().top);
      var top = $(this).position().top;// + $("#dropdown_search").position().top;

      setSearchInput($(this).data("id"), $(this).data("type"),
                     $(this).data("insee"), top );
    });
  }

  function initBtnLink(){

    //parcours tous les boutons link pour vérifier si l'entité est déjà dans mon répertoire
    $.each($(".followBtn"), function(index, value){
      var id = $(value).attr("data-id");
      var type = $(value).attr("data-type");
	  type = type + "s";

      //console.log("#floopItem-"+type+"-"+id);
      if($("#floopItem-"+type+"-"+id).length){
        //console.log("I FOLLOW THIS");
        $(value).html("");
		$(value).attr("data-ownerlink","unparticipate");
        $(value).attr("data-original-title","Ne plus participer à l\'évènement");
      }
    });
    //on click sur les boutons link
    $(".followBtn").click(function(){
      formData = new Object();
   		formData.parentId = $(this).attr("data-id");
   		formData.parentType = $(this).attr("data-id");
   		formData.childId = userId;
   		formData.childType = personCOLLECTION;
   		var type = $(this).attr("data-type");
   		var name = $(this).attr("data-name");
   		var id = $(this).attr("data-id");
   		//traduction du type pour le floopDrawer
   		var typeOrigine = type + "s";
   		formData.parentType = typeOrigine;
   		type = type + "s";
		var thiselement = this;
		$(this).html("");
		console.log(formData);
		if ($(this).attr("data-ownerlink")=="participate"){
			formData.connectType =  "attendee";
			$.ajax({
				type: "POST",
				url: baseUrl+"/"+moduleId+"/link/connect",
				data: formData,
				dataType: "json",
				success: function(data) {
					if(data.result){
						//addFloopEntity(data.parent["_id"]["$id"], data.parentType, data.parent);
						toastr.success(data.msg);
						$(thiselement).html("");
						$(thiselement).attr("data-ownerlink","unparticipate");
						$(thiselement).attr("data-original-title", "Ne plus particper à l'évènement");
						addFloopEntity(id, type, data.parent);
						showFloopDrawer(true);
					}
					else
						toastr.error(data.msg);
				},
			});
		} else if ($(this).attr("data-ownerlink")=="unparticipate"){
			formData.connectType =  "attendees";
			console.log(formData);
			$.ajax({
				type: "POST",
				url: baseUrl+"/"+moduleId+"/link/disconnect",
				data : formData,
				dataType: "json",
				success: function(data){
					if ( data && data.result ) {
						$(thiselement).html("");
						$(thiselement).attr("data-ownerlink","participate");
						$(thiselement).attr("data-original-title", "Suivre");
						removeFloopEntity(data.parentId, type);
						toastr.success(trad["leaveeventsuccess"]);
					} else {
					   toastr.error("You leave succesfully");
					}
				}
			});
		}
    });

    $(".btn-tag").click(function(){
      setSearchValue($(this).html());
    });
  }

  function setSearchValue(value){
    $("#searchBarText").val(value);
    startSearch();
  }


text:
package com.ciklum.testing.places.component;

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
import com.google.android.gms.common.api.PendingResult;
import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.location.LocationSettingsRequest;
import com.google.android.gms.location.LocationSettingsResult;
import com.google.android.gms.location.LocationSettingsStatusCodes;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.model.LatLng;

import com.ciklum.testing.places.R;
import com.ciklum.testing.places.data.Place;
import com.ciklum.testing.places.location.GeocodeAsyncTask;
import com.ciklum.testing.places.location.GeocodeResultListener;
import com.ciklum.testing.places.ui.AutoFitRecyclerView;
import com.ciklum.testing.places.utils.SimpleTextWatcher;
import com.ciklum.testing.places.utils.Utils;

import android.content.IntentSender;
import android.gesture.Gesture;
import android.gesture.GestureOverlayView;
import android.location.Address;
import android.location.Location;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import java.util.ArrayList;

/**
 * @author Alexandr Stetsko (alexandr.stetsko@innomos.com)
 */
public class PlaceActivity extends FragmentActivity implements ConnectionCallbacks, OnConnectionFailedListener,
        LocationListener,
        LoaderManager.LoaderCallbacks<ArrayList<Place>> {

    protected static final String TAG = PlaceActivity.class.getSimpleName();

    private static final int LOADER_ID = 1015;

    /**
     * Camera animation zoom
     */
    public static final float MAP_CAMERA_ZOOM = 15.f;

    /**
     * The desired interval for location updates. Inexact. Updates may be more or less frequent.
     */
    public static final long UPDATE_INTERVAL_IN_MILLISECONDS = 10000;

    /**
     * The fastest rate for active location updates. Exact. Updates will never be more frequent
     * than this value.
     */
    public static final long FASTEST_UPDATE_INTERVAL_IN_MILLISECONDS =
            UPDATE_INTERVAL_IN_MILLISECONDS / 2;

    /**
     * Provides the entry point to Google Play services.
     */
    protected GoogleApiClient mGoogleApiClient;

    /**
     * Stores parameters for requests to the FusedLocationProviderApi.
     */
    protected LocationRequest mLocationRequest;

    /**
     * Represents a geographical location.
     */
    protected Location mCurrentLocation;

    private GoogleMap mMapView;
    private boolean mSkipAnimationToMyLocation = false;

    private TextView mKeyWordTextView;
    private AutoFitRecyclerView mRecycleView;
    private View mProgressView;
    private View mInfoView;

    private Address mAddress;
    private GeocodeAsyncTask mGeocodeAsyncTask;
    private PlaceAdapter mPlaceAdapter;

    private View mLeftContainer;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_places);

//        if (!Utils.isGooglePlayServicesAvailable(this)) {
//            finish();
//        }

        getSupportLoaderManager().initLoader(LOADER_ID, null, this);

        mProgressView      = findViewById(R.id.progress_view);
        mInfoView          = findViewById(R.id.info_view);
        mRecycleView       = (AutoFitRecyclerView)findViewById(R.id.recycler_view);
        initEditWidgets();

        mProgressView.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                return true;
            }
        });

        mPlaceAdapter = new PlaceAdapter();

        mRecycleView.setHasFixedSize(false);
        mRecycleView.setAdapter(mPlaceAdapter);

        mLeftContainer = findViewById(R.id.left_panel);

        final MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
        mapFragment.getMapAsync(new OnMapReadyCallback() {
            @Override
            public void onMapReady(GoogleMap googleMap) {
                mMapView = googleMap;
                mMapView.getUiSettings().setMyLocationButtonEnabled(false);
                mMapView.setMyLocationEnabled(true);
            }
        });

        GestureOverlayView gestureOverlayView = (GestureOverlayView)findViewById(R.id.gestures);
        gestureOverlayView.setGestureVisible(false);
        gestureOverlayView.addOnGesturePerformedListener(new GestureOverlayView.OnGesturePerformedListener() {
            @Override
            public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
            }
        });
        gestureOverlayView.addOnGesturingListener(new GestureOverlayView.OnGesturingListener() {
            @Override
            public void onGesturingStarted(GestureOverlayView overlay) {
                mSkipAnimationToMyLocation = true;
            }

            @Override
            public void onGesturingEnded(GestureOverlayView overlay) {
            }
        });

        // Update values using data stored in the Bundle.
        updateValuesFromBundle(savedInstanceState);

        // Kick off the process of building a GoogleApiClient and requesting the LocationServices
        // API.
        buildGoogleApiClient();

        //Task for gettin address
        mGeocodeAsyncTask = new GeocodeAsyncTask(this, new ContactsGeocodeResultListener());
    }

    private void initEditWidgets(){
        mKeyWordTextView = (TextView)findViewById(R.id.edit_text_keyword);

        final View clearKeyWordView = findViewById(R.id.clear_keyword_view);

        clearKeyWordView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mKeyWordTextView.setText("");
            }
        });

        mKeyWordTextView.addTextChangedListener(new SimpleTextWatcher() {
            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                if (s.length() > 0 && clearKeyWordView.getVisibility() != View.VISIBLE) {
                    clearKeyWordView.setVisibility(View.VISIBLE);
                } else if (s.length() == 0 && clearKeyWordView.getVisibility() == View.VISIBLE) {
                    clearKeyWordView.setVisibility(View.INVISIBLE);
                }
            }
        });
    }

    @Override
    public Loader<ArrayList<Place>> onCreateLoader(int id, Bundle args) {
        Loader<ArrayList<Place>> loader = null;
        if (id == LOADER_ID) {
            String keyword = (mKeyWordTextView!=null && mKeyWordTextView.getText()!=null)?mKeyWordTextView.getText().toString():null;
            loader = new PlaceLoader(getApplicationContext(), keyword, mCurrentLocation);
        }
        return loader;
    }

    @Override
    public void onLoadFinished(Loader<ArrayList<Place>> loader, ArrayList<Place> data) {
        mPlaceAdapter = new PlaceAdapter(data, mCurrentLocation);
        mPlaceAdapter.notifyDataSetChanged();
        mRecycleView.setAdapter(mPlaceAdapter);
        mProgressView.setVisibility(View.GONE);
        if(data==null || data.isEmpty()) {
            showInfoMessage(true);
        }
    }

    @Override
    public void onLoaderReset(Loader<ArrayList<Place>> loader) {
        mProgressView.setVisibility(View.GONE);
    }

    /**
     * Call user when click by button search
     * @param view in layout
     */
    public void onSearchClick(View view) {
        boolean isNetworkAvailable = Utils.isNetworkAvailable(getApplicationContext());

        if(isNetworkAvailable) {
            mProgressView.setVisibility(View.VISIBLE);
            mInfoView.setVisibility(View.GONE);

            String keyWord = mKeyWordTextView.getText() != null ? mKeyWordTextView.getText().toString() : null;

            mKeyWordTextView.clearFocus();
            Loader<ArrayList<Place>> loaderPlace = getSupportLoaderManager().getLoader(LOADER_ID);

            mPlaceAdapter.updateData(null, mCurrentLocation);
            PlaceLoader placeLoader = (PlaceLoader) loaderPlace;
            placeLoader.updateRequestData(keyWord, mCurrentLocation);
            placeLoader.forceLoad();
        }else {
            showInfoMessage(false);
        }
    }

    /**
     * Call user when click by button find me
     * @param view in layout
     */
    public void findMe(View view) {
        mSkipAnimationToMyLocation = false;
        if (mCurrentLocation != null) {
            animateToMyPosition();
        } else {
            showLocationWarningDialogIfNeed();
        }
        if (mGoogleApiClient.isConnected()) {
            startLocationUpdates();
        }
    }

    private void showLocationWarningDialogIfNeed() {
        LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()
                .addLocationRequest(mLocationRequest);

        //**************************
        builder.setAlwaysShow(true); //this is the key ingredient
        //**************************

        PendingResult<LocationSettingsResult> result =
                LocationServices.SettingsApi.checkLocationSettings(mGoogleApiClient, builder.build());
        result.setResultCallback(new ResultCallback<LocationSettingsResult>() {
            @Override
            public void onResult(LocationSettingsResult result) {
                final Status status = result.getStatus();
                switch (status.getStatusCode()) {
                    case LocationSettingsStatusCodes.SUCCESS:
                        // All location settings are satisfied. The client can initialize location
                        // requests here.
                        break;
                    case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:
                        // Location settings are not satisfied. But could be fixed by showing the user
                        // a dialog.
                        try {
                            // Show the dialog by calling startResolutionForResult(),
                            // and check the result in onActivityResult().
                            status.startResolutionForResult(PlaceActivity.this, 1000);
                        } catch (IntentSender.SendIntentException e) {
                            // Ignore the error.
                        }
                        break;
                    case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:
                        // Location settings are not satisfied. However, we have no way to fix the
                        // settings so we won't show the dialog.
                        break;
                }
            }
        });
    }

    /**
     * Updates fields based on data stored in the bundle.
     *
     * @param savedInstanceState The activity state saved in the Bundle.
     */
    private void updateValuesFromBundle(Bundle savedInstanceState) {
        Log.i(TAG, "Updating values from bundle");
    }

    /**
     * Builds a GoogleApiClient. Uses the {@code #addApi} method to request the
     * LocationServices API.
     */
    protected synchronized void buildGoogleApiClient() {
        Log.i(TAG, "Building GoogleApiClient");
        mGoogleApiClient = new GoogleApiClient.Builder(this)
                .addConnectionCallbacks(this)
                .addOnConnectionFailedListener(this)
                .addApi(LocationServices.API)
                .build();
        createLocationRequest();
    }

    /**
     * Sets up the location request. Android has two location request settings:
     * {@code ACCESS_COARSE_LOCATION} and {@code ACCESS_FINE_LOCATION}. These settings control
     * the accuracy of the current location. This sample uses ACCESS_FINE_LOCATION, as defined in
     * the AndroidManifest.xml.
     *

     * When the ACCESS_FINE_LOCATION setting is specified, combined with a fast update
     * interval (5 seconds), the Fused Location Provider API returns location updates that are
     * accurate to within a few feet.
     *

     * These settings are appropriate for mapping applications that show real-time location
     * updates.
     */
    protected void createLocationRequest() {
        mLocationRequest = new LocationRequest();
        mLocationRequest.setInterval(UPDATE_INTERVAL_IN_MILLISECONDS);
        mLocationRequest.setFastestInterval(FASTEST_UPDATE_INTERVAL_IN_MILLISECONDS);
        mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);

        showLocationWarningDialogIfNeed();

    }

    /**
     * Requests location updates from the FusedLocationApi.
     */
    protected void startLocationUpdates() {
        LocationServices.FusedLocationApi.requestLocationUpdates(
                mGoogleApiClient, mLocationRequest, this);
    }

    private void animateToMyPosition() {
        if(mCurrentLocation!=null && !mSkipAnimationToMyLocation) {
            double latitude  = mCurrentLocation.getLatitude();
            double longitude = mCurrentLocation.getLongitude();
            LatLng latLng = new LatLng(latitude, longitude);
            if(mMapView!=null) {
                mMapView.moveCamera(CameraUpdateFactory.newLatLng(latLng));
                mMapView.animateCamera(CameraUpdateFactory.zoomTo(MAP_CAMERA_ZOOM));
            }
        }
    }

    /**
     * Removes location updates from the FusedLocationApi.
     */
    protected void stopLocationUpdates() {
        LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, this);
    }

    @Override
    protected void onStart() {
        super.onStart();
        mGoogleApiClient.connect();
    }

    @Override
    public void onResume() {
        super.onResume();
        if (mGoogleApiClient.isConnected()) {
            startLocationUpdates();
        }
    }

    @Override
    protected void onPause() {
        super.onPause();
        if (mGoogleApiClient.isConnected()) {
            stopLocationUpdates();
        }
    }

    @Override
    protected void onStop() {
        super.onStop();
        mGoogleApiClient.disconnect();
    }

    private void showInfoMessage(boolean noResults) {
        ImageView infoImageView = ((ImageView) mInfoView.findViewById(R.id.contact_info_image));
        TextView infoMessageView = ((TextView) mInfoView.findViewById(R.id.contact_info_text));
        int idText = 0, idImage = 0;

        if(noResults) {
            idImage = R.drawable.no_results_icon;
            idText = R.string.places_not_found;
        }else {
            idText  = R.string.no_connection;
            idImage = R.drawable.network_error_icon;
        }

        if(idText>0) {
            infoMessageView.setText(idText);
        }
        if(idImage>0) {
            infoImageView.setImageResource(idImage);
        }
        mInfoView.setVisibility(View.VISIBLE);
    }

    /**
     * Runs when a GoogleApiClient object successfully connects.
     */
    @Override
    public void onConnected(Bundle connectionHint) {
        Log.i(TAG, "Connected to GoogleApiClient");

        mCurrentLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
        animateToMyPosition();
        startLocationUpdates();
    }

    /**
     * Callback that fires when the location changes.
     */
    @Override
    public void onLocationChanged(Location location) {
        mCurrentLocation = location;
        animateToMyPosition();

        if(mGeocodeAsyncTask == null){
            mGeocodeAsyncTask =  new GeocodeAsyncTask(this, new ContactsGeocodeResultListener());
        }
        if(mGeocodeAsyncTask.getStatus() == AsyncTask.Status.PENDING) {
            mGeocodeAsyncTask.execute(mCurrentLocation);
        }
    }

    @Override
    public void onConnectionSuspended(int cause) {
        mGoogleApiClient.connect();
    }

    @Override
    public void onConnectionFailed(ConnectionResult result) {
        Log.i(TAG, "Connection failed: ConnectionResult.getErrorCode() = " + result.getErrorCode());
    }

    @Override
    public void onSaveInstanceState(@NonNull Bundle savedInstanceState) {
        super.onSaveInstanceState(savedInstanceState);
    }

    private class  ContactsGeocodeResultListener implements GeocodeResultListener {
        @Override
        public void onResult(Address address) {
            mAddress = address;
            if(mAddress!=null) {
                if(mGoogleApiClient!=null && mGoogleApiClient.isConnected()) {
                    stopLocationUpdates();
                }
                mGeocodeAsyncTask = null;
            }
        }
    }

}


text:
/**
 * @module utils
 */

(/** @lends module:utils */function(){

/**
 * This is a string formatter, it is used for providing
 * pretty printing of arbitrary objects to strings.
 *
 * @constructor
*/
function Formatter() {
  this.result = '';
  this.tab    = '  ';
  this.level  = 0;
}
exports.Formatter = Formatter;

/**
 * Returns a string verison of the formatter.
 *
 * @returns {String} a string version of the formatter.
 */
Formatter.prototype.toString = function() {
  return this.result;
};

function indent(tab, level) {
  var result = '';
  for(var i=0; i<level; ++i) {
    result += tab;
  }
  return result;
}

Formatter.prototype.indent = function() {
  this.result += indent(this.tab, this.level);
  return this;
};

/**
 * Used to begin a formatter block.
 *
 * @param {String} name - the name of the current formatter block
 * @returns {Formatter} a reference to self
 */
Formatter.prototype.begin = function(name) {
  this.indent();
  this.result += name + ' {' + '\n';
  this.level += 1;
  return this;
};

/**
 * Used to end a formatter block.
 *
 * @returns {Formatter} a reference to self
 */
Formatter.prototype.end = function() {
  this.level -= 1;
  this.indent();
  this.result += '}';
  return this;
};

/**
 * Adds a field/value to the formatter.
 *
 * @param {String} field - attribute title of the pair
 * @param {Object} value - object that will be stringified
 * @returns {Formatter} returns a self reference
 */
Formatter.prototype.addPair = function(field, value) {
  this.indent();
  this.result += field + ': ' + value + '\n';
  return this;
};

/**
 * Adds a field/name/value to the formatter.
 *
 * @param {String} field - attribute title of the pair
 * @param {String} name - string representation of value
 * @param {Object} value - object that will be stringified
 * @returns {Formatter} returns a self reference
 */
Formatter.prototype.addTriple = function(field, name, value) {
  this.indent();
  this.result += field + ': ' + name + '(' + value + ')' + '\n';
  return this;
};

/**
 * A toString funciton that can be added to *.prototype.toString of
 * objects that need this behavior.
 *
 * @returns {String} a stringified version of a formatter invoked against this
 */
function toString() {
  var fmt = new Formatter();
  this.toFormatter(fmt);
  return fmt.toString();
}
exports.toString = toString;

})();


text:
body, header, section, div, ul {
  margin: 0;
  padding: 0; }

body header {
  text-align: center;
  color: black; }
  body header > ul {
    font-size: 1.3rem;
    margin-top: 15px;
    margin-bottom: 35px;
    list-style: none; }
    body header > ul span {
      font-style: italic; }
body #input-section {
  margin-left: 5px; }
  body #input-section #numbers {
    margin-right: 10px;
    text-align: right;
    width: 550px; }
  body #input-section #check {
    border-radius: 5px;
    margin-left: 10px; }
  body #input-section #clear {
    border-radius: 5px;
    margin-left: 10px; }
body #console {
  margin-top: 15px;
  margin-left: 5px; }

/*# sourceMappingURL=Min.Max of sequence.css.map */


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using PartyInvites.Models;

namespace PartyInvites
{
    public class Startup
    {
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddTransient<IRepository, EFRepository>();
            services.AddMvc();
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            app.UseStatusCodePages();
            app.UseDeveloperExceptionPage();
            app.UseStaticFiles();
            app.UseMvcWithDefaultRoute();
        }
    }
}


text:
package java2typescript.jackson.module.visitors;

import static java2typescript.jackson.module.visitors.TSJsonFormatVisitorWrapper.getTSTypeForHandler;

import java2typescript.jackson.module.grammar.MapType;

import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonMapFormatVisitor;

import java2typescript.jackson.module.Configuration;

public class TSJsonMapFormatVisitor extends ABaseTSJsonFormatVisitor<MapType> implements JsonMapFormatVisitor {

	public TSJsonMapFormatVisitor(ABaseTSJsonFormatVisitor parentHolder, Configuration conf) {
		super(parentHolder, conf);
		type = new MapType();
	}

	@Override
	public void keyFormat(JsonFormatVisitable handler, JavaType keyType) throws JsonMappingException {
		type.setKeyType(getTSTypeForHandler(this, handler, keyType, conf));
	}

	@Override
	public void valueFormat(JsonFormatVisitable handler, JavaType valueType) throws JsonMappingException {
		type.setValueType(getTSTypeForHandler(this, handler, valueType, conf));
	}

}