text:
<?php
declare(strict_types=1);

namespace Cake\Http\Middleware;

use Cake\Http\Exception\BadRequestException;
use Cake\Utility\Exception\XmlException;
use Cake\Utility\Xml;
use Closure;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;

/**
 * Parse encoded request body data.
 *
 * Enables JSON and XML request payloads to be parsed into the request's body.
 * You can also add your own request body parsers using the `addParser()` method.
 */
class BodyParserMiddleware implements MiddlewareInterface
{
    /**
     * Registered Parsers
     *
     * @var array<\Closure>
     */
    protected $parsers = [];

    /**
     * The HTTP methods to parse data on.
     *
     * @var array<string>
     */
    protected $methods = ['PUT', 'POST', 'PATCH', 'DELETE'];

    /**
     * Constructor
     *
     * ### Options
     *
     * - `json` Set to false to disable JSON body parsing.
     * - `xml` Set to true to enable XML parsing. Defaults to false, as XML
     *   handling requires more care than JSON does.
     * - `methods` The HTTP methods to parse on. Defaults to PUT, POST, PATCH DELETE.
     *
     * @param array<string, mixed> $options The options to use. See above.
     */
    public function __construct(array $options = [])
    {
        $options += ['json' => true, 'xml' => false, 'methods' => null];
        if ($options['json']) {
            $this->addParser(
                ['application/json', 'text/json'],
                Closure::fromCallable([$this, 'decodeJson'])
            );
        }
        if ($options['xml']) {
            $this->addParser(
                ['application/xml', 'text/xml'],
                Closure::fromCallable([$this, 'decodeXml'])
            );
        }
        if ($options['methods']) {
            $this->setMethods($options['methods']);
        }
    }

    /**
     * Set the HTTP methods to parse request bodies on.
     *
     * @param array<string> $methods The methods to parse data on.
     * @return $this
     */
    public function setMethods(array $methods)
    {
        $this->methods = $methods;

        return $this;
    }

    /**
     * Get the HTTP methods to parse request bodies on.
     *
     * @return array<string>
     */
    public function getMethods(): array
    {
        return $this->methods;
    }

    /**
     * Add a parser.
     *
     * Map a set of content-type header values to be parsed by the $parser.
     *
     * ### Example
     *
     * An naive CSV request body parser could be built like so:
     *
     * ```
     * $parser->addParser(['text/csv'], function ($body) {
     *   return str_getcsv($body);
     * });
     * ```
     *
     * @param array<string> $types An array of content-type header values to match. eg. application/json
     * @param \Closure $parser The parser function. Must return an array of data to be inserted
     *   into the request.
     * @return $this
     */
    public function addParser(array $types, Closure $parser)
    {
        foreach ($types as $type) {
            $type = strtolower($type);
            $this->parsers[$type] = $parser;
        }

        return $this;
    }

    /**
     * Get the current parsers
     *
     * @return array<\Closure>
     */
    public function getParsers(): array
    {
        return $this->parsers;
    }

    /**
     * Apply the middleware.
     *
     * Will modify the request adding a parsed body if the content-type is known.
     *
     * @param \Psr\Http\Message\ServerRequestInterface $request The request.
     * @param \Psr\Http\Server\RequestHandlerInterface $handler The request handler.
     * @return \Psr\Http\Message\ResponseInterface A response.
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        if (!in_array($request->getMethod(), $this->methods, true)) {
            return $handler->handle($request);
        }
        [$type] = explode(';', $request->getHeaderLine('Content-Type'));
        $type = strtolower($type);
        if (!isset($this->parsers[$type])) {
            return $handler->handle($request);
        }

        $parser = $this->parsers[$type];
        $result = $parser($request->getBody()->getContents());
        if (!is_array($result)) {
            throw new BadRequestException();
        }
        $request = $request->withParsedBody($result);

        return $handler->handle($request);
    }

    /**
     * Decode JSON into an array.
     *
     * @param string $body The request body to decode
     * @return array|null
     */
    protected function decodeJson(string $body)
    {
        if ($body === '') {
            return [];
        }
        $decoded = json_decode($body, true);
        if (json_last_error() === JSON_ERROR_NONE) {
            return (array)$decoded;
        }

        return null;
    }

    /**
     * Decode XML into an array.
     *
     * @param string $body The request body to decode
     * @return array
     */
    protected function decodeXml(string $body): array
    {
        try {
            $xml = Xml::build($body, ['return' => 'domdocument', 'readFile' => false]);
            // We might not get child nodes if there are nested inline entities.
            if ((int)$xml->childNodes->length > 0) {
                return Xml::toArray($xml);
            }

            return [];
        } catch (XmlException $e) {
            return [];
        }
    }
}


text:
  Meillon est
       un village
       situé dans le département des Pyrénées-Atlantiques en Aquitaine. Elle comptait 781 habitants en 2008.

La ville propose quelques  équipements sportifs, elle dispose, entre autres, de un terrain de tennis et deux terrains de sport.

Si vous pensez venir habiter à Meillon, vous pourrez facilement trouver une maison à vendre.

Meillon est localisé à seulement 6 Kilomètres de Pau, les élèves qui voudrons se loger à pas cher pourront envisager de louer un logement à Meillon. Meillon est aussi un bon investissement locatif a cause de sa proximité de Pau et de ses Universités. Il sera envisageable de trouver un logement à acheter.

Le nombre d'habitations, à Meillon, était réparti en 2011 en 22 appartements et 333 maisons soit
 un marché relativement équilibré.

À Meillon, la valorisation moyenne à la vente d'un appartement se situe à zero € du m² en vente. la valorisation moyenne d'une maison à l'achat se situe à 2 890 € du m². À la location la valeur moyenne se situe à 8,5 € du m² mensuel.

À proximité de Meillon sont positionnées géographiquement les communes de
Lée à 3 km, 1 096 habitants,
Mazères-Lezons localisée à 3 km, 2 026 habitants,
Narcastet à 1 km, 570 habitants,
Ousse localisée à 4 km, 1 367 habitants,
Bizanos située à 4 km, 4 612 habitants,
Baliros située à 4 km, 377 habitants,
 entre autres. De plus, Meillon est située à seulement six km de Pau.

redpajama_set_name: RedPajamaGithub


text:
import { Component, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { UiService } from '@colmena/admin-ui'

import { User, UsersService } from '../users.service'
import { NavTabLink } from '../components/user-tabs.component'

@Component({
  selector: 'app-user-detail',
  template: `

        <app-user-header [user]="item?.user"></app-user-header>
        <app-user-tabs [tabs]="tabs"></app-user-tabs>

        <router-outlet></router-outlet>

  `,
  styles: [`
    .card-header {
      padding-bottom: 0;
    }
  `],
})
export class UserDetailComponent implements OnInit {

  public tabs: NavTabLink[] = [
    { icon: 'fa fa-user', title: 'Profile', link: 'profile' },
    { icon: 'fa fa-key', title: 'Password', link: 'password' },
    { icon: 'fa fa-unlock', title: 'Access Tokens', link: 'access-tokens' },
    { icon: 'fa fa-tags', title: 'Roles', link: 'roles' },
  ]

  public item: any

  constructor(
    public service: UsersService,
    public uiService: UiService,
    private router: Router,
    private route: ActivatedRoute,
  ) {
  }

  ngOnInit() {
    this.item = this.route.snapshot.data.systemUser
    if (!this.item) {
      this.item = new User()
      this.tabs = this.tabs.splice(0, 1)
    }
    this.service.setSelectedUser(this.item)
  }
}


text:
package HTTP::Proxy::HeaderFilter;

use strict;
use Carp;

sub new {
    my $class = shift;
    my $self = bless {}, $class;
    $self->init(@_) if $self->can('init');
    return $self;
}

sub filter {
    croak "HTTP::Proxy::HeaderFilter cannot be used as a filter";
}

sub proxy {
    my ( $self, $new ) = @_;
    return $new ? $self->{_hphf_proxy} = $new : $self->{_hphf_proxy};
}

1;

__END__

=head1 NAME

HTTP::Proxy::HeaderFilter - A base class for HTTP message header filters

=head1 SYNOPSIS

    package MyFilter;

    use base qw( HTTP::Proxy::HeaderFilter );

    # changes the User-Agent header in all requests
    # this filter must be pushed on the request stack
    sub filter {
        my ( $self, $headers, $message ) = @_;

        $message->headers->header( User_Agent => 'MyFilter/1.0' );
    }

    1;

=head1 DESCRIPTION

The HTTP::Proxy::HeaderFilter class is used to create filters for
HTTP request/response headers.

=head2 Creating a HeaderFilter

A HeaderFilter is just a derived class that implements some methods
called by the proxy. Of all the methods presented below, only
C<filter()> B<must> be defined in the derived class.

=over 4

=item filter()

The signature of the filter() method is the following:

    sub filter { my ( $self, $headers, $message) = @_; ... }

where $self is the filter object, $headers is a HTTP::Headers object,
and $message is either a HTTP::Request or a HTTP::Response object.

The $headers HTTP::Headers object is the one that will be sent to
the client (if the filter is on the response stack) or origin
server (if the filter is on the request stack). If $headers is
modified by the filter, the modified headers will be sent to the
client or server.

The init() method (if it exists) is called by the new() constructeur
to perform all initisalisation tasks. It's called once in the filter
lifetime.

A HTTP::Proxy::HeaderFilter object is a blessed hash, and the base class
reserves only hash keys that start with C<_hphf>.

=item new()

The constructor is defined for all subclasses. Initialisation tasks
(if any) for subclasses should be done in the C<init()> method (see below).

=item init()

This method is called by the C<new()> constructeur to perform all
initisalisation tasks. It's called once in the filter lifetime.

It receives all the parameters passed to C<new()>.

=back

=head2 Standard HeaderFilters

Standard HTTP::Proxy::HeaderFilter classes are lowercase.

The following HeaderFilters are included in the HTTP::Proxy distribution:

=over 4

=item simple

This class lets you create a simple header filter from a code reference.

=item standard

This is the filter that provides standard headers handling for HTTP::Proxy.
It is loaded automatically by HTTP::Proxy.

=back

Please read each filter's documentation for more details about their use.

=head1 USEFUL METHODS FOR SUBCLASSES

Some methods are available to filters, so that they can eventually use
the little knowledge they might have of HTTP::Proxy's internals. They
mostly are accessors.

=over 4

=item proxy()

Gets a reference to the HTTP::Proxy objects that owns the filter.
This gives access to some of the proxy methods.

=back

=head1 AUTHOR

Philippe "BooK" Bruhat, E<lt>book@cpan.orgE<gt>.

=head1 SEE ALSO

L<HTTP::Proxy>, L<HTTP::Proxy::BodyFilter>.

=head1 COPYRIGHT

Copyright 2003-2005, Philippe Bruhat.

=head1 LICENSE

This module is free software; you can redistribute it or modify it under
the same terms as Perl itself.

=cut


text:
if(RapidJSONAlt_FOUND)
  return()
endif()

set(find_package_args)
if(RapidJSONAlt_FIND_VERSION)
  list(APPEND find_package_args ${RapidJSONAlt_FIND_VERSION})
endif()
if(RapidJSONAlt_FIND_QUIETLY)
  list(APPEND find_package_args QUIET)
endif()
find_package(RapidJSON ${find_package_args})
if(RapidJSON_FOUND)
  set(RapidJSONAlt_FOUND TRUE)
  set(RAPIDJSON_INCLUDE_DIR ${RAPIDJSON_INCLUDE_DIRS})
  return()
endif()

if(RapidJSON_ROOT)
  find_path(RAPIDJSON_INCLUDE_DIR
            NAMES rapidjson/rapidjson.h
            PATHS ${RapidJSON_ROOT}
            NO_DEFAULT_PATH
            PATH_SUFFIXES "include")
else()
  find_path(RAPIDJSON_INCLUDE_DIR
            NAMES rapidjson/rapidjson.h
            PATH_SUFFIXES "include")
endif()

if(RAPIDJSON_INCLUDE_DIR)
  file(READ "${RAPIDJSON_INCLUDE_DIR}/rapidjson/rapidjson.h" RAPIDJSON_H_CONTENT)
  string(REGEX MATCH "#define RAPIDJSON_MAJOR_VERSION ([0-9]+)"
               RAPIDJSON_MAJOR_VERSION_DEFINITION "${RAPIDJSON_H_CONTENT}")
  string(REGEX REPLACE "^.+ ([0-9]+)$" "\\1" RAPIDJSON_MAJOR_VERSION
                       "${RAPIDJSON_MAJOR_VERSION_DEFINITION}")
  string(REGEX MATCH "#define RAPIDJSON_MINOR_VERSION ([0-9]+)"
               RAPIDJSON_MINOR_VERSION_DEFINITION "${RAPIDJSON_H_CONTENT}")
  string(REGEX REPLACE "^.+ ([0-9]+)$" "\\1" RAPIDJSON_MINOR_VERSION
                       "${RAPIDJSON_MINOR_VERSION_DEFINITION}")
  string(REGEX MATCH "#define RAPIDJSON_PATCH_VERSION ([0-9]+)"
               RAPIDJSON_PATCH_VERSION_DEFINITION "${RAPIDJSON_H_CONTENT}")
  string(REGEX REPLACE "^.+ ([0-9]+)$" "\\1" RAPIDJSON_PATCH_VERSION
                       "${RAPIDJSON_PATCH_VERSION_DEFINITION}")
  if("${RAPIDJSON_MAJOR_VERSION}" STREQUAL ""
     OR "${RAPIDJSON_MINOR_VERSION}" STREQUAL ""
     OR "${RAPIDJSON_PATCH_VERSION}" STREQUAL "")
    set(RAPIDJSON_VERSION "0.0.0")
  else()
    set(RAPIDJSON_VERSION
        "${RAPIDJSON_MAJOR_VERSION}.${RAPIDJSON_MINOR_VERSION}.${RAPIDJSON_PATCH_VERSION}"
    )
  endif()
endif()

find_package_handle_standard_args(
  RapidJSONAlt
  REQUIRED_VARS RAPIDJSON_INCLUDE_DIR
  VERSION_VAR RAPIDJSON_VERSION)


text:
module Bootscale
  module ActiveSupport
    class << self
      attr_reader :cache, :cache_directory

      def cache_builder
        @cache_builder ||= CacheBuilder.new
      end

      def setup(options = {})
        @cache_directory = options.fetch(:cache_directory, Bootscale.cache_directory)
        require 'active_support'
        require 'active_support/dependencies'
        cache_implementation = options.fetch(:development_mode, false) ? DevelopmentCache : Cache
        @cache = cache_implementation.new(cache_directory)
        require_relative 'active_support/core_ext'
      end
    end

    module CacheConcern
      def load_path
        ::ActiveSupport::Dependencies.autoload_paths
      end

      # Ideally we'd use a more accurate comparison like `#hash`, unfortunately it's
      # not efficient enough given how much of a hot spot this is.
      # So we assume entries are not mutated or replaced, only added or removed.
      # It is obviously wrong sometimes, and you'll have to manually call Bootscale.regenerate
      def reload(force = true)
        @load_path_size ||= nil

        if force
          @cache = fetch(load_path)
          @load_path_size = load_path.size
        elsif (size = load_path.size) != @load_path_size
          @cache = fetch(load_path)
          @load_path_size = size
        end
      end
    end

    class Cache < ::Bootscale::Cache
      include CacheConcern
    end

    class DevelopmentCache < ::Bootscale::DevelopmentCache
      include CacheConcern
    end
  end
end


text:
<?php

/**
 * Ashiato form base class.
 *
 * @method Ashiato getObject() Returns the current form's model object
 *
 * @package    OpenPNE
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseAshiatoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'member_id_from' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Member_2'), 'add_empty' => true)),
      'member_id_to'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Member'), 'add_empty' => true)),
      'r_date'         => new sfWidgetFormDate(),
      'created_at'     => new sfWidgetFormDateTime(),
      'updated_at'     => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'member_id_from' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Member_2'), 'required' => false)),
      'member_id_to'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Member'), 'required' => false)),
      'r_date'         => new sfValidatorDate(array('required' => false)),
      'created_at'     => new sfValidatorDateTime(),
      'updated_at'     => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('ashiato[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Ashiato';
  }

}


text:
from watson_developer_cloud.watson_developer_cloud_service import \
    WatsonDeveloperCloudService

class NaturalLanguageUnderstandingV1(WatsonDeveloperCloudService):
    """
    All methods taking features use the feature classes
    from watson_developer_cloud/natural_language_understanding/features/v1

    """
    base_url = 'https://gateway.watsonplatform.net'
    default_url = '{0}/natural-language-understanding/api'.format(base_url)
    latest_version = '2017-02-27'

    def __init__(self,
                 version,
                 url=default_url,
                 username=None,
                 password=None,
                 **kwargs):
        WatsonDeveloperCloudService.__init__(
            self, 'natural-language-understanding', url,
            username, password, **kwargs)
        self.version = version

    def analyze(self, features, text=None, url=None, html=None,
                clean=True, xpath=None, fallback_to_raw=True,
                return_analyzed_text=False, language=None):
        """
        This is the method to call and analyze text with the supplied features
        :param features: The list of features
        :param text: Text to analyze (pick one of text, url, or html)
        :param url: url to analyze (pick one of text, url, or html)
        :param html: html to analyze (pick one of text, url, or html)
        :param clean: should the service clean the text?
        :param xpath: xpath to use for html or url
        :param fallback_to_raw:
        :param return_analyzed_text: should the analyzed
               text be returned (defaults to false)
        :param language: what language to use
        :return: dict of analyzed text
        """
        body = {
            'clean': clean,
            'fallback_to_raw': fallback_to_raw,
            'return_analyzed_text': return_analyzed_text,
            'xpath': xpath,
            'language': language,
            'text': text,
            'url': url,
            'html': html
        }

        feature_dict = {}
        for feature in features:
            feature_dict[feature.name()] = feature.toDict()
        body['features'] = feature_dict

        if text is None and html is None and url is None:
            msg = "html, text, or url must have content"
            raise ValueError(msg)

        if len(features) < 1:
            raise ValueError("Must supply at least one feature")

        return self.request(method='POST', url='/v1/analyze',
                            params={"version": self.version},
                            headers={'content-type': 'application/json'},
                            json=body,
                            accept_json=True)

    def list_models(self):
        """
        Lists the custom models available for your service instance
        :return: dict of available custom models
        """
        return self.request(method='GET', url='/v1/models',
                            params={"version": self.version},
                            accept_json=True)

    def delete_model(self, model_id):
        """
        Deletes a custom model
        :param model_id: The ID of the model to delete
        :return: dict with status of model deletion
        """

        return self.request(method='DELETE',
                            url='/v1/models/{0}'.format(model_id),
                            params={"version": self.version},
                            accept_json=True)


text:
var proxyquire = require('proxyquire');
var Readable = require('stream').Readable;
var EventEmitter = require('events').EventEmitter;

describe('JiraClient.getIssue()', function () {
    it('works for valid input!', function (done) {
        var key = 'PROJ-123', summary = "It's broke";
        var mockJiraJson = JSON.stringify({
            issues: [{ key: key, fields: { summary: summary} }]
        });
        var mockHttps = createMockHttps(mockJiraJson);
        var JiraClient = proxyquire('../index.js',
            { https: mockHttps });
        var sut = new JiraClient({
            host: 'whatever',
            user: 'whatever',
            password: '***'});
        sut.getIssue(key, function (err, issue) {
            expect(issue.summary).toBe(summary);
            done();
        });
    });
});

function createMockHttps(responseData) {
    return {
        get: function (opts, callback) {
            var rs = new Readable;
            rs.push(responseData);
            rs.push(null);
            callback(rs);
            return new EventEmitter;
        }
    };
}


text:
var fs = require('fs'),
	_ = require('underscore'),
	path = require('path'),
	Issue = require('./Issue');

// TODO: writing to disk rather sucks

var issueDao = module.exports = {};

var home = '';
var issues = {};

issueDao.init = function (dir) {
	home = path.normalize(dir);
	console.log('storing issues in: ' + home);
};

function getIssueFileFromProject(project) {
	return home + project.slug + '.json';
}

issueDao.load = function (project, callback) {
	var issueFile = getIssueFileFromProject(project);
	console.log('Loading issues from ' + issueFile);
	try {
		var issueJSON = fs.readFileSync(issueFile);
		issues[project.slug] = Issue.applyDefaults(JSON.parse(issueJSON.toString()));
	} catch (e) {
		console.log("Issue file does not appear to exist yet, but that's okay. It'll get created with the first issue.", e);
	}
	callback(null, issues[project.slug] || []);
};

issueDao.count = function (project, callback) {
	var cached = issues[project.slug];
	if (cached !== undefined) {
		callback(null, cached.length);
	} else {
		issueDao.load(project, function (err, issues) {
			if (err) {
				callback(err);
			} else {
				callback(null, issues.length);
			}
		});
	}
};

issueDao.add = function (description, name, project, callback) {
	if (!issues[project.slug]) {
		issues[project.slug] = [];
	}

	var id = issues[project.slug].length + 1;
	var issue = new Issue(id, description, name);
	issues[project.slug].push(issue);
	this.write(project);

	callback(null, issue);
};

issueDao.find = function (id, project) {
	return issues[project.slug][id - 1];
};

issueDao.addTag = function (id, tag, project, callback) {
	var issue = issueDao.find(id, project);
	if (!issue) {
		callback(null, null);
	} else {
		issue.tags.push(tag);
		issues[project.slug][issue.id - 1] = issue;
		this.write(project);
		callback(null, issue);
	}
};

issueDao.stripTags = function (id, project, callback) {
	var issue = issueDao.find(id, project);
	if (!issue) {
		callback(null, null);
	} else {
		issue.tags = [];
		issues[project.slug][issue.id - 1] = issue;
		this.write(project);
		callback(null, issue);
	}
};

issueDao.update = function (id, props, project, callback) {
	delete props['id']; // never change this

	var issue = issueDao.find(id, project);
	if (!issue) {
		callback(null, null);
	} else {
		for (var key in props) {
			if (key === 'critical') {
				issue[key] = !issue[key];
			} else {
				issue[key] = props[key];
			}
		}
		issues[project.slug][issue.id - 1] = issue;
		this.write(project); // TODO: only persist updated
		callback(null, issue);
	}
};

issueDao.write = function (project) {
	var issueFile = getIssueFileFromProject(project);
	fs.writeFile(issueFile, JSON.stringify(issues[project.slug]), function (err) {
		if (err) {
			console.log("Couldn't write issues file.");
			throw err;
		}
	});
};

issueDao.reset = function (project, callback) {
	issues[project.slug] = [];
	this.write(project);
	callback(null);
};


text:
import { vec2 } from 'gl-matrix';

// Helper to get scroll position since cross browser is a mess:
// https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY
const getScrollValues = () => (
  vec2.fromValues(
    window.pageXOffset ||
    document.documentElement.scrollLeft ||
    document.body.scrollLeft ||
    0,
    window.pageYOffset ||
    document.documentElement.scrollTop ||
    document.body.scrollTop ||
    0
  )
);

const scrollListeners = [];
const resizeListeners = [];

let currentScrollPosition;

export default {
  init() {
    currentScrollPosition = getScrollValues();

    window.addEventListener('scroll', () => requestAnimationFrame(() => {
      currentScrollPosition = getScrollValues();
      scrollListeners.forEach(callback => callback(currentScrollPosition));
    }));

    window.addEventListener('resize', () => requestAnimationFrame(() => {
      resizeListeners.forEach(callback => callback());
    }));
  },

  getScrollPosition() {
    return currentScrollPosition;
  },

  addScrollListener(callback) {
    scrollListeners.push(callback);
  },

  addResizeListener(callback) {
    resizeListeners.push(callback)
  },
};


text:
import React, { Component } from 'react';
import { Dropdown } from 'semantic-ui-react'

export default class RateDroplist extends Component {

    render() {
        const{currencyName,ChangeText}=this.props;

        let stateOptions=[];
        Object.keys(currencyName).map((title) =>{
            let target_object = {};
            target_object['key']=title;
            target_object['value']=title;
            target_object['text']=currencyName[title];
            stateOptions=stateOptions.concat(target_object);
            return true;
        });

        return (

          <div className="setMargin">
                <Dropdown  placeholder='Currency Choices'
                           search
                           selection
                           options={stateOptions}
                           onChange={(e,{value})=>{ChangeText(value);}
                           }/>
            </div>

        )
    }
}


text:
require 'pathname'

require File.join(File.expand_path(File.dirname(__FILE__)), '/classes/IlluminatorFramework.rb')

workspace = Dir.pwd

# TODO: helpful message if file isn't supplied

overrideOptions = lambda {|opts| opts}

success = IlluminatorFramework.reRun(ARGV[0], workspace, overrideOptions)

exit 1 unless success


text:
module AwsSdkCodeGenerator
  class ResourceIdentifier

    # @return [String]
    attr_accessor :name

    # @return [String]
    attr_accessor :type

    # @return [String, nil]
    attr_accessor :offset

    # @return [String, nil]
    attr_accessor :alias

    class << self

      # @return [Array<ResourceIdentifier>)
      def build_list(resource)
        resource.fetch('identifiers', []).each.with_index.map do |i, n|
          ResourceIdentifier.new.tap do |identifier|
            identifier.name = Underscore.underscore(i['name'])
            identifier.type = Docstring.ucfirst(i['type'] || 'String')
            identifier.offset = n
            identifier.alias = identifier_alias(i)
          end
        end
      end

      private

      def identifier_alias(identifier)
        if identifier['memberName'] && identifier['memberName'] != identifier['name']
          Underscore.underscore(identifier['memberName'])
        else
          nil
        end
      end

    end
  end
end


text:
package Google::Ads::AdWords::v201402::DataService::getAdGroupBidLandscape;
use strict;
use warnings;

{ # BLOCK to scope variables

sub get_xmlns { 'https://adwords.google.com/api/adwords/cm/v201402' }

__PACKAGE__->__set_name('getAdGroupBidLandscape');
__PACKAGE__->__set_nillable();
__PACKAGE__->__set_minOccurs();
__PACKAGE__->__set_maxOccurs();
__PACKAGE__->__set_ref();

use base qw(
    SOAP::WSDL::XSD::Typelib::Element
    Google::Ads::SOAP::Typelib::ComplexType
);

our $XML_ATTRIBUTE_CLASS;
undef $XML_ATTRIBUTE_CLASS;

sub __get_attr_class {
    return $XML_ATTRIBUTE_CLASS;
}

use Class::Std::Fast::Storable constructor => 'none';
use base qw(Google::Ads::SOAP::Typelib::ComplexType);

{ # BLOCK to scope variables

my %serviceSelector_of :ATTR(:get<serviceSelector>);

__PACKAGE__->_factory(
    [ qw(        serviceSelector

    ) ],
    {
        'serviceSelector' => \%serviceSelector_of,
    },
    {
        'serviceSelector' => 'Google::Ads::AdWords::v201402::Selector',
    },
    {

        'serviceSelector' => 'serviceSelector',
    }
);

} # end BLOCK

} # end of BLOCK

1;

=pod

=head1 NAME

Google::Ads::AdWords::v201402::DataService::getAdGroupBidLandscape

=head1 DESCRIPTION

Perl data type class for the XML Schema defined element
getAdGroupBidLandscape from the namespace https://adwords.google.com/api/adwords/cm/v201402.

Returns a list of {@link AdGroupBidLandscape}s for the ad groups specified in the selector. In the result, the returned {@link LandscapePoint}s are grouped into {@link AdGroupBidLandscape}s by their ad groups, and numberResults of paging limits the total number of {@link LandscapePoint}s instead of number of {@link AdGroupBidLandscape}s. @param serviceSelector Selects the entities to return bid landscapes for. @return A list of bid landscapes. @throws ApiException when there is at least one error with the request.

=head1 PROPERTIES

The following properties may be accessed using get_PROPERTY / set_PROPERTY
methods:

=over

=item * serviceSelector

 $element->set_serviceSelector($data);
 $element->get_serviceSelector();

=back

=head1 METHODS

=head2 new

 my $element = Google::Ads::AdWords::v201402::DataService::getAdGroupBidLandscape->new($data);

Constructor. The following data structure may be passed to new():

 {
   serviceSelector =>  $a_reference_to, # see Google::Ads::AdWords::v201402::Selector
 },

=head1 AUTHOR

Generated by SOAP::WSDL

=cut


text:
@font-face {
	font-family: 'RaghuMalayalam';
	src: url('RaghuMalayalam/RaghuMalayalamSans-Regular.eot');
	src: url('RaghuMalayalam/RaghuMalayalamSans-Regular.eot?#iefix') format('embedded-opentype'),
		url('RaghuMalayalam/RaghuMalayalamSans-Regular.woff2') format('woff2'),
		url('RaghuMalayalam/RaghuMalayalamSans-Regular.woff') format('woff'),
		url('RaghuMalayalam/RaghuMalayalamSans-Regular.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
	unicode-range: U+0000-02DC, U+0D01-0D7F, U+200C-200D, U+25CC;
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>tools.datasync</groupId>
	<artifactId>db2dbseed</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>

	<name>db2dbseed</name>
	<url>http://www.datasync.tools</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<spring.version>4.1.1.RELEASE</spring.version>
	</properties>

	<repositories>
		<repository>
			<id>codehaus</id>
			<url>http://repository.codehaus.org/org/codehaus</url>
		</repository>
	</repositories>

	<dependencies>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.codehaus.jackson</groupId>
			<artifactId>jackson-mapper-asl</artifactId>
			<version>1.8.5</version>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.derby</groupId>
			<artifactId>derby</artifactId>
			<version>10.11.1.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jdbc</artifactId>
			<version>${spring.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<version>${spring.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<resources>
			<resource>
				<directory>src/test/resources</directory>
				<includes>
					<include>**/*.properties</include>
					<include>**/*.xml</include>
				</includes>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
				<includes>
					<include>**/*.properties</include>
					<include>**/*.xml</include>
				</includes>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.1</version>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>


text:
#include <stdio.h>
#include <algorithm>

#include "perfetto/ext/base/file_utils.h"
#include "perfetto/ext/base/getopt.h"
#include "perfetto/ext/base/string_utils.h"
#include "perfetto/ext/base/unix_task_runner.h"
#include "perfetto/ext/base/utils.h"
#include "perfetto/ext/base/version.h"
#include "perfetto/ext/base/watchdog.h"
#include "perfetto/ext/traced/traced.h"
#include "perfetto/ext/tracing/ipc/default_socket.h"
#include "perfetto/ext/tracing/ipc/service_ipc_host.h"
#include "src/traced/service/builtin_producer.h"

#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
#define PERFETTO_SET_SOCKET_PERMISSIONS
#include <fcntl.h>
#include <grp.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#endif

#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
#include <sys/system_properties.h>
#endif

namespace perfetto {
namespace {
#if defined(PERFETTO_SET_SOCKET_PERMISSIONS)
void SetSocketPermissions(const std::string& socket_name,
                          const std::string& group_name,
                          const std::string& mode_bits) {
  PERFETTO_CHECK(!socket_name.empty());
  PERFETTO_CHECK(!group_name.empty());
  struct group* socket_group = nullptr;
  // Query the group ID of |group|.
  do {
    socket_group = getgrnam(group_name.c_str());
  } while (socket_group == nullptr && errno == EINTR);
  if (socket_group == nullptr) {
    PERFETTO_FATAL("Failed to get group information of %s ",
                   group_name.c_str());
  }

  if (PERFETTO_EINTR(
          chown(socket_name.c_str(), geteuid(), socket_group->gr_gid))) {
    PERFETTO_FATAL("Failed to chown %s ", socket_name.c_str());
  }

  // |mode| accepts values like "0660" as "rw-rw----" mode bits.
  auto mode_value = base::StringToInt32(mode_bits, 8);
  if (!(mode_bits.size() == 4 && mode_value.has_value())) {
    PERFETTO_FATAL(
        "The chmod option must be a 4-digit octal number, e.g. 0660");
  }
  if (PERFETTO_EINTR(chmod(socket_name.c_str(),
                           static_cast<mode_t>(mode_value.value())))) {
    PERFETTO_FATAL("Failed to chmod %s", socket_name.c_str());
  }
}
#endif  // defined(PERFETTO_SET_SOCKET_PERMISSIONS)

void PrintUsage(const char* prog_name) {
  fprintf(stderr, R"(
Usage: %s [option] ...
Options and arguments
    --background : Exits immediately and continues running in the background
    --version : print the version number and exit.
    --set-socket-permissions <permissions> : sets group ownership and permission
        mode bits of the producer and consumer sockets.
        <permissions> format: <prod_group>:<prod_mode>:<cons_group>:<cons_mode>,
        where <prod_group> is the group name for chgrp the producer socket,
        <prod_mode> is the mode bits (e.g. 0660) for chmod the produce socket,
        <cons_group> is the group name for chgrp the consumer socket, and
        <cons_mode> is the mode bits (e.g. 0660) for chmod the consumer socket.

Example:
    %s --set-socket-permissions traced-producer:0660:traced-consumer:0660
    starts the service and sets the group ownership of the producer and consumer
    sockets to "traced-producer" and "traced-consumer", respectively. Both
    producer and consumer sockets are chmod with 0660 (rw-rw----) mode bits.
)",
          prog_name, prog_name);
}
}  // namespace

int PERFETTO_EXPORT_ENTRYPOINT ServiceMain(int argc, char** argv) {
  enum LongOption {
    OPT_VERSION = 1000,
    OPT_SET_SOCKET_PERMISSIONS = 1001,
    OPT_BACKGROUND,
  };

  bool background = false;

  static const option long_options[] = {
      {"background", no_argument, nullptr, OPT_BACKGROUND},
      {"version", no_argument, nullptr, OPT_VERSION},
      {"set-socket-permissions", required_argument, nullptr,
       OPT_SET_SOCKET_PERMISSIONS},
      {nullptr, 0, nullptr, 0}};

  std::string producer_socket_group, consumer_socket_group,
      producer_socket_mode, consumer_socket_mode;

  for (;;) {
    int option = getopt_long(argc, argv, "", long_options, nullptr);
    if (option == -1)
      break;
    switch (option) {
      case OPT_BACKGROUND:
        background = true;
        break;
      case OPT_VERSION:
        printf("%s\n", base::GetVersionString());
        return 0;
      case OPT_SET_SOCKET_PERMISSIONS: {
        // Check that the socket permission argument is well formed.
        auto parts = base::SplitString(std::string(optarg), ":");
        PERFETTO_CHECK(parts.size() == 4);
        PERFETTO_CHECK(
            std::all_of(parts.cbegin(), parts.cend(),
                        [](const std::string& part) { return !part.empty(); }));
        producer_socket_group = parts[0];
        producer_socket_mode = parts[1];
        consumer_socket_group = parts[2];
        consumer_socket_mode = parts[3];
        break;
      }
      default:
        PrintUsage(argv[0]);
        return 1;
    }
  }

  if (background) {
    base::Daemonize([] { return 0; });
  }

  base::UnixTaskRunner task_runner;
  std::unique_ptr<ServiceIPCHost> svc;
  svc = ServiceIPCHost::CreateInstance(&task_runner);

  // When built as part of the Android tree, the two socket are created and
  // bound by init and their fd number is passed in two env variables.
  // See libcutils' android_get_control_socket().
  const char* env_prod = getenv("ANDROID_SOCKET_traced_producer");
  const char* env_cons = getenv("ANDROID_SOCKET_traced_consumer");
  PERFETTO_CHECK((!env_prod && !env_cons) || (env_prod && env_cons));
  bool started;
  if (env_prod) {
#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
    PERFETTO_CHECK(false);
#else
    base::ScopedFile producer_fd(atoi(env_prod));
    base::ScopedFile consumer_fd(atoi(env_cons));
    started = svc->Start(std::move(producer_fd), std::move(consumer_fd));
#endif
  } else {
    remove(GetProducerSocket());
    remove(GetConsumerSocket());
    started = svc->Start(GetProducerSocket(), GetConsumerSocket());

    if (!producer_socket_group.empty()) {
#if defined(PERFETTO_SET_SOCKET_PERMISSIONS)
      SetSocketPermissions(GetProducerSocket(), producer_socket_group,
                           producer_socket_mode);
      SetSocketPermissions(GetConsumerSocket(), consumer_socket_group,
                           consumer_socket_mode);
#else
      PERFETTO_ELOG(
          "Setting socket permissions is not supported on this platform");
      return 1;
#endif
    }
  }

  if (!started) {
    PERFETTO_ELOG("Failed to start the traced service");
    return 1;
  }

  // Advertise builtin producers only on in-tree builds. These producers serve
  // only to dynamically start heapprofd and other services via sysprops, but
  // that can only ever happen in in-tree builds.
#if PERFETTO_BUILDFLAG(PERFETTO_ANDROID_BUILD)
  BuiltinProducer builtin_producer(&task_runner, /*lazy_stop_delay_ms=*/30000);
  builtin_producer.ConnectInProcess(svc->service());
#endif

  // Set the CPU limit and start the watchdog running. The memory limit will
  // be set inside the service code as it relies on the size of buffers.
  // The CPU limit is the generic one defined in watchdog.h.
  base::Watchdog* watchdog = base::Watchdog::GetInstance();
  watchdog->SetCpuLimit(base::kWatchdogDefaultCpuLimit,
                        base::kWatchdogDefaultCpuWindow);
  watchdog->Start();

  // If the TRACED_NOTIFY_FD env var is set, write 1 and close the FD. This is
  // so tools can synchronize with the point where the IPC socket has been
  // opened, without having to poll. This is used for //src/tracebox.
  const char* env_notif = getenv("TRACED_NOTIFY_FD");
  if (env_notif) {
    int notif_fd = atoi(env_notif);
    PERFETTO_CHECK(base::WriteAll(notif_fd, "1", 1) == 1);
    PERFETTO_CHECK(base::CloseFile(notif_fd) == 0);
  }

#if PERFETTO_BUILDFLAG(PERFETTO_ANDROID_BUILD) && \
    PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
  // Notify init (perfetto.rc) that traced has been started. Used only by
  // the perfetto_trace_on_boot init service.
  // This property can be set only in in-tree builds. shell.te doesn't have
  // SELinux permissions to set sys.trace.* properties.
  if (__system_property_set("sys.trace.traced_started", "1") != 0) {
    PERFETTO_PLOG("Failed to set property sys.trace.traced_started");
  }
#endif

  PERFETTO_ILOG("Started traced, listening on %s %s", GetProducerSocket(),
                GetConsumerSocket());
  task_runner.Run();
  return 0;
}

}  // namespace perfetto


text:
Configuration

Tableau de Bord

Gérer Staff

    <form class="col-md-10 col-md-offset-1" name="form" novalidate>

            Nom * :
            <input class="col-md-7" type="text" placeholder="Nom" ng-model="staff.nom" name="nom" required/>

Vous devez entrer le nom.

            Identifiant * :
            <input class="col-md-7" type="text" placeholder="Identifiant" ng-model="staff.identifiant" name="ident" required/>

Vous devez entrer l'identifiant.

            Mot de passe * :
            <input class="col-md-7" type="password" placeholder="Mot de passe" ng-model="staff.password" name="mdp" required/>

Vous devez entrer un mot de passe.

            Re-Mot de passe * :
            <input class="col-md-7" type="password" placeholder="Re-saisir le mot de passe" ng-model="staff.repassword" name="rmdp" required/>

Vous devez entrer à nouveau le mot de passe.

Veuillez saisir le même mot de passe.

            Niveau d'authorisation * :
            <select class="col-md-7 text-center" ng-model="staff.authorisation" name="autho" required>
                <option value="" selected>----- Niveau d'authorisation -----</option>
                <option value="Staff">Staff</option>
                <option value="Admin">Admin</option>
            </select>

Vous devez choisir le niveau d'authorisation.

        <input type="submit" class="col-md-2 col-md-offset-5 btn btn-sm btn-info" value="Valider" ng-click="form.$valid && addStaff()"/>

* : Champs obligatoire

    </form>

0">

        Nom
        Identifiant
        Niveau d'authorisation

        {{obj.nom}}
        {{obj.login}}
        {{obj.permission}}

            <input class="col-md-4" type="text" placeholder="Nom" ng-model="obj.nom" name="nom" required/>
            <input class="col-md-4" type="text" placeholder="Login" ng-model="obj.login" name="login" required/>
            <select class="col-md-3 text-center" ng-model="obj.permission" name="permission" required>
                <option value="" selected>----- Niveau d'authorisation -----</option>
                <option value="Staff">Staff</option>
                <option value="Admin">Admin</option>
            </select>
            <input type="submit" class="col-md-1 btn btn-sm btn-success" value="Valider" ng-click="updateStaff(obj)"/>


text:
package pl.themolka.arcade.respawn;

import org.bukkit.Location;
import pl.themolka.arcade.ArcadePlugin;
import pl.themolka.arcade.session.ArcadePlayer;
import pl.themolka.arcade.session.PlayerEvent;

public class PlayerRespawnEvent extends PlayerEvent {
    private Location respawnPosition;

    public PlayerRespawnEvent(ArcadePlugin plugin, ArcadePlayer player) {
        super(plugin, player);
    }

    public Location getRespawnPosition() {
        return respawnPosition;
    }

    public void setRespawnPosition(Location respawnPosition) {
        this.respawnPosition = respawnPosition;
    }
}


text:
#ifndef NET_GRPC_COMPILER_RUBY_GENERATOR_HELPERS_INL_H_
#define NET_GRPC_COMPILER_RUBY_GENERATOR_HELPERS_INL_H_

#include <string>

#include <google/protobuf/descriptor.h>
#include "src/compiler/ruby_generator_string-inl.h"

namespace grpc_ruby_generator {

inline bool ServicesFilename(const google::protobuf::FileDescriptor *file,
                             std::string *file_name_or_error) {
  // Get output file name.
  static const unsigned proto_suffix_length = 6;  // length of ".proto"
  if (file->name().size() > proto_suffix_length &&
      file->name().find_last_of(".proto") == file->name().size() - 1) {
    *file_name_or_error =
        file->name().substr(0, file->name().size() - proto_suffix_length) +
        "_services.rb";
    return true;
  } else {
    *file_name_or_error = "Invalid proto file name:  must end with .proto";
    return false;
  }
}

inline std::string MessagesRequireName(
    const google::protobuf::FileDescriptor *file) {
  return Replace(file->name(), ".proto", "");
}

}  // namespace grpc_ruby_generator

#endif  // NET_GRPC_COMPILER_RUBY_GENERATOR_HELPERS_INL_H_


text:
var features = {};

features.eatApple = function(person, apples) {
  score++;
  apples.kill();

  if (score === MAX_SCORE) {
    this.gameOver("Player 1");
  }
}

features.cherry = function(person, cherry) {
  cherry.kill();
  person.cherry = true;
  setTimeout(function(){person.cherry = false}, 5000);
}

features.speedUp = function(character, speedUp) {
  speedUp.kill();
  character.speedMultiplyer = 1.5;
  setTimeout(function(){character.speedMultiplyer = 1}, 5000);
}

features.slowDown = function(character, slowDown) {
  slowDown.kill();
  character.speedMultiplyer = 0.5;
  setTimeout(function(){character.speedMultiplyer = 1}, 5000);
}

features.teleportOne = function(person, starOne) {
  person.kill();
  person.reset(790,353);
  person.body.velocity.x = -200;
};

features.teleportTwo = function(person, starTwo) {
  person.kill();
  person.reset(40,353);
  person.body.velocity.x = 200;
};

features.pacMeetsGhost = function(person, ghost) {
  if (person.cherry === true){
    features.eatGhost(person, ghost);
  }
  else {
    features.loseLife(person, ghost);
  }
}

features.eatGhost = function(person, ghost) {
  ghost.kill();
  ghost.reset(Math.random() * CANVAS_WIDTH, Math.random() * CANVAS_HEIGHT);
};

features.loseLife = function(person) {
  person.kill();
  ghost.kill();
  person.reset(CANVAS_WIDTH/2, CANVAS_HEIGHT/2);
  ghost.reset(70, 70);
  features.gameOver("Player 2");
};

features.movePlayer = function(character) {
  if (cursors.left.isDown || this.pointer('left')){
    character.body.velocity.x = -VELOCITY * character.speedMultiplyer;
    character.body.velocity.y = 0;
    character.animations.play('left', 10, true);
  } else if (cursors.right.isDown || this.pointer('right')){
    character.body.velocity.x = VELOCITY * character.speedMultiplyer;
    character.body.velocity.y = 0;
    character.animations.play('right', 10, true);
  } else if (cursors.up.isDown || this.pointer('up')){
    character.body.velocity.y = -VELOCITY * character.speedMultiplyer;
    character.body.velocity.x = 0;
    character.animations.play('up', 10, true);
  } else if (cursors.down.isDown || this.pointer('down')) {
    character.body.velocity.y = VELOCITY * character.speedMultiplyer;
    character.body.velocity.x = 0;
    character.animations.play('bottom', 10, true);
  }
}

features.pointer = function(direction) {
  if (game.input.activePointer.isDown) {
    if (direction === "up") {
      if (game.input.activePointer.y < 100) {
        return true;
      }
    } else if (direction === "down") {
      if (game.input.activePointer.y > 220) {
        return true;
      }
    } else if (direction === "left") {
      if (game.input.activePointer.x < 100) {
        return true;
      }
    } else if (direction === "right") {
      if (game.input.activePointer.x > 600) {
        return true;
      }
    }
  }
  return false;
}

features.pacmanCoordinates = function() {
  if (currentPlayer === "player1") {
    this.movePlayer(person);
    if ((person.x !== person.lastx) || (person.y !== person.lasty )) {
      fb.person.set({
        x : person.position.x,
        y : person.position.y
      });
    }

    fb.ghost.on("value", function(snapshot) {
      ghost.x = snapshot.val().x
      ghost.y = snapshot.val().y
    });
  }
}

features.ghostCoordinates = function() {
  if (currentPlayer === "player2") {
    this.movePlayer(ghost);
    if ((ghost.x !== ghost.lastx) || (ghost.y !== ghost.lasty )) {
      fb.ghost.set({
        x : ghost.position.x,
        y : ghost.position.y
      });
    }

    fb.person.on("value", function(snapshot) {
      person.x = snapshot.val().x
      person.y = snapshot.val().y
    });
  }
}

features.gameOver = function(winner) {
  fb.pause.set(true);
  fb.player1.set(false);
  fb.player2.set(false);
  location.reload();
};


text:
<?php $this->load->helper('url'); ?>

                <?php foreach ($nuevas as $cerv): ?>

                        <?php if($cerv['Global']!=0)
                        echo "
".$cerv['Global']."/50
";
                        else
                            echo "
S/C
";?>

                    <a class='darken small' href='<?php echo base_url()."bb/perfil_cerveza?idCheve=".$cerv['idCheve']; ?>'>
                        <img width='130' height='109' src='<?php echo base_url(); ?>uploads/<?php echo $cerv['idCheve'].".jpg"; ?>' style='display: block; margin-left: auto; margin-right: auto'/>

                    <a class='title' href='<?php echo base_url()."bb/perfil_cerveza?idCheve=".$cerv['idCheve']; ?>'><?php echo $cerv['nombre'];?>

                        <img alt='icon' src='<?php echo base_url()."images/review-beer-dark.png"; ?>'/>

            <?php endforeach; ?>

7.4

                Gotye – Mirrors

                    <img alt="icon" src="<?php echo base_url();?>/images/review-beer-dark.png" />


text:
      double precision function  fdisc(blockno,xc,yc)
      implicit none

      double precision xc,yc
      integer blockno

      double precision r, hmax, b, c
      common /slotteddisk_parms/ r, hmax, b, c

      integer*8 cont, fclaw_map_get_context

      double precision q, qv, slotted_disk_sum
      double precision xp, yp, zp

      cont = fclaw_map_get_context()

      call fclaw2d_map_c2m(cont,blockno,xc,yc,xp,yp,zp)

c      call get_td_sdisk_parms(r,hmax,b,c)

c     # Returns 0 or 1.
      q = slotted_disk_sum(xp,yp,zp)

      qv = (q-b)/c
      fdisc = 1 - 2*qv
      end


text:
import {Component, ViewEncapsulation} from '@angular/core';

@Component({
  selector: 'sidenav-fab-example',
  templateUrl: './sidenav-fab-example.html',
  styleUrls: ['./sidenav-fab-example.css'],
  encapsulation: ViewEncapsulation.None,
})
export class SidenavFabExample {}


text:
controller 					= require('./controller');

function block(){
	tomodel = {};
	user_blocking_model 	= require('../models/user_blocking_model');
	user_blocking_history_model = require('../models/user_blocking_history_model');
};
block.prototype.constructor = block;

block.prototype.post =  function(req, res) {
	tomodel.user_id = req.session.user_id;
	tomodel.blocking_id = req.body.blocking_id;
	if(Number.isInteger(parseInt(tomodel.blocking_id))) {
		user_blocking_model.insert_blocking(tomodel, function(err,rows){
			save_blocking_history(tomodel, req, res);
		});
	}
}

block.prototype.index =  function(req, res) {
	tomodel.user_id = req.session.user_id;
	user_blocking_model.select_blocking(tomodel, function(err,rows){
		var data = res.locals;
		data['blocking'] = rows;
		data['status'] = '200';
		res.send(data);
	});
}

function save_blocking_history(tomodel, req, res) {
	tomodel.status = 1;
	console.log(tomodel);
	user_blocking_history_model.insert_blocking_history(tomodel, function(err,rows){
		var data = res.locals;
		data['status'] = '200';
		res.send(data);
	});
}

module.exports = new block();


text:
package iurii.job.interview.codility.onpex;

import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;

public class AdjacentCoinProblemTest {

    @Test
    public void test() {
        AdjacentCoinProblem adjacentCoinProblem = new AdjacentCoinProblem();
        assertThat(adjacentCoinProblem.solution(new int[]{1})).isEqualTo(0);
        assertThat(adjacentCoinProblem.solution(new int[]{0,0})).isEqualTo(0);
        assertThat(adjacentCoinProblem.solution(new int[]{0,1})).isEqualTo(1);
        assertThat(adjacentCoinProblem.solution(new int[]{1,1,1})).isEqualTo(1);
        assertThat(adjacentCoinProblem.solution(new int[]{1,0,1})).isEqualTo(2);
        assertThat(adjacentCoinProblem.solution(new int[]{0,1,1})).isEqualTo(2);
        assertThat(adjacentCoinProblem.solution(new int[]{1,1,0})).isEqualTo(2);
    }
}


text:
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>edu.javacourse</groupId>
    <artifactId>ejb</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <name>EJB</name>

    <modules>
        <module>stateless-ejb-local-remote</module>
        <module>stateful-ejb</module>
        <module>jms</module>
        <module>async-ejb-war</module>
        <module>interceptors-ejb-war</module>
        <module>security-ejb-war</module>
        <module>timer-service-ejb-war</module>
        <module>transactions/bean-transactions-ejb-war</module>
        <module>transactions/container-transactions-ejb-war</module>
        <module>transactions/container-transactions-ejb-jpa-war</module>
    </modules>

</project>


text:
package org.apache.derby.iapi.services.monitor;

import org.apache.derby.iapi.services.info.ProductVersionHolder;
import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.services.stream.InfoStreams;
import org.apache.derby.iapi.services.monitor.PersistentService;
import org.apache.derby.iapi.services.loader.InstanceGetter;

import java.util.Properties;
import java.util.Locale;
import java.io.InputStream;
import java.io.IOException;

/**
The monitor provides a central registry for all modules in the system,
and manages loading, starting, and finding them.
*/

public interface ModuleFactory
{

    /**
     * Find the module in the system with the given module protocol,
	 * protocolVersion and identifier.

     * @return The module instance if found, or null.
     */
    public Object findModule(Object service, String protocol, String identifier);

	/**
		Return the name of the service that the passed in module lives in.
	*/
	public String getServiceName(Object serviceModule);

	/**
		Return the locale of the service that the passed in module lives in.
		Will return null if no-locale has been defined.
	*/
	public Locale getLocale(Object serviceModule);

	/**
		Translate a string of the form ll[_CC[_variant]] to a Locale.
		This is in the Monitor because we want this translation to be
		in only one place in the code.
	 */
	public Locale getLocaleFromString(String localeDescription)
					throws StandardException;

	/**
		Set the locale for the service *outside* of boot time.

		@param userDefinedLocale	A String in the form xx_YY, where xx is the
									language code and YY is the country code.

		@return		The new Locale for the service

		@exception StandardException	Thrown on error
	 */
	public Locale setLocale(Object serviceModule, String userDefinedLocale)
						throws StandardException;

	/**
		Set the locale for the service at boot time. The passed-in
		properties must be the one passed to the boot method.

		@exception StandardException	Derby error.
	 */
	public Locale setLocale(Properties serviceProperties,
							String userDefinedLocale)
						throws StandardException;

	/**
		Return the PersistentService object for a service.
		Will return null if the service does not exist.
	*/
	public PersistentService getServiceType(Object serviceModule);

    /**
     * Return the PersistentService for a subsubprotocol.
     *
     * @return the PersistentService or null if it does not exist
     *
     * @exception StandardException
     */
    public PersistentService getServiceProvider(String subSubProtocol) throws StandardException;

    /**
     * Return the application set of properties which correspond
     * to the set of properties in the file derby.properties.
     */
	public Properties getApplicationProperties();

	/**
		Shut down the complete system that was started by this Monitor. Will
		cause the stop() method to be called on each loaded module.
	*/
	public void shutdown();

	/**
		Shut down a service that was started by this Monitor. Will
		cause the stop() method to be called on each loaded module.
		Requires that a context stack exist.
	*/
	public void shutdown(Object service);

	/**
		Obtain a class that supports the given identifier.

		@param identifier	identifer to associate with class

		@return a reference InstanceGetter

		@exception StandardException See Monitor.classFromIdentifier
	*/
	public InstanceGetter classFromIdentifier(int identifier)
		throws StandardException;

	/**
		Obtain an new instance of a class that supports the given identifier.

		@param identifier	identifer to associate with class

		@return a reference to a newly created object

		@exception StandardException See Monitor.newInstanceFromIdentifier

	*/
	public Object newInstanceFromIdentifier(int identifier)
		throws StandardException;

	/**
		Return the environment object that this system was booted in.
		This is a free form object that is set by the method the
		system is booted. For example when running in a Marimba system
		it is set to the maribma application context. In most environments
		it will be set to a java.io.File object representing the system home directory.
		Code that call this method usualy have predefined knowledge of the type of the returned object, e.g.
		Marimba store code knows that this will be set to a marimba application
		context.
	*/
	public Object getEnvironment();

	/**
		Return an array of the service identifiers that are running and
		implement the passed in protocol (java interface class name).
		This list is a snapshot of the current running systesm, once
		the call returns the service may have been shutdown or
		new ones added.

		@return The list of service names, if no services exist that
		implement the protocol an array with zero elements is returned.
	*/
	public String[] getServiceList(String protocol);

	/**
		Start a persistent service.

		Do not call directly - use Monitor.startPersistentService()

 The poperty set passed in is for boot options for the modules
		required to start the service. It does not support defining different
		or new modules implementations.

		@param serviceName Name of the service to be started
		@param properties Property set made available to all modules booted
		for this service, through their ModuleControl.boot method.

		@return true if the service type is handled by the monitor, false if it isn't

		@exception StandardException An attempt to start the service failed.

		@see Monitor#startPersistentService
	*/
	public boolean startPersistentService(String serviceName, Properties properties)
		throws StandardException;

	/**
		Create a persistent service.

		Do not call directly - use Monitor.startPersistentService()

		@exception StandardException An attempt to create the service failed.

		@see Monitor#createPersistentService
	*/
	public Object createPersistentService(String factoryInterface, String serviceName, Properties properties)
		throws StandardException;
    public void removePersistentService(String name)
        throws StandardException;

	/**
		Start a non-persistent service.

		Do not call directly - use Monitor.startNonPersistentService()

		@exception StandardException An attempt to start the service failed.

		@see Monitor#startNonPersistentService
	*/
	public Object startNonPersistentService(String factoryInterface, String serviceName, Properties properties)
		throws StandardException;

	/**
		Canonicalize a service name, mapping different user-specifications of a database name
        onto a single, standard name.
	*/
    public  String  getCanonicalServiceName( String userSpecifiedName )
        throws StandardException;

	/**
		Find a service.

		Do not call directly - use Monitor.findService()

		@return a refrence to a module represeting the service or null if the service does not exist.

		@see Monitor#findService
	*/
	public Object findService(String protocol, String identifier);

	/**
		Start a module.

		Do not call directly - use Monitor.startSystemModule() or Monitor.bootServiceModule()

		@exception StandardException An attempt to start the module failed.

		@see Monitor#startSystemModule
		@see Monitor#bootServiceModule
	*/
	public Object startModule(boolean create, Object service, String protocol,
									 String identifier, Properties properties)
									 throws StandardException;

	/**
		Get the defined default system streams object.
	*/
	public InfoStreams getSystemStreams();

	/**
		Start all services identified by derby.service.*
		in the property set. If bootAll is true the services
		that are persistent will be booted.
	*/
	public void startServices(Properties properties, boolean bootAll);

	/**
		Return a property from the JVM's system set.
		In a Java2 environment this will be executed as a privileged block
		if and only if the property starts with 'derby.'.
		If a SecurityException occurs, null is returned.
	*/
	public String getJVMProperty(String key);

	/**
		Get a newly created background thread.
		The thread is set to be a daemon but is not started.
	*/
	public Thread getDaemonThread(Runnable task, String name, boolean setMinPriority);

	/**
		Set the priority of the current thread.
		If the current thread was not returned by getDaemonThread() then no action is taken.
	*/
	public void setThreadPriority(int priority);

	public ProductVersionHolder getEngineVersion();

	/**
	 * Get the UUID factory for the system.  The UUID factory provides
	 * methods to create and recreate database unique identifiers.
	 */
	public org.apache.derby.iapi.services.uuid.UUIDFactory getUUIDFactory();

	/**
	 * Get the Timer factory for the system. The Timer factory provides
     * access to Timer objects for various purposes.
     *
     * @return the system's Timer factory.
	 */
    public org.apache.derby.iapi.services.timer.TimerFactory getTimerFactory();
}


text:
namespace AquaNodeApp.RPi
{
    partial class frmGraph
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label1 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // label1
            //
            this.label1.Dock = System.Windows.Forms.DockStyle.Top;
            this.label1.Location = new System.Drawing.Point(0, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(304, 13);
            this.label1.TabIndex = 1;
            this.label1.Text = "label1";
            this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
            //
            // frmGraph
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(304, 242);
            this.ControlBox = false;
            this.Controls.Add(this.label1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.Name = "frmGraph";
            this.ShowIcon = false;
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "frmGraph";
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Label label1;
    }
}


text:
package router

//go:generate counterfeiter . Connection

// Connection creates and executes http requests
type Connection interface {
	Make(request *Request, passedResponse *Response) error
}


text:
using System.Collections.Generic;
using Newtonsoft.Json;
using Ptv.Timetable.Api.Converters;

namespace Ptv.Timetable.Api.Responses
{
    [JsonConverter(typeof(LinesByModeConverter))]
    public class LinesByModeResponse
    {
        public LinesByModeResponse()
        {
            Lines = new List<Line>();
        }

        public List<Line> Lines { get; private set; }
    }
}


text:
/*
$Revision: 1.3 $
$Date: 2008-03-12 22:23:18 $

*/

package org.rti.webgenome.service.dao.hibernate;

import java.util.List;

import org.rti.webgenome.domain.Array;
import org.rti.webgenome.service.dao.ArrayDao;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

/**
 * Implementation of {@link org.rti.webgenome.service.dao.ArrayDao}
 * using Hibernate.
 * @author dhall
 *
 */
public class HibernateArrayDao extends HibernateDaoSupport
implements ArrayDao {

	/**
	 * {@inheritDoc}
	 */
	public void delete(final Array array) {
		this.getHibernateTemplate().delete(array);
	}

	/**
	 * {@inheritDoc}
	 */
	public void saveOrUpdate(final Array array) {
		this.getHibernateTemplate().saveOrUpdate(array);
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean isReferenced(final Array array) {
		String query = "from BioAssay ba where ba.array = ?";
		Object[] args = new Object[]{array};
		List bioAssays =
			this.getHibernateTemplate().find(query, args);
		return bioAssays != null && bioAssays.size() > 0;
	}
}


text:
abstract type AbstractRate end

# These are different structs introduced to deal with the case where the rate function is constant in between jumps: this are defined through the following type `ConstantRate`. This leads us to treat the case where the user can provide two rate functions, the first one being a `ConstantRate` and a second one `VariableRate` where no a-priori knowledge in infused by the user. These two functions are encapsulated in a `CompositeRate` structure. A composite rate `r::CompositeRate` is called like `r(rate, xc, xd, p, t, issum)`. In this case, the two components of `r` act on the same rate vector `rate` so the indexing of `rate` inside `r.Rcst` and `r.Rvar` should be considered global by the user and not local.

# this is used to initialise the rate component of the structure `PDMPCaracteristics`. This is useful so that a call to `solve` with identical seed always return the same trajectory
init!(R::AbstractRate) = nothing

struct VariableRate{TR} <: AbstractRate
	R::TR
end

function (vr::VariableRate)(rate, xc, xd, p, t, issum)
	return vr.R(rate, xc, xd, p, t, issum)
end

# Structure meant to deal with rate functions which are constant in between jumps. The only way the rate function can change is when `xd` changes. Hence, while c::ConstantRate is called like `c(rate, xc, xd, p, t, true)`, it returns `c.totalrate`. In the codes CHV and Rejection, a call to `c(rate, xc, xd, p, t, false)` that a jump has occurred and one wants to (possibly) change `xd`. We use this call to trigger the update of `c.totalrate`. This update is also triggered whenever `c.totalrate < 0` like for initialisation purposes.
mutable struct ConstantRate{TR} <: AbstractRate
	R::TR
	totalrate::Float64

	function ConstantRate(R)
		return new{typeof(R)}(R, -1.0)
	end
end

init!(r::ConstantRate) = r.totalrate = -1.0

function (cr::ConstantRate)(rate, xc, xd, p, t, issum)
	if issum == true
		if cr.totalrate < 0
			# update the catched value
			cr.totalrate = cr.R(rate, xc, xd, p, t, issum)[1]
		end
		return cr.totalrate, cr.totalrate
	else
		# the following call will be amortized if we call the method twice
		cr.totalrate = -1
		cr.R(rate, xc, xd, p, t, issum)
	end
end

struct CompositeRate{TRc, TRv} <: AbstractRate
	Rcst::TRc
	Rvar::TRv

	function CompositeRate(Rc, Rv)
		rc = ConstantRate(Rc)
		rv = VariableRate(Rv)
		return new{typeof(rc), typeof(rv)}(rc, rv)
	end

	function CompositeRate(rc::AbstractRate, rv::AbstractRate)
		return new{typeof(rc), typeof(rv)}(rc, rv)
	end
end

init!(r::CompositeRate) = (init!(r.Rcst); init!(r.Rvar))

# TODO For some reason, this is still allocating
function (cpr::CompositeRate)(rate, xc, xd, p, t, issum)
	if issum == false
		cpr.Rcst(rate, xc, xd, p, t, issum)
		cpr.Rvar(rate, xc, xd, p, t, issum)
	else
		out_cst = cpr.Rcst(rate, xc, xd, p, t, issum)
		out_var = cpr.Rvar(rate, xc, xd, p, t, issum)
		return out_cst .+ out_var
	end
end


text:
<?php

namespace PHPExiftool\Driver\Tag\Olympus;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class RawDevWBFineAdjustment extends AbstractTag
{

    protected $Id = 'mixed';

    protected $Name = 'RawDevWBFineAdjustment';

    protected $FullName = 'mixed';

    protected $GroupName = 'Olympus';

    protected $g0 = 'MakerNotes';

    protected $g1 = 'Olympus';

    protected $g2 = 'Camera';

    protected $Type = 'int16s';

    protected $Writable = true;

    protected $Description = 'Raw Dev WB Fine Adjustment';

    protected $flag_Permanent = true;

}


text:
class CreateLinksNotesTable < ActiveRecord::Migration
  def change
    create_table :links_notes do |t|
      t.integer :link_id
      t.integer :note_id
    end
  end
end


text:
<?php

namespace admin\aws;

class ChangePassword extends \admin\ngrest\base\ActiveWindow
{
    public $module = 'admin';

    public function index()
    {
        return $this->render('index', [
            'itemId' => $this->getItemId()
        ]);
    }

    public function callbackSave($newpass, $newpasswd)
    {
        $model = new \admin\models\User();
        $user = $model->findOne($this->getItemId());
        $user->scenario = 'changepassword';
        if ($user->changePassword($newpass, $newpasswd)) {
            return $this->response(true, ['message' => 'we have successfully changed your password!']);
        } else {
            return $this->response(false, $user->getFirstErrors());
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

using xcordion.api;

namespace xcordion.lang.csharp
{
    public class XmlTestDocument : TestDocument<XmlTestElement>
    {
        private XmlDocument doc;
        private Dictionary<XmlElement, XmlTestElement> elementCache = new Dictionary<XmlElement, XmlTestElement>();

        public XmlTestDocument(XmlDocument d)
        {
            this.doc = d;
        }

        public XmlTestElement getRootElement()
        {
            return wrap(doc.DocumentElement);
        }

        internal XmlTestElement wrap(XmlElement xmlElement)
        {
            if (!elementCache.ContainsKey(xmlElement))
            {
                elementCache.Add(xmlElement, new XmlTestElement(this, xmlElement));
            }
            return elementCache[xmlElement];
        }

        public XmlTestElement newElement(string name)
        {
            return wrap(doc.CreateElement(name));
        }

        public XmlTestElement newElement(string namespaceUri, string name)
        {
            return wrap(doc.CreateElement(name, namespaceUri));
        }

        public string asXml()
        {
            return doc.OuterXml;
        }
    }
}


text:
package utility

import (
	"strings"
	"testing"

	"github.com/bitrise-io/bitrise-workflow-editor/apiserver/config"
	"github.com/stretchr/testify/require"
)

func TestValidateBitriseConfigAndSecret(t *testing.T) {
	validConfigs := []string{
		config.MinimalValidBitriseYML,
		//
		`format_version: 1.3.0
app:
  envs:
  - KEY_ONE: value one
workflows:
  empty_wf:
    steps: []
`,
		//
	}
	validSecrets := []string{
		config.MinimalValidSecrets,
		"",
		"#",
		" ",
		"\n",
		"{}",
		"envs:",
		"envs: ",
		`envs: []`,
		//
		`envs:
- SECRET_ONE: secret value one`,
		//
		`envs:
- SECRET_ONE: secret value one
`,
		//
	}
	validWithWarning :=
		`
format_version: 1.1.0
trigger_map:
- pattern: ci/quick
  workflow: _prepare_and_setup
workflows:
 _prepare_and_setup:
  description: desc
`

	t.Log("Valid combinations")
	{
		for _, aValidConfig := range validConfigs {
			for _, aValidSecret := range validSecrets {
				t.Log("Config: ", aValidConfig)
				t.Log("Secret: ", aValidSecret)
				warningItems, err := ValidateBitriseConfigAndSecret(aValidConfig, aValidSecret)
				require.NoError(t, err)
				require.Nil(t, warningItems)
			}
		}
	}

	t.Log("Valid config with warnings")
	{
		warnings, err := ValidateBitriseConfigAndSecret(validWithWarning,
			config.MinimalValidSecrets)
		require.NoError(t, err)
		require.Equal(t, "workflow (_prepare_and_setup) defined in trigger item (pattern: ci/quick && is_pull_request_allowed: false -> workflow: _prepare_and_setup), but utility workflows can't be triggered directly", warnings.Config[0])
	}

	t.Log("Invalid configs - empty")
	{
		{
			_, err := ValidateBitriseConfigAndSecret(``, config.MinimalValidSecrets)
			require.Error(t, err)
			require.True(t, strings.Contains(err.Error(), "Validation failed: Config validation error: "), err.Error())
		}

		{
			_, err := ValidateBitriseConfigAndSecret(`{}`, config.MinimalValidSecrets)
			require.Error(t, err)
			require.True(t, strings.Contains(err.Error(), "Validation failed: Config validation error: Failed to get config (bitrise.yml) from base 64 data, err: Failed to parse bitrise config, error: missing format_version"), err.Error())
		}
	}

	t.Log("Invalid configs - 1")
	{
		_, err := ValidateBitriseConfigAndSecret(`format_version: 1.3.0
app:
  envs:
  - A
`, config.MinimalValidSecrets)

		require.Error(t, err)
		require.True(t, strings.Contains(err.Error(), "Validation failed: Config validation error: Failed to get config (bitrise.yml) from base 64 data, err: Failed to parse bitrise config, error: yaml: unmarshal errors:\n  line 4: cannot unmarshal !!str `A` into models.EnvironmentItemModel"), err.Error())
	}

	t.Log("Invalid configs - missing format_version")
	{
		_, err := ValidateBitriseConfigAndSecret(`
app:
  envs:
  - KEY_ONE: value one
workflows:
  empty_wf:
    steps: []
`, config.MinimalValidSecrets)

		require.Error(t, err)
		require.True(t, strings.Contains(err.Error(), "Validation failed: Config validation error: Failed to get config (bitrise.yml) from base 64 data, err: Failed to parse bitrise config, error: missing format_version"), err.Error())
	}

	t.Log("Invalid secrets - envs as empty hash")
	{
		_, err := ValidateBitriseConfigAndSecret(config.MinimalValidBitriseYML, "envs: {}")
		require.Error(t, err)
		require.True(t, strings.Contains(err.Error(), "Validation failed: Secret validation error: Failed to get inventory from base 64 data, err: yaml: unmarshal errors:\n  line 1: cannot unmarshal !!map into []models.EnvironmentItemModel"), err.Error())
	}

	t.Log("Invalid secrets - envs as hash with value")
	{
		_, err := ValidateBitriseConfigAndSecret(config.MinimalValidBitriseYML, `envs:
  KEY_ONE: value one`)
		require.Error(t, err)
		require.True(t, strings.Contains(err.Error(), "Validation failed: Secret validation error: Failed to get inventory from base 64 data, err: yaml: unmarshal errors:\n  line 2: cannot unmarshal !!map into []models.EnvironmentItemModel"), err.Error())
	}
}


text:
{{period.title}}

{{year.year}}


text:
package com.sample.ext.v1;

import io.undertow.server.HttpHandler;
import io.undertow.server.HttpServerExchange;

/**
 * Created by Zero on 2017/4/19.
 */
public interface RequestHandlerV1 extends HttpHandler{

    @Override
    default void handleRequest(HttpServerExchange exchange) throws Exception {
        handleRequest(new Request(exchange), new Response(exchange));
    }

    static HttpHandler adpt(RequestHandlerV1 handler) {
        return handler;
    }

    void handleRequest(Request request, Response response);

}


text:
module IHaskell.Display.Widgets (module X) where

import           IHaskell.Display.Widgets.Button as X

import           IHaskell.Display.Widgets.Box.Box as X
import           IHaskell.Display.Widgets.Box.SelectionContainer.Accordion as X
import           IHaskell.Display.Widgets.Box.SelectionContainer.Tab as X

import           IHaskell.Display.Widgets.Bool.CheckBox as X
import           IHaskell.Display.Widgets.Bool.ToggleButton as X
import           IHaskell.Display.Widgets.Bool.Valid as X

import           IHaskell.Display.Widgets.Int.IntText as X
import           IHaskell.Display.Widgets.Int.BoundedInt.BoundedIntText as X
import           IHaskell.Display.Widgets.Int.BoundedInt.IntProgress as X
import           IHaskell.Display.Widgets.Int.BoundedInt.IntSlider as X
import           IHaskell.Display.Widgets.Int.BoundedIntRange.IntRangeSlider as X

import           IHaskell.Display.Widgets.Float.FloatText as X
import           IHaskell.Display.Widgets.Float.BoundedFloat.BoundedFloatText as X
import           IHaskell.Display.Widgets.Float.BoundedFloat.FloatProgress as X
import           IHaskell.Display.Widgets.Float.BoundedFloat.FloatSlider as X
import           IHaskell.Display.Widgets.Float.BoundedFloatRange.FloatRangeSlider as X

import           IHaskell.Display.Widgets.Image as X

import           IHaskell.Display.Widgets.Output as X

import           IHaskell.Display.Widgets.Selection.Dropdown as X
import           IHaskell.Display.Widgets.Selection.RadioButtons as X
import           IHaskell.Display.Widgets.Selection.Select as X
import           IHaskell.Display.Widgets.Selection.ToggleButtons as X
import           IHaskell.Display.Widgets.Selection.SelectMultiple as X

import           IHaskell.Display.Widgets.String.HTML as X
import           IHaskell.Display.Widgets.String.Label as X
import           IHaskell.Display.Widgets.String.Text as X
import           IHaskell.Display.Widgets.String.TextArea as X

import           IHaskell.Display.Widgets.Common as X
import           IHaskell.Display.Widgets.Types as X (setField, getField, properties, triggerDisplay,
                                                      triggerChange, triggerClick, triggerSelection,
                                                      triggerSubmit, ChildWidget(..))